diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-10-10 00:12:39 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-10-10 00:12:39 +0200 |
commit | 13b07efc49584ea8b864403ff15bae9042ffb3af (patch) | |
tree | a56b5b9132d16d00341edd7a1f3e8b7f221595a4 /src/drivers/px4io/px4io.cpp | |
parent | d8396ca4b3514d9fb325ec2a85ec8f7575f93bd5 (diff) | |
download | px4-firmware-13b07efc49584ea8b864403ff15bae9042ffb3af.tar.gz px4-firmware-13b07efc49584ea8b864403ff15bae9042ffb3af.tar.bz2 px4-firmware-13b07efc49584ea8b864403ff15bae9042ffb3af.zip |
added hw test, added better io debugging
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 969dbefea..f6d4f1ed4 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1545,7 +1545,7 @@ PX4IO::print_debug() int io_fd = -1; if (io_fd < 0) { - io_fd = ::open("/dev/ttyS0", O_RDONLY | O_NONBLOCK); + io_fd = ::open("/dev/ttyS0", O_RDONLY | O_NONBLOCK | O_NOCTTY); } /* read IO's output */ @@ -1555,7 +1555,7 @@ PX4IO::print_debug() fds[0].events = POLLIN; usleep(500); - int pret = ::poll(fds, sizeof(fds) / sizeof(fds[0]), 10); + int pret = ::poll(fds, sizeof(fds) / sizeof(fds[0]), 0); if (pret > 0) { int count; @@ -1606,6 +1606,8 @@ PX4IO::mixer_send(const char *buf, unsigned buflen, unsigned retries) memcpy(&msg->text[0], buf, count); buf += count; buflen -= count; + } else { + continue; } /* @@ -1644,7 +1646,8 @@ PX4IO::mixer_send(const char *buf, unsigned buflen, unsigned retries) /* ensure a closing newline */ msg->text[0] = '\n'; msg->text[1] = '\0'; - int ret = io_reg_set(PX4IO_PAGE_MIXERLOAD, 0, (uint16_t *)frame, 1); + + int ret = io_reg_set(PX4IO_PAGE_MIXERLOAD, 0, (uint16_t *)frame, (sizeof(px4io_mixdata) + 2) / 2); retries--; |