From c7dbaea08aa94da86f166e71f08f91853b150630 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 24 Jun 2022 23:40:26 +1000 Subject: [PATCH] Fix > 25V input --- source/Core/Threads/GUIThread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Core/Threads/GUIThread.cpp b/source/Core/Threads/GUIThread.cpp index 1e96be26..cb2d57cf 100644 --- a/source/Core/Threads/GUIThread.cpp +++ b/source/Core/Threads/GUIThread.cpp @@ -132,14 +132,14 @@ static bool checkVoltageForExit() { static void gui_drawBatteryIcon() { #if defined(POW_PD) || defined(POW_QC) if (!getIsPoweredByDCIN()) { - // On TS80 we replace this symbol with the voltage we are operating on + // On non-DC inputs we replace this symbol with the voltage we are operating on // If <9V then show single digit, if not show dual small ones vertically stacked - uint8_t V = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0); + uint16_t V = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0); if (V % 10 >= 5) - V = V / 10 + 1; // round up + V = (V / 10) + 1; // round up else V = V / 10; - if (V >= 10) { + if (V > 9) { int16_t xPos = OLED::getCursorX(); OLED::printNumber(V / 10, 1, FontStyle::SMALL); OLED::setCursor(xPos, 8);