Fix GPIO limits
authorJeremy Tan <[email protected]>
Sun, 29 Sep 2013 12:40:16 +0000 (20:40 +0800)
committerJeremy Tan <[email protected]>
Sun, 29 Sep 2013 12:40:16 +0000 (20:40 +0800)
server/pin_test.c

index 86685e8..2ef0612 100644 (file)
@@ -118,7 +118,7 @@ void Pin_Handler(FCGIContext *context, char * params)
 
        if (strcmp(type, "gpo") == 0)
        {
-               if (num <= 0 || num > GPIO_NUM_PINS)
+               if (num <= 0 || num > GPIO_MAX_NUMBER)
                {
                        FCGI_RejectJSON(context, "Invalid GPIO pin");
                        return;
@@ -137,7 +137,7 @@ void Pin_Handler(FCGIContext *context, char * params)
        }
        else if (strcmp(type, "gpi") == 0)
        {
-               if (num < 0 || num >= GPIO_NUM_PINS)
+               if (num < 0 || num > GPIO_MAX_NUMBER)
                {
                        FCGI_RejectJSON(context, "Invalid GPIO pin");
                        return;

UCC git Repository :: git.ucc.asn.au