-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/sam0_common/periph_timer: implement timer_set() #19036
base: master
Are you sure you want to change the base?
Conversation
The fallback implementation of timer_set() in `drivers/periph_common` is known to fail on short relative sets. This adds a robust implementation.
* afterwards. We add one to risk rather jumping over one tick | ||
* rather than having the clock going backwards by one time */ | ||
unsigned now = timer_read(tim); | ||
timer_stop(tim); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Does this have nasty side affects like loosing the IRQ mask or the CC reg of the other channel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO required to be done for this PR ?
If not, I can have a look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally I would just extend the periph_timer test so that such side effects would be directly detected. I'll try to allocate some time for that, but currently my work load is quite high :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel your pain, I'm somehow in the same position :)
So should we wait a bit for this PR ?
Contribution description
The fallback implementation of timer_set() in
drivers/periph_common
is known to fail on short relative sets. This adds a robust implementation.Testing procedure
Run
tests/periph_timer_short_relative_set
at least a few dozen times (or use #19030 to have a few dozen repetitions of the test case in a single run of the test application). It should now succeed.Issues/PRs references
None