1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 01:18:28 +00:00

add static seed layout

This commit is contained in:
chren 2016-06-07 18:24:03 +02:00 committed by Pavol Rusnak
parent 9ca6d61bcc
commit 0e8d7a5d6c
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
5 changed files with 44 additions and 0 deletions

17
src/apps/seed/__init__.py Normal file
View File

@ -0,0 +1,17 @@
from trezor.dispatcher import register
from trezor.utils import unimport_func
@unimport_func
def dispatch_Initialize(mtype, mbuf):
from trezor.messages.Initialize import Initialize
message = Initialize.loads(mbuf)
from .layout_seed import layout_seed
return layout_seed(message)
def boot():
Initialize = 0
# register(Initialize, dispatch_Initialize)

View File

@ -0,0 +1,25 @@
from trezor import ui, dispatcher, loop, res, wire
from trezor.ui.swipe import Swipe
from trezor.utils import unimport_gen
def swipe_to_rotate():
while True:
degrees = yield from Swipe(absolute=True).wait()
ui.display.orientation(degrees)
def animate_logo():
def func(foreground):
ui.display.icon(105, 200, res.load('apps/seed/res/small-arrow.toig'), foreground, ui.BLACK)
yield from ui.animate_pulse(func, ui.WHITE, ui.BLACK, speed=190000)
@unimport_gen
def layout_seed(initialize_msg=None):
# header title
ui.display.text(10, 30, 'Write down your seed', ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
yield loop.Wait([dispatcher.dispatch(),
swipe_to_rotate(),
animate_logo()])

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

View File

@ -6,12 +6,14 @@ from apps import playground
from apps import homescreen from apps import homescreen
from apps import management from apps import management
from apps import wallet from apps import wallet
from apps import seed
# Initialize all applications # Initialize all applications
playground.boot() playground.boot()
homescreen.boot() homescreen.boot()
management.boot() management.boot()
wallet.boot() wallet.boot()
seed.boot()
# just a demo to show how to register USB ifaces # just a demo to show how to register USB ifaces
msg.setup([(1, 0xF53C), (2, 0xF1D0)]) msg.setup([(1, 0xF53C), (2, 0xF1D0)])