Disabled battery current sensing if no battery is connected.

This commit is contained in:
Michael Keller 2017-01-23 12:41:45 +13:00
parent 8555a65b1b
commit 33c020fcc3
1 changed files with 46 additions and 41 deletions

View File

@ -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();
@ -317,6 +318,10 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
break;
}
} else {
amperage = 0;
amperageLatest = 0;
}
}
float calculateVbatPidCompensation(void) {