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

74 lines
1.5 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, utils, wire, workflow
2017-08-15 13:09:09 +00:00
# start the USB
usb.bus.open()
2018-07-03 14:20:58 +00:00
def _boot_apps() -> None:
2019-07-11 14:52:25 +00:00
# load applications
import apps.base
2019-07-11 14:52:25 +00:00
import apps.management
import apps.bitcoin
import apps.misc
2019-08-22 18:15:16 +00:00
if not utils.BITCOIN_ONLY:
import apps.ethereum
import apps.lisk
import apps.monero
import apps.nem
import apps.stellar
import apps.ripple
import apps.cardano
import apps.tezos
import apps.eos
import apps.binance
import apps.webauthn
2019-07-11 14:52:25 +00:00
if __debug__:
import apps.debug
# boot applications
apps.base.boot()
2019-07-11 14:52:25 +00:00
apps.management.boot()
apps.bitcoin.boot()
apps.misc.boot()
2019-08-22 18:15:16 +00:00
if not utils.BITCOIN_ONLY:
apps.ethereum.boot()
apps.lisk.boot()
apps.monero.boot()
apps.nem.boot()
apps.stellar.boot()
apps.ripple.boot()
apps.cardano.boot()
apps.tezos.boot()
apps.eos.boot()
apps.binance.boot()
apps.webauthn.boot()
2019-07-11 14:52:25 +00:00
if __debug__:
apps.debug.boot()
# run main event loop and specify which screen is the default
apps.base.set_homescreen()
workflow.start_default()
2019-07-11 14:52:25 +00:00
_boot_apps()
# initialize the wire codec
wire.setup(usb.iface_wire)
if __debug__:
wire.setup(usb.iface_debug, is_debug_session=True)
loop.run()
# loop is empty. That should not happen
utils.halt("All tasks have died.")