File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 2626#include "soc/efuse_reg.h"
2727#include "esp32-hal.h"
2828#include "esp32-hal-cpu.h"
29+ #include "hal/timer_ll.h"
30+ #include "esp_private/systimer.h"
2931
3032#include "esp_system.h"
3133#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
@@ -173,7 +175,9 @@ static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) {
173175#endif
174176}
175177
178+ #if defined(CONFIG_IDF_TARGET_ESP32 ) && !defined(LACT_MODULE ) && !defined(LACT_TICKS_PER_US )
176179void esp_timer_impl_update_apb_freq (uint32_t apb_ticks_per_us ); //private in IDF
180+ #endif
177181
178182bool setCpuFrequencyMhz (uint32_t cpu_freq_mhz ) {
179183 rtc_cpu_freq_config_t conf , cconf ;
@@ -246,7 +250,13 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
246250 //Update APB Freq REG
247251 rtc_clk_apb_freq_update (apb );
248252 //Update esp_timer divisor
253+ #if CONFIG_IDF_TARGET_ESP32
254+ #if defined(LACT_MODULE ) && defined(LACT_TICKS_PER_US )
255+ timer_ll_set_lact_clock_prescale (TIMER_LL_GET_HW (LACT_MODULE ), apb / MHZ / LACT_TICKS_PER_US );
256+ #else
249257 esp_timer_impl_update_apb_freq (apb / MHZ );
258+ #endif
259+ #endif
250260 }
251261#endif
252262 //Update FreeRTOS Tick Divisor
You can’t perform that action at this time.
0 commit comments