diff options
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/main_menu.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 985efc2580..614f5a6c34 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -291,6 +291,7 @@ static int info_speak_item(int selected_item, void * data) | |||
291 | 291 | ||
292 | #if CONFIG_RTC | 292 | #if CONFIG_RTC |
293 | struct tm *tm; | 293 | struct tm *tm; |
294 | static int last_talk = 0; | ||
294 | #endif | 295 | #endif |
295 | 296 | ||
296 | switch (selected_item) | 297 | switch (selected_item) |
@@ -313,14 +314,18 @@ static int info_speak_item(int selected_item, void * data) | |||
313 | } | 314 | } |
314 | break; | 315 | break; |
315 | case INFO_DATE: | 316 | case INFO_DATE: |
316 | tm = get_time(); | 317 | if (TIME_AFTER(current_tick, last_talk + HZ*60)) |
317 | if (valid_time(tm)) | ||
318 | { | ||
319 | talk_date(get_time(), true); | ||
320 | } | ||
321 | else | ||
322 | { | 318 | { |
323 | talk_id(LANG_UNKNOWN, true); | 319 | tm = get_time(); |
320 | if (valid_time(tm)) | ||
321 | { | ||
322 | talk_date(get_time(), true); | ||
323 | } | ||
324 | else | ||
325 | { | ||
326 | talk_id(LANG_UNKNOWN, true); | ||
327 | } | ||
328 | last_talk = current_tick; | ||
324 | } | 329 | } |
325 | break; | 330 | break; |
326 | #endif | 331 | #endif |
@@ -417,13 +422,18 @@ static int info_action_callback(int action, struct gui_synclist *lists) | |||
417 | return ACTION_REDRAW; | 422 | return ACTION_REDRAW; |
418 | } | 423 | } |
419 | #if CONFIG_RTC | 424 | #if CONFIG_RTC |
420 | else if (action == ACTION_NONE && lists->selected_item == INFO_TIME) | 425 | else if (action == ACTION_NONE) |
421 | { | 426 | { |
422 | static int last_redraw = 0; | 427 | if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) || |
423 | if (TIME_AFTER(current_tick, last_redraw + HZ/2)) | 428 | (!global_settings.talk_menu && |
429 | gui_synclist_item_is_onscreen(lists, 0, INFO_TIME))) | ||
424 | { | 430 | { |
425 | last_redraw = current_tick; | 431 | static int last_redraw = 0; |
426 | return ACTION_REDRAW; | 432 | if (TIME_AFTER(current_tick, last_redraw + HZ*5)) |
433 | { | ||
434 | last_redraw = current_tick; | ||
435 | return ACTION_REDRAW; | ||
436 | } | ||
427 | } | 437 | } |
428 | } | 438 | } |
429 | #endif | 439 | #endif |