Ejemplo n.º 1
0
async def more_setup():
    # Boot up code; splash screen is being shown

    # MAYBE: check if we're a brick and die again? Or show msg?

    try:
        # Some background "tasks"
        #
        from dev_helper import monitor_usb
        IMPT.start_task('vcp', monitor_usb())

        from files import CardSlot
        CardSlot.setup()

        # This "pa" object holds some state shared w/ bootloader about the PIN
        try:
            from pincodes import pa
            pa.setup(b'')  # just to see where we stand.
        except RuntimeError as e:
            print("Problem: %r" % e)

        if version.is_factory_mode:
            # in factory mode, turn on USB early to allow debug/setup
            from usb import enable_usb
            enable_usb()

            # always start the self test.
            if not settings.get('tested', False):
                from actions import start_selftest
                await start_selftest()

        else:
            # force them to accept terms (unless marked as already done)
            from actions import accept_terms
            await accept_terms()

        # Prompt for PIN and then pick appropriate top-level menu,
        # based on contents of secure chip (ie. is there
        # a wallet defined)
        from actions import start_login_sequence
        await start_login_sequence()
    except BaseException as exc:
        die_with_debug(exc)

    IMPT.start_task('mainline', mainline())
Ejemplo n.º 2
0
    #   in memory forever; instead, extend done_splash2 above.
    from ux import the_ux

    gc.collect()
    #print("Free mem: %d" % gc.mem_free())

    while 1:
        await the_ux.interact()

# Setup to start the splash screen.
dis.splash_animate(loop, done_splash2)

# Some background "tasks"
#
from dev_helper import monitor_usb
loop.create_task(monitor_usb())

from files import CardSlot
CardSlot.setup()

# This "pa" object holds some state shared w/ bootloader about the PIN
try:
    from pincodes import PinAttempt

    pa = PinAttempt()
    pa.setup(b'')       # just to see where we stand.
except RuntimeError as e:
    print("Problem: %r" % e)

def go():
    # Wrapper for better error handling/recovery at top level.