We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72a582b commit 7fedc2cCopy full SHA for 7fedc2c
cores/esp32/esp32-hal-cpu.c
@@ -26,6 +26,8 @@
26
#include "soc/efuse_reg.h"
27
#include "esp32-hal.h"
28
#include "esp32-hal-cpu.h"
29
+#include "hal/timer_ll.h"
30
+#include "esp_private/systimer.h"
31
32
#include "esp_system.h"
33
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
@@ -246,7 +248,11 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
246
248
//Update APB Freq REG
247
249
rtc_clk_apb_freq_update(apb);
250
//Update esp_timer divisor
251
+#if defined(LACT_MODULE) && defined(LACT_TICKS_PER_US)
252
+ timer_ll_set_lact_clock_prescale(TIMER_LL_GET_HW(LACT_MODULE), apb / MHZ / LACT_TICKS_PER_US);
253
+#else
254
esp_timer_impl_update_apb_freq(apb / MHZ);
255
+#endif
256
}
257
#endif
258
//Update FreeRTOS Tick Divisor
0 commit comments