Skip to content
Snippets Groups Projects
Verified Commit 020050f4 authored by rahix's avatar rahix
Browse files

fix(menu): Fix UX issues in USB-Mode


Add a short delay after opening USB-Mode to prevent immediate exit which
happened when pressing the select-button for a very short time.

Also exit the menu-app after exiting USB-Mode to force a reload and thus
immediately display changes in the apps/ folder.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 30ae2751
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment