1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-22 21:30:56 +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(); check_bootloader_version();
#endif #endif
main_start:
display_clear(); display_clear();
// delay to detect touch // delay to detect touch
@ -262,6 +260,7 @@ main_start:
vendor_header vhdr; vendor_header vhdr;
image_header hdr; image_header hdr;
secbool stay_in_bootloader = sectrue; // flag to stay in bootloader
// detect whether the devices contains a valid firmware // detect whether the devices contains a valid firmware
@ -309,48 +308,19 @@ main_start:
if (bootloader_usb_loop(NULL, NULL) != sectrue) { if (bootloader_usb_loop(NULL, NULL) != sectrue) {
return 1; return 1;
} }
} else } else {
// ... or if user touched the screen on start // ... or if user touched the screen on start
if (touched) { // ... or we have stay_in_bootloader flag to force it
// show firmware info with connect buttons 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(sectrue, &vhdr, &hdr); ui_screen_info(secfalse, &vhdr, &hdr);
ui_fadein(); ui_fadein();
for (;;) { // and start the usb loop
int response = ui_user_input(INPUT_CONFIRM | INPUT_CANCEL | INPUT_INFO); if (bootloader_usb_loop(&vhdr, &hdr) != sectrue) {
ui_fadeout(); return 1;
// 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;
} }
} }