Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/stm32: remove redundant conditional compile block #20495

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpu/stm32/include/clk/c0/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef CLK_C0_CFG_CLOCK_DEFAULT_H
#define CLK_C0_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_fx_gx_mp1_c0.h"
#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 2 additions & 0 deletions cpu/stm32/include/clk/cfg_clock_common_fx_gx_mp1_c0.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef CLK_CFG_CLOCK_COMMON_FX_GX_MP1_C0_H
#define CLK_CFG_CLOCK_COMMON_FX_GX_MP1_C0_H

#include "kernel_defines.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 2 additions & 0 deletions cpu/stm32/include/clk/cfg_clock_common_lx_u5_wx.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef CLK_CFG_CLOCK_COMMON_LX_U5_WX_H
#define CLK_CFG_CLOCK_COMMON_LX_U5_WX_H

#include "kernel_defines.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
14 changes: 0 additions & 14 deletions cpu/stm32/include/clk/clk_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@
#ifndef CLK_CLK_CONF_H
#define CLK_CLK_CONF_H

#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"
Expand Down
4 changes: 4 additions & 0 deletions cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#ifndef CLK_F0F1F3_CFG_CLOCK_DEFAULT_H
#define CLK_F0F1F3_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_fx_gx_mp1_c0.h"
#include "kernel_defines.h"
#include "macros/units.h"
aabadie marked this conversation as resolved.
Show resolved Hide resolved

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -102,7 +106,7 @@
* PLL_MUL: multiplier, allowed range: [2:16]
* CORECLOCK -> 48MHz Max on F0, 72MHz MAX on F1/F3!
*/
#define CLOCK_CORECLOCK ((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_PREDIV) * CONFIG_CLOCK_PLL_MUL)

Check warning on line 109 in cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#ifdef CPU_FAM_STM32F0
#if CLOCK_CORECLOCK > MHZ(48)
#error "SYSCLK cannot exceed 48MHz"
Expand All @@ -123,7 +127,7 @@
#define CONFIG_CLOCK_APB1_DIV (2)
#endif
#endif
#define CLOCK_APB1 (CLOCK_AHB / CONFIG_CLOCK_APB1_DIV) /* PCLK1, max: 48MHz (F0), 36MHz (F1/F3)*/

Check warning on line 130 in cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#ifdef CPU_FAM_STM32F0
/* APB2 and APB1 are the same bus but configuration registers still follows the
* split between APB1 and APB2. Since it's the same bus, APB2 clock is equal to APB1 clock.
Expand All @@ -133,7 +137,7 @@
#ifndef CONFIG_CLOCK_APB2_DIV
#define CONFIG_CLOCK_APB2_DIV (1)
#endif
#define CLOCK_APB2 (CLOCK_AHB / CONFIG_CLOCK_APB2_DIV) /* PCLK2, max: 72MHz */

Check warning on line 140 in cpu/stm32/include/clk/f0f1f3/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#endif
/** @} */

Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_H
#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_fx_gx_mp1_c0.h"
#include "kernel_defines.h"

#if defined(CPU_FAM_STM32F2)
#include "f2f4f7/cfg_clock_default_120.h"
#elif defined(CPU_FAM_STM32F4)
Expand Down Expand Up @@ -66,10 +69,10 @@
#define CLOCK_CORECLOCK (CONFIG_CLOCK_HSE)

#elif IS_ACTIVE(CONFIG_USE_CLOCK_PLL)
#define CLOCK_CORECLOCK (((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_M) * CONFIG_CLOCK_PLL_N) / CONFIG_CLOCK_PLL_P)

Check warning on line 72 in cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#endif /* CONFIG_USE_CLOCK_PLL */

#define CLOCK_PLLQ (((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_M) * CONFIG_CLOCK_PLL_N) / CONFIG_CLOCK_PLL_Q)

Check warning on line 75 in cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

#define CLOCK_AHB CLOCK_CORECLOCK
#define CLOCK_APB1 (CLOCK_CORECLOCK / CONFIG_CLOCK_APB1_DIV)
Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/f2f4f7/cfg_clock_default_100.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_100_H
#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_100_H

#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/f2f4f7/cfg_clock_default_120.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H
#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H

#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/f2f4f7/cfg_clock_default_180.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_180_H
#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_180_H

#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/f2f4f7/cfg_clock_default_216.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_216_H
#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_216_H

#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/f2f4f7/cfg_clock_default_84.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_84_H
#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_84_H

#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
4 changes: 4 additions & 0 deletions cpu/stm32/include/clk/g0g4/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#ifndef CLK_G0G4_CFG_CLOCK_DEFAULT_H
#define CLK_G0G4_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_fx_gx_mp1_c0.h"
#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -103,12 +107,12 @@
#ifndef CONFIG_CLOCK_APB1_DIV
#define CONFIG_CLOCK_APB1_DIV (1)
#endif
#define CLOCK_APB1 (CLOCK_CORECLOCK / CONFIG_CLOCK_APB1_DIV) /* max: 64MHz (G0), 170MHZ (G4) */

Check warning on line 110 in cpu/stm32/include/clk/g0g4/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#ifdef CPU_FAM_STM32G4
#ifndef CONFIG_CLOCK_APB2_DIV
#define CONFIG_CLOCK_APB2_DIV (1)
#endif
#define CLOCK_APB2 (CLOCK_AHB / CONFIG_CLOCK_APB2_DIV) /* max: 170MHz (only on G4) */

Check warning on line 115 in cpu/stm32/include/clk/g0g4/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#endif
/** @} */

Expand Down
3 changes: 3 additions & 0 deletions cpu/stm32/include/clk/l0l1/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#ifndef CLK_L0L1_CFG_CLOCK_DEFAULT_H
#define CLK_L0L1_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_lx_u5_wx.h"
#include "kernel_defines.h"
#include "macros/units.h"
#include "periph_cpu.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -71,7 +74,7 @@
* PLL_MUL: multiplier, allowed values: 3, 4, 6, 8, 12, 16, 24, 32, 48. Default is 4.
* CORECLOCK -> 32MHz MAX!
*/
#define CLOCK_CORECLOCK ((CLOCK_PLL_SRC * CONFIG_CLOCK_PLL_MUL) / CONFIG_CLOCK_PLL_DIV)

Check warning on line 77 in cpu/stm32/include/clk/l0l1/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#if CLOCK_CORECLOCK > MHZ(32)
#error "SYSCLK cannot exceed 32MHz"
#endif
Expand Down
4 changes: 4 additions & 0 deletions cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#ifndef CLK_L4L5WX_CFG_CLOCK_DEFAULT_H
#define CLK_L4L5WX_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_lx_u5_wx.h"
#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -170,11 +174,11 @@
#ifndef CONFIG_CLOCK_APB1_DIV
#define CONFIG_CLOCK_APB1_DIV (4)
#endif
#define CLOCK_APB1 (CLOCK_AHB / CONFIG_CLOCK_APB1_DIV) /* PCLK1, max: 48/64/80/120MHz */

Check warning on line 177 in cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#ifndef CONFIG_CLOCK_APB2_DIV
#define CONFIG_CLOCK_APB2_DIV (2)
#endif
#define CLOCK_APB2 (CLOCK_AHB / CONFIG_CLOCK_APB2_DIV) /* PCLK1, max: 48/64/80/120MHz */

Check warning on line 181 in cpu/stm32/include/clk/l4l5wx/cfg_clock_default.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
/** @} */

#ifdef __cplusplus
Expand Down
4 changes: 4 additions & 0 deletions cpu/stm32/include/clk/mp1/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef CLK_MP1_CFG_CLOCK_DEFAULT_H
#define CLK_MP1_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_fx_gx_mp1_c0.h"
#include "kernel_defines.h"
#include "macros/units.h"

/**
* @name MP1 clock PLL settings (208MHz)
* @{
Expand Down
4 changes: 4 additions & 0 deletions cpu/stm32/include/clk/u5/cfg_clock_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef CLK_U5_CFG_CLOCK_DEFAULT_H
#define CLK_U5_CFG_CLOCK_DEFAULT_H

#include "cfg_clock_common_lx_u5_wx.h"
#include "kernel_defines.h"
#include "macros/units.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
Loading