From 9c68c69cf029b22587f4a7225261a45e5391a242 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 16 Nov 2020 11:32:12 -0500 Subject: FS13257: Fix inconsistent defaults in the USB mode selection Change-Id: I44894d13f070313ad326ce68018556573e35aad9 --- firmware/usb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'firmware/usb.c') 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; static int usb_num_acks_to_expect = 0; static long usb_last_broadcast_tick = 0; #ifdef HAVE_USB_POWER -static int usb_mode = USB_MODE_ASK; -static int new_usbmode = USB_MODE_ASK; +static int usb_mode = USBMODE_DEFAULT; +static int new_usbmode = USBMODE_DEFAULT; #endif static int usb_release_exclusive_storage(void); @@ -476,6 +476,7 @@ static void NORETURN_ATTR usb_thread(void) /* Power (charging-only) button */ #ifdef HAVE_USB_POWER + new_usbmode = usb_mode; switch (usb_mode) { case USB_MODE_CHARGE: case USB_MODE_ADB: @@ -491,7 +492,7 @@ static void NORETURN_ATTR usb_thread(void) case USB_MODE_MASS_STORAGE: if (button_status() & ~USBPOWER_BTN_IGNORE) new_usbmode = USB_MODE_CHARGE; - break; + break; } #ifndef BOOTLOADER -- cgit v1.2.3