From 6cfec6fc535212d183d9770fe4e010f1e1c6e7d4 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Wed, 11 Apr 2018 19:31:57 +1200 Subject: [PATCH] Added config checks for the RSSI config. (#5644) --- src/main/fc/config.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/fc/config.c b/src/main/fc/config.c index 2bf16fdfab..96871cc7e3 100644 --- a/src/main/fc/config.c +++ b/src/main/fc/config.c @@ -260,6 +260,22 @@ static void validateAndFixConfig(void) pgResetFn_serialConfig(serialConfigMutable()); } +#if !defined(USE_OSD_SLAVE) +#if defined(USE_PWM) || defined(USE_PPM) + if (feature(FEATURE_RX_PPM) || feature(FEATURE_RX_PARALLEL_PWM)) { + rxConfigMutable()->rssi_src_frame_errors = false; + } else +#endif + if (rxConfig()->rssi_src_frame_errors) { + featureClear(FEATURE_RSSI_ADC); + rxConfigMutable()->rssi_channel = 0; +#if defined(USE_ADC) + } else if (feature(FEATURE_RSSI_ADC)) { + rxConfigMutable()->rssi_channel = 0; +#endif + } +#endif // USE_OSD_SLAVE + // clear features that are not supported. // I have kept them all here in one place, some could be moved to sections of code above. @@ -331,6 +347,10 @@ static void validateAndFixConfig(void) featureClear(FEATURE_DYNAMIC_FILTER); #endif +#if !defined(USE_ADC) + featureClear(FEATURE_RSSI_ADC); +#endif + #if defined(TARGET_VALIDATECONFIG) targetValidateConfiguration(); #endif