rc_update: make specific RC loss check only on PPM

This makes the check more specific, so it's only active on PPM input.
This commit is contained in:
Julian Oes
2020-02-19 18:26:20 +01:00
committed by Beat Küng
parent 3f16eba3f7
commit e7c655ba52
+8 -3
View File
@@ -351,10 +351,15 @@ RCUpdate::Run()
/* signal is lost or no enough channels */
signal_lost = true;
//This problem occurs at RC controllers which are use PPM signal on RFD 868+/900 Modems (Maybe it can be also related another types)
} else if (rc_input.channel_count ==
16) { // check failsafe by channel values to detect RC loss (This statement is specific for only RF modules that still sending valid PPM signal when RC loss from ground RF)
} else if ((rc_input.input_source == input_rc_s::RC_INPUT_SOURCE_PX4FMU_PPM ||
rc_input.input_source == input_rc_s::RC_INPUT_SOURCE_PX4IO_PPM)
&& rc_input.channel_count == 16) {
// This is a specific RC lost check for RFD 868+/900 Modems on PPM.
// The observation was that when RC is lost, 16 channels are active and the first 12 are 1000
// and the remaining ones are 0.
for (unsigned int i = 0; i < 16; i++) {
if (i < 12 && rc_input.values[i] > 999 && rc_input.values[i] < 1005) {
signal_lost = true;