1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +00:00
trezor-firmware/src/main.py

46 lines
1002 B
Python
Raw Normal View History

# unlock the device
import boot # noqa: F401
2017-10-24 11:59:09 +00:00
# prepare the USB interfaces, but do not connect to the host yet
import usb
from trezor import loop, wire, workflow, utils
2017-08-15 13:09:09 +00:00
# load applications
import apps.homescreen
import apps.management
import apps.wallet
import apps.ethereum
import apps.lisk
2018-03-09 10:37:06 +00:00
import apps.nem
2018-02-09 15:45:36 +00:00
if __debug__:
import apps.debug
2018-02-09 15:45:36 +00:00
else:
import apps.fido_u2f
2017-08-15 13:09:09 +00:00
# boot applications
apps.homescreen.boot()
apps.management.boot()
apps.wallet.boot()
apps.ethereum.boot()
apps.lisk.boot()
2018-03-09 10:37:06 +00:00
apps.nem.boot()
2018-02-09 15:45:36 +00:00
if __debug__:
apps.debug.boot()
2018-02-09 15:45:36 +00:00
else:
apps.fido_u2f.boot(usb.iface_u2f)
2017-08-15 13:09:09 +00:00
2017-08-21 11:22:44 +00:00
# initialize the wire codec and start the USB
wire.setup(usb.iface_wire)
2017-10-30 16:34:21 +00:00
if __debug__:
wire.setup(usb.iface_debug)
usb.bus.open()
# switch into unprivileged mode, as we don't need the extra permissions anymore
utils.set_mode_unprivileged()
# run main event loop and specify which screen is the default
2018-02-27 15:35:21 +00:00
from apps.homescreen.homescreen import homescreen
workflow.startdefault(homescreen)
2017-08-21 11:22:44 +00:00
loop.run()