From cc37bf9f954481d6c7864cddf04f59aad9f59089 Mon Sep 17 00:00:00 2001 From: DriftKingTW Date: Fri, 29 Mar 2024 15:42:43 +0800 Subject: [PATCH] fix: battery won't update in caffeinated or output-locked mode --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ee710e1..94dd245 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -376,13 +376,16 @@ void generalTask(void *pvParameters) { // } // Update screen info + String result = ""; if (isGoingToSleep) { contentBottom = "Going to sleep"; contentIcon = 7; } else if (isOutputLocked) { contentIcon = 10; + result = "Bat. " + (String)batteryPercentage + "%"; } else if (isCaffeinated) { contentIcon = 9; + result = "Bat. " + (String)batteryPercentage + "%"; } else if (bootWiFiMode) { String networkInfo = ""; if (currentMillis - networkInfoPreviousMillis < @@ -406,7 +409,6 @@ void generalTask(void *pvParameters) { } contentTop = networkInfo; } else { - String result = ""; bool plugged = getUSBPowerState(); if (!plugged) { isUsbMode = false;