if cfg_greyscale: items.append("RENDERING : Greyscale (slow)") else: items.append("RENDERING : Black & white (quick)") if cfg_logo: items.append("LOGO : " + cfg_logo) else: items.append("LOGO : None") if cfg_led_animation: items.append("LED ANIMATION: " + cfg_led_animation) else: items.append("LED ANIMATION: None") items.append("< Back") option = term.menu("Splash screen settings", items, option, "", 64) if option == 0: machine.nvs_set_u8('splash', 'term_menu', not cfg_term_menu) elif option == 1: machine.nvs_set_u8('splash', 'services', not cfg_services) elif option == 2: machine.nvs_set_u8('splash', 'wifi', not cfg_wifi) elif option == 3: machine.nvs_set_u8('splash', 'nickname', not cfg_nickname) elif option == 4: machine.nvs_set_u8('splash', 'greyscale', not cfg_greyscale) elif option == 5: term.header(True, "Logo path") if not cfg_logo: cfg_logo = "" cfg_logo = term.prompt("Logo path", 1, 3, cfg_logo) if not cfg_logo: try:
def nvs_set_u8(space, item, value): if space == "badge": space = "system" return machine.nvs_set_u8(space, item, value)
while True: current = load() if current == None: option = 0 elif current == 0: option = 1 #DISABLE elif current == 1: option = 2 #ALT elif current == 2: option = 3 #SHA else: # Invalid value, set SHA2017 type option = 3 machine.nvs_set_u8('system', 'eink.dev.type', 2) items = [] items.append("Use default") items.append("Disable display driver") items.append("GDEH029A1 (replacement)") items.append("DEPG0290B1 (SHA2017)") items.append("< Back") option = term.menu("Splash screen settings", items, option, "", 64) if option == 0: try: machine.nvs_erase("system", "eink.dev.type") except: pass if option == 1: machine.nvs_set_u8('system', 'eink.dev.type', 0) if option == 2: