diff --git a/gpio/gpio.c b/gpio/gpio.c index 9b16921..dced95c 100644 --- a/gpio/gpio.c +++ b/gpio/gpio.c @@ -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]) ; diff --git a/gpio/readall.c b/gpio/readall.c index 0237110..8fc9f88 100644 --- a/gpio/readall.c +++ b/gpio/readall.c @@ -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)]) ; } diff --git a/wiringPi/max5322.c b/wiringPi/max5322.c index c0b6264..b7cd6a9 100644 --- a/wiringPi/max5322.c +++ b/wiringPi/max5322.c @@ -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 ;