-
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/msp430: improve periph_timer #20160
Conversation
Could this be tested on a different MSP430 board as well? |
Yes, any MSP430 board supported by RIOT has the same two timer peripherals. Only the frequencies the first timer can generate will differ when the CPU clock is different. Note that the tests for the 32.678 kHz timer is taking a couple of seconds due to the slow speed of the timer and the test iterating over three different frequencies the timer claims to support. |
Looks like there is still an issue with spurious IRQs on MSP430 F2xx/G2xx:
|
680e61b
to
b501ff2
Compare
No, the test was just buggy 😅 #20161 fixes the issue. |
b501ff2
to
1c944fc
Compare
Now it works:
|
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 don't have the hardware, but I trust your testing.
Code wise this looks good and is certainly an improvement over the status quo.
- add support for multiple timers - add support for selecting clock source in the board's `periph_conf.h` - add support for the prescaler - implement `periph_timer_query_freqs` - add a second timer to all MSP430 boards - the first timer is fast ticking, high-power - the second is slow ticking, low-power
Declare functions retrieving the clock domains frequency as pure so that common subexpressions can be eliminated more easily.
Move common configuration for MSP430 based boards to `boards/common/msp430` and make use of that.
1995f4e
to
b51ea4c
Compare
|
🎉 Thanks a lot! :-) |
Contribution description
periph_conf.h
periph_timer_query_freqs
Testing procedure
make BOARD=olimex-msp430-h1611 flash test -C tests/periph/timer
Issues/PRs references
Implements: #16349
Depends on and includes: