From 450b574a71921c2a5adfb23118e14e7943bab7ad Mon Sep 17 00:00:00 2001 From: Guo-Rong <5484552+gkoh@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:16:28 +1030 Subject: [PATCH] Fix high charge battery level mapping. Lower the battery level max so 4 bars is 85-100%. Otherwise, anything less than 100% is 3 bars. --- lib/M5ez/src/M5ez.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/M5ez/src/M5ez.cpp b/lib/M5ez/src/M5ez.cpp index 1b904d4..aa47bd0 100644 --- a/lib/M5ez/src/M5ez.cpp +++ b/lib/M5ez/src/M5ez.cpp @@ -2121,7 +2121,7 @@ uint16_t ezBattery::loop() { uint8_t ezBattery::getTransformedBatteryLevel() { int32_t level = M5.Power.getBatteryLevel(); - return map(level, 0, 100, 0, 4); + return map(level, 0, 85, 0, 4); } // Return the theme based battery bar color according to its level