usb: Add ability to prompt user about what to do upon usb insertion

v3: Add in config option
 v4: Bugfixes
 v5: Force a redraw upon exiting
 v6: keypress-in-chargeonly mode enables mass storage (and vice versa)
 v7: Fix bootloader builds
 v8: Update manual, and have bootloader respect keypresses
 v9: Change default to mass storage (ie no change in behavior)

 todo:
  * test-build dx50/dx90
  * Switch from yes/no to proper menu?
  * prevent WPS progress bar from drawing over us

Change-Id: I82e0ccb08497b7a5aa756ce77f1332ee963703a7

...

Change-Id: I7946cf240b18a4fa8ace5e25e1eb6e97b8b12d7c
This commit is contained in:
Solomon Peachy 2020-11-02 08:10:15 -05:00
parent fc4fff0b81
commit 60f581e8f5
30 changed files with 224 additions and 156 deletions

View file

@ -60,11 +60,9 @@ static void usb_enable_mass_storage(void)
DEBUGF("ERROR %s: No command processor available.", __func__);
}
/* Default at boot not known. */
static int _last_usb_mode = -1;
void ibasso_set_usb_mode(int mode)
{
DEBUGF("DEBUG %s: _last_usb_mode: %d, mode: %d.", __func__, _last_usb_mode, mode);

View file

@ -25,30 +25,10 @@
#ifndef _USB_DX50_H_
#define _USB_DX50_H_
/* Supported usb modes. */
enum ibasso_usb_mode
{
/*
USB mass storage mode. On USB connection, Rockbox will terminate and the internel and
external storage gets exported to the connected client.
*/
USB_MODE_MASS_STORAGE = 0,
/*
Actually the same, since we to not have proper USB detection.
Starts the adb server and enables adb connection over USB. Rockbox will continue to run.
*/
USB_MODE_CHARGE,
USB_MODE_ADB
};
/*
Set the usb mode.
mode: ibasso_usb_mode
*/
void ibasso_set_usb_mode(int mode);
#endif