mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Merge pull request #5135 from codecae/battery_telemetry_init_fix
Corrected issue with telemetry init when battery cell estimation is undefined
This commit is contained in:
commit
8a95474bff
8 changed files with 56 additions and 38 deletions
|
@ -450,9 +450,9 @@ void batteryUpdateAlarms(void)
|
|||
}
|
||||
}
|
||||
|
||||
bool isBatteryVoltageAvailable(void)
|
||||
bool isBatteryVoltageConfigured(void)
|
||||
{
|
||||
return batteryConfig()->voltageMeterSource != VOLTAGE_METER_NONE && getBatteryCellCount() > 0;
|
||||
return batteryConfig()->voltageMeterSource != VOLTAGE_METER_NONE;
|
||||
}
|
||||
|
||||
uint16_t getBatteryVoltage(void)
|
||||
|
@ -475,7 +475,7 @@ uint16_t getBatteryAverageCellVoltage(void)
|
|||
return voltageMeter.filtered / batteryCellCount;
|
||||
}
|
||||
|
||||
bool isAmperageAvailable(void)
|
||||
bool isAmperageConfigured(void)
|
||||
{
|
||||
return batteryConfig()->currentMeterSource != CURRENT_METER_NONE;
|
||||
}
|
||||
|
|
|
@ -77,13 +77,13 @@ struct rxConfig_s;
|
|||
|
||||
float calculateVbatPidCompensation(void);
|
||||
uint8_t calculateBatteryPercentageRemaining(void);
|
||||
bool isBatteryVoltageAvailable(void);
|
||||
bool isBatteryVoltageConfigured(void);
|
||||
uint16_t getBatteryVoltage(void);
|
||||
uint16_t getBatteryVoltageLatest(void);
|
||||
uint8_t getBatteryCellCount(void);
|
||||
uint16_t getBatteryAverageCellVoltage(void);
|
||||
|
||||
bool isAmperageAvailable(void);
|
||||
bool isAmperageConfigured(void);
|
||||
int32_t getAmperage(void);
|
||||
int32_t getAmperageLatest(void);
|
||||
int32_t getMAhDrawn(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue