summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-09-13 15:08:12 +0700
committerGitHub <[email protected]>2022-09-13 15:08:12 +0700
commit111515a29cce668ea435904a397a1f0117114122 (patch)
treeb92e34fbea9aa3095b9a5cf7bd26b3e183cc1b28 /src
parent7ba950c00686dc94d5314bf5358186f17e507d91 (diff)
parent0931b52b66864ab680f1e5b52eb0c20d028f5558 (diff)
Merge pull request #1629 from jmark1m/master
Fix bug #1628 by preventing shared irq slots for filling up
Diffstat (limited to 'src')
-rw-r--r--src/portable/raspberrypi/rp2040/hcd_rp2040.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/portable/raspberrypi/rp2040/hcd_rp2040.c b/src/portable/raspberrypi/rp2040/hcd_rp2040.c
index e9118c6a3..6ca992954 100644
--- a/src/portable/raspberrypi/rp2040/hcd_rp2040.c
+++ b/src/portable/raspberrypi/rp2040/hcd_rp2040.c
@@ -380,6 +380,9 @@ bool hcd_init(uint8_t rhport)
// Force VBUS detect to always present, for now we assume vbus is always provided (without using VBUS En)
usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
+ // Remove shared irq if it was previously added so as not to fill up shared irq slots
+ irq_remove_handler(USBCTRL_IRQ, hcd_rp2040_irq);
+
irq_add_shared_handler(USBCTRL_IRQ, hcd_rp2040_irq, PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY);
// clear epx and interrupt eps