diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-18 15:50:07 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-18 15:50:07 +0200 |
commit | 798075c90d0bf1d271ce9758f1649f160b7373ec (patch) | |
tree | 477bc962db8c5c958d1109fbb965a16d64227464 /src | |
parent | f93fbbae238e0d3c303a3553322dfa6a8cc277f2 (diff) | |
download | px4-firmware-798075c90d0bf1d271ce9758f1649f160b7373ec.tar.gz px4-firmware-798075c90d0bf1d271ce9758f1649f160b7373ec.tar.bz2 px4-firmware-798075c90d0bf1d271ce9758f1649f160b7373ec.zip |
Work around orb_check fail in sensors app
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/sensors/sensors.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index ae5a55109..be87c752d 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -1141,10 +1141,13 @@ Sensors::ppm_poll() { /* read low-level values from FMU or IO RC inputs (PPM, Spektrum, S.Bus) */ - bool rc_updated; - orb_check(_rc_sub, &rc_updated); + struct pollfd fds[1]; + fds[0].fd = _rc_sub; + fds[0].events = POLLIN; + /* check non-blocking for new data */ + int poll_ret = poll(fds, 1, 0); - if (rc_updated) { + if (poll_ret > 0) { struct rc_input_values rc_input; orb_copy(ORB_ID(input_rc), _rc_sub, &rc_input); |