kinetis: Refactor PIT timer driver implementation#8933
kinetis: Refactor PIT timer driver implementation#8933astralien3000 merged 2 commits intoRIOT-OS:masterfrom
Conversation
84f7f84 to
8ba9abc
Compare
|
Rebased after #8928 was merged |
8ba9abc to
7e09861
Compare
Stop prescaler instead of counter channel to avoid the need for saving and restoring timeouts
ac35a9a to
fb73067
Compare
|
@aabadie can you perform an initial review? |
|
I don't feel enough confident with kinetis to review this, but maybe @kYc0o or @astralien3000 could be of better help here. |
astralien3000
left a comment
There was a problem hiding this comment.
I have not seen any problem here. Implementation choices are commented. Code is clean. I have no experience in this driver so that I can't comment the way it's done, but at this point I think we just need to test.
|
I don't have my teensy right now. I will try to test as soon as possible. |
|
I recommend #8531 for testing timer implementations |
|
Sorry for the long waiting. I tested xtimer_msg, periph_timer, and bench_timers (from #8531) on a teensy31. Everything is working fine. I also tested bench_timers without this PR, which was showing errors. So, ACK ! |
Contribution description
Cleaned up the PIT driver implementation significantly. Simplify the implementation by stopping/starting the prescaler channel instead of the counter. The refactor also fixes some random deadline misses in the old driver where the timer would occasionally overshoot by some 0.5-2 ms. The cause of the bug is unknown, just that the broken behaviour has not been observed with this refactored driver. The measurable driver runtime overhead seem to be lower in the refactored driver. Also fixed a bug where setting a new target on a stopped timer would modify the paused timer_read value.
Issues/PRs references
depends on #8928. Use #8531 for testing