From fd105b7e773e53bdfdec6b794e95a563dd603184 Mon Sep 17 00:00:00 2001 From: Joshua DeWeese Date: Wed, 20 Mar 2024 11:29:25 -0400 Subject: [PATCH] cpu/stm32: remove redundant conditional compile This patch removes a largely redundant block of conditional includes. The removed includes are moved into the family specific headers so that the more specific headers may override defaults defined in the shared headers. --- cpu/stm32/include/clk/c0/cfg_clock_default.h | 2 ++ cpu/stm32/include/clk/clk_conf.h | 11 ----------- cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h | 2 ++ cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h | 2 ++ cpu/stm32/include/clk/g0g4/cfg_clock_default.h | 2 ++ cpu/stm32/include/clk/l0l1/cfg_clock_default.h | 1 + cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h | 2 ++ cpu/stm32/include/clk/mp1/cfg_clock_default.h | 2 ++ cpu/stm32/include/clk/u5/cfg_clock_default.h | 2 ++ 9 files changed, 15 insertions(+), 11 deletions(-) diff --git a/cpu/stm32/include/clk/c0/cfg_clock_default.h b/cpu/stm32/include/clk/c0/cfg_clock_default.h index 3118bb2688..527d88c465 100644 --- a/cpu/stm32/include/clk/c0/cfg_clock_default.h +++ b/cpu/stm32/include/clk/c0/cfg_clock_default.h @@ -19,6 +19,8 @@ #ifndef CLK_C0_CFG_CLOCK_DEFAULT_H #define CLK_C0_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_fx_gx_mp1_c0.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/cpu/stm32/include/clk/clk_conf.h b/cpu/stm32/include/clk/clk_conf.h index 4b093cdd82..3fecf62749 100644 --- a/cpu/stm32/include/clk/clk_conf.h +++ b/cpu/stm32/include/clk/clk_conf.h @@ -22,17 +22,6 @@ #include "kernel_defines.h" #include "macros/units.h" -#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F1) || \ - defined(CPU_FAM_STM32F2) || defined(CPU_FAM_STM32F3) || \ - defined(CPU_FAM_STM32F4) || defined(CPU_FAM_STM32F7) || \ - defined(CPU_FAM_STM32G0) || defined(CPU_FAM_STM32G4) || \ - defined(CPU_FAM_STM32MP1) || defined(CPU_FAM_STM32C0) -#include "cfg_clock_common_fx_gx_mp1_c0.h" -#else /* CPU_FAM_STM32L0 || CPU_FAM_STM32L1 || CPU_FAM_STM32L4 || - * CPU_FAM_STM32L5 || CPU_FAM_STM32U5 || CPU_FAM_STM32WB */ -#include "cfg_clock_common_lx_u5_wx.h" -#endif - #if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F1) || \ defined(CPU_FAM_STM32F3) #include "f0f1f3/cfg_clock_default.h" diff --git a/cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h b/cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h index 180dff3719..e623c2e614 100644 --- a/cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h +++ b/cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h @@ -26,6 +26,8 @@ #ifndef CLK_F0F1F3_CFG_CLOCK_DEFAULT_H #define CLK_F0F1F3_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_fx_gx_mp1_c0.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h index 46d6c81fef..3e7e2335e9 100644 --- a/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h @@ -19,6 +19,8 @@ #ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_H #define CLK_F2F4F7_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_fx_gx_mp1_c0.h" + #if defined(CPU_FAM_STM32F2) #include "f2f4f7/cfg_clock_default_120.h" #elif defined(CPU_FAM_STM32F4) diff --git a/cpu/stm32/include/clk/g0g4/cfg_clock_default.h b/cpu/stm32/include/clk/g0g4/cfg_clock_default.h index 7facc82ebb..92cf17ef61 100644 --- a/cpu/stm32/include/clk/g0g4/cfg_clock_default.h +++ b/cpu/stm32/include/clk/g0g4/cfg_clock_default.h @@ -23,6 +23,8 @@ #ifndef CLK_G0G4_CFG_CLOCK_DEFAULT_H #define CLK_G0G4_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_fx_gx_mp1_c0.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/cpu/stm32/include/clk/l0l1/cfg_clock_default.h b/cpu/stm32/include/clk/l0l1/cfg_clock_default.h index bdb0c092c8..1c90c5fe5b 100644 --- a/cpu/stm32/include/clk/l0l1/cfg_clock_default.h +++ b/cpu/stm32/include/clk/l0l1/cfg_clock_default.h @@ -19,6 +19,7 @@ #ifndef CLK_L0L1_CFG_CLOCK_DEFAULT_H #define CLK_L0L1_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_lx_u5_wx.h" #include "periph_cpu.h" #ifdef __cplusplus diff --git a/cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h b/cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h index 89eb43735e..ca842fee48 100644 --- a/cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h +++ b/cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h @@ -21,6 +21,8 @@ #ifndef CLK_L4L5WX_CFG_CLOCK_DEFAULT_H #define CLK_L4L5WX_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_lx_u5_wx.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/cpu/stm32/include/clk/mp1/cfg_clock_default.h b/cpu/stm32/include/clk/mp1/cfg_clock_default.h index 8d6ba8f93e..10802d2542 100644 --- a/cpu/stm32/include/clk/mp1/cfg_clock_default.h +++ b/cpu/stm32/include/clk/mp1/cfg_clock_default.h @@ -19,6 +19,8 @@ #ifndef CLK_MP1_CFG_CLOCK_DEFAULT_H #define CLK_MP1_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_fx_gx_mp1_c0.h" + /** * @name MP1 clock PLL settings (208MHz) * @{ diff --git a/cpu/stm32/include/clk/u5/cfg_clock_default.h b/cpu/stm32/include/clk/u5/cfg_clock_default.h index 6f29345a83..fa66f9b6c4 100644 --- a/cpu/stm32/include/clk/u5/cfg_clock_default.h +++ b/cpu/stm32/include/clk/u5/cfg_clock_default.h @@ -19,6 +19,8 @@ #ifndef CLK_U5_CFG_CLOCK_DEFAULT_H #define CLK_U5_CFG_CLOCK_DEFAULT_H +#include "cfg_clock_common_lx_u5_wx.h" + #ifdef __cplusplus extern "C" { #endif