summaryrefslogtreecommitdiff
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
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
-rw-r--r--apps/settings_list.c7
-rw-r--r--firmware/export/usb.h1
-rw-r--r--firmware/usb.c25
-rwxr-xr-xmanual/configure_rockbox/system_options.tex10
-rw-r--r--manual/rockbox_interface/main.tex15
5 files changed, 17 insertions, 41 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index e230a5a081..d6449d1c6f 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -2148,19 +2148,18 @@ const struct settings_list settings[] = {
2148 LANG_USB_MODE, 2148 LANG_USB_MODE,
2149 USBMODE_DEFAULT, 2149 USBMODE_DEFAULT,
2150 "usb mode", 2150 "usb mode",
2151 "ask,mass storage,charge" 2151 "mass storage,charge"
2152#if defined(DX50) || defined(DX90) 2152#if defined(DX50) || defined(DX90)
2153 ",adb" 2153 ",adb"
2154#endif 2154#endif
2155 , 2155 ,
2156#if defined(DX50) || defined(DX90) 2156#if defined(DX50) || defined(DX90)
2157 ibasso_set_usb_mode, 2157 ibasso_set_usb_mode,
2158 4, 2158 3,
2159#else 2159#else
2160 usb_set_mode, 2160 usb_set_mode,
2161 3, 2161 2,
2162#endif 2162#endif
2163 ID2P(LANG_ASK),
2164 ID2P(LANG_USB_MODE_MASS_STORAGE), 2163 ID2P(LANG_USB_MODE_MASS_STORAGE),
2165 ID2P(LANG_USB_MODE_CHARGE) 2164 ID2P(LANG_USB_MODE_CHARGE)
2166#if defined(DX50) || defined(DX90) 2165#if defined(DX50) || defined(DX90)
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
diff --git a/manual/configure_rockbox/system_options.tex b/manual/configure_rockbox/system_options.tex
index 5a95df27b1..52750f7486 100755
--- a/manual/configure_rockbox/system_options.tex
+++ b/manual/configure_rockbox/system_options.tex
@@ -870,8 +870,14 @@ therefore result in better runtime.
870\opt{usb_power}{ 870\opt{usb_power}{
871 \subsection{USB Mode} 871 \subsection{USB Mode}
872 This controls what happens with the \dap{}'s USB port is connected. 872 This controls what happens with the \dap{}'s USB port is connected.
873 \setting{Charge Only} and \setting{Mass Storage} will automatically enter 873 \setting{Mass Storage} allows you to transfer files, while
874 that mode, and \setting{Ask} will prompt the user each time. 874 \setting{Charge Only} will only charge the battery (and allow you to keep
875 using the player). You can choose the opposite behavior by holding down any
876 button while plugging in the USB cable.
877 \nopt{fuzeplus}{
878 \note{Be aware that holding a button may still perform its normal function,
879 so it is recommended to use a button without harmful side effects, such as
880 \ActionStdUsbCharge{}.}
875} 881}
876\opt{multidrive_usb}{ 882\opt{multidrive_usb}{
877 \subsection{USB Hide Internal Drive} 883 \subsection{USB Hide Internal Drive}
diff --git a/manual/rockbox_interface/main.tex b/manual/rockbox_interface/main.tex
index 20aa8c833e..82192829fd 100644
--- a/manual/rockbox_interface/main.tex
+++ b/manual/rockbox_interface/main.tex
@@ -848,16 +848,13 @@ properly.}
848 848
849 \opt{usb_power}{ 849 \opt{usb_power}{
850 \section{USB Charging} 850 \section{USB Charging}
851 Whenever your \dap{} is connected to USB, it will automatically charge. 851 Your \dap{} will automatically charge when connected to USB. By default
852 However, depending on the \config{usb\_mode} setting, the \dap{} may also 852 Rockbox will connect in mass storage mode to transfer files, but you can
853 enter mass storage mode or prompt the user for what action to take. 853 prevent this by holding down any button while plugging in the USB cable,
854 When the \dap{} is configured to enter mass storage mode or automatically 854 or by changing the \setting{USB Mode} setting to \setting{Charge Only}.
855 charge, you may trigger the opposite behavior by holding down any button
856 while plugging it in. Your \dap{} must already be in Rockbox for this to
857 function.
858 \nopt{fuzeplus}{ 855 \nopt{fuzeplus}{
859 \note{Be aware that this button may still perform its normal function, so 856 \note{Be aware that holding a button may still perform its normal function,
860 it is recommended to use a button without harmful side effects, such as 857 so it is recommended to use a button without harmful side effects, such as
861 \ActionStdUsbCharge{}.} 858 \ActionStdUsbCharge{}.}
862 } 859 }
863 } 860 }