1
0
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:
Marian Buschsieweke 2024-04-14 20:19:39 +02:00
parent 3cdc4379b7
commit 5adf1f1a28
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -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: