Browse Source

Reverted gpio readall to older version - new version is gpio nreadall

fixed the max5322 code.
pull/22/head
Gordon Henderson 11 years ago
parent
commit
8c8578a26b
3 changed files with 8 additions and 8 deletions
  1. +3
    -3
      gpio/gpio.c
  2. +3
    -3
      gpio/readall.c
  3. +2
    -2
      wiringPi/max5322.c

+ 3
- 3
gpio/gpio.c View File

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


+ 3
- 3
gpio/readall.c View File

@@ -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)]) ;
}



+ 2
- 2
wiringPi/max5322.c View File

@@ -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…
Cancel
Save