From fbd4353121f3b1365a54a04f511b4304345e9029 Mon Sep 17 00:00:00 2001 From: Connor Gibson Date: Thu, 15 May 2025 17:19:22 -0700 Subject: [PATCH 1/4] Remove deprecated digitalRead8() and digitalWrite8() functions from comments --- wiringPi/wiringPi.c | 51 --------------------------------------------- wiringPi/wiringPi.h | 2 -- 2 files changed, 53 deletions(-) diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index 7887633..bea4084 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -1624,8 +1624,6 @@ struct wiringPiNodeStruct *wiringPiFindNode (int pin) static void pinModeDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int mode) { return ; } static void pullUpDnControlDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int pud) { return ; } -//static unsigned int digitalRead8Dummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return 0 ; } -//static void digitalWrite8Dummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } static int digitalReadDummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return LOW ; } static void digitalWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } static void pwmWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } @@ -1657,9 +1655,7 @@ struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins) node->pinMode = pinModeDummy ; node->pullUpDnControl = pullUpDnControlDummy ; node->digitalRead = digitalReadDummy ; -//node->digitalRead8 = digitalRead8Dummy ; node->digitalWrite = digitalWriteDummy ; -//node->digitalWrite8 = digitalWrite8Dummy ; node->pwmWrite = pwmWriteDummy ; node->analogRead = analogReadDummy ; node->analogWrite = analogWriteDummy ; @@ -2230,27 +2226,6 @@ int digitalRead (int pin) } -/* - * digitalRead8: - * Read 8-bits (a byte) from given start pin. - ********************************************************************************* - -unsigned int digitalRead8 (int pin) -{ - struct wiringPiNodeStruct *node = wiringPiNodes ; - - if ((pin & PI_GPIO_MASK) == 0) // On-Board Pin - return 0 ; - else - { - if ((node = wiringPiFindNode (pin)) == NULL) - return LOW ; - return node->digitalRead8 (node, pin) ; - } -} - */ - - /* * digitalWrite: * Set an output bit @@ -2334,32 +2309,6 @@ void digitalWrite (int pin, int value) } -/* - * digitalWrite8: - * Set an output 8-bit byte on the device from the given pin number - ********************************************************************************* - -void digitalWrite8 (int pin, int value) -{ - struct wiringPiNodeStruct *node = wiringPiNodes ; - - if ((pin & PI_GPIO_MASK) == 0) // On-Board Pin - return ; - else - { - if ((node = wiringPiFindNode (pin)) != NULL) - node->digitalWrite8 (node, pin, value) ; - } -} - */ - - -/* - * pwmWrite: - * Set an output PWM value - ********************************************************************************* - */ - void pwmWrite (int pin, int value) { struct wiringPiNodeStruct *node = wiringPiNodes ; diff --git a/wiringPi/wiringPi.h b/wiringPi/wiringPi.h index f2a4599..dd37943 100644 --- a/wiringPi/wiringPi.h +++ b/wiringPi/wiringPi.h @@ -178,9 +178,7 @@ struct wiringPiNodeStruct void (*pinMode) (struct wiringPiNodeStruct *node, int pin, int mode) ; void (*pullUpDnControl) (struct wiringPiNodeStruct *node, int pin, int mode) ; int (*digitalRead) (struct wiringPiNodeStruct *node, int pin) ; -//unsigned int (*digitalRead8) (struct wiringPiNodeStruct *node, int pin) ; void (*digitalWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; -// void (*digitalWrite8) (struct wiringPiNodeStruct *node, int pin, int value) ; void (*pwmWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; int (*analogRead) (struct wiringPiNodeStruct *node, int pin) ; void (*analogWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; From 044af6cb9a8a35a0b6bdd75e7d8ff558b98a0dcf Mon Sep 17 00:00:00 2001 From: Connor Gibson Date: Thu, 15 May 2025 17:28:24 -0700 Subject: [PATCH 2/4] Fix indentation --- wiringPi/wiringPi.c | 14 +++++++------- wiringPi/wiringPi.h | 36 +++++++++++++++++------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index bea4084..16c6cf4 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -1622,13 +1622,13 @@ struct wiringPiNodeStruct *wiringPiFindNode (int pin) ********************************************************************************* */ -static void pinModeDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int mode) { return ; } -static void pullUpDnControlDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int pud) { return ; } -static int digitalReadDummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return LOW ; } -static void digitalWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } -static void pwmWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } -static int analogReadDummy (UNU struct wiringPiNodeStruct *node, UNU int pin) { return 0 ; } -static void analogWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } +static void pinModeDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int mode) { return ; } +static void pullUpDnControlDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int pud) { return ; } +static int digitalReadDummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return LOW ; } +static void digitalWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } +static void pwmWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } +static int analogReadDummy (UNU struct wiringPiNodeStruct *node, UNU int pin) { return 0 ; } +static void analogWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; } struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins) { diff --git a/wiringPi/wiringPi.h b/wiringPi/wiringPi.h index dd37943..d612754 100644 --- a/wiringPi/wiringPi.h +++ b/wiringPi/wiringPi.h @@ -175,13 +175,13 @@ struct wiringPiNodeStruct unsigned int data2 ; // ditto unsigned int data3 ; // ditto - void (*pinMode) (struct wiringPiNodeStruct *node, int pin, int mode) ; - void (*pullUpDnControl) (struct wiringPiNodeStruct *node, int pin, int mode) ; - int (*digitalRead) (struct wiringPiNodeStruct *node, int pin) ; - void (*digitalWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; - void (*pwmWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; - int (*analogRead) (struct wiringPiNodeStruct *node, int pin) ; - void (*analogWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; + void (*pinMode) (struct wiringPiNodeStruct *node, int pin, int mode) ; + void (*pullUpDnControl) (struct wiringPiNodeStruct *node, int pin, int mode) ; + int (*digitalRead) (struct wiringPiNodeStruct *node, int pin) ; + void (*digitalWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; + void (*pwmWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; + int (*analogRead) (struct wiringPiNodeStruct *node, int pin) ; + void (*analogWrite) (struct wiringPiNodeStruct *node, int pin, int value) ; struct wiringPiNodeStruct *next ; } ; @@ -252,18 +252,16 @@ enum WPIPinAlt { }; -extern int wiringPiGpioDeviceGetFd(); //Interface V3.3 -extern void pinModeAlt (int pin, int mode) ; -extern enum WPIPinAlt getPinModeAlt (int pin) ; // Interface V3.5, same as getAlt but wie enum -extern void pinMode (int pin, int mode) ; -extern void pullUpDnControl (int pin, int pud) ; -extern int digitalRead (int pin) ; -extern void digitalWrite (int pin, int value) ; -extern unsigned int digitalRead8 (int pin) ; -extern void digitalWrite8 (int pin, int value) ; -extern void pwmWrite (int pin, int value) ; -extern int analogRead (int pin) ; -extern void analogWrite (int pin, int value) ; +extern int wiringPiGpioDeviceGetFd(); //Interface V3.3 +extern void pinModeAlt (int pin, int mode) ; +extern enum WPIPinAlt getPinModeAlt (int pin) ; // Interface V3.5, same as getAlt but wie enum +extern void pinMode (int pin, int mode) ; +extern void pullUpDnControl (int pin, int pud) ; +extern int digitalRead (int pin) ; +extern void digitalWrite (int pin, int value) ; +extern void pwmWrite (int pin, int value) ; +extern int analogRead (int pin) ; +extern void analogWrite (int pin, int value) ; // PiFace specifics // (Deprecated) From 6c51ad838e460e191c749addd389e4c3fe2b645e Mon Sep 17 00:00:00 2001 From: Connor Gibson Date: Thu, 15 May 2025 17:30:24 -0700 Subject: [PATCH 3/4] [drcNet.c] Remove digitalRead8() and digitalWrite8() comments --- wiringPi/drcNet.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/wiringPi/drcNet.c b/wiringPi/drcNet.c index 0fc5d2b..88ff655 100644 --- a/wiringPi/drcNet.c +++ b/wiringPi/drcNet.c @@ -253,24 +253,6 @@ static void myDigitalWrite (struct wiringPiNodeStruct *node, int pin, int value) } -/* - * myDigitalWrite8: - ********************************************************************************* - -static void myDigitalWrite8 (struct wiringPiNodeStruct *node, int pin, int value) -{ - struct drcNetComStruct cmd ; - - cmd.pin = pin - node->pinBase ; - cmd.cmd = DRCN_DIGITAL_WRITE8 ; - cmd.data = value ; - - (void)send (node->fd, &cmd, sizeof (cmd), 0) ; - (void)recv (node->fd, &cmd, sizeof (cmd), 0) ; -} - */ - - /* * myAnalogWrite: ********************************************************************************* @@ -347,26 +329,6 @@ static int myDigitalRead (struct wiringPiNodeStruct *node, int pin) } -/* - * myDigitalRead8: - ********************************************************************************* - -static unsigned int myDigitalRead8 (struct wiringPiNodeStruct *node, int pin) -{ - struct drcNetComStruct cmd ; - - cmd.pin = pin - node->pinBase ; - cmd.cmd = DRCN_DIGITAL_READ8 ; - cmd.data = 0 ; - - (void)send (node->fd, &cmd, sizeof (cmd), 0) ; - (void)recv (node->fd, &cmd, sizeof (cmd), 0) ; - - return cmd.data ; -} - */ - - /* * drcNet: * Create a new instance of an DRC GPIO interface. @@ -397,8 +359,6 @@ int drcSetupNet (const int pinBase, const int numPins, const char *ipAddress, co node->analogWrite = myAnalogWrite ; node->digitalRead = myDigitalRead ; node->digitalWrite = myDigitalWrite ; -//node->digitalRead8 = myDigitalRead8 ; -//node->digitalWrite8 = myDigitalWrite8 ; node->pwmWrite = myPwmWrite ; return TRUE ; From 325bf0eccce07bd561c1cbcc33c38c6b43359e84 Mon Sep 17 00:00:00 2001 From: Connor Gibson Date: Thu, 15 May 2025 17:35:00 -0700 Subject: [PATCH 4/4] [runRemote.c] Remove digitalRead8() and digitalWrite8() comments --- wiringPiD/runRemote.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/wiringPiD/runRemote.c b/wiringPiD/runRemote.c index 7c6a5cb..d00ddf2 100644 --- a/wiringPiD/runRemote.c +++ b/wiringPiD/runRemote.c @@ -92,7 +92,6 @@ void runRemoteCommands (int fd) break ; case DRCN_DIGITAL_WRITE8: - //digitalWrite8 (pin, cmd.data) ; if (send (fd, &cmd, sizeof (cmd), 0) != sizeof (cmd)) return ; break ; @@ -104,7 +103,6 @@ void runRemoteCommands (int fd) break ; case DRCN_DIGITAL_READ8: - //cmd.data = digitalRead8 (pin) ; if (send (fd, &cmd, sizeof (cmd), 0) != sizeof (cmd)) return ; break ;