def input_down(pressed): global current_index pm.feed() if pressed: current_index = (current_index + 1) % len(apps) render_current_app()
def input_down(pressed): global current_index pm.feed() if pressed: current_index = (current_index + 1) % len(apps) machine.nvs_setint('launcher', 'index', current_index) render_current_app()
def input_down(pressed): global current_index, nvs pm.feed() if pressed: current_index = (current_index + 1) % len(apps) nvs.set_i32('index', current_index) nvs.commit() render_current_app()
def wifiTask(): global wifi_status_prev, wifi_status_curr, gui_redraw, ota_available wifi_status_prev = wifi_status_curr wifi_status_curr = wifi.status() if wifi_status_curr: wifi.ntp(True) if wifi_status_curr != wifi_status_prev: pm.feed() wifi_status_prev = wifi_status_curr gui_redraw = True if wifi_status_curr: ota_available = otacheck.available(True) return 1000
def wifiTask(): global wifi_status_prev, wifi_status_curr, gui_redraw, ota_available wifi_status_prev = wifi_status_curr wifi_status_curr = wifi.status() if wifi_status_curr: wifi.ntp(True) if wifi_status_curr != wifi_status_prev: print("WiFi status changed", wifi_status_curr) pm.feed() wifi_status_prev = wifi_status_curr gui_redraw = True if wifi_status_curr: ota_available = otacheck.available(True) print("Check OTA", ota_available) return 1000
def prev_app(pressed): global gui_apps, gui_app_current, gui_redraw pm.feed() if pressed: if gui_app_current >= 0: try: gui_apps[gui_app_current].focus(False) except BaseException as e: sys.print_exception(e) gui_app_current -= 1 if gui_app_current >= 0: try: gui_apps[gui_app_current].focus(True) except BaseException as e: sys.print_exception(e) gui_redraw = True
def input_B(pressed): pm.feed() if pressed: app = apps[current_index] uninstall(app)
def init_power_management(): virtualtimers.activate(1000) # Start scheduler with 1 second ticks pm.set_timeout(5*60*1000) # Set timeout to 5 minutes pm.callback(pm_cb) # Go to splash instead of sleep pm.feed() # Feed the power management task, starts the countdown...
neopixel.send(bytes([0x00]*3*12)) if idleTime == None: idleTime = virtualtimers.idle_time() gui_redraw = True #virtualtimers.delete(scrollerTask) #virtualtimers.delete(ledTask) stopThreads = True display.windowHide("scroller") drawTask(True) display.flush() time.sleep(0.1) system.sleep(idleTime, True) pm.callback(cbSleep) pm.enable() pm.feed() # WiFi wifi_status_prev = False wifi_status_curr = False ota_available = False def wifiTask(): global wifi_status_prev, wifi_status_curr, gui_redraw, ota_available wifi_status_prev = wifi_status_curr wifi_status_curr = wifi.status() if wifi_status_curr: wifi.ntp(True) if wifi_status_curr != wifi_status_prev: #pm.feed() wifi_status_prev = wifi_status_curr
def input_uninstall(pressed): pm.feed() if pressed: uninstall()
def input_other(pressed): pm.feed() if pressed: ugfx.flush()
def splash_input_a(pressed): if pressed: splash_about_countdown_trigger() pm.feed()
def input_home(pressed): pm.feed() if pressed: appglue.home()
def input_start(pressed): pm.feed() if pressed: system.home()
def input_other(pressed): pm.feed() if pressed: global einkNeedsUpdate einkNeedsUpdate = True
def cbFeedPowerManagement(pressed): pm.feed()
def input_a(pressed): pm.feed() if pressed: run()
def splash_input_select(pressed): if pressed: if otac.available(False): appglue.start_ota() pm.feed()
def splash_input_a(pressed): print("A", pressed) if pressed: pm.feed()
def splash_input_select(pressed): print("Select", pressed) if pressed: #if otac.available(False): # appglue.start_ota() pm.feed()
def btn_unhandled(pressed): pm.feed()
def splash_input_other(pressed): print("Other", pressed) if pressed: pm.feed()
def splash_input_other(pressed): if pressed: pm.feed()
def input_right(pressed): global current_index pm.feed() if pressed: rgb.setbrightness(rgb.getbrightness() + 2)
def input_b(pressed): pm.feed()
def input_other(pressed): pm.feed()
def input_select(pressed): pm.feed() if pressed: uninstall()
def init_power_management(): virtualtimers.activate(1000) # Start scheduler with 1 second ticks pm.set_timeout(5 * 60 * 1000) # Set timeout to 5 minutes pm.callback(cbSleep) # Show sleep message pm.feed() # Feed the power management task, starts the countdown...
def init_power_management(): pm.set_timeout(5 * 60 * 1000) # Set timeout to 5 minutes pm.callback(pm_cb) # Go to splash instead of sleep pm.feed(True)
def splash_input_select(pressed): if pressed: if otac.available(False): system.ota() pm.feed()