File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,13 @@ extern "C" {
4242
4343// USB processing will be a periodic timer task
4444#define USB_TASK_INTERVAL 1000
45+
46+ // SDK >= 1.4.0 need to dynamically request the IRQ to avoid conflicts
47+ #if (PICO_SDK_VERSION_MAJOR * 100 + PICO_SDK_VERSION_MINOR) < 104
4548#define USB_TASK_IRQ 31
49+ #else
50+ static unsigned int USB_TASK_IRQ;
51+ #endif
4652
4753// --------------------------------------------------------------------+
4854// Forward USB interrupt events to TinyUSB IRQ Handler
@@ -118,6 +124,9 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
118124 tusb_init ();
119125
120126 // soft irq for periodically task runner
127+ #if (PICO_SDK_VERSION_MAJOR * 100 + PICO_SDK_VERSION_MINOR) >= 104
128+ USB_TASK_IRQ = user_irq_claim_unused (true );
129+ #endif
121130 irq_set_exclusive_handler (USB_TASK_IRQ, usb_irq);
122131 irq_set_enabled (USB_TASK_IRQ, true );
123132 setup_periodic_usb_hanlder (USB_TASK_INTERVAL);
You can’t perform that action at this time.
0 commit comments