mirror of
https://github.com/esphome/esphome.git
synced 2025-01-18 12:05:41 +00:00
[esp32] Fix arch_get_cpu_freq_hz (#8047)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
This commit is contained in:
parent
fb87a1c0bc
commit
aac3841991
@ -58,7 +58,11 @@ uint32_t arch_get_cpu_cycle_count() { return esp_cpu_get_cycle_count(); }
|
|||||||
#else
|
#else
|
||||||
uint32_t arch_get_cpu_cycle_count() { return cpu_hal_get_cycle_count(); }
|
uint32_t arch_get_cpu_cycle_count() { return cpu_hal_get_cycle_count(); }
|
||||||
#endif
|
#endif
|
||||||
uint32_t arch_get_cpu_freq_hz() { return rtc_clk_apb_freq_get(); }
|
uint32_t arch_get_cpu_freq_hz() {
|
||||||
|
rtc_cpu_freq_config_t config;
|
||||||
|
rtc_clk_cpu_freq_get_config(&config);
|
||||||
|
return config.freq_mhz * 1000000U;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_ESP_IDF
|
#ifdef USE_ESP_IDF
|
||||||
TaskHandle_t loop_task_handle = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
TaskHandle_t loop_task_handle = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
Loading…
Reference in New Issue
Block a user