summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-11-16 11:32:12 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-11-16 17:11:38 +0000
commit9c68c69cf029b22587f4a7225261a45e5391a242 (patch)
tree378ca94924c6448a521a73f139e211d1e80730f4 /firmware/usb.c
parent525252393718a74dd38895a1a945fa4cbf223bbd (diff)
downloadrockbox-9c68c69cf029b22587f4a7225261a45e5391a242.tar.gz
rockbox-9c68c69cf029b22587f4a7225261a45e5391a242.zip
FS13257: Fix inconsistent defaults in the USB mode selection
Change-Id: I44894d13f070313ad326ce68018556573e35aad9
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index aca2683d58..8c6eae9b3f 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -95,8 +95,8 @@ static bool usb_host_present = false;
95static int usb_num_acks_to_expect = 0; 95static int usb_num_acks_to_expect = 0;
96static long usb_last_broadcast_tick = 0; 96static long usb_last_broadcast_tick = 0;
97#ifdef HAVE_USB_POWER 97#ifdef HAVE_USB_POWER
98static int usb_mode = USB_MODE_ASK; 98static int usb_mode = USBMODE_DEFAULT;
99static int new_usbmode = USB_MODE_ASK; 99static int new_usbmode = USBMODE_DEFAULT;
100#endif 100#endif
101 101
102static int usb_release_exclusive_storage(void); 102static int usb_release_exclusive_storage(void);
@@ -476,6 +476,7 @@ static void NORETURN_ATTR usb_thread(void)
476 476
477 /* Power (charging-only) button */ 477 /* Power (charging-only) button */
478#ifdef HAVE_USB_POWER 478#ifdef HAVE_USB_POWER
479 new_usbmode = usb_mode;
479 switch (usb_mode) { 480 switch (usb_mode) {
480 case USB_MODE_CHARGE: 481 case USB_MODE_CHARGE:
481 case USB_MODE_ADB: 482 case USB_MODE_ADB:
@@ -491,7 +492,7 @@ static void NORETURN_ATTR usb_thread(void)
491 case USB_MODE_MASS_STORAGE: 492 case USB_MODE_MASS_STORAGE:
492 if (button_status() & ~USBPOWER_BTN_IGNORE) 493 if (button_status() & ~USBPOWER_BTN_IGNORE)
493 new_usbmode = USB_MODE_CHARGE; 494 new_usbmode = USB_MODE_CHARGE;
494 break; 495 break;
495 } 496 }
496 497
497#ifndef BOOTLOADER 498#ifndef BOOTLOADER