1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 19:08:12 +00:00

refactor(core): drop buttons argument for ui_screen_firmware_info

This commit is contained in:
Pavol Rusnak 2021-03-10 17:18:50 +01:00
parent 814db111b2
commit 1e2bb337a9
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 11 additions and 18 deletions

View File

@ -158,7 +158,7 @@ static int display_vendor_string(const char *text, int textlen,
} }
} }
void ui_screen_info(secbool buttons, const vendor_header *const vhdr, void ui_screen_firmware_info(const vendor_header *const vhdr,
const image_header *const hdr) { const image_header *const hdr) {
display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WHITE); display_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WHITE);
const char *ver_str = format_ver("Bootloader %d.%d.%d", VERSION_UINT32); const char *ver_str = format_ver("Bootloader %d.%d.%d", VERSION_UINT32);
@ -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, display_text(55, 70, "No Firmware", -1, FONT_NORMAL, COLOR_BL_GRAY,
COLOR_WHITE); 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, display_text_center(120, 220, "Go to trezor.io/start", -1, FONT_NORMAL,
COLOR_BLACK, COLOR_WHITE); 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_bar(0, 0, DISPLAY_RESX, DISPLAY_RESY, COLOR_WHITE);
display_text(16, 32, "Firmware fingerprint", -1, FONT_NORMAL, COLOR_BLACK, display_text(16, 32, "Firmware fingerprint", -1, FONT_NORMAL, COLOR_BLACK,
COLOR_WHITE); COLOR_WHITE);

View File

@ -32,9 +32,9 @@ void ui_screen_welcome_first(void);
void ui_screen_welcome_second(void); void ui_screen_welcome_second(void);
void ui_screen_welcome_third(void); void ui_screen_welcome_third(void);
void ui_screen_info(secbool buttons, const vendor_header* const vhdr, void ui_screen_firmware_info(const vendor_header* const vhdr,
const image_header* const hdr); const image_header* const hdr);
void ui_screen_info_fingerprint(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, void ui_screen_install_confirm_upgrade(const vendor_header* const vhdr,
const image_header* const hdr); const image_header* const hdr);

View File

@ -120,7 +120,7 @@ static secbool bootloader_usb_loop(const vendor_header *const vhdr,
int response = ui_user_input(INPUT_CONFIRM | INPUT_CANCEL); int response = ui_user_input(INPUT_CONFIRM | INPUT_CANCEL);
if (INPUT_CANCEL == response) { if (INPUT_CANCEL == response) {
ui_fadeout(); ui_fadeout();
ui_screen_info(secfalse, vhdr, hdr); ui_screen_firmware_info(vhdr, hdr);
ui_fadein(); ui_fadein();
send_user_abort(USB_IFACE_NUM, "Wipe cancelled"); send_user_abort(USB_IFACE_NUM, "Wipe cancelled");
break; break;
@ -315,7 +315,7 @@ int main(void) {
// ... or we have stay_in_bootloader flag to force it // ... or we have stay_in_bootloader flag to force it
if (touched || stay_in_bootloader == sectrue) { if (touched || stay_in_bootloader == sectrue) {
// no ui_fadeout(); - we already start from black screen // no ui_fadeout(); - we already start from black screen
ui_screen_info(secfalse, &vhdr, &hdr); ui_screen_firmware_info(&vhdr, &hdr);
ui_fadein(); ui_fadein();
// and start the usb loop // and start the usb loop

View File

@ -529,7 +529,7 @@ int process_msg_FirmwareUpload(uint8_t iface_num, uint32_t msg_size,
if (INPUT_CANCEL == response) { if (INPUT_CANCEL == response) {
ui_fadeout(); ui_fadeout();
ui_screen_info(secfalse, &current_vhdr, &current_hdr); ui_screen_firmware_info(&current_vhdr, &current_hdr);
ui_fadein(); ui_fadein();
send_user_abort(iface_num, "Firmware install cancelled"); send_user_abort(iface_num, "Firmware install cancelled");
return -4; return -4;