Module: xenomai-3
Branch: stable-3.0.x
Commit: 597e4bf3b0f95c6802489e19e6671cf0a7e0c33e
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=597e4bf3b0f95c6802489e19e6671cf0a7e0c33e

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