diff --git a/preload/menu.py b/preload/menu.py index 2a3794a0dab1a3778725c52e20224aa59aaff376..1fe2b532eb1e2c2572ac8aeb03511cc7b3224c88 100644 --- a/preload/menu.py +++ b/preload/menu.py @@ -67,16 +67,21 @@ def usb_mode(disp): disp.print("open", posx=52, posy=40, fg=color.CAMPGREEN_DARK) disp.update() + utime.sleep_ms(200) + # Wait for select button to be released - while buttons.read(0xFF) == buttons.TOP_RIGHT: + while buttons.read() == buttons.TOP_RIGHT: pass # Wait for any button to be pressed and disable USB storage again - while buttons.read(0xFF) == 0: + while buttons.read() == 0: pass os.usbconfig(os.USB_SERIAL) + # Exit after USB-Mode to reload menu + os.exit(0) + class MainMenu(simple_menu.Menu): timeout = 30.0