Skip to content

Remove the need for periodical timer to run usb task for rp2040 #187

@hathach

Description

@hathach

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions