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:
commit
1fe48b913a
1 changed files with 46 additions and 41 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue