Skip to content

Commit d09d0b3

Browse files
authored
Merge pull request #1519 from kilograham/rp2040_shared_handler
rp2040: use shared IRQ handlers, so user can also hook the USB IRQ
2 parents e0d7c16 + c45118d commit d09d0b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/portable/raspberrypi/rp2040/dcd_rp2040.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void dcd_init (uint8_t rhport)
363363
usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
364364
#endif
365365

366-
irq_set_exclusive_handler(USBCTRL_IRQ, dcd_rp2040_irq);
366+
irq_add_shared_handler(USBCTRL_IRQ, dcd_rp2040_irq, PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY);
367367

368368
// Init control endpoints
369369
tu_memclr(hw_endpoints[0], 2*sizeof(hw_endpoint_t));

src/portable/raspberrypi/rp2040/hcd_rp2040.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ bool hcd_init(uint8_t rhport)
369369
// Force VBUS detect to always present, for now we assume vbus is always provided (without using VBUS En)
370370
usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
371371

372-
irq_set_exclusive_handler(USBCTRL_IRQ, hcd_rp2040_irq);
372+
irq_add_shared_handler(USBCTRL_IRQ, hcd_rp2040_irq, PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY);
373373

374374
// clear epx and interrupt eps
375375
memset(&ep_pool, 0, sizeof(ep_pool));

0 commit comments

Comments
 (0)