summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/2lib/2ui.c13
-rw-r--r--firmware/2lib/include/2ui.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index 99cedb0c..85c00672 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -314,12 +314,14 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id,
while (1) {
/* Draw if there are state changes. */
if (memcmp(&prev_state, ui.state, sizeof(*ui.state)) ||
- /* We want to redraw when timer is disabled. */
+ /* Redraw when timer is disabled. */
prev_disable_timer != ui.disable_timer ||
- /* We want to redraw/beep on a transition. */
+ /* Redraw/beep on a transition. */
prev_error_code != ui.error_code ||
- /* We want to beep. */
- ui.error_beep != 0) {
+ /* Beep. */
+ ui.error_beep != 0 ||
+ /* Redraw on a screen request to refresh. */
+ ui.force_display) {
menu = get_menu(&ui);
VB2_DEBUG("<%s> menu item <%s>\n",
@@ -338,6 +340,9 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id,
ui.error_beep = 0;
}
+ /* Reset refresh flag. */
+ ui.force_display = 0;
+
/* Update prev variables. */
memcpy(&prev_state, ui.state, sizeof(*ui.state));
prev_disable_timer = ui.disable_timer;
diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h
index 867b0c81..790301ef 100644
--- a/firmware/2lib/include/2ui.h
+++ b/firmware/2lib/include/2ui.h
@@ -108,6 +108,10 @@ struct vb2_ui_context {
/* For displaying error messages. */
enum vb2_ui_error error_code;
+
+ /* Force calling vb2ex_display_ui for refreshing the screen. This flag
+ will be reset after done. */
+ int force_display;
};
vb2_error_t vb2_ui_developer_mode_boot_internal_action(