tud_task() should provide a way to indicate if it did anything #2930
Closed
ReimuNotMoe
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
disable_interrupt()
if (!tud_task_event_ready()) _wfi(); // enter WFI if there is no pending usb event.
enable_interrupt() you can also use the tud_event_hook_cb() that invoked when there is a push to event queue as well. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm attempting to make my firmware fully tickless, which means, the CPU will go to sleep when nothing can be done and only the peripheral interrupts can wake it up.
In this way, each task in the main loop must indicate if they did anything in the current loop invocation. Now I have to modify
tud_task()
to make it indicate it's busy when it received something from the queue.So IMO it's better to provide a standardized API to let the TinyUSB stack report its busy status. Such a mechanism is also mandatory when using TinyUSB on Linux (using
/dev/mem
or UIO) because a non-stopwhile (1)
loop will eat up all the CPU.Beta Was this translation helpful? Give feedback.
All reactions