summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-09-28 23:37:32 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2021-09-29 01:17:45 -0400
commitb662ff945ac36b314ecf91177b271578622e2694 (patch)
tree3fd7e267e2eed043884ea79aa417ba0c3159f8fd
parent4f450b6e116c806c430d32cd2aa03f77c1934510 (diff)
Bugfix AS3525 usb driver unboosted the cpu without first boosting it
Change-Id: Id2d45870a9128b19ace0e8d5c16d3b3fa4b923dd
-rw-r--r--firmware/target/arm/as3525/usb-as3525.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c
index d798d4da83..3f636256a8 100644
--- a/firmware/target/arm/as3525/usb-as3525.c
+++ b/firmware/target/arm/as3525/usb-as3525.c
@@ -53,12 +53,21 @@ static int usb_status = USB_EXTRACTED;
void usb_enable(bool on)
{
#if defined(HAVE_USBSTACK)
+ static int boosted = 0;
if (on){
- cpu_boost(1);
+ if (boosted == 0)
+ {
+ cpu_boost(1);
+ boosted = 1;
+ }
usb_core_init();
} else {
usb_core_exit();
- cpu_boost(0);
+ if(boosted == 1)
+ {
+ cpu_boost(0);
+ boosted = 0;
+ }
}
#else
(void)on;