Skip to content

Commit ce34a1f

Browse files
authored
Merge pull request WiringPi#350 from Next-Door-Tech/cleanup
[cleanup] Remove comments referencing deprecated `digitalRead8()` and `digitalWrite8()` functions
2 parents c173100 + 70a455a commit ce34a1f

File tree

4 files changed

+24
-121
lines changed

4 files changed

+24
-121
lines changed

wiringPi/drcNet.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -253,24 +253,6 @@ static void myDigitalWrite (struct wiringPiNodeStruct *node, int pin, int value)
253253
}
254254

255255

256-
/*
257-
* myDigitalWrite8:
258-
*********************************************************************************
259-
260-
static void myDigitalWrite8 (struct wiringPiNodeStruct *node, int pin, int value)
261-
{
262-
struct drcNetComStruct cmd ;
263-
264-
cmd.pin = pin - node->pinBase ;
265-
cmd.cmd = DRCN_DIGITAL_WRITE8 ;
266-
cmd.data = value ;
267-
268-
(void)send (node->fd, &cmd, sizeof (cmd), 0) ;
269-
(void)recv (node->fd, &cmd, sizeof (cmd), 0) ;
270-
}
271-
*/
272-
273-
274256
/*
275257
* myAnalogWrite:
276258
*********************************************************************************
@@ -347,26 +329,6 @@ static int myDigitalRead (struct wiringPiNodeStruct *node, int pin)
347329
}
348330

349331

350-
/*
351-
* myDigitalRead8:
352-
*********************************************************************************
353-
354-
static unsigned int myDigitalRead8 (struct wiringPiNodeStruct *node, int pin)
355-
{
356-
struct drcNetComStruct cmd ;
357-
358-
cmd.pin = pin - node->pinBase ;
359-
cmd.cmd = DRCN_DIGITAL_READ8 ;
360-
cmd.data = 0 ;
361-
362-
(void)send (node->fd, &cmd, sizeof (cmd), 0) ;
363-
(void)recv (node->fd, &cmd, sizeof (cmd), 0) ;
364-
365-
return cmd.data ;
366-
}
367-
*/
368-
369-
370332
/*
371333
* drcNet:
372334
* 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
397359
node->analogWrite = myAnalogWrite ;
398360
node->digitalRead = myDigitalRead ;
399361
node->digitalWrite = myDigitalWrite ;
400-
//node->digitalRead8 = myDigitalRead8 ;
401-
//node->digitalWrite8 = myDigitalWrite8 ;
402362
node->pwmWrite = myPwmWrite ;
403363

404364
return TRUE ;

wiringPi/wiringPi.c

Lines changed: 7 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,15 +1664,13 @@ struct wiringPiNodeStruct *wiringPiFindNode (int pin)
16641664
*********************************************************************************
16651665
*/
16661666

1667-
static void pinModeDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int mode) { return ; }
1668-
static void pullUpDnControlDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int pud) { return ; }
1669-
//static unsigned int digitalRead8Dummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return 0 ; }
1670-
//static void digitalWrite8Dummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
1671-
static int digitalReadDummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return LOW ; }
1672-
static void digitalWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
1673-
static void pwmWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
1674-
static int analogReadDummy (UNU struct wiringPiNodeStruct *node, UNU int pin) { return 0 ; }
1675-
static void analogWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
1667+
static void pinModeDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int mode) { return ; }
1668+
static void pullUpDnControlDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int pud) { return ; }
1669+
static int digitalReadDummy (UNU struct wiringPiNodeStruct *node, UNU int UNU pin) { return LOW ; }
1670+
static void digitalWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
1671+
static void pwmWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
1672+
static int analogReadDummy (UNU struct wiringPiNodeStruct *node, UNU int pin) { return 0 ; }
1673+
static void analogWriteDummy (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
16761674

16771675
struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins)
16781676
{
@@ -1699,9 +1697,7 @@ struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins)
16991697
node->pinMode = pinModeDummy ;
17001698
node->pullUpDnControl = pullUpDnControlDummy ;
17011699
node->digitalRead = digitalReadDummy ;
1702-
//node->digitalRead8 = digitalRead8Dummy ;
17031700
node->digitalWrite = digitalWriteDummy ;
1704-
//node->digitalWrite8 = digitalWrite8Dummy ;
17051701
node->pwmWrite = pwmWriteDummy ;
17061702
node->analogRead = analogReadDummy ;
17071703
node->analogWrite = analogWriteDummy ;
@@ -2324,27 +2320,6 @@ int digitalRead (int pin)
23242320
}
23252321

23262322

2327-
/*
2328-
* digitalRead8:
2329-
* Read 8-bits (a byte) from given start pin.
2330-
*********************************************************************************
2331-
2332-
unsigned int digitalRead8 (int pin)
2333-
{
2334-
struct wiringPiNodeStruct *node = wiringPiNodes ;
2335-
2336-
if ((pin & PI_GPIO_MASK) == 0) // On-Board Pin
2337-
return 0 ;
2338-
else
2339-
{
2340-
if ((node = wiringPiFindNode (pin)) == NULL)
2341-
return LOW ;
2342-
return node->digitalRead8 (node, pin) ;
2343-
}
2344-
}
2345-
*/
2346-
2347-
23482323
/*
23492324
* digitalWrite:
23502325
* Set an output bit
@@ -2433,32 +2408,6 @@ void digitalWrite (int pin, int value)
24332408
}
24342409

24352410

2436-
/*
2437-
* digitalWrite8:
2438-
* Set an output 8-bit byte on the device from the given pin number
2439-
*********************************************************************************
2440-
2441-
void digitalWrite8 (int pin, int value)
2442-
{
2443-
struct wiringPiNodeStruct *node = wiringPiNodes ;
2444-
2445-
if ((pin & PI_GPIO_MASK) == 0) // On-Board Pin
2446-
return ;
2447-
else
2448-
{
2449-
if ((node = wiringPiFindNode (pin)) != NULL)
2450-
node->digitalWrite8 (node, pin, value) ;
2451-
}
2452-
}
2453-
*/
2454-
2455-
2456-
/*
2457-
* pwmWrite:
2458-
* Set an output PWM value
2459-
*********************************************************************************
2460-
*/
2461-
24622411
void pwmWrite (int pin, int value)
24632412
{
24642413
struct wiringPiNodeStruct *node = wiringPiNodes ;

wiringPi/wiringPi.h

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,13 @@ struct wiringPiNodeStruct
176176
unsigned int data2 ; // ditto
177177
unsigned int data3 ; // ditto
178178

179-
void (*pinMode) (struct wiringPiNodeStruct *node, int pin, int mode) ;
180-
void (*pullUpDnControl) (struct wiringPiNodeStruct *node, int pin, int mode) ;
181-
int (*digitalRead) (struct wiringPiNodeStruct *node, int pin) ;
182-
//unsigned int (*digitalRead8) (struct wiringPiNodeStruct *node, int pin) ;
183-
void (*digitalWrite) (struct wiringPiNodeStruct *node, int pin, int value) ;
184-
// void (*digitalWrite8) (struct wiringPiNodeStruct *node, int pin, int value) ;
185-
void (*pwmWrite) (struct wiringPiNodeStruct *node, int pin, int value) ;
186-
int (*analogRead) (struct wiringPiNodeStruct *node, int pin) ;
187-
void (*analogWrite) (struct wiringPiNodeStruct *node, int pin, int value) ;
179+
void (*pinMode) (struct wiringPiNodeStruct *node, int pin, int mode) ;
180+
void (*pullUpDnControl) (struct wiringPiNodeStruct *node, int pin, int mode) ;
181+
int (*digitalRead) (struct wiringPiNodeStruct *node, int pin) ;
182+
void (*digitalWrite) (struct wiringPiNodeStruct *node, int pin, int value) ;
183+
void (*pwmWrite) (struct wiringPiNodeStruct *node, int pin, int value) ;
184+
int (*analogRead) (struct wiringPiNodeStruct *node, int pin) ;
185+
void (*analogWrite) (struct wiringPiNodeStruct *node, int pin, int value) ;
188186

189187
struct wiringPiNodeStruct *next ;
190188
} ;
@@ -255,18 +253,16 @@ enum WPIPinAlt {
255253
};
256254

257255

258-
extern int wiringPiGpioDeviceGetFd(); //Interface V3.3
259-
extern void pinModeAlt (int pin, int mode) ;
260-
extern enum WPIPinAlt getPinModeAlt (int pin) ; // Interface V3.5, same as getAlt but wie enum
261-
extern void pinMode (int pin, int mode) ;
262-
extern void pullUpDnControl (int pin, int pud) ;
263-
extern int digitalRead (int pin) ;
264-
extern void digitalWrite (int pin, int value) ;
265-
extern unsigned int digitalRead8 (int pin) ;
266-
extern void digitalWrite8 (int pin, int value) ;
267-
extern void pwmWrite (int pin, int value) ;
268-
extern int analogRead (int pin) ;
269-
extern void analogWrite (int pin, int value) ;
256+
extern int wiringPiGpioDeviceGetFd(); //Interface V3.3
257+
extern void pinModeAlt (int pin, int mode) ;
258+
extern enum WPIPinAlt getPinModeAlt (int pin) ; // Interface V3.5, same as getAlt but wie enum
259+
extern void pinMode (int pin, int mode) ;
260+
extern void pullUpDnControl (int pin, int pud) ;
261+
extern int digitalRead (int pin) ;
262+
extern void digitalWrite (int pin, int value) ;
263+
extern void pwmWrite (int pin, int value) ;
264+
extern int analogRead (int pin) ;
265+
extern void analogWrite (int pin, int value) ;
270266

271267
// PiFace specifics
272268
// (Deprecated)

wiringPiD/runRemote.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ void runRemoteCommands (int fd)
9292
break ;
9393

9494
case DRCN_DIGITAL_WRITE8:
95-
//digitalWrite8 (pin, cmd.data) ;
9695
if (send (fd, &cmd, sizeof (cmd), 0) != sizeof (cmd))
9796
return ;
9897
break ;
@@ -104,7 +103,6 @@ void runRemoteCommands (int fd)
104103
break ;
105104

106105
case DRCN_DIGITAL_READ8:
107-
//cmd.data = digitalRead8 (pin) ;
108106
if (send (fd, &cmd, sizeof (cmd), 0) != sizeof (cmd))
109107
return ;
110108
break ;

0 commit comments

Comments
 (0)