Skip to content

Commit 3718f60

Browse files
committed
fix(build): Try to stay backward compatible for ESP32 only
1 parent c755948 commit 3718f60

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cores/esp32/esp32-hal-cpu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) {
175175
#endif
176176
}
177177

178+
#if defined(CONFIG_IDF_TARGET_ESP32) && !defined(LACT_MODULE) && !defined(LACT_TICKS_PER_US)
178179
void esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us); //private in IDF
180+
#endif
179181

180182
bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
181183
rtc_cpu_freq_config_t conf, cconf;
@@ -248,8 +250,12 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
248250
//Update APB Freq REG
249251
rtc_clk_apb_freq_update(apb);
250252
//Update esp_timer divisor
253+
#if CONFIG_IDF_TARGET_ESP32
251254
#if defined(LACT_MODULE) && defined(LACT_TICKS_PER_US)
252255
timer_ll_set_lact_clock_prescale(TIMER_LL_GET_HW(LACT_MODULE), apb / MHZ / LACT_TICKS_PER_US);
256+
#else
257+
esp_timer_impl_update_apb_freq(apb / MHZ);
258+
#endif
253259
#endif
254260
}
255261
#endif

0 commit comments

Comments
 (0)