1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/efm32: use IS_ACTIVE for CONFIG_EFM32_USE_LETIMER

This commit is contained in:
Francisco Molina 2020-08-18 14:47:47 +02:00
parent 029ae8c7d2
commit 5c4db4a65b
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
13 changed files with 22 additions and 21 deletions

View File

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

View File

@ -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)
/** @} */

View File

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

View File

@ -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)
/** @} */

View File

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

View File

@ -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)
/** @} */

View File

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

View File

@ -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)
/** @} */

View File

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

View File

@ -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)
/** @} */

View File

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

View File

@ -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)
/** @} */

View File

@ -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
*/