main: unlock storage after boot

pull/25/head
Jan Pochyla 7 years ago committed by Pavol Rusnak
parent 8288255048
commit a255938903

@ -0,0 +1,27 @@
from trezor import config
from trezor import loop
from trezor import ui
from apps.common.request_pin import request_pin
async def unlock_layout():
while True:
if config.has_pin():
pin = await request_pin()
else:
pin = ''
if config.unlock(pin):
return
else:
await unlock_failed()
async def unlock_failed():
pass
config.init()
ui.display.backlight(ui.BACKLIGHT_DIM)
loop.schedule(unlock_layout())
loop.run()

@ -1,12 +1,11 @@
from trezor import config
import boot
from trezor import io
from trezor import log
from trezor import loop
from trezor import wire
from trezor import workflow
config.init()
log.level = log.DEBUG
# initialize the USB stack
@ -102,7 +101,6 @@ usb.add(usb_vcp)
usb.add(usb_u2f)
# load applications
from apps.common import storage
if __debug__:
from apps import debug
from apps import homescreen

@ -86,7 +86,7 @@ def run():
task_entry = [0, 0, 0] # deadline, task, value
msg_entry = [0, 0] # iface | flags, value
while True:
while _queue or _paused:
# compute the maximum amount of time we can wait for a message
if _queue:
delay = utime.ticks_diff(_queue.peektime(), utime.ticks_us())

Loading…
Cancel
Save