Disabled battery current sensing if no battery is connected.
This commit is contained in:
parent
8555a65b1b
commit
33c020fcc3
|
@ -266,6 +266,7 @@ void updateConsumptionWarning(void)
|
|||
|
||||
void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t deadband3d_throttle)
|
||||
{
|
||||
if (getBatteryState() != BATTERY_NOT_PRESENT) {
|
||||
switch(batteryConfig->currentMeterType) {
|
||||
case CURRENT_SENSOR_ADC:
|
||||
updateBatteryCurrent();
|
||||
|
@ -294,7 +295,7 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
|
|||
|
||||
break;
|
||||
case CURRENT_SENSOR_ESC:
|
||||
#ifdef USE_ESC_SENSOR
|
||||
#ifdef USE_ESC_SENSOR
|
||||
if (feature(FEATURE_ESC_SENSOR)) {
|
||||
escSensorData_t *escData = getEscSensorData(ESC_SENSOR_COMBINED);
|
||||
if (escData->dataAge <= MAX_ESC_BATTERY_AGE) {
|
||||
|
@ -310,13 +311,17 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
|
|||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case CURRENT_SENSOR_NONE:
|
||||
amperage = 0;
|
||||
amperageLatest = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
amperage = 0;
|
||||
amperageLatest = 0;
|
||||
}
|
||||
}
|
||||
|
||||
float calculateVbatPidCompensation(void) {
|
||||
|
|
Loading…
Reference in New Issue