From 99193144f120c256cd05c6d6ec8d5a09bab3a2f8 Mon Sep 17 00:00:00 2001 From: Robert Wolterman Date: Sat, 18 Jun 2016 14:44:36 -0500 Subject: [PATCH] Stupid logic error preventing XIO-P1 or higher to work. Fixed now --- source/common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/common.c b/source/common.c index 3b1bbef..a6f24e1 100644 --- a/source/common.c +++ b/source/common.c @@ -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; }