diff --git a/gpio/gpio.c b/gpio/gpio.c index 3fc97a3..447e53d 100644 --- a/gpio/gpio.c +++ b/gpio/gpio.c @@ -66,23 +66,27 @@ int wpMode ; char *usage = "Usage: gpio -v\n" " gpio -h\n" " gpio [-g|-1] ...\n" + " where -g: pin numbering according to readall BCM column\n" + " where -1: pin numbering according to readall Physical column\n" + " when omitted: pin numbering according to readall wPi column\n" " gpio [-d] ...\n" " [-x extension:params] [[ -x ...]] ...\n" " gpio [-p] ...\n" " gpio ...\n" " gpio \n" - " gpio readall\n" - " gpio wfi \n" - " gpio drive \n" - " gpio pwm-bal/pwm-ms \n" - " gpio pwmr \n" - " gpio pwmc \n" - " gpio i2cd/i2cdetect\n" - " gpio rbx/rbd\n" - " gpio wb \n" - " gpio usbp high/low\n" - " gpio gbr \n" - " gpio gbw " ; // No trailing newline needed here. + " gpio readall\n" + " gpio wfi \n" + " where can be: rising, falling, both\n" + " gpio drive \n" + " gpio pwm-bal/pwm-ms \n" + " gpio pwmr \n" + " gpio pwmc \n" + " gpio i2cd/i2cdetect\n" + " gpio rbx/rbd\n" + " gpio wb \n" + " gpio usbp high/low\n" + " gpio gbr \n" + " gpio gbw " ; // No trailing newline needed here. #ifdef NOT_FOR_NOW diff --git a/wiringPi/test/Makefile b/wiringPi/test/Makefile index 299dcb4..151a476 100644 --- a/wiringPi/test/Makefile +++ b/wiringPi/test/Makefile @@ -11,7 +11,7 @@ xotests = wiringpi_xotest_test1_spi wiringpi_i2c_test1_pcf8574 wiringpi_test8_pw # Need PiFace hardware and BCM23 <-> BCM24 , BCM18 <-> BCM17 connected (1kOhm), and PiFace Out7<->In4, Out6<->In5, R0_NO<->In6, R0_NO<->In7, R_C<-100Ohm->GND pifacetests = wiringpi_piface_test1 wiringpi_test8_pwm wiringpi_test9_pwm -all: $(tests) $(xotests) $(pifacetests) +all: $(tests) $(xotests) $(pifacetests) .gitignore wiringpi_test0_version: ${CC} ${CFLAGS} wiringpi_test0_version.c -o wiringpi_test0_version -lwiringPi @@ -113,7 +113,23 @@ pifacetest: echo "\n\e[5mPIFACE TEST SUCCESS\e[0m\n"; \ fi +# Add all binaries to a folder-local .gitignore file +.gitignore: + @echo "Updating test directory .gitignore..." + @if ! test -f "./.gitignore"; then \ + echo "# This file is automatically generated by make." >> .gitignore; \ + echo "# Git will ignore this file and all generated WiringPi test binaries in this folder." >> .gitignore; \ + echo "/.gitignore" >> .gitignore; \ + fi + @for t in $(tests) $(xotests) $(pifacetests) ; do \ + if ! grep -q "/$$t" .gitignore; then \ + echo "/$$t" >> .gitignore; \ + echo "Added /$$t to .gitignore"; \ + fi; \ + done + clean: for t in $(tests) $(xotests) $(pifacetests) ; do \ rm -fv $${t} ; \ done + rm -fv .gitignore diff --git a/wiringPi/wiringPiSPI.c b/wiringPi/wiringPiSPI.c index 4657b38..581a079 100644 --- a/wiringPi/wiringPiSPI.c +++ b/wiringPi/wiringPiSPI.c @@ -1,7 +1,7 @@ /* * wiringPiSPI.c: * Simplified SPI access routines - * Copyright (c) 2012-2015 Gordon Henderson + * Copyright (c) 2012-2025 Gordon Henderson and contributors *********************************************************************** * This file is part of wiringPi: * https://github.com/WiringPi/WiringPi/ @@ -195,6 +195,11 @@ int wiringPiSPISetupMode (int channel, int speed, int mode) { ********************************************************************************* */ +int wiringPiSPIxSetup (const int number, const int channel, const int speed) { + return wiringPiSPIxSetupMode(number, channel, speed, 0) ; +} + + int wiringPiSPISetup (int channel, int speed) { return wiringPiSPIxSetupMode(0, channel, speed, 0) ; } diff --git a/wiringPi/wiringPiSPI.h b/wiringPi/wiringPiSPI.h index cd1bc03..d60b064 100644 --- a/wiringPi/wiringPiSPI.h +++ b/wiringPi/wiringPiSPI.h @@ -1,7 +1,7 @@ /* * wiringPiSPI.h: * Simplified SPI access routines - * Copyright (c) 2012-2024 Gordon Henderson and contributors + * Copyright (c) 2012-2025 Gordon Henderson and contributors *********************************************************************** * This file is part of wiringPi: * https://github.com/WiringPi/WiringPi/