1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Corrected issue with telemetry init when battery cell estimatation is undefined

This commit is contained in:
Curtis Bangert 2018-02-07 20:30:00 -05:00
parent 25b49a58a1
commit 3a7540e042
8 changed files with 56 additions and 38 deletions

View file

@ -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;
}

View file

@ -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);