From 7b83864d5f43aecf93639e269a8133d4908f32a8 Mon Sep 17 00:00:00 2001 From: 3djc Date: Thu, 2 May 2019 08:57:19 +0200 Subject: [PATCH] Handle TIMEHOUR for 128x64 drawTimer. This brings 128 inb line with 212 and 480. Warning : TIMEHOUR was default behaviour previously for 128, this will likely expose issues in UI --- radio/src/gui/128x64/lcd.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/radio/src/gui/128x64/lcd.cpp b/radio/src/gui/128x64/lcd.cpp index 9de75127e..4b94b72ff 100644 --- a/radio/src/gui/128x64/lcd.cpp +++ b/radio/src/gui/128x64/lcd.cpp @@ -660,21 +660,24 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2 qr = div((int)tme, 60); char separator = ':'; - if (tme >= 3600) { - qr = div(qr.quot, 60); - separator = CHR_HOUR; - } - if(qr.quot < 100) { - lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2); - } - else { - lcdDrawNumber(x, y, qr.quot, att|LEFT); + if (att & TIMEHOUR) { + div_t qr2 = div(qr.quot, 60); + if (qr2.quot < 100) { + lcdDrawNumber(x, y, qr2.quot, att|LEADING0|LEFT, 2); + } + else { + lcdDrawNumber(x, y, qr2.quot, att|LEFT); + } + lcdDrawChar(lcdNextPos, y, separator, att); + qr.quot = qr2.rem; + x = lcdNextPos; } if (FONTSIZE(att) == MIDSIZE) { lcdLastRightPos--; } if (separator == CHR_HOUR) att &= ~DBLSIZE; + lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2); #if defined(RTCLOCK) if (att & TIMEBLINK) lcdDrawChar(lcdLastRightPos, y, separator, BLINK);