diff --git a/src/menu/menu.c b/src/menu/menu.c index 2329d06b..6b32eaef 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -1,4 +1,5 @@ #include +#include #include @@ -162,6 +163,8 @@ void menu_run (boot_params_t *boot_params) { boot_pending = true; } } + + time(&menu->current_time); } while (audio_can_write()) { diff --git a/src/menu/menu_state.h b/src/menu/menu_state.h index 148cf002..97aa8e5a 100644 --- a/src/menu/menu_state.h +++ b/src/menu/menu_state.h @@ -8,6 +8,7 @@ #define MENU_STRUCT_H__ +#include #include "boot/boot.h" #include "flashcart/flashcart.h" #include "path.h" @@ -64,6 +65,8 @@ typedef struct { char *error_message; + time_t current_time; + struct { bool go_up; bool go_down; diff --git a/src/menu/views/browser.c b/src/menu/views/browser.c index cec47fae..15b7adfe 100644 --- a/src/menu/views/browser.c +++ b/src/menu/views/browser.c @@ -262,14 +262,12 @@ static void draw (menu_t *menu, surface_t *d) { menu->browser.entries == 0 ? "" : "R: Info" ); - time_t current_time = time(NULL); - - if (current_time >= 0) { + if (menu->current_time >= 0) { component_actions_bar_text_draw( ALIGN_CENTER, VALIGN_TOP, "\n" "%s", - ctime(¤t_time) + ctime(&menu->current_time) ); }