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: |
benpicco
left a comment
There was a problem hiding this comment.
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.hperiph_timer_query_freqsTesting procedure
make BOARD=olimex-msp430-h1611 flash test -C tests/periph/timerIssues/PRs references
Implements: #16349
Depends on and includes: