Merge pull request #350 from Next-Door-Tech/cleanup

[cleanup] Remove comments referencing deprecated `digitalRead8()` and `digitalWrite8()` functions
This commit is contained in:
Manfred Wallner
2025-06-05 13:23:02 +02:00
committed by GitHub
4 changed files with 24 additions and 121 deletions

View File

@@ -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 ;

View File

@@ -1664,15 +1664,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 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 ; }
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)
{
@@ -1699,9 +1697,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 ;
@@ -2324,27 +2320,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
@@ -2433,32 +2408,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 ;

View File

@@ -176,15 +176,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) ;
//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) ;
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 ;
} ;
@@ -255,18 +253,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)

View File

@@ -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 ;