1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00

feat(core/bootloader): remove different logo color when firmware present

This commit is contained in:
tychovrahe 2023-03-23 21:41:16 +01:00 committed by matejcik
parent ae9960ca61
commit 7e96b96d00
5 changed files with 11 additions and 18 deletions

View File

@ -205,9 +205,7 @@ void ui_screen_done(uint8_t restart_seconds, secbool full_redraw) {
screen_install_success(str, initial_setup, full_redraw); screen_install_success(str, initial_setup, full_redraw);
} }
void ui_screen_boot_empty(bool firmware_present, bool fading) { void ui_screen_boot_empty(bool fading) { screen_boot_empty(fading); }
screen_boot_empty(firmware_present, fading);
}
// error UI // error UI
void ui_screen_fail(void) { screen_install_fail(); } void ui_screen_fail(void) { screen_install_fail(); }

View File

@ -66,7 +66,7 @@ void ui_fadein(void);
void ui_fadeout(void); void ui_fadeout(void);
void ui_set_initial_setup(bool initial); 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 // clang-format off
#define INPUT_CANCEL 0x01 // Cancel button #define INPUT_CANCEL 0x01 // Cancel button

View File

@ -195,7 +195,7 @@ static usb_result_t bootloader_usb_loop(const vendor_header *const vhdr,
hal_delay(1000); hal_delay(1000);
usb_stop(); usb_stop();
usb_deinit(); usb_deinit();
ui_screen_boot_empty(true, true); ui_screen_boot_empty(true);
return CONTINUE; return CONTINUE;
} }
break; break;
@ -320,7 +320,7 @@ int bootloader_main(void) {
display_set_little_endian(); display_set_little_endian();
#endif #endif
ui_screen_boot_empty(firmware_present == sectrue, false); ui_screen_boot_empty(false);
#ifdef USE_TOUCH #ifdef USE_TOUCH
touch_power_on(); touch_power_on();
@ -419,7 +419,7 @@ int bootloader_main(void) {
screen = SCREEN_INTRO; screen = SCREEN_INTRO;
} }
if (ui_result == 2) { // reboot if (ui_result == 2) { // reboot
ui_screen_boot_empty(true, true); ui_screen_boot_empty(true);
continue_to_firmware = true; continue_to_firmware = true;
} }
if (ui_result == 3) { // wipe if (ui_result == 3) { // wipe

View File

@ -28,4 +28,4 @@ uint32_t screen_install_success(const char* reboot_msg, bool initial_setup,
uint32_t screen_install_fail(void); uint32_t screen_install_fail(void);
void screen_welcome_model(void); void screen_welcome_model(void);
void screen_welcome(void); void screen_welcome(void);
void screen_boot_empty(bool firmware_present, bool fading); void screen_boot_empty(bool fading);

View File

@ -37,9 +37,7 @@ use crate::{
welcome::Welcome, welcome::Welcome,
}, },
component::{Button, ResultScreen}, component::{Button, ResultScreen},
theme::{ theme::{BACKLIGHT_DIM, BACKLIGHT_NORMAL, BLACK, FG, TEXT_ERROR_HIGHLIGHT, WHITE},
BACKLIGHT_DIM, BACKLIGHT_NORMAL, BLACK, FG, GREY_DARK, TEXT_ERROR_HIGHLIGHT, WHITE,
},
}, },
util::{from_c_array, from_c_str}, util::{from_c_array, from_c_str},
}, },
@ -391,17 +389,14 @@ extern "C" fn screen_wipe_fail() {
} }
#[no_mangle] #[no_mangle]
extern "C" fn screen_boot_empty(firmware_present: bool, fading: bool) { extern "C" fn screen_boot_empty(fading: bool) {
if fading { if fading {
fadeout(); fadeout();
} }
let fg = if firmware_present { GREY_DARK } else { WHITE }; let fg = WHITE;
let bg = if firmware_present { let bg = BLACK;
BLACK
} else {
WELCOME_COLOR
};
display::rect_fill(constant::screen(), bg); display::rect_fill(constant::screen(), bg);
let icon = Icon::new(LOGO_EMPTY); let icon = Icon::new(LOGO_EMPTY);
icon.draw(Point::new(screen().center().x, 48), TOP_CENTER, fg, bg); icon.draw(Point::new(screen().center().x, 48), TOP_CENTER, fg, bg);