Allow more the 2 hours digits for TIMEHOUR (#5715)
* Handle 3 digits or more in TIMEHOUR * Cleanup
This commit is contained in:
@@ -813,7 +813,12 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
|||||||
#else
|
#else
|
||||||
#define separator ':'
|
#define separator ':'
|
||||||
#endif
|
#endif
|
||||||
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
if(qr.quot < 100) {
|
||||||
|
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lcdDrawNumber(x, y, qr.quot, att|LEFT);
|
||||||
|
}
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
if (FONTSIZE(att) == MIDSIZE) {
|
if (FONTSIZE(att) == MIDSIZE) {
|
||||||
lcdLastRightPos--;
|
lcdLastRightPos--;
|
||||||
|
|||||||
@@ -540,15 +540,15 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
|||||||
#define separator ':'
|
#define separator ':'
|
||||||
if (att & TIMEHOUR) {
|
if (att & TIMEHOUR) {
|
||||||
div_t qr2 = div(qr.quot, 60);
|
div_t qr2 = div(qr.quot, 60);
|
||||||
lcdDrawNumber(x, y, qr2.quot, att|LEADING0|LEFT, 2);
|
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);
|
lcdDrawChar(lcdNextPos, y, separator, att);
|
||||||
qr.quot = qr2.rem;
|
qr.quot = qr2.rem;
|
||||||
if (att & MIDSIZE)
|
x = lcdNextPos;
|
||||||
x += 17;
|
|
||||||
else if (att & BOLD)
|
|
||||||
x += 15;
|
|
||||||
else
|
|
||||||
x += 13;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user