1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Watt Hours Drawn OSD Element and Post Flight Stat

The Watt hours used element was added per a feature request to give
another way of interpreting the battery usage. It was also added as a
post flight stat to show consumption similar to the mAh post flight
stat. This once again is just giving pilots another option that some may
find useful.
This commit is contained in:
Jon Mahoney 2022-09-19 23:36:23 -04:00
parent 8d909fbe99
commit a2d356dc78
8 changed files with 58 additions and 2 deletions

View file

@ -100,6 +100,7 @@ extern "C" {
uint16_t simulationBatteryVoltage;
uint32_t simulationBatteryAmperage;
uint32_t simulationMahDrawn;
float simulationWhDrawn;
int32_t simulationAltitude;
int32_t simulationVerticalSpeed;
uint16_t simulationCoreTemperature;
@ -128,6 +129,7 @@ void setDefaultSimulationState()
simulationBatteryVoltage = 1680;
simulationBatteryAmperage = 0;
simulationMahDrawn = 0;
simulationWhDrawn = 0;
simulationAltitude = 0;
simulationVerticalSpeed = 0;
simulationCoreTemperature = 0;
@ -1324,6 +1326,10 @@ extern "C" {
return simulationMahDrawn;
}
float getWhDrawn() {
return simulationWhDrawn;
}
int32_t getEstimatedAltitudeCm() {
return simulationAltitude;
}