1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-20 05:18:08 +00:00
trezor-firmware/src/main.py

52 lines
1.0 KiB
Python
Raw Normal View History

# isort:skip_file
# 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-05-11 13:31:53 +00:00
import apps.stellar
2018-07-03 14:20:58 +00:00
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-05-11 13:31:53 +00:00
apps.stellar.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
2018-07-03 14:20:58 +00:00
2018-02-27 15:35:21 +00:00
workflow.startdefault(homescreen)
2017-08-21 11:22:44 +00:00
loop.run()