From 1e2bb337a9546f46487e4ab0bba4bc51f7ef5bdc Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 10 Mar 2021 17:18:50 +0100 Subject: [PATCH] refactor(core): drop buttons argument for ui_screen_firmware_info --- core/embed/bootloader/bootui.c | 17 +++++------------ core/embed/bootloader/bootui.h | 6 +++--- core/embed/bootloader/main.c | 4 ++-- core/embed/bootloader/messages.c | 2 +- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/core/embed/bootloader/bootui.c b/core/embed/bootloader/bootui.c index 37dd78ee64..36c7487f10 100644 --- a/core/embed/bootloader/bootui.c +++ b/core/embed/bootloader/bootui.c @@ -158,8 +158,8 @@ static int display_vendor_string(const char *text, int textlen, } } -void ui_screen_info(secbool buttons, const vendor_header *const vhdr, - const image_header *const hdr) { +void ui_screen_firmware_info(const vendor_header *const vhdr, + const image_header *const hdr) { display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WHITE); const char *ver_str = format_ver("Bootloader %d.%d.%d", VERSION_UINT32); display_text(16, 32, ver_str, -1, FONT_NORMAL, COLOR_BLACK, COLOR_WHITE); @@ -174,18 +174,11 @@ void ui_screen_info(secbool buttons, const vendor_header *const vhdr, display_text(55, 70, "No Firmware", -1, FONT_NORMAL, COLOR_BL_GRAY, COLOR_WHITE); } - - if (sectrue == buttons) { - display_text_center(120, 170, "Connect to host?", -1, FONT_NORMAL, - COLOR_BLACK, COLOR_WHITE); - ui_confirm_cancel_buttons(); - } else { - display_text_center(120, 220, "Go to trezor.io/start", -1, FONT_NORMAL, - COLOR_BLACK, COLOR_WHITE); - } + display_text_center(120, 220, "Go to trezor.io/start", -1, FONT_NORMAL, + COLOR_BLACK, COLOR_WHITE); } -void ui_screen_info_fingerprint(const image_header *const hdr) { +void ui_screen_firmware_fingerprint(const image_header *const hdr) { display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WHITE); display_text(16, 32, "Firmware fingerprint", -1, FONT_NORMAL, COLOR_BLACK, COLOR_WHITE); diff --git a/core/embed/bootloader/bootui.h b/core/embed/bootloader/bootui.h index 00b8243923..0d74d316ec 100644 --- a/core/embed/bootloader/bootui.h +++ b/core/embed/bootloader/bootui.h @@ -32,9 +32,9 @@ void ui_screen_welcome_first(void); void ui_screen_welcome_second(void); void ui_screen_welcome_third(void); -void ui_screen_info(secbool buttons, const vendor_header* const vhdr, - const image_header* const hdr); -void ui_screen_info_fingerprint(const image_header* const hdr); +void ui_screen_firmware_info(const vendor_header* const vhdr, + const image_header* const hdr); +void ui_screen_firmware_fingerprint(const image_header* const hdr); void ui_screen_install_confirm_upgrade(const vendor_header* const vhdr, const image_header* const hdr); diff --git a/core/embed/bootloader/main.c b/core/embed/bootloader/main.c index a77aa26eff..3c944e3c82 100644 --- a/core/embed/bootloader/main.c +++ b/core/embed/bootloader/main.c @@ -120,7 +120,7 @@ static secbool bootloader_usb_loop(const vendor_header *const vhdr, int response = ui_user_input(INPUT_CONFIRM | INPUT_CANCEL); if (INPUT_CANCEL == response) { ui_fadeout(); - ui_screen_info(secfalse, vhdr, hdr); + ui_screen_firmware_info(vhdr, hdr); ui_fadein(); send_user_abort(USB_IFACE_NUM, "Wipe cancelled"); break; @@ -315,7 +315,7 @@ int main(void) { // ... or we have stay_in_bootloader flag to force it if (touched || stay_in_bootloader == sectrue) { // no ui_fadeout(); - we already start from black screen - ui_screen_info(secfalse, &vhdr, &hdr); + ui_screen_firmware_info(&vhdr, &hdr); ui_fadein(); // and start the usb loop diff --git a/core/embed/bootloader/messages.c b/core/embed/bootloader/messages.c index d135ad1e06..97dd267c77 100644 --- a/core/embed/bootloader/messages.c +++ b/core/embed/bootloader/messages.c @@ -529,7 +529,7 @@ int process_msg_FirmwareUpload(uint8_t iface_num, uint32_t msg_size, if (INPUT_CANCEL == response) { ui_fadeout(); - ui_screen_info(secfalse, ¤t_vhdr, ¤t_hdr); + ui_screen_firmware_info(¤t_vhdr, ¤t_hdr); ui_fadein(); send_user_abort(iface_num, "Firmware install cancelled"); return -4;