1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

fix(legacy): show dialog before rebooting to bootloader

This commit is contained in:
Pavol Rusnak 2021-04-15 14:25:36 +02:00
parent e3539b0a73
commit 0d37824b01

View File

@ -306,7 +306,20 @@ static bool fsm_layoutAddress(const char *address, const char *desc,
}
void fsm_msgRebootToBootloader(void) {
fsm_sendSuccess(_("You are being rebooted"));
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL,
_("Do you want to"), _("restart device in"),
_("bootloader mode?"), NULL, NULL, NULL);
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
layoutHome();
return;
}
oledClear();
oledRefresh();
fsm_sendSuccess(_("Rebooting"));
// make sure the outgoing message is sent
usbPoll();
usbSleep(500);
#if !EMULATOR
svc_reboot_to_bootloader();
#else