Ensure that current meter feature is not disabled since it requires no

hardware io.
This commit is contained in:
Dominic Clifton 2015-01-31 21:56:01 +01:00
parent c85919325c
commit 27f0216a19
1 changed files with 5 additions and 3 deletions

View File

@ -676,7 +676,9 @@ void validateAndFixConfig(void)
// rssi adc needs the same ports // rssi adc needs the same ports
featureClear(FEATURE_RSSI_ADC); featureClear(FEATURE_RSSI_ADC);
// current meter needs the same ports // current meter needs the same ports
featureClear(FEATURE_CURRENT_METER); if (masterConfig.batteryConfig.currentMeterType == CURRENT_SENSOR_ADC) {
featureClear(FEATURE_CURRENT_METER);
}
#endif #endif
#if defined(STM32F10X) || defined(CHEBUZZ) || defined(STM32F3DISCOVERY) #if defined(STM32F10X) || defined(CHEBUZZ) || defined(STM32F3DISCOVERY)
@ -709,13 +711,13 @@ void validateAndFixConfig(void)
#endif #endif
#if defined(NAZE) && defined(SONAR) #if defined(NAZE) && defined(SONAR)
if (feature(FEATURE_RX_PARALLEL_PWM) && feature(FEATURE_SONAR) && feature(FEATURE_CURRENT_METER)) { if (feature(FEATURE_RX_PARALLEL_PWM) && feature(FEATURE_SONAR) && feature(FEATURE_CURRENT_METER) && masterConfig.batteryConfig.currentMeterType == CURRENT_SENSOR_ADC) {
featureClear(FEATURE_CURRENT_METER); featureClear(FEATURE_CURRENT_METER);
} }
#endif #endif
#if defined(OLIMEXINO) && defined(SONAR) #if defined(OLIMEXINO) && defined(SONAR)
if (feature(FEATURE_SONAR) && feature(FEATURE_CURRENT_METER)) { if (feature(FEATURE_SONAR) && feature(FEATURE_CURRENT_METER) && masterConfig.batteryConfig.currentMeterType == CURRENT_SENSOR_ADC) {
featureClear(FEATURE_CURRENT_METER); featureClear(FEATURE_CURRENT_METER);
} }
#endif #endif