Exemple #1
0
def start():
    if badge.safe_mode():
        splash = 'splash'
    else:
        splash = badge.nvs_get_str('boot', 'splash', 'splash')
        if splash.startswith('bpp '):
            splash = splash[4:len(splash)]
            badge.mount_bpp()
        elif splash.startswith('sdcard '):
            splash = splash[7:len(splash)]
            badge.mount_sdcard()
        __import__(splash)
Exemple #2
0
    if load_me:
        splash = load_me
        print("starting %s" % load_me)
        esp.rtcmem_write_string("")

try:
    if not splash == "shell":
        if splash.startswith('bpp '):
            splash = splash[4:len(splash)]
            badge.mount_bpp()
        elif splash.startswith('remfs '):
            splash = splash[6:len(splash)]
            badge.mount_remfs()
        elif splash.startswith('sdcard '):
            splash = splash[7:len(splash)]
            badge.mount_sdcard()

        def back_button_default_action(pressed):
            if pressed:
                esp.rtcmem_write_string("")
                machine.deepsleep(1)

        ugfx.input_attach(ugfx.BTN_B, back_button_default_action)

        __import__(splash)
    else:
        ugfx.clear(ugfx.WHITE)
        ugfx.flush(ugfx.LUT_FULL)
except BaseException as e:
    sys.print_exception(e)
    import easydraw