0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

On-screen battery level when charging

This commit is contained in:
OneOfEleven
2023-09-18 14:31:14 +01:00
parent 1610daaf01
commit c4c7148d61
6 changed files with 42 additions and 13 deletions

View File

@ -68,23 +68,29 @@ void BATTERY_GetReadings(bool bDisplayBatteryLevel)
if (gBatteryCurrent < 501)
{
if (gChargingWithTypeC)
gUpdateStatus = true;
gChargingWithTypeC = 0;
{
gUpdateStatus = true;
gUpdateDisplay = true;
}
gChargingWithTypeC = false;
}
else
{
if (!gChargingWithTypeC)
{
gUpdateStatus = true;
gUpdateStatus = true;
gUpdateDisplay = true;
BACKLIGHT_TurnOn();
}
gChargingWithTypeC = 1;
gChargingWithTypeC = true;
}
if (PreviousBatteryLevel != gBatteryDisplayLevel)
{
if (gBatteryDisplayLevel < 2)
{
gLowBattery = true;
}
else
{
gLowBattery = false;