Skip to content

Commit

Permalink
cpu/esp32: move CLOCK_CORECLOCK to periph_cpu_*.h
Browse files Browse the repository at this point in the history
This define does not belong to the defines in `sdkconfig_*.h` that are used for the ESP-IDF SDK. It is therefore moved to the corresponding `periph_cpu_*.h` file.
  • Loading branch information
gschorcht committed Aug 17, 2022
1 parent a76f5fd commit e7bf789
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
5 changes: 5 additions & 0 deletions cpu/esp32/include/periph_cpu_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* @{
Expand Down
5 changes: 5 additions & 0 deletions cpu/esp32/include/periph_cpu_esp32c3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* @{
Expand Down
3 changes: 3 additions & 0 deletions cpu/esp32/include/periph_cpu_esp32s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions cpu/esp32/include/sdkconfig_esp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/** @} */

/**
Expand Down
5 changes: 0 additions & 5 deletions cpu/esp32/include/sdkconfig_esp32c3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/** @} */

/**
Expand Down
4 changes: 0 additions & 4 deletions cpu/esp32/include/sdkconfig_esp32s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/** @} */

/**
Expand Down

0 comments on commit e7bf789

Please sign in to comment.