1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

Merge pull request #2193 from mikeller/disable_current_sensing_without_battery

Disabled battery current sensing if no battery is connected.
This commit is contained in:
Michael Keller 2017-01-25 12:56:32 +13:00 committed by GitHub
commit 1fe48b913a

View file

@ -266,6 +266,7 @@ void updateConsumptionWarning(void)
void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t deadband3d_throttle) void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t deadband3d_throttle)
{ {
if (getBatteryState() != BATTERY_NOT_PRESENT) {
switch(batteryConfig->currentMeterType) { switch(batteryConfig->currentMeterType) {
case CURRENT_SENSOR_ADC: case CURRENT_SENSOR_ADC:
updateBatteryCurrent(); updateBatteryCurrent();
@ -317,6 +318,10 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
break; break;
} }
} else {
amperage = 0;
amperageLatest = 0;
}
} }
float calculateVbatPidCompensation(void) { float calculateVbatPidCompensation(void) {