-
Notifications
You must be signed in to change notification settings - Fork 164
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Currently rp2040 port use an periodic timer to run usb task, triggered every 1ms, which is pretty wasteful.
Adafruit_TinyUSB_Arduino/src/arduino/ports/rp2040/Adafruit_TinyUSB_rp2040.cpp
Lines 84 to 91 in 5be0b21
| static int64_t timer_task(__unused alarm_id_t id, __unused void *user_data) { | |
| irq_set_pending(USB_TASK_IRQ); | |
| return USB_TASK_INTERVAL; | |
| } | |
| static void setup_periodic_usb_hanlder(uint64_t us) { | |
| add_alarm_in_us(us, timer_task, NULL, true); | |
| } |
Describe the solution you'd like
We should make use of hathach/tinyusb#1519 to register an shared IRQ to know when to invoke usb task.