diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-21 10:48:40 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-21 10:48:40 +0200 |
commit | 4440c6383c3ad9030db7de4b828a7c4a1627c100 (patch) | |
tree | 93d5d83f62b4284210dde257db7d97548e7f8448 /src | |
parent | 027919302d9537e4787f1384690a019eb937e458 (diff) | |
download | px4-firmware-4440c6383c3ad9030db7de4b828a7c4a1627c100.tar.gz px4-firmware-4440c6383c3ad9030db7de4b828a7c4a1627c100.tar.bz2 px4-firmware-4440c6383c3ad9030db7de4b828a7c4a1627c100.zip |
IO RSSI handling: Make 0-RSSI value consistent for all input sources
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/px4iofirmware/controls.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/modules/px4iofirmware/controls.c b/src/modules/px4iofirmware/controls.c index 4ef27718c..c9702c2ec 100644 --- a/src/modules/px4iofirmware/controls.c +++ b/src/modules/px4iofirmware/controls.c @@ -196,6 +196,11 @@ controls_tick() { } #endif + /* zero RSSI if signal is lost */ + if (!(r_raw_rc_flags & (PX4IO_P_RAW_RC_FLAGS_RC_OK))) { + rssi = 0; + } + perf_begin(c_gather_dsm); bool dsm_updated, st24_updated, sumd_updated; (void)dsm_port_input(&rssi, &dsm_updated, &st24_updated, &sumd_updated); @@ -227,19 +232,17 @@ controls_tick() { r_raw_rc_flags &= ~(PX4IO_P_RAW_RC_FLAGS_FRAME_DROP); } - /* set RSSI to an emulated value if ADC RSSI is off */ - if (!(r_setup_features & PX4IO_P_SETUP_FEATURES_ADC_RSSI)) { - rssi = sbus_rssi; - } - if (sbus_failsafe) { r_raw_rc_flags |= PX4IO_P_RAW_RC_FLAGS_FAILSAFE; - /* set RSSI to 0 if the decoder senses complete drop, independent of the ADC value */ - rssi = 0; } else { r_raw_rc_flags &= ~(PX4IO_P_RAW_RC_FLAGS_FAILSAFE); } + /* set RSSI to an emulated value if ADC RSSI is off */ + if (!(r_setup_features & PX4IO_P_SETUP_FEATURES_ADC_RSSI)) { + rssi = sbus_rssi; + } + } perf_end(c_gather_sbus); |