1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Added config checks for the RSSI config. (#5644)

This commit is contained in:
Michael Keller 2018-04-11 19:31:57 +12:00 committed by GitHub
parent d749879cf6
commit 6cfec6fc53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -260,6 +260,22 @@ static void validateAndFixConfig(void)
pgResetFn_serialConfig(serialConfigMutable()); 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. // clear features that are not supported.
// I have kept them all here in one place, some could be moved to sections of code above. // 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); featureClear(FEATURE_DYNAMIC_FILTER);
#endif #endif
#if !defined(USE_ADC)
featureClear(FEATURE_RSSI_ADC);
#endif
#if defined(TARGET_VALIDATECONFIG) #if defined(TARGET_VALIDATECONFIG)
targetValidateConfiguration(); targetValidateConfiguration();
#endif #endif