mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-14 09:20:55 +00:00
legacy/bootloader: refactor show_unplug
This commit is contained in:
parent
f86ac65ad1
commit
86b7813629
@ -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,
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
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);
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user