diff --git a/legacy/bootloader/bootloader.c b/legacy/bootloader/bootloader.c index c8229b279..4bbc54960 100644 --- a/legacy/bootloader/bootloader.c +++ b/legacy/bootloader/bootloader.c @@ -57,6 +57,11 @@ void show_halt(const char *line1, const char *line2) { shutdown(); } +void show_unplug(const char *line1, const char *line2) { + layoutDialog(&bmp_icon_ok, NULL, NULL, NULL, line1, line2, NULL, + "You may now", "unplug your Trezor.", NULL); +} + static void show_unofficial_warning(const uint8_t *hash) { layoutDialog(&bmp_icon_warning, "Abort", "I'll take the risk", NULL, "WARNING!", NULL, "Unofficial firmware", "detected.", NULL, diff --git a/legacy/bootloader/bootloader.h b/legacy/bootloader/bootloader.h index 244171b7b..b29f3242e 100644 --- a/legacy/bootloader/bootloader.h +++ b/legacy/bootloader/bootloader.h @@ -29,6 +29,7 @@ #include void show_halt(const char *line1, const char *line2); +void show_unplug(const char *line1, const char *line2); void layoutFirmwareFingerprint(const uint8_t *hash); bool get_button_response(void); diff --git a/legacy/bootloader/usb.c b/legacy/bootloader/usb.c index df8473317..9d8448d0d 100644 --- a/legacy/bootloader/usb.c +++ b/legacy/bootloader/usb.c @@ -201,15 +201,11 @@ static void rx_callback(usbd_device *dev, uint8_t ep) { if (but) { erase_storage_code_progress(); flash_state = STATE_END; - layoutDialog(&bmp_icon_ok, NULL, NULL, NULL, "Device", - "successfully wiped.", NULL, "You may now", - "unplug your Trezor.", NULL); + show_unplug("Device", "successfully wiped."); send_msg_success(dev); } else { flash_state = STATE_END; - layoutDialog(&bmp_icon_warning, NULL, NULL, NULL, "Device wipe", - "aborted.", NULL, "You may now", "unplug your Trezor.", - NULL); + show_unplug("Device wipe", "aborted."); send_msg_failure(dev); } return; @@ -245,9 +241,7 @@ static void rx_callback(usbd_device *dev, uint8_t ep) { } else { send_msg_failure(dev); flash_state = STATE_END; - layoutDialog(&bmp_icon_warning, NULL, NULL, NULL, - "Firmware installation", "aborted.", NULL, "You may now", - "unplug your Trezor.", NULL); + show_unplug("Firmware installation", "aborted."); } return; } @@ -421,9 +415,7 @@ static void rx_callback(usbd_device *dev, uint8_t ep) { flash_state = STATE_END; if (hash_check_ok) { - layoutDialog(&bmp_icon_ok, NULL, NULL, NULL, "New firmware", - "successfully installed.", NULL, "You may now", - "unplug your Trezor.", NULL); + show_unplug("New firmware", "successfully installed."); send_msg_success(dev); shutdown(); } else {