Fix to handle OUT_HIGH in gpio set direction 89/131089/1
authorHyeongsik Min <hyeongsik.min@samsung.com>
Thu, 25 May 2017 10:09:51 +0000 (19:09 +0900)
committerHyeongsik Min <hyeongsik.min@samsung.com>
Thu, 25 May 2017 10:13:59 +0000 (19:13 +0900)
Change-Id: I3d76dafa2ef5c9aaee123ffc04e2a62a54b7c7fe
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
src/interface/gpio.c

index 7e689b3..40901e8 100644 (file)
@@ -69,9 +69,11 @@ int gpio_set_direction(int gpiopin, gpio_direction_e dir)
        }
 
        if (dir == GPIO_DIRECTION_OUT)
-               status = write(fd, "out", strlen("out")+1);
+               status = write(fd, "low", strlen("low")+1);
        else if (dir == GPIO_DIRECTION_IN)
                status = write(fd, "in", strlen("in")+1);
+       else if (dir == GPIO_DIRECTION_OUT_HIGH)
+               status = write(fd, "high", strlen("high")+1);
        else {
                close(fd);
                _E("Error: gpio direction is wrong\n");