diff --git a/boards/hifive1/include/periph_conf.h b/boards/hifive1/include/periph_conf.h index bcef081c37..c9fea46e8f 100644 --- a/boards/hifive1/include/periph_conf.h +++ b/boards/hifive1/include/periph_conf.h @@ -33,22 +33,22 @@ extern "C" { #ifndef CONFIG_USE_CLOCK_HFXOSC_PLL #if IS_ACTIVE(CONFIG_USE_CLOCK_HFXOSC) || IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC_PLL) || \ IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC) -#define CONFIG_USE_CLOCK_HFXOSC_PLL (0) +#define CONFIG_USE_CLOCK_HFXOSC_PLL 0 #else -#define CONFIG_USE_CLOCK_HFXOSC_PLL (1) /* Use PLL clocked by HFXOSC by default */ +#define CONFIG_USE_CLOCK_HFXOSC_PLL 1 /* Use PLL clocked by HFXOSC by default */ #endif #endif /* CONFIG_USE_CLOCK_HFXOSC_PLL */ #ifndef CONFIG_USE_CLOCK_HFXOSC -#define CONFIG_USE_CLOCK_HFXOSC (0) +#define CONFIG_USE_CLOCK_HFXOSC 0 #endif /* CONFIG_USE_CLOCK_HFXOSC */ #ifndef CONFIG_USE_CLOCK_HFROSC_PLL -#define CONFIG_USE_CLOCK_HFROSC_PLL (0) +#define CONFIG_USE_CLOCK_HFROSC_PLL 0 #endif /* CONFIG_USE_CLOCK_HFROSC_PLL */ #ifndef CONFIG_USE_CLOCK_HFROSC -#define CONFIG_USE_CLOCK_HFROSC (0) +#define CONFIG_USE_CLOCK_HFROSC 0 #endif /* CONFIG_USE_CLOCK_HFROSC */ #if CONFIG_USE_CLOCK_HFXOSC_PLL && \ diff --git a/boards/hifive1b/include/periph_conf.h b/boards/hifive1b/include/periph_conf.h index 0d8d5fd071..e6535a685e 100644 --- a/boards/hifive1b/include/periph_conf.h +++ b/boards/hifive1b/include/periph_conf.h @@ -34,22 +34,22 @@ extern "C" { #ifndef CONFIG_USE_CLOCK_HFXOSC_PLL #if IS_ACTIVE(CONFIG_USE_CLOCK_HFXOSC) || IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC_PLL) || \ IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC) -#define CONFIG_USE_CLOCK_HFXOSC_PLL (0) +#define CONFIG_USE_CLOCK_HFXOSC_PLL 0 #else -#define CONFIG_USE_CLOCK_HFXOSC_PLL (1) /* Use PLL clocked by HFXOSC by default */ +#define CONFIG_USE_CLOCK_HFXOSC_PLL 1 /* Use PLL clocked by HFXOSC by default */ #endif #endif /* CONFIG_USE_CLOCK_HFXOSC_PLL */ #ifndef CONFIG_USE_CLOCK_HFXOSC -#define CONFIG_USE_CLOCK_HFXOSC (0) +#define CONFIG_USE_CLOCK_HFXOSC 0 #endif /* CONFIG_USE_CLOCK_HFXOSC */ #ifndef CONFIG_USE_CLOCK_HFROSC_PLL -#define CONFIG_USE_CLOCK_HFROSC_PLL (0) +#define CONFIG_USE_CLOCK_HFROSC_PLL 0 #endif /* CONFIG_USE_CLOCK_HFROSC_PLL */ #ifndef CONFIG_USE_CLOCK_HFROSC -#define CONFIG_USE_CLOCK_HFROSC (0) +#define CONFIG_USE_CLOCK_HFROSC 0 #endif /* CONFIG_USE_CLOCK_HFROSC */ #if CONFIG_USE_CLOCK_HFXOSC_PLL && \ diff --git a/cpu/fe310/clock.c b/cpu/fe310/clock.c index 194eb68158..717fa4d4f0 100644 --- a/cpu/fe310/clock.c +++ b/cpu/fe310/clock.c @@ -22,7 +22,7 @@ #include "vendor/prci_driver.h" -#if CONFIG_USE_CLOCK_HFROSC || CONFIG_USE_CLOCK_HFROSC_PLL +#if IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC) || IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC_PLL) static uint32_t _cpu_frequency = 0; #endif @@ -41,7 +41,7 @@ void clock_init(void) PRCI_REG(PRCI_PLLCFG) &= ~PLL_SEL(PLL_SEL_PLL); } - if (CONFIG_USE_CLOCK_HFXOSC || CONFIG_USE_CLOCK_HFXOSC_PLL) { + if (IS_ACTIVE(CONFIG_USE_CLOCK_HFXOSC) || IS_ACTIVE(CONFIG_USE_CLOCK_HFXOSC_PLL)) { /* Ensure HFXOSC is enabled */ PRCI_REG(PRCI_HFXOSCCFG) = XOSC_EN(1); @@ -51,7 +51,7 @@ void clock_init(void) /* Select HFXOSC as reference frequency and bypass PLL */ PRCI_REG(PRCI_PLLCFG) = PLL_REFSEL(PLL_REFSEL_HFXOSC) | PLL_BYPASS(1); - if (CONFIG_USE_CLOCK_HFXOSC_PLL) { + if (IS_ACTIVE(CONFIG_USE_CLOCK_HFXOSC_PLL)) { /* Divide final output frequency by 1 */ PRCI_REG(PRCI_PLLDIV) = (PLL_FINAL_DIV_BY_1(1) | PLL_FINAL_DIV(0)); @@ -71,7 +71,7 @@ void clock_init(void) /* Turn off the HFROSC */ PRCI_REG(PRCI_HFROSCCFG) &= ~ROSC_EN(1); } - else if (CONFIG_USE_CLOCK_HFROSC_PLL) { + else if (IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC_PLL)) { PRCI_set_hfrosctrim_for_f_cpu(CONFIG_CLOCK_DESIRED_FREQUENCY, PRCI_FREQ_UNDERSHOOT); } else { /* Clock HFROSC */ @@ -91,7 +91,7 @@ void clock_init(void) uint32_t cpu_freq(void) { -#if CONFIG_USE_CLOCK_HFROSC || CONFIG_USE_CLOCK_HFROSC_PLL +#if IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC) || IS_ACTIVE(CONFIG_USE_CLOCK_HFROSC_PLL) /* Clock frequency with HFROSC cannot be determined precisely from settings */ /* If not done already, estimate the CPU frequency */