mirror of
https://github.com/xtacocorex/CHIP_IO
synced 2025-07-20 04:43:21 +00:00
Stupid logic error preventing XIO-P1 or higher to work. Fixed now
This commit is contained in:
@ -204,10 +204,10 @@ int lookup_gpio_by_key(const char *key)
|
||||
for (p = table; p->key != NULL; ++p) {
|
||||
if (strcmp(p->key, key) == 0) {
|
||||
// FIGURE OUT IF WE'RE AN XIO PIN USING THE DEFAULT PINS
|
||||
if (p->gpio >= 408) {
|
||||
if (p->gpio >= OLDXIOBASE) {
|
||||
int gbase = get_xio_base();
|
||||
if (gbase != -1) {
|
||||
return gbase - (p->gpio - OLDXIOBASE);
|
||||
return (gbase + (p->gpio - OLDXIOBASE));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@ -225,10 +225,10 @@ int lookup_gpio_by_name(const char *name)
|
||||
for (p = table; p->name != NULL; ++p) {
|
||||
if (strcmp(p->name, name) == 0) {
|
||||
// FIGURE OUT IF WE'RE AN XIO PIN USING THE DEFAULT PINS
|
||||
if (p->gpio >= 408) {
|
||||
if (p->gpio >= OLDXIOBASE) {
|
||||
int gbase = get_xio_base();
|
||||
if (gbase != -1) {
|
||||
return gbase - (p->gpio - OLDXIOBASE);
|
||||
return (gbase + (p->gpio - OLDXIOBASE));
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user