Improvements to time and timer display #911 (#912)

* Fix time display #911

* move TIMEHOUR definition

* change time format

* Refactoring

* rename

* remove unncessary code

* Change hour/minute format

* pack TimerDisplayOptions structure
This commit is contained in:
eshifri
2021-10-25 12:36:16 +11:00
committed by GitHub
parent 2b8dfeef59
commit 4e571c1325
13 changed files with 95 additions and 56 deletions
+3 -1
View File
@@ -367,7 +367,9 @@ static int luaLcdDrawTimer(lua_State *L)
char s[LEN_TIMER_STRING];
int tme = luaL_checkinteger(L, 3);
LcdFlags flags = luaL_optunsigned(L, 4, 0);
getTimerString(s, tme, (flags & TIMEHOUR) != 0);
TimerOptions timerOptions;
timerOptions.options = (flags & TIMEHOUR) != 0 ? SHOW_TIME : SHOW_TIMER;
getTimerString(s, tme, timerOptions);
drawString(L, s, flags);
return 0;
}