diff --git a/cpu/esp32/include/periph_cpu_esp32.h b/cpu/esp32/include/periph_cpu_esp32.h index 9bdda88cad..98fe0a3a91 100644 --- a/cpu/esp32/include/periph_cpu_esp32.h +++ b/cpu/esp32/include/periph_cpu_esp32.h @@ -19,10 +19,15 @@ #ifndef PERIPH_CPU_ESP32_H #define PERIPH_CPU_ESP32_H +#include "sdkconfig.h" + #ifdef __cplusplus extern "C" { #endif +/** Mapping configured ESP32 default clock to CLOCK_CORECLOCK define */ +#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) + /** * @name Predefined GPIO names * @{ diff --git a/cpu/esp32/include/periph_cpu_esp32c3.h b/cpu/esp32/include/periph_cpu_esp32c3.h index e9127ba5fa..f4bab20a77 100644 --- a/cpu/esp32/include/periph_cpu_esp32c3.h +++ b/cpu/esp32/include/periph_cpu_esp32c3.h @@ -19,10 +19,15 @@ #ifndef PERIPH_CPU_ESP32C3_H #define PERIPH_CPU_ESP32C3_H +#include "sdkconfig.h" + #ifdef __cplusplus extern "C" { #endif +/** Mapping configured ESP32-C3 default clock to CLOCK_CORECLOCK define */ +#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ) + /** * @name Predefined GPIO names * @{ diff --git a/cpu/esp32/include/periph_cpu_esp32s3.h b/cpu/esp32/include/periph_cpu_esp32s3.h index 5bc2c06f81..2856d39cfe 100644 --- a/cpu/esp32/include/periph_cpu_esp32s3.h +++ b/cpu/esp32/include/periph_cpu_esp32s3.h @@ -19,6 +19,9 @@ #ifndef PERIPH_CPU_ESP32S3_H #define PERIPH_CPU_ESP32S3_H +/** Mapping configured ESP32-S3 default clock to CLOCK_CORECLOCK define */ +#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ) + #ifdef __cplusplus extern "C" { #endif diff --git a/cpu/esp32/include/sdkconfig_esp32.h b/cpu/esp32/include/sdkconfig_esp32.h index 942435c37b..05fec6a33f 100644 --- a/cpu/esp32/include/sdkconfig_esp32.h +++ b/cpu/esp32/include/sdkconfig_esp32.h @@ -58,11 +58,6 @@ extern "C" { #ifndef CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ #define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 80 #endif - -/** - * @brief Mapping configured ESP32 default clock to CLOCK_CORECLOCK define - */ -#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) /** @} */ /** diff --git a/cpu/esp32/include/sdkconfig_esp32c3.h b/cpu/esp32/include/sdkconfig_esp32c3.h index b1d5aaf60d..eac3d286d8 100644 --- a/cpu/esp32/include/sdkconfig_esp32c3.h +++ b/cpu/esp32/include/sdkconfig_esp32c3.h @@ -56,11 +56,6 @@ extern "C" { #ifndef CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ #define CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ 80 #endif - -/** - * @brief Mapping configured ESP32-C3 default clock to CLOCK_CORECLOCK define - */ -#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ) /** @} */ /** diff --git a/cpu/esp32/include/sdkconfig_esp32s3.h b/cpu/esp32/include/sdkconfig_esp32s3.h index e301ed8605..044ad0003c 100644 --- a/cpu/esp32/include/sdkconfig_esp32s3.h +++ b/cpu/esp32/include/sdkconfig_esp32s3.h @@ -58,10 +58,6 @@ extern "C" { #ifndef CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ #define CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ 80 #endif -/** - * @brief Mapping configured ESP32 default clock to CLOCK_CORECLOCK define - */ -#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ) /** @} */ /**