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" {
42
42
43
43
// USB processing will be a periodic timer task
44
44
#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
45
48
#define USB_TASK_IRQ 31
49
+ #else
50
+ static unsigned int USB_TASK_IRQ;
51
+ #endif
46
52
47
53
// --------------------------------------------------------------------+
48
54
// Forward USB interrupt events to TinyUSB IRQ Handler
@@ -118,6 +124,9 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
118
124
tusb_init ();
119
125
120
126
// 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
121
130
irq_set_exclusive_handler (USB_TASK_IRQ, usb_irq);
122
131
irq_set_enabled (USB_TASK_IRQ, true );
123
132
setup_periodic_usb_hanlder (USB_TASK_INTERVAL);
You can’t perform that action at this time.
0 commit comments