File tree 1 file changed +10
-0
lines changed 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 26
26
#include "soc/efuse_reg.h"
27
27
#include "esp32-hal.h"
28
28
#include "esp32-hal-cpu.h"
29
+ #include "hal/timer_ll.h"
30
+ #include "esp_private/systimer.h"
29
31
30
32
#include "esp_system.h"
31
33
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
@@ -173,7 +175,9 @@ static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) {
173
175
#endif
174
176
}
175
177
178
+ #if defined(CONFIG_IDF_TARGET_ESP32 ) && !defined(LACT_MODULE ) && !defined(LACT_TICKS_PER_US )
176
179
void esp_timer_impl_update_apb_freq (uint32_t apb_ticks_per_us ); //private in IDF
180
+ #endif
177
181
178
182
bool setCpuFrequencyMhz (uint32_t cpu_freq_mhz ) {
179
183
rtc_cpu_freq_config_t conf , cconf ;
@@ -246,7 +250,13 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
246
250
//Update APB Freq REG
247
251
rtc_clk_apb_freq_update (apb );
248
252
//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
249
257
esp_timer_impl_update_apb_freq (apb / MHZ );
258
+ #endif
259
+ #endif
250
260
}
251
261
#endif
252
262
//Update FreeRTOS Tick Divisor
You can’t perform that action at this time.
0 commit comments