From 42deb1ab85a2042e745a6013d7dbcd3abea7652d Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Tue, 27 Oct 2020 00:15:13 +0100 Subject: [PATCH] boards/efm32: align xtimer configuration - move XTIMER_WIDTH within #if statement because sltk3402a is 32-bit - update comments - alignment. --- boards/common/slwstk6000b/include/board.h | 11 ++++++++++- boards/ikea-tradfri/include/board.h | 8 +++++--- boards/ikea-tradfri/include/periph_conf.h | 4 ++-- boards/slstk3401a/include/board.h | 8 +++++--- boards/slstk3402a/include/board.h | 5 ++++- boards/sltb001a/include/board.h | 5 +++-- boards/stk3200/include/board.h | 4 +++- boards/stk3600/include/board.h | 5 +++-- boards/stk3700/include/board.h | 5 +++-- 9 files changed, 38 insertions(+), 17 deletions(-) diff --git a/boards/common/slwstk6000b/include/board.h b/boards/common/slwstk6000b/include/board.h index f7c4e34f16..0250538ded 100644 --- a/boards/common/slwstk6000b/include/board.h +++ b/boards/common/slwstk6000b/include/board.h @@ -33,11 +33,20 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 KHz to increase accuracy. + * The timer runs at 250 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ +#if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) +#define XTIMER_DEV (TIMER_DEV(1)) +#define XTIMER_HZ (32768UL) +#define XTIMER_WIDTH (16) +#else +#define XTIMER_DEV (TIMER_DEV(0)) #define XTIMER_HZ (250000UL) #define XTIMER_WIDTH (16) +#endif +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/ikea-tradfri/include/board.h b/boards/ikea-tradfri/include/board.h index 8a4c0db91d..c6e508df39 100644 --- a/boards/ikea-tradfri/include/board.h +++ b/boards/ikea-tradfri/include/board.h @@ -33,18 +33,20 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 kHz to increase accuracy or 32768 Hz for LETIMER. + * The timer runs at 250 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) #define XTIMER_DEV (TIMER_DEV(1)) #define XTIMER_HZ (32768UL) +#define XTIMER_WIDTH (16) #else #define XTIMER_DEV (TIMER_DEV(0)) #define XTIMER_HZ (250000UL) -#endif #define XTIMER_WIDTH (16) -#define XTIMER_CHAN (0) +#endif +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/ikea-tradfri/include/periph_conf.h b/boards/ikea-tradfri/include/periph_conf.h index f32a46703f..c1bd331727 100644 --- a/boards/ikea-tradfri/include/periph_conf.h +++ b/boards/ikea-tradfri/include/periph_conf.h @@ -96,7 +96,7 @@ static const timer_conf_t timer_config[] = { .cmu = cmuClock_TIMER1 }, .irq = TIMER1_IRQn, - .channel_numof = 3 + .channel_numof = 4 }, { .prescaler = { @@ -109,7 +109,7 @@ static const timer_conf_t timer_config[] = { }, .irq = LETIMER0_IRQn, .channel_numof = 2 - }, + } }; #define TIMER_0_ISR isr_timer1 diff --git a/boards/slstk3401a/include/board.h b/boards/slstk3401a/include/board.h index 66bc4ceefd..656f136ce8 100644 --- a/boards/slstk3401a/include/board.h +++ b/boards/slstk3401a/include/board.h @@ -32,18 +32,20 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. + * The timer runs at 250 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) #define XTIMER_DEV (TIMER_DEV(1)) #define XTIMER_HZ (32768UL) +#define XTIMER_WIDTH (16) #else #define XTIMER_DEV (TIMER_DEV(0)) #define XTIMER_HZ (250000UL) -#endif #define XTIMER_WIDTH (16) -#define XTIMER_CHAN (0) +#endif +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/slstk3402a/include/board.h b/boards/slstk3402a/include/board.h index bdcb2aa644..ad3cfe1cd5 100644 --- a/boards/slstk3402a/include/board.h +++ b/boards/slstk3402a/include/board.h @@ -31,6 +31,9 @@ extern "C" { /** * @name Xtimer configuration + * + * The timer runs at 1000 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) @@ -42,7 +45,7 @@ extern "C" { #define XTIMER_HZ (1000000UL) #define XTIMER_WIDTH (32) #endif -#define XTIMER_CHAN (0) +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/sltb001a/include/board.h b/boards/sltb001a/include/board.h index 1bef11f897..adddfe0241 100644 --- a/boards/sltb001a/include/board.h +++ b/boards/sltb001a/include/board.h @@ -32,7 +32,8 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. + * The timer runs at 250 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) @@ -44,7 +45,7 @@ extern "C" { #define XTIMER_HZ (250000UL) #define XTIMER_WIDTH (16) #endif -#define XTIMER_CHAN (0) +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/stk3200/include/board.h b/boards/stk3200/include/board.h index f80e79ba82..a3cac098c8 100644 --- a/boards/stk3200/include/board.h +++ b/boards/stk3200/include/board.h @@ -32,11 +32,13 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 KHz to increase accuracy. + * The timer runs at 250 kHz. * @{ */ +#define XTIMER_DEV (TIMER_DEV(0)) #define XTIMER_HZ (250000UL) #define XTIMER_WIDTH (16) +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/stk3600/include/board.h b/boards/stk3600/include/board.h index 224d642bf4..62ee8c254b 100644 --- a/boards/stk3600/include/board.h +++ b/boards/stk3600/include/board.h @@ -32,7 +32,8 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. + * The timer runs at 250 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) @@ -44,7 +45,7 @@ extern "C" { #define XTIMER_HZ (250000UL) #define XTIMER_WIDTH (16) #endif -#define XTIMER_CHAN (0) +#define XTIMER_CHAN (0) /** @} */ /** diff --git a/boards/stk3700/include/board.h b/boards/stk3700/include/board.h index 2e58eeb6a9..a8efa2b173 100644 --- a/boards/stk3700/include/board.h +++ b/boards/stk3700/include/board.h @@ -32,7 +32,8 @@ extern "C" { /** * @name Xtimer configuration * - * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. + * The timer runs at 250 kHz to increase accuracy, or at 32.768 kHz if + * LETIMER is used. * @{ */ #if IS_ACTIVE(CONFIG_EFM32_XTIMER_USE_LETIMER) @@ -44,7 +45,7 @@ extern "C" { #define XTIMER_HZ (250000UL) #define XTIMER_WIDTH (16) #endif -#define XTIMER_CHAN (0) +#define XTIMER_CHAN (0) /** @} */ /**