From 2d70fdcd8c6f4fc30c06d07299d6b499389456b8 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 5 Aug 2019 22:05:32 -0400 Subject: Improved reliability of runtime accounting and speaking it. Change-Id: I6f0fb907e0378487cec387a2cfd3a20b9a596c4e --- apps/screens.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apps/screens.c') diff --git a/apps/screens.c b/apps/screens.c index 9cb5ebe258..e7262704f0 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -1018,6 +1018,7 @@ int view_runtime(void) { static const char *lines[]={ID2P(LANG_CLEAR_TIME)}; static const struct text_message message={lines, 1}; + bool say_runtime = true; struct gui_synclist lists; int action; @@ -1031,12 +1032,17 @@ int view_runtime(void) gui_synclist_set_voice_callback(&lists, runtime_speak_data); gui_synclist_set_icon_callback(&lists, NULL); gui_synclist_set_nb_items(&lists, 4); - gui_synclist_speak_item(&lists); + while(1) { global_status.runtime += ((current_tick - lasttime) / HZ); lasttime = current_tick; + if (say_runtime) + { + gui_synclist_speak_item(&lists); + say_runtime = false; + } gui_synclist_draw(&lists); list_do_action(CONTEXT_STD, HZ, &lists, &action, LIST_WRAP_UNLESS_HELD); @@ -1049,7 +1055,7 @@ int view_runtime(void) global_status.runtime = 0; else global_status.topruntime = 0; - gui_synclist_speak_item(&lists); + say_runtime = true; } } if(default_event_handler(action) == SYS_USB_CONNECTED) -- cgit v1.2.3