1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-20 13:28:10 +00:00
trezor-firmware/src/boot.py

29 lines
583 B
Python
Raw Normal View History

2017-10-24 11:59:09 +00:00
from trezor import config
from trezor.pin import pin_to_int, show_pin_timeout
2017-10-24 11:59:09 +00:00
from trezor import loop
from trezor import ui
from apps.common.request_pin import request_pin
2017-10-24 11:59:09 +00:00
async def unlock_layout():
while True:
if config.has_pin():
pin = await request_pin()
else:
pin = ''
if config.unlock(pin_to_int(pin), show_pin_timeout):
2017-10-24 11:59:09 +00:00
return
else:
await unlock_failed()
async def unlock_failed():
pass
config.init()
ui.display.backlight(ui.BACKLIGHT_DIM)
loop.schedule(unlock_layout())
loop.run()