1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

feat(core/bootloader): emulator can now show custom error screens

This commit is contained in:
matejcik 2023-03-29 16:21:43 +02:00
parent 2dd44786d5
commit 6d434122f7
2 changed files with 11 additions and 2 deletions

View File

@ -36,6 +36,7 @@ void ui_screen_boot(const vendor_header* const vhdr,
const image_header* const hdr);
void ui_screen_boot_wait(int wait_seconds);
void ui_screen_boot_click(void);
void ui_click(void);
void ui_screen_welcome_model(void);
void ui_screen_welcome(void);

View File

@ -2,9 +2,10 @@
#include "common.h"
#include "display.h"
#include "emulator.h"
#include "flash.h"
#include "rust_ui.h"
#include "bootui.h"
#include "emulator.h"
uint8_t *FIRMWARE_START = 0;
uint32_t stay_in_bootloader_flag;
@ -18,9 +19,16 @@ int main(int argc, char **argv) {
FIRMWARE_START =
(uint8_t *)flash_get_address(FLASH_SECTOR_FIRMWARE_START, 0, 0);
if (argc > 1 && argv[1][0] == 's') {
if (argc == 2 && argv[1][0] == 's') {
// Run the firmware
stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG;
} else if (argc == 4) {
display_init();
display_backlight(180);
screen_fatal_error_rust(argv[1], argv[2], argv[3]);
display_refresh();
ui_click();
exit(0);
}
int retval = bootloader_main();