- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was wondering to use the fine timer for a timeout on a while loop, but I experienced that the fine timer callback is not called while in the loop. What's the priority above the user code?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
finetimer callback happens in the application thread (the timer ISR serializes an event to the application thread). So, unless you exit the while loop, the app thread will not be able to go back to the top of its loop to pick up fine timer expired event from its message queue and call the callback.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fine-timer has a resolution of 12.5ms and it is the preferred timer as it consumes less power.
Check out this thread Can we implement main loop to run application code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's a few additional Fine Timer threads I found which may help as well:
Re: [20736]Fine timer fires during sleep ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
finetimer callback happens in the application thread (the timer ISR serializes an event to the application thread). So, unless you exit the while loop, the app thread will not be able to go back to the top of its loop to pick up fine timer expired event from its message queue and call the callback.