mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/msp430/periph_timer: fix timer_query_freqs()
`timer_query_freqs()` should return 0 when index is out of range according to the doc. This changes the code to live up to the spec.
This commit is contained in:
parent
3cdc4379b7
commit
5adf1f1a28
@ -188,6 +188,10 @@ uint32_t timer_query_freqs(tim_t dev, uword_t index)
|
||||
assume((clock_source == TIMER_CLOCK_SOURCE_AUXILIARY_CLOCK) ||
|
||||
(clock_source == TIMER_CLOCK_SOURCE_SUBMAIN_CLOCK));
|
||||
|
||||
if (index > TXID_DIV_MAX) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t clock_freq;
|
||||
switch (clock_source) {
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user