Browse Source

#254 remove pins and wiringpid, fix compile error

pull/275/head
mstroh76 5 months ago
parent
commit
2abcabc4f7
2 changed files with 10 additions and 6 deletions
  1. +2
    -2
      CMakeLists.txt
  2. +8
    -4
      wiringPi/wiringPi.c

+ 2
- 2
CMakeLists.txt View File

@@ -4,6 +4,6 @@ project(WiringPiLib)
# Include subdirectories
add_subdirectory(devLib)
add_subdirectory(gpio)
add_subdirectory(pins)
#add_subdirectory(pins)
add_subdirectory(wiringPi)
add_subdirectory(wiringPiD)
#add_subdirectory(wiringPiD)

+ 8
- 4
wiringPi/wiringPi.c View File

@@ -1966,10 +1966,14 @@ int digitalRead (int pin)
}

if (PI_MODEL_5 == RaspberryPiModel) {
switch(gpio[2*pin] & RP1_STATUS_LEVEL_MASK) {
default: // 11 or 00 not allowed, give LOW!
case RP1_STATUS_LEVEL_LOW: return LOW ;
case RP1_STATUS_LEVEL_HIGH: return HIGH ;
const unsigned int status = gpio[2*pin] & RP1_STATUS_LEVEL_MASK;
if (RP1_STATUS_LEVEL_LOW==status) {
return LOW;
} else if (RP1_STATUS_LEVEL_HIGH==status) {
return HIGH;
} else { // 11 or 00 not allowed, give LOW!
fprintf(stderr, "digitalRead: invalid status %u\n", status);
return LOW;
}
} else {
if ((*(gpio + gpioToGPLEV [pin]) & (1 << (pin & 31))) != 0)


Loading…
Cancel
Save