Add formatted prinbt function for LCD menu and use systick vonversion in uptime shell command

This commit is contained in:
2020-06-14 14:45:58 +02:00
parent 372be53471
commit 679d4534cb
4 changed files with 33 additions and 20 deletions

View File

@@ -189,8 +189,18 @@ static shellmatta_retCode_t shell_cmd_uptime(const shellmatta_handle_t handle,
{
(void)arguments;
(void)length;
uint32_t days;
uint32_t hours;
uint32_t mins;
uint32_t secs;
shellmatta_printf(handle, "Uptime: %llu secs", global_tick_ms/1000);
systick_get_uptime_from_tick(&days, &hours, &mins, &secs);
shellmatta_printf(handle, "Uptime: %u day%s %02u:%02u:%02u",
days, (days == 1 ? "" : "s"),
hours,
mins,
secs);
return SHELLMATTA_OK;
}