diff options
-rw-r--r-- | firmware/2lib/2ui.c | 9 | ||||
-rw-r--r-- | firmware/2lib/2ui_screens.c | 6 | ||||
-rw-r--r-- | firmware/2lib/include/2api.h | 6 | ||||
-rw-r--r-- | firmware/2lib/include/2ui.h | 5 |
4 files changed, 10 insertions, 16 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c index 23b7b0dd..fea3b4ad 100644 --- a/firmware/2lib/2ui.c +++ b/firmware/2lib/2ui.c @@ -327,13 +327,10 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, ui.state->disabled_item_mask, ui.disable_timer, ui.error_code); - /* - * Only beep if we're transitioning from no - * error to an error. - */ - if (prev_error_code == VB2_UI_ERROR_NONE && - ui.error_code != VB2_UI_ERROR_NONE) + if (ui.error_beep) { vb2ex_beep(250, 400); + ui.error_beep = 0; + } /* Update prev variables. */ memcpy(&prev_state, ui.state, sizeof(*ui.state)); diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index 97c9b5e5..ab15a2b3 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -490,7 +490,7 @@ vb2_error_t vb2_ui_developer_mode_boot_external_action( !vb2_dev_boot_allowed(ui->ctx) || !vb2_dev_boot_external_allowed(ui->ctx)) { VB2_DEBUG("ERROR: Dev mode external boot not allowed\n"); - ui->error_code = VB2_UI_ERROR_DEV_EXTERNAL_NOT_ALLOWED; + ui->error_beep = 1; return VB2_REQUEST_UI_CONTINUE; } @@ -501,7 +501,7 @@ vb2_error_t vb2_ui_developer_mode_boot_external_action( if (ui->state->screen->id != VB2_SCREEN_DEVELOPER_BOOT_EXTERNAL) { VB2_DEBUG("No external disk found\n"); - ui->error_code = VB2_UI_ERROR_DEV_EXTERNAL_BOOT_FAILED; + ui->error_beep = 1; } return vb2_ui_screen_change( ui, VB2_SCREEN_DEVELOPER_BOOT_EXTERNAL); @@ -509,7 +509,7 @@ vb2_error_t vb2_ui_developer_mode_boot_external_action( if (ui->state->screen->id != VB2_SCREEN_DEVELOPER_INVALID_DISK) { VB2_DEBUG("Invalid external disk: %#x\n", rv); - ui->error_code = VB2_UI_ERROR_DEV_EXTERNAL_BOOT_FAILED; + ui->error_beep = 1; } return vb2_ui_screen_change( ui, VB2_SCREEN_DEVELOPER_INVALID_DISK); diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 0a023c6f..84b589fa 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -1239,12 +1239,6 @@ enum vb2_ui_error { VB2_UI_ERROR_NONE = 0, /* Dev mode already enabled */ VB2_UI_ERROR_DEV_MODE_ALREADY_ENABLED, - /* Dev mode internal boot not allowed */ - VB2_UI_ERROR_DEV_INTERNAL_NOT_ALLOWED, - /* Dev mode external boot not allowed */ - VB2_UI_ERROR_DEV_EXTERNAL_NOT_ALLOWED, - /* Dev mode external boot failed */ - VB2_UI_ERROR_DEV_EXTERNAL_BOOT_FAILED, }; /** diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h index 35dddb89..fa8c66a3 100644 --- a/firmware/2lib/include/2ui.h +++ b/firmware/2lib/include/2ui.h @@ -89,8 +89,11 @@ struct vb2_ui_context { /* For language selection screen. */ struct vb2_menu language_menu; + /* For error beep sound. */ + int error_beep; + /* For displaying error messages. */ - enum vb2_ui_error error_code; + enum vb2_ui_error error_code; }; vb2_error_t vb2_ui_developer_mode_boot_internal_action( |