mirror of
https://github.com/clockworkpi/WiringPi.git
synced 2025-12-12 16:08:49 +01:00
Reverted gpio readall to older version - new version is gpio nreadall
fixed the max5322 code.
This commit is contained in:
parent
27afc017b9
commit
8c8578a26b
@ -51,7 +51,7 @@ extern void doReadallOld (void) ;
|
||||
# define FALSE (1==2)
|
||||
#endif
|
||||
|
||||
#define VERSION "2.08"
|
||||
#define VERSION "2.09"
|
||||
#define I2CDETECT "/usr/sbin/i2cdetect"
|
||||
|
||||
int wpMode ;
|
||||
@ -1190,8 +1190,8 @@ int main (int argc, char *argv [])
|
||||
else if (strcasecmp (argv [1], "pwmr" ) == 0) doPwmRange (argc, argv) ;
|
||||
else if (strcasecmp (argv [1], "pwmc" ) == 0) doPwmClock (argc, argv) ;
|
||||
else if (strcasecmp (argv [1], "drive" ) == 0) doPadDrive (argc, argv) ;
|
||||
else if (strcasecmp (argv [1], "readall" ) == 0) doReadall () ;
|
||||
else if (strcasecmp (argv [1], "oreadall" ) == 0) doReadallOld () ;
|
||||
else if (strcasecmp (argv [1], "readall" ) == 0) doReadallOld () ;
|
||||
else if (strcasecmp (argv [1], "nreadall" ) == 0) doReadall () ;
|
||||
else if (strcasecmp (argv [1], "i2cdetect") == 0) doI2Cdetect (argc, argv) ;
|
||||
else if (strcasecmp (argv [1], "i2cd" ) == 0) doI2Cdetect (argc, argv) ;
|
||||
else if (strcasecmp (argv [1], "reset" ) == 0) doReset (argv [0]) ;
|
||||
|
||||
@ -137,7 +137,7 @@ static char *physNames [64] =
|
||||
"3.3v", "GPIO5",
|
||||
"MOSI", "0v",
|
||||
"MISO", "GPIO6",
|
||||
"SCLK", "CE1",
|
||||
"SCLK", "CE0",
|
||||
"0v", "CE1",
|
||||
|
||||
NULL,NULL,NULL,NULL,NULL,
|
||||
@ -178,7 +178,7 @@ static void readallPhys (int physPin)
|
||||
pin = physToWpi [physPin] ;
|
||||
|
||||
printf (" | %4s", alts [getAlt (pin)]) ;
|
||||
printf (" | %s", (digitalRead (pin) == 0) ? "Hi" : "Lo") ;
|
||||
printf (" | %s", (digitalRead (pin) == LOW) ? "Lo" : "Hi") ;
|
||||
}
|
||||
|
||||
// Pin numbers:
|
||||
@ -200,7 +200,7 @@ static void readallPhys (int physPin)
|
||||
else
|
||||
pin = physToWpi [physPin] ;
|
||||
|
||||
printf (" | %s", (digitalRead (pin) == 0) ? "Hi" : "Lo") ;
|
||||
printf (" | %s", (digitalRead (pin) == LOW) ? "Lo" : "Hi") ;
|
||||
printf (" | %-4s", alts [getAlt (pin)]) ;
|
||||
}
|
||||
|
||||
|
||||
@ -44,8 +44,8 @@ static void myAnalogWrite (struct wiringPiNodeStruct *node, int pin, int value)
|
||||
else
|
||||
chanBits = 0b01010000 ;
|
||||
|
||||
chanBits |= ((value >> 4) & 0x0F) ;
|
||||
dataBits = ((value << 4) & 0xF0) ;
|
||||
chanBits |= ((value >> 12) & 0x0F) ;
|
||||
dataBits = ((value ) & 0xFF) ;
|
||||
|
||||
spiData [0] = chanBits ;
|
||||
spiData [1] = dataBits ;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user