mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-20 06:58:39 +03:00
Pulled in egzumer's battery percentage !
This commit is contained in:
@ -169,10 +169,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
|
||||
case 2: // percentage
|
||||
{
|
||||
const uint16_t voltage = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v : gBatteryVoltageAverage;
|
||||
const uint16_t percent = (100 * (voltage - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v);
|
||||
// const uint16_t percent = gBatteryDisplayLevel;
|
||||
sprintf(s, "%u%%", percent);
|
||||
sprintf(s, "%u%%", BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
space_needed = (7 * strlen(s));
|
||||
if (x2 >= (x1 + space_needed))
|
||||
UI_PrintStringSmallBuffer(s, line + x2 - space_needed);
|
||||
|
Reference in New Issue
Block a user