1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-18 03:55:40 +00:00

[esp32] Fix arch_get_cpu_freq_hz (#8047)

Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
This commit is contained in:
Jonathan Swoboda 2025-01-12 20:45:35 -05:00 committed by GitHub
parent fb87a1c0bc
commit aac3841991
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,7 +58,11 @@ uint32_t arch_get_cpu_cycle_count() { return esp_cpu_get_cycle_count(); }
#else
uint32_t arch_get_cpu_cycle_count() { return cpu_hal_get_cycle_count(); }
#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
TaskHandle_t loop_task_handle = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)