summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-05-25 00:43:19 +0100
committerSolomon Peachy <pizza@shaftnet.org>2022-06-21 18:11:53 -0400
commit7e0492444c38f2ed350016be15b6a4d8ba489bcd (patch)
treef7fe53822d1ff95595c33b6c8964fd87dd17d6af /firmware
parent6cdd142d5c841eedb6a900cd50ee5f526f933eec (diff)
downloadrockbox-7e0492444c38f2ed350016be15b6a4d8ba489bcd.tar.gz
rockbox-7e0492444c38f2ed350016be15b6a4d8ba489bcd.zip
usb: remove "Ask" USB Mode (FS#13317)
USB ask mode is basically a footgun: it can't work on native targets and doesn't work reliably on hosted ones, and it continually produces a slow trickle of problems. FS#13317 gives a rundown of the issues. Removing the setting seems like the best solution for now, since a fix would be pretty involved. This partially reverts 60f581e8f5. The USB Mode setting is left in place so the option can be added back later in a non-buggy way. Change-Id: Ie01b28dd2ed95a31b509a7834d85bac8eb866098
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/usb.h1
-rw-r--r--firmware/usb.c25
2 files changed, 0 insertions, 26 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index fe9f3bcfa1..c075fa83ec 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -134,7 +134,6 @@ enum
134/* Supported usb modes. */ 134/* Supported usb modes. */
135enum 135enum
136{ 136{
137 USB_MODE_ASK = 0,
138 USB_MODE_MASS_STORAGE, 137 USB_MODE_MASS_STORAGE,
139 USB_MODE_CHARGE, 138 USB_MODE_CHARGE,
140 USB_MODE_ADB 139 USB_MODE_ADB
diff --git a/firmware/usb.c b/firmware/usb.c
index 4c122e8eea..c4d07c5533 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -491,37 +491,12 @@ static void NORETURN_ATTR usb_thread(void)
491 if (button_status() & ~USBPOWER_BTN_IGNORE) 491 if (button_status() & ~USBPOWER_BTN_IGNORE)
492 new_usbmode = USB_MODE_MASS_STORAGE; 492 new_usbmode = USB_MODE_MASS_STORAGE;
493 break; 493 break;
494#ifndef BOOTLOADER
495 case USB_MODE_ASK:
496 new_usbmode = USB_MODE_ASK;
497 break;
498#endif
499 default: 494 default:
500 case USB_MODE_MASS_STORAGE: 495 case USB_MODE_MASS_STORAGE:
501 if (button_status() & ~USBPOWER_BTN_IGNORE) 496 if (button_status() & ~USBPOWER_BTN_IGNORE)
502 new_usbmode = USB_MODE_CHARGE; 497 new_usbmode = USB_MODE_CHARGE;
503 break; 498 break;
504 } 499 }
505
506#ifndef BOOTLOADER
507 if (new_usbmode == USB_MODE_ASK)
508 {
509 push_current_activity(ACTIVITY_USBSCREEN);
510 if (yesno_pop(ID2P(LANG_ENTER_USB_STORAGE_MODE_QUERY)))
511 new_usbmode = USB_MODE_MASS_STORAGE;
512 else
513 new_usbmode = USB_MODE_CHARGE;
514 pop_current_activity();
515 /* Force full redraw */
516// queue_post(&button_queue, BUTTON_REDRAW, 0);
517// Alternative approach, as above is supposedly inadequate by design.
518 FOR_NB_SCREENS(i)
519 {
520 struct screen *screen = &screens[i];
521 screen->set_viewport(NULL);
522 }
523 }
524#endif
525#endif 500#endif
526 501
527#ifndef USB_DETECT_BY_REQUEST 502#ifndef USB_DETECT_BY_REQUEST