From a2e0dd5a97f54adaec9465af45d7ab7904f5b3ed Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Fri, 6 Oct 2023 20:57:17 +0200 Subject: [PATCH] Red border in battery indicator was sometimes shown faulty --- TEF6686_ESP32.ino | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 5fc1037..5915565 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -2889,8 +2889,11 @@ void ShowBattery() { tft.drawRoundRect(277, 6, 37, 20, 2, ActiveColor); tft.fillRoundRect(313, 13, 4, 6, 2, ActiveColor); } - tft.fillRoundRect(279, 8, 33, 16, 2, BackgroundColor); - if (batteryoptions != BATTERY_VALUE && batteryoptions != BATTERY_PERCENT) tft.fillRoundRect(279, 8, (battery * 8) , 16, 2, BarInsignificantColor); + if (batteryoptions != BATTERY_VALUE && batteryoptions != BATTERY_PERCENT && battery != 0) { + tft.fillRoundRect(279, 8, (battery * 8) , 16, 2, BarInsignificantColor); + } else { + tft.fillRoundRect(279, 8, 33, 16, 2, BackgroundColor); + } } else { tft.drawRoundRect(277, 6, 37, 20, 2, GreyoutColor); tft.fillRoundRect(313, 13, 4, 6, 2, GreyoutColor);