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

This commit is contained in:
3djc
2019-05-02 08:57:19 +02:00
parent 5e6e581ba1
commit 7b83864d5f
+12 -9
View File
@@ -660,21 +660,24 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
qr = div((int)tme, 60); qr = div((int)tme, 60);
char separator = ':'; char separator = ':';
if (tme >= 3600) { if (att & TIMEHOUR) {
qr = div(qr.quot, 60); div_t qr2 = div(qr.quot, 60);
separator = CHR_HOUR; if (qr2.quot < 100) {
} lcdDrawNumber(x, y, qr2.quot, att|LEADING0|LEFT, 2);
if(qr.quot < 100) { }
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2); else {
} lcdDrawNumber(x, y, qr2.quot, att|LEFT);
else { }
lcdDrawNumber(x, y, qr.quot, att|LEFT); lcdDrawChar(lcdNextPos, y, separator, att);
qr.quot = qr2.rem;
x = lcdNextPos;
} }
if (FONTSIZE(att) == MIDSIZE) { if (FONTSIZE(att) == MIDSIZE) {
lcdLastRightPos--; lcdLastRightPos--;
} }
if (separator == CHR_HOUR) if (separator == CHR_HOUR)
att &= ~DBLSIZE; att &= ~DBLSIZE;
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
#if defined(RTCLOCK) #if defined(RTCLOCK)
if (att & TIMEBLINK) if (att & TIMEBLINK)
lcdDrawChar(lcdLastRightPos, y, separator, BLINK); lcdDrawChar(lcdLastRightPos, y, separator, BLINK);