diff options
-rw-r--r-- | firmware/2lib/2ui.c | 8 | ||||
-rw-r--r-- | firmware/2lib/include/2api.h | 3 | ||||
-rw-r--r-- | tests/vb2_ui_action_tests.c | 1 | ||||
-rw-r--r-- | tests/vb2_ui_tests.c | 1 |
4 files changed, 12 insertions, 1 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c index 81243ac2..91478623 100644 --- a/firmware/2lib/2ui.c +++ b/firmware/2lib/2ui.c @@ -285,6 +285,7 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, { struct vb2_ui_context ui; struct vb2_screen_state prev_state; + int prev_disable_timer; enum vb2_ui_error prev_error_code; const struct vb2_menu *menu; const struct vb2_screen_info *root_info; @@ -301,12 +302,15 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, if (rv != VB2_REQUEST_UI_CONTINUE) return rv; memset(&prev_state, 0, sizeof(prev_state)); + prev_disable_timer = 0; prev_error_code = VB2_UI_ERROR_NONE; while (1) { /* Draw if there are state changes. */ if (memcmp(&prev_state, ui.state, sizeof(*ui.state)) || - /* we want to redraw/beep on a transition */ + /* We want to redraw when timer is disabled. */ + prev_disable_timer != ui.disable_timer || + /* We want to redraw/beep on a transition. */ prev_error_code != ui.error_code) { menu = get_menu(&ui); @@ -318,6 +322,7 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, vb2ex_display_ui(ui.state->screen->id, ui.locale_id, ui.state->selected_item, ui.state->disabled_item_mask, + ui.disable_timer, ui.error_code); /* * Only beep if we're transitioning from no @@ -329,6 +334,7 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, /* Update prev variables. */ memcpy(&prev_state, ui.state, sizeof(*ui.state)); + prev_disable_timer = ui.disable_timer; prev_error_code = ui.error_code; } diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 69fd1458..0a023c6f 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -1256,6 +1256,8 @@ enum vb2_ui_error { * doesn't have a menu, this value will be ignored. * @param disabled_item_mask Mask for disabled menu items. Bit (1 << idx) * indicates whether item 'idx' is disabled. + * @param timer_disabled Whether timer is disabled or not. Some screen + * descriptions will depend on this value. * @param error_code Error code if an error occurred. * @return VB2_SUCCESS, or error code on error. */ @@ -1263,6 +1265,7 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen, uint32_t locale_id, uint32_t selected_item, uint32_t disabled_item_mask, + int timer_disabled, enum vb2_ui_error error_code); /** diff --git a/tests/vb2_ui_action_tests.c b/tests/vb2_ui_action_tests.c index b32bafe5..fb110b4e 100644 --- a/tests/vb2_ui_action_tests.c +++ b/tests/vb2_ui_action_tests.c @@ -386,6 +386,7 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen, uint32_t locale_id, uint32_t selected_item, uint32_t disabled_item_mask, + int timer_disabled, enum vb2_ui_error error_code) { struct display_call displayed = (struct display_call){ diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c index 47c70466..516ec6f0 100644 --- a/tests/vb2_ui_tests.c +++ b/tests/vb2_ui_tests.c @@ -326,6 +326,7 @@ vb2_error_t vb2ex_display_ui(enum vb2_screen screen, uint32_t locale_id, uint32_t selected_item, uint32_t disabled_item_mask, + int timer_disabled, enum vb2_ui_error error_code) { struct display_call displayed = (struct display_call){ |