From 7e96b96d00f76e48112397245262542d1964852f Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Thu, 23 Mar 2023 21:41:16 +0100 Subject: [PATCH] feat(core/bootloader): remove different logo color when firmware present --- core/embed/bootloader/bootui.c | 4 +--- core/embed/bootloader/bootui.h | 2 +- core/embed/bootloader/main.c | 6 +++--- core/embed/rust/rust_ui.h | 2 +- core/embed/rust/src/ui/model_tt/bootloader/mod.rs | 15 +++++---------- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/core/embed/bootloader/bootui.c b/core/embed/bootloader/bootui.c index f5b56b8fa..1ced805d4 100644 --- a/core/embed/bootloader/bootui.c +++ b/core/embed/bootloader/bootui.c @@ -205,9 +205,7 @@ void ui_screen_done(uint8_t restart_seconds, secbool full_redraw) { screen_install_success(str, initial_setup, full_redraw); } -void ui_screen_boot_empty(bool firmware_present, bool fading) { - screen_boot_empty(firmware_present, fading); -} +void ui_screen_boot_empty(bool fading) { screen_boot_empty(fading); } // error UI void ui_screen_fail(void) { screen_install_fail(); } diff --git a/core/embed/bootloader/bootui.h b/core/embed/bootloader/bootui.h index 4149de155..ccd6fd0a5 100644 --- a/core/embed/bootloader/bootui.h +++ b/core/embed/bootloader/bootui.h @@ -66,7 +66,7 @@ void ui_fadein(void); void ui_fadeout(void); void ui_set_initial_setup(bool initial); -void ui_screen_boot_empty(bool firmware_present, bool fading); +void ui_screen_boot_empty(bool fading); // clang-format off #define INPUT_CANCEL 0x01 // Cancel button diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index c057b73e0..877ba27fd 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -195,7 +195,7 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr, hal_delay(1000); usb_stop(); usb_deinit(); - ui_screen_boot_empty(true, true); + ui_screen_boot_empty(true); return CONTINUE; } break; @@ -320,7 +320,7 @@ int bootloader_main(void) { display_set_little_endian(); #endif - ui_screen_boot_empty(firmware_present == sectrue, false); + ui_screen_boot_empty(false); #ifdef USE_TOUCH touch_power_on(); @@ -419,7 +419,7 @@ int bootloader_main(void) { screen = SCREEN_INTRO; } if (ui_result == 2) { // reboot - ui_screen_boot_empty(true, true); + ui_screen_boot_empty(true); continue_to_firmware = true; } if (ui_result == 3) { // wipe diff --git a/core/embed/rust/rust_ui.h b/core/embed/rust/rust_ui.h index 632eede70..044102989 100644 --- a/core/embed/rust/rust_ui.h +++ b/core/embed/rust/rust_ui.h @@ -28,4 +28,4 @@ uint32_t screen_install_success(const char* reboot_msg, bool initial_setup, uint32_t screen_install_fail(void); void screen_welcome_model(void); void screen_welcome(void); -void screen_boot_empty(bool firmware_present, bool fading); +void screen_boot_empty(bool fading); diff --git a/core/embed/rust/src/ui/model_tt/bootloader/mod.rs b/core/embed/rust/src/ui/model_tt/bootloader/mod.rs index 980845f2d..110ea1164 100644 --- a/core/embed/rust/src/ui/model_tt/bootloader/mod.rs +++ b/core/embed/rust/src/ui/model_tt/bootloader/mod.rs @@ -37,9 +37,7 @@ use crate::{ welcome::Welcome, }, component::{Button, ResultScreen}, - theme::{ - BACKLIGHT_DIM, BACKLIGHT_NORMAL, BLACK, FG, GREY_DARK, TEXT_ERROR_HIGHLIGHT, WHITE, - }, + theme::{BACKLIGHT_DIM, BACKLIGHT_NORMAL, BLACK, FG, TEXT_ERROR_HIGHLIGHT, WHITE}, }, util::{from_c_array, from_c_str}, }, @@ -391,17 +389,14 @@ extern "C" fn screen_wipe_fail() { } #[no_mangle] -extern "C" fn screen_boot_empty(firmware_present: bool, fading: bool) { +extern "C" fn screen_boot_empty(fading: bool) { if fading { fadeout(); } - let fg = if firmware_present { GREY_DARK } else { WHITE }; - let bg = if firmware_present { - BLACK - } else { - WELCOME_COLOR - }; + let fg = WHITE; + let bg = BLACK; + display::rect_fill(constant::screen(), bg); let icon = Icon::new(LOGO_EMPTY); icon.draw(Point::new(screen().center().x, 48), TOP_CENTER, fg, bg);