mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-06 16:21:33 +00:00
rp2040: use shared IRQ handlers, so user can also hook the USB IRQ
This commit is contained in:
parent
e0d7c16788
commit
c45118dacf
@ -363,7 +363,7 @@ void dcd_init (uint8_t rhport)
|
|||||||
usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
|
usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
irq_set_exclusive_handler(USBCTRL_IRQ, dcd_rp2040_irq);
|
irq_add_shared_handler(USBCTRL_IRQ, dcd_rp2040_irq, PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY);
|
||||||
|
|
||||||
// Init control endpoints
|
// Init control endpoints
|
||||||
tu_memclr(hw_endpoints[0], 2*sizeof(hw_endpoint_t));
|
tu_memclr(hw_endpoints[0], 2*sizeof(hw_endpoint_t));
|
||||||
|
@ -369,7 +369,7 @@ bool hcd_init(uint8_t rhport)
|
|||||||
// Force VBUS detect to always present, for now we assume vbus is always provided (without using VBUS En)
|
// 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;
|
usb_hw->pwr = USB_USB_PWR_VBUS_DETECT_BITS | USB_USB_PWR_VBUS_DETECT_OVERRIDE_EN_BITS;
|
||||||
|
|
||||||
irq_set_exclusive_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
|
// clear epx and interrupt eps
|
||||||
memset(&ep_pool, 0, sizeof(ep_pool));
|
memset(&ep_pool, 0, sizeof(ep_pool));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user