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

pull/2879/head
tychovrahe 2 years ago committed by matejcik
parent ae9960ca61
commit 7e96b96d00

@ -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(); }

@ -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

@ -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

@ -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);

@ -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);

Loading…
Cancel
Save