1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-22 13:21:03 +00:00

feat(core): remove connect to host dialog in the bootloader

This commit is contained in:
Ondrej Mikle 2021-01-05 18:00:12 +01:00 committed by Pavol Rusnak
parent f3ae3615c7
commit a4ba24645b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -246,8 +246,6 @@ int main(void) {
check_bootloader_version();
#endif
main_start:
display_clear();
// delay to detect touch
@ -262,6 +260,7 @@ main_start:
vendor_header vhdr;
image_header hdr;
secbool stay_in_bootloader = sectrue; // flag to stay in bootloader
// detect whether the devices contains a valid firmware
@ -309,50 +308,21 @@ main_start:
if (bootloader_usb_loop(NULL, NULL) != sectrue) {
return 1;
}
} else
} else {
// ... or if user touched the screen on start
if (touched) {
// show firmware info with connect buttons
// ... 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(sectrue, &vhdr, &hdr);
ui_fadein();
for (;;) {
int response = ui_user_input(INPUT_CONFIRM | INPUT_CANCEL | INPUT_INFO);
ui_fadeout();
// if cancel was pressed -> restart
if (INPUT_CANCEL == response) {
goto main_start;
}
// if confirm was pressed -> jump out
if (INPUT_CONFIRM == response) {
// show firmware info without connect buttons
ui_screen_info(secfalse, &vhdr, &hdr);
ui_fadein();
break;
}
// if info icon was pressed -> show fingerprint
if (INPUT_INFO == response) {
// show fingerprint
ui_screen_info_fingerprint(&hdr);
ui_fadein();
while (INPUT_LONG_CONFIRM != ui_user_input(INPUT_LONG_CONFIRM)) {
}
ui_fadeout();
ui_screen_info(sectrue, &vhdr, &hdr);
ui_fadein();
}
}
// and start the usb loop
if (bootloader_usb_loop(&vhdr, &hdr) != sectrue) {
return 1;
}
}
}
ensure(load_vendor_header_keys((const uint8_t *)FIRMWARE_START, &vhdr),
"invalid vendor header");