-
Notifications
You must be signed in to change notification settings - Fork 934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devlopment branch: incompatibility between HID host and repeating timer #2011
Comments
ping @hathach in case he has any ideas? |
"The time is updated by the timer callback." Sorry, what do you mean by this exactly? |
The time is maintained in the timer callback using the usual simple code. The fact this it isn't updating shows the callback isn't executing. This is just a convenient way to demonstrate it. I've also shown it with more direct monitoring by comparing in the main code a counter incremented in the callback with time_us_64(). Also the heartbeat stops
|
Is your code in github somewhere? It sounds like you might be calling tuh_task inside of the timer call back which makes me wonder how you avoid calling sleep inside of an exception handler? Anyway, I tried to reproduce this using the tinyusb example and couldn't. I was somewhat surprised that tuh_task sleeps, which could cause problems if you call it in a timer interrupt. |
Closing this. I tried to reproduce the problem without luck. Reopen if you can point me towards some code that reproduces the problem. |
Code works on V2.0.0 but was advised to try development branch to fix an issue with a repeating timer occasionally stopping after an extended period
add_repeating_timer_us(-1000, timer_callback, NULL, &timer);
The development branch appear to correct this except if tuh_task(); is called in which case, if a hid device is plugged in, the timer stops.
In the example output below I call tuh_task() for the first time 10 seconds after the program starts. The time is updated by the timer callback. You can see in the output after the call to tuh_host() the timer stops updating. Then after an extended period (c1min) the hid device spontaneously disconnects and reconnects and the timer is running again. During all of this the main program is working as expected.
The text was updated successfully, but these errors were encountered: