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: Rahix's avatarRahix <rahix@rahix.de>
parent 30ae2751
Pipeline #4238 passed with stages
in 2 minutes and 5 seconds
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment