diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-12 11:26:09 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-14 08:00:41 +0200 |
commit | 8deb1c9160ae02828ce5bc810a4262daca94b530 (patch) | |
tree | bad773e1c7f2bf991021e38ad5b499bb977f128f | |
parent | 97fb361ea9e8d0952327a51b3400401d96f08506 (diff) | |
download | px4-firmware-8deb1c9160ae02828ce5bc810a4262daca94b530.tar.gz px4-firmware-8deb1c9160ae02828ce5bc810a4262daca94b530.tar.bz2 px4-firmware-8deb1c9160ae02828ce5bc810a4262daca94b530.zip |
Read out the RC status at the same transfer as the channels to ensure we got synchronized data
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index aec6dd3b7..e937f940a 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1477,12 +1477,14 @@ PX4IO::io_get_raw_rc_input(rc_input_values &input_rc) input_rc.rc_ppm_frame_length = regs[PX4IO_P_RAW_RC_DATA]; input_rc.rssi = regs[PX4IO_P_RAW_RC_NRSSI]; input_rc.rc_failsafe = (regs[PX4IO_P_RAW_RC_FLAGS] & PX4IO_P_RAW_RC_FLAGS_FAILSAFE); + input_rc.rc_lost = !(regs[PX4IO_P_RAW_RC_FLAGS] & PX4IO_P_RAW_RC_FLAGS_RC_OK); input_rc.rc_lost_frame_count = regs[PX4IO_P_RAW_LOST_FRAME_COUNT]; input_rc.rc_total_frame_count = regs[PX4IO_P_RAW_FRAME_COUNT]; /* rc_lost has to be set before the call to this function */ - if (!input_rc.rc_lost && !input_rc.rc_failsafe) + if (!input_rc.rc_lost && !input_rc.rc_failsafe) { _rc_last_valid = input_rc.timestamp_publication; + } input_rc.timestamp_last_signal = _rc_last_valid; |