mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-15 19:08:07 +00:00
bootloader: show DOM QR code on welcome screen
This commit is contained in:
parent
b544fd3f81
commit
5f256ce0b0
@ -30,12 +30,14 @@ SOURCE_MOD += [
|
||||
CPPDEFINES_MOD += [
|
||||
'TREZOR_FONT_MONO_DISABLE',
|
||||
'TREZOR_FONT_NORMAL_DISABLE',
|
||||
('QR_MAX_VERSION', '0'),
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorui/display.c',
|
||||
'embed/extmod/modtrezorui/inflate.c',
|
||||
'embed/extmod/modtrezorui/font_bitmap.c',
|
||||
'embed/extmod/modtrezorui/font_roboto_bold_20.c',
|
||||
'embed/extmod/modtrezorui/trezor-qrenc/qr_encode.c',
|
||||
]
|
||||
|
||||
SOURCE_STMHAL = [
|
||||
|
@ -66,6 +66,21 @@ void display_error(void)
|
||||
display_footer("Error! Unplug the device", COLOR_BL_RED);
|
||||
}
|
||||
|
||||
void display_welcome(void)
|
||||
{
|
||||
display_clear();
|
||||
display_header("TREZOR Bootloader");
|
||||
|
||||
uint8_t dom[32];
|
||||
// format: TREZOR2-YYMMDD
|
||||
if (flash_otp_read(0, 0, dom, 32) && 0 == memcmp(dom, "TREZOR2-", 8) && dom[14] == 0) {
|
||||
display_qrcode(120, 120, (const char *)dom, 14, 4);
|
||||
display_text_center(120, 210, (const char *)dom, 14, FONT_BOLD, COLOR_WHITE, COLOR_BLACK);
|
||||
}
|
||||
|
||||
display_fade(0, BACKLIGHT_NORMAL, 1000);
|
||||
}
|
||||
|
||||
void display_vendor(const uint8_t *vimg, const char *vstr, uint32_t vstr_len, uint32_t fw_version)
|
||||
{
|
||||
display_clear();
|
||||
@ -155,9 +170,7 @@ bool bootloader_loop(void)
|
||||
{
|
||||
usb_init_all();
|
||||
|
||||
display_clear();
|
||||
display_header("TREZOR Bootloader");
|
||||
display_fade(0, BACKLIGHT_NORMAL, 1000);
|
||||
display_welcome();
|
||||
|
||||
uint8_t buf[USB_PACKET_SIZE];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user