1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +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

@ -187,6 +187,7 @@ const osd_stats_e osdStatsDisplayOrder[OSD_STAT_COUNT] = {
OSD_STAT_TOTAL_FLIGHTS,
OSD_STAT_TOTAL_TIME,
OSD_STAT_TOTAL_DIST,
OSD_STAT_WATT_HOURS_DRAWN,
};
// Group elements in a number of groups to reduce task scheduling overhead
@ -780,6 +781,14 @@ static bool osdDisplayStat(int statistic, uint8_t displayRow)
return true;
}
break;
case OSD_STAT_WATT_HOURS_DRAWN:
if (batteryConfig()->currentMeterSource != CURRENT_METER_NONE) {
osdPrintFloat(buff, SYM_NONE, getWhDrawn(), "", 2, true, SYM_NONE);
osdDisplayStatisticLabel(displayRow, "USED WATT HOURS", buff);
return true;
}
break;
#ifdef USE_BLACKBOX
case OSD_STAT_BLACKBOX: