From bd1774e764e14dc98b5431a1499a60492d3c36b8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 5 Oct 2016 21:36:11 +0200 Subject: [PATCH] add experiment with logo/fingerprint switching --- bootloader/ui-mockup/boot_info.py | 4 ++-- bootloader/ui-mockup/install_fw.py | 31 +++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/bootloader/ui-mockup/boot_info.py b/bootloader/ui-mockup/boot_info.py index 3d387cf312..0bbfb5f020 100755 --- a/bootloader/ui-mockup/boot_info.py +++ b/bootloader/ui-mockup/boot_info.py @@ -23,11 +23,11 @@ ui.display.backlight(255) image = res.load('./res/sl_logo.toif') ui.display.image(60, 0, image) -ui.display.text_center(120, 160, "SatoshiLabs firmware", 1, ui.WHITE, ui.BLACK) +ui.display.text_center(120, 160, "SatoshiLabs", 1, ui.WHITE, ui.BLACK) ui.display.text_center(120, 183, "v0.1.1", 1, ui.GREY, ui.BLACK) reboot = button.Button((0, 240 - 48, 240, 48), 'Reboot', normal_style=DEFAULT_BUTTON, active_style=DEFAULT_BUTTON_ACTIVE) reboot.render() while True: - if hasattr(ui.display, 'refresh'): ui.display.refresh() \ No newline at end of file + if hasattr(ui.display, 'refresh'): ui.display.refresh() diff --git a/bootloader/ui-mockup/install_fw.py b/bootloader/ui-mockup/install_fw.py index 82e692fdbd..04392489d5 100755 --- a/bootloader/ui-mockup/install_fw.py +++ b/bootloader/ui-mockup/install_fw.py @@ -2,6 +2,7 @@ import sys sys.path.append('../../src') +import utime from trezor import ui, res from trezor.ui import button from bl_common import bl_header @@ -38,16 +39,22 @@ ui.display.backlight(255) bl_header('Install new firmware') # content -ui.display.text(10, 53, 'Monero v.1.1', ui.NORMAL, ui.WHITE, ui.BLACK) -ui.display.text(10, 76, 'Check fingerprint:', ui.BOLD, ui.GREY, ui.BLACK) +ui.display.text(10, 53, 'SatoshiLabs v0.1.1', ui.NORMAL, ui.WHITE, ui.BLACK) -# fingerprint box -ui.display.bar(10, 82, 220, 102, ui.DARK_GREY) -s = 105 -ui.display.text(15, s, '5764715dbcf8ed88', ui.MONO, ui.GREY, ui.DARK_GREY) -ui.display.text(15, s + 1 * 23, 'bc0ae1c2f715277f', ui.MONO, ui.GREY, ui.DARK_GREY) -ui.display.text(15, s + 2 * 23, '22b67f26c15e1f75', ui.MONO, ui.GREY, ui.DARK_GREY) -ui.display.text(15, s + 3 * 23, '43b2b44913b5c255', ui.MONO, ui.GREY, ui.DARK_GREY) +def fingerprint(): + ui.display.bar(0, 60, 240, 128, ui.BLACK) + ui.display.text(10, 76, 'Fingerprint:', ui.BOLD, ui.GREY, ui.BLACK) + ui.display.bar(10, 82, 220, 102, ui.DARK_GREY) + s = 105 + ui.display.text(15, s, '5764715dbcf8ed88', ui.MONO, ui.GREY, ui.DARK_GREY) + ui.display.text(15, s + 1 * 23, 'bc0ae1c2f715277f', ui.MONO, ui.GREY, ui.DARK_GREY) + ui.display.text(15, s + 2 * 23, '22b67f26c15e1f75', ui.MONO, ui.GREY, ui.DARK_GREY) + ui.display.text(15, s + 3 * 23, '43b2b44913b5c255', ui.MONO, ui.GREY, ui.DARK_GREY) + +def logo(): + ui.display.bar(0, 60, 240, 128, ui.BLACK) + image = res.load('./res/sl_logo.toif') + ui.display.image(60, 64, image) confirm = button.Button((121, 240 - 48, 119, 48), 'Confirm', normal_style=CONFIRM_BUTTON, active_style=CONFIRM_BUTTON_ACTIVE) confirm.render() @@ -55,4 +62,10 @@ cancel = button.Button((0, 240 - 48, 119, 48), 'Cancel', normal_style=CANCEL_BUT cancel.render() while True: + logo() if hasattr(ui.display, 'refresh'): ui.display.refresh() + utime.sleep(2) + + fingerprint() + if hasattr(ui.display, 'refresh'): ui.display.refresh() + utime.sleep(2)