From 5c4db4a65b766b9ab9ff3961dc592157acf9d919 Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Tue, 18 Aug 2020 14:47:47 +0200 Subject: [PATCH] cpu/efm32: use IS_ACTIVE for CONFIG_EFM32_USE_LETIMER --- boards/ikea-tradfri/include/board.h | 2 +- boards/ikea-tradfri/include/periph_conf.h | 4 ++-- boards/slstk3401a/include/board.h | 2 +- boards/slstk3401a/include/periph_conf.h | 4 ++-- boards/slstk3402a/include/board.h | 2 +- boards/slstk3402a/include/periph_conf.h | 4 ++-- boards/sltb001a/include/board.h | 2 +- boards/sltb001a/include/periph_conf.h | 4 ++-- boards/stk3600/include/board.h | 2 +- boards/stk3600/include/periph_conf.h | 4 ++-- boards/stk3700/include/board.h | 2 +- boards/stk3700/include/periph_conf.h | 4 ++-- cpu/efm32/include/periph_cpu.h | 7 ++++--- 13 files changed, 22 insertions(+), 21 deletions(-) diff --git a/boards/ikea-tradfri/include/board.h b/boards/ikea-tradfri/include/board.h index 108f827236..054eb73fc2 100644 --- a/boards/ikea-tradfri/include/board.h +++ b/boards/ikea-tradfri/include/board.h @@ -34,7 +34,7 @@ extern "C" { * The timer runs at 250 kHz to increase accuracy or 32768 Hz for LETIMER. * @{ */ -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #define XTIMER_HZ (32768UL) #else #define XTIMER_HZ (250000UL) diff --git a/boards/ikea-tradfri/include/periph_conf.h b/boards/ikea-tradfri/include/periph_conf.h index 77e72a3f9c..8255ba038c 100644 --- a/boards/ikea-tradfri/include/periph_conf.h +++ b/boards/ikea-tradfri/include/periph_conf.h @@ -85,7 +85,7 @@ static const spi_dev_t spi_config[] = { * or two regular timers in cascade mode. * @{ */ -#if EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) static const timer_conf_t timer_config[] = { { .timer = { @@ -113,7 +113,7 @@ static const timer_conf_t timer_config[] = { }; #define TIMER_0_ISR isr_timer1 -#endif /* EFM32_USE_LETIMER */ +#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/boards/slstk3401a/include/board.h b/boards/slstk3401a/include/board.h index 40a9157694..8fc23e0b0f 100644 --- a/boards/slstk3401a/include/board.h +++ b/boards/slstk3401a/include/board.h @@ -35,7 +35,7 @@ extern "C" { * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * @{ */ -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #define XTIMER_HZ (32768UL) #else #define XTIMER_HZ (250000UL) diff --git a/boards/slstk3401a/include/periph_conf.h b/boards/slstk3401a/include/periph_conf.h index 2a3ad6ba5f..e6b3207332 100644 --- a/boards/slstk3401a/include/periph_conf.h +++ b/boards/slstk3401a/include/periph_conf.h @@ -145,7 +145,7 @@ static const spi_dev_t spi_config[] = { * or two regular timers in cascade mode. * @{ */ -#if EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) static const timer_conf_t timer_config[] = { { .timer = { @@ -173,7 +173,7 @@ static const timer_conf_t timer_config[] = { }; #define TIMER_0_ISR isr_timer1 -#endif /* EFM32_USE_LETIMER */ +#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/boards/slstk3402a/include/board.h b/boards/slstk3402a/include/board.h index b4149c1f00..8e025c5abb 100644 --- a/boards/slstk3402a/include/board.h +++ b/boards/slstk3402a/include/board.h @@ -33,7 +33,7 @@ extern "C" { * @name Xtimer configuration * @{ */ -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #define XTIMER_HZ (32768UL) #define XTIMER_WIDTH (16) #else diff --git a/boards/slstk3402a/include/periph_conf.h b/boards/slstk3402a/include/periph_conf.h index dfefe0bd5c..c5aae742e3 100644 --- a/boards/slstk3402a/include/periph_conf.h +++ b/boards/slstk3402a/include/periph_conf.h @@ -136,7 +136,7 @@ static const spi_dev_t spi_config[] = { * or two regular timers in cascade mode. * @{ */ -#if EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) static const timer_conf_t timer_config[] = { { .timer = { @@ -164,7 +164,7 @@ static const timer_conf_t timer_config[] = { }; #define TIMER_0_ISR isr_wtimer1 -#endif /* EFM32_USE_LETIMER */ +#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/boards/sltb001a/include/board.h b/boards/sltb001a/include/board.h index 1291ca66e9..ef3f2c6d61 100644 --- a/boards/sltb001a/include/board.h +++ b/boards/sltb001a/include/board.h @@ -35,7 +35,7 @@ extern "C" { * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * @{ */ -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #define XTIMER_HZ (32768UL) #define XTIMER_WIDTH (16) #else diff --git a/boards/sltb001a/include/periph_conf.h b/boards/sltb001a/include/periph_conf.h index ddc13e9645..98b43802b2 100644 --- a/boards/sltb001a/include/periph_conf.h +++ b/boards/sltb001a/include/periph_conf.h @@ -145,7 +145,7 @@ static const spi_dev_t spi_config[] = { * or two regular timers in cascade mode. * @{ */ -#if EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) static const timer_conf_t timer_config[] = { { .timer = { @@ -173,7 +173,7 @@ static const timer_conf_t timer_config[] = { }; #define TIMER_0_ISR isr_timer1 -#endif /* EFM32_USE_LETIMER */ +#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/boards/stk3600/include/board.h b/boards/stk3600/include/board.h index 52e0869e08..20caffd57f 100644 --- a/boards/stk3600/include/board.h +++ b/boards/stk3600/include/board.h @@ -35,7 +35,7 @@ extern "C" { * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * @{ */ -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #define XTIMER_HZ (32768UL) #define XTIMER_WIDTH (16) #else diff --git a/boards/stk3600/include/periph_conf.h b/boards/stk3600/include/periph_conf.h index bbef6a9327..6f90a95668 100644 --- a/boards/stk3600/include/periph_conf.h +++ b/boards/stk3600/include/periph_conf.h @@ -199,7 +199,7 @@ static const spi_dev_t spi_config[] = { * or two regular timers in cascade mode. * @{ */ -#if EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) static const timer_conf_t timer_config[] = { { .timer = { @@ -227,7 +227,7 @@ static const timer_conf_t timer_config[] = { }; #define TIMER_0_ISR isr_timer1 -#endif /* EFM32_USE_LETIMER */ +#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/boards/stk3700/include/board.h b/boards/stk3700/include/board.h index 973c6b2399..efc3fcc545 100644 --- a/boards/stk3700/include/board.h +++ b/boards/stk3700/include/board.h @@ -35,7 +35,7 @@ extern "C" { * The timer runs at 250 KHz to increase accuracy or 32768 Hz for LETIMER. * @{ */ -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) #define XTIMER_HZ (32768UL) #define XTIMER_WIDTH (16) #else diff --git a/boards/stk3700/include/periph_conf.h b/boards/stk3700/include/periph_conf.h index 01829e99a9..659bb48e29 100644 --- a/boards/stk3700/include/periph_conf.h +++ b/boards/stk3700/include/periph_conf.h @@ -199,7 +199,7 @@ static const spi_dev_t spi_config[] = { * or two regular timers in cascade mode. * @{ */ -#if EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) static const timer_conf_t timer_config[] = { { .timer = { @@ -227,7 +227,7 @@ static const timer_conf_t timer_config[] = { }; #define TIMER_0_ISR isr_timer1 -#endif /* EFM32_USE_LETIMER */ +#endif /* CONFIG_EFM32_USE_LETIMER */ #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/cpu/efm32/include/periph_cpu.h b/cpu/efm32/include/periph_cpu.h index 6ef3507a33..4260578814 100644 --- a/cpu/efm32/include/periph_cpu.h +++ b/cpu/efm32/include/periph_cpu.h @@ -20,6 +20,7 @@ #ifndef PERIPH_CPU_H #define PERIPH_CPU_H +#include "kernel_defines.h" #include "mutex.h" #include "cpu_conf.h" @@ -363,11 +364,11 @@ typedef struct { /** * @brief The implementation can use one LETIMER or two regular timers cascaded */ -#ifndef EFM32_USE_LETIMER -#define EFM32_USE_LETIMER 0 +#ifndef CONFIG_EFM32_USE_LETIMER +#define CONFIG_EFM32_USE_LETIMER 0 #endif -#ifdef EFM32_USE_LETIMER +#if IS_ACTIVE(CONFIG_EFM32_USE_LETIMER) /** * @brief This timer implementation has two available channels */