Module: xenomai-3
Branch: wip/drivers
Commit: c777a7681d9eedd07eba38559473ac15f71eb1c8
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c777a7681d9eedd07eba38559473ac15f71eb1c8

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Jun 25 18:53:36 2016 +0200

testsuite/gpiotest: set GPIO direction

---

 testsuite/gpiotest/gpiotest.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testsuite/gpiotest/gpiotest.c b/testsuite/gpiotest/gpiotest.c
index 838f498..65949ee 100644
--- a/testsuite/gpiotest/gpiotest.c
+++ b/testsuite/gpiotest/gpiotest.c
@@ -117,6 +117,9 @@ static int run_read_value(struct smokey_test *t, int argc, 
char *const argv[])
                return ret;
        }
 
+       if (!__T(ret, ioctl(fd, GPIO_RTIOC_DIR_IN)))
+               return ret;
+
        ret = read(fd, &value, sizeof(value));
        close(fd);
 
@@ -149,6 +152,9 @@ static int run_write_value(struct smokey_test *t, int argc, 
char *const argv[])
                return ret;
        }
 
+       if (!__T(ret, ioctl(fd, GPIO_RTIOC_DIR_OUT)))
+               return ret;
+       
        ret = write(fd, &value, sizeof(value));
        close(fd);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to