From 7e0492444c38f2ed350016be15b6a4d8ba489bcd Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 25 May 2022 00:43:19 +0100 Subject: 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 --- firmware/export/usb.h | 1 - firmware/usb.c | 25 ------------------------- 2 files changed, 26 deletions(-) (limited to 'firmware') 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 /* Supported usb modes. */ enum { - USB_MODE_ASK = 0, USB_MODE_MASS_STORAGE, USB_MODE_CHARGE, 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) if (button_status() & ~USBPOWER_BTN_IGNORE) new_usbmode = USB_MODE_MASS_STORAGE; break; -#ifndef BOOTLOADER - case USB_MODE_ASK: - new_usbmode = USB_MODE_ASK; - break; -#endif default: case USB_MODE_MASS_STORAGE: if (button_status() & ~USBPOWER_BTN_IGNORE) new_usbmode = USB_MODE_CHARGE; break; } - -#ifndef BOOTLOADER - if (new_usbmode == USB_MODE_ASK) - { - push_current_activity(ACTIVITY_USBSCREEN); - if (yesno_pop(ID2P(LANG_ENTER_USB_STORAGE_MODE_QUERY))) - new_usbmode = USB_MODE_MASS_STORAGE; - else - new_usbmode = USB_MODE_CHARGE; - pop_current_activity(); - /* Force full redraw */ -// queue_post(&button_queue, BUTTON_REDRAW, 0); -// Alternative approach, as above is supposedly inadequate by design. - FOR_NB_SCREENS(i) - { - struct screen *screen = &screens[i]; - screen->set_viewport(NULL); - } - } -#endif #endif #ifndef USB_DETECT_BY_REQUEST -- cgit v1.2.3