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-12 11:26:09 +0200 |
commit | 105d434a819cbe5c5daad2c72551733b126b9319 (patch) | |
tree | ff395f195e144d4cc4827455fa13958b597b8337 | |
parent | 2f5d0cd2f818c0824b9c6c1a360d4d643c6e8c40 (diff) | |
download | px4-firmware-105d434a819cbe5c5daad2c72551733b126b9319.tar.gz px4-firmware-105d434a819cbe5c5daad2c72551733b126b9319.tar.bz2 px4-firmware-105d434a819cbe5c5daad2c72551733b126b9319.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; |