Remove blocking ctimer API support#533
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the blocking countdown timer implementation by enabling the stop-on-match hardware feature and updating the expiration detection logic accordingly.
- Enables stop-on-match bits (mr0s, mr1s, mr2s, mr3s) in the MCR register so the timer automatically stops when the match condition is met
- Changes expiration detection to check if the timer counter enable (cen) bit is cleared, which is a more reliable indicator after enabling stop-on-match
- Renames
count_timer_enable_interrupttocount_timer_enableto reflect that the function now configures both interrupt and stop-on-match behavior
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/timer.rs | Renames timer enable function, adds stop-on-match configuration for all channels, and simplifies expiration check by monitoring the counter enable bit |
| examples/rt685s-evk/src/bin/timer.rs | Fixes spelling error in comment and adds informational logging for timer start events |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Remove the blocking countdown timer implementation because it is not there is no safe way to implement sub timer channel in blocking mode without interrupts.
70a11fa to
25bbf55
Compare
25bbf55 to
5b2ae14
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Removing blocking ctimer API support as there is no way to make this safe between different ctimer channels without interrupts and a blocking timer does not make a lot of sense. Plus the same functionality can be achieve using embassy timers.
This pull request removes the implementation of the
CountingTimerfor theBlockingmode fromsrc/timer.rs. The main effect is that the blocking timer functionality, including the ability to create a blocking timer and wait synchronously for a countdown, is no longer available.Removed blocking timer functionality:
impl<'p> CountingTimer<'p, Blocking>block, including thenew_blockingconstructor and thewait_ussynchronous wait method, eliminating blocking mode support from the timer API.