From e7c655ba52e81dc9f138ce898206a0feac8d5d8d Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 19 Feb 2020 18:26:20 +0100 Subject: [PATCH] rc_update: make specific RC loss check only on PPM This makes the check more specific, so it's only active on PPM input. --- src/modules/rc_update/rc_update.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/modules/rc_update/rc_update.cpp b/src/modules/rc_update/rc_update.cpp index 7c3ddc76b9..d8162713df 100644 --- a/src/modules/rc_update/rc_update.cpp +++ b/src/modules/rc_update/rc_update.cpp @@ -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;