Skip to content

Commit a441cad

Browse files
songruojack0c
authored andcommitted
fix(sleep): Fix CPU clk src when restoring CPU frequency after wakeup for c5
1 parent d5ff5d3 commit a441cad

File tree

1 file changed

+6
-2
lines changed
  • components/esp_hw_support/port/esp32c5

1 file changed

+6
-2
lines changed

components/esp_hw_support/port/esp32c5/rtc_clk.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,12 @@ void rtc_clk_cpu_freq_set_xtal_for_sleep(void)
411411

412412
void rtc_clk_cpu_freq_to_pll_and_pll_lock_release(int cpu_freq_mhz)
413413
{
414-
// TODO: IDF-8641 CPU_MAX_FREQ don't know what to do... pll_240 or pll_160...
415-
rtc_clk_cpu_freq_to_pll_240_mhz(cpu_freq_mhz);
414+
// IDF-11064
415+
if (cpu_freq_mhz == 240 || (cpu_freq_mhz == 80 && !ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 1))) {
416+
rtc_clk_cpu_freq_to_pll_240_mhz(cpu_freq_mhz);
417+
} else { // cpu_freq_mhz is 160 or 80 (fixed for chip rev. >= ECO1)
418+
rtc_clk_cpu_freq_to_pll_160_mhz(cpu_freq_mhz);
419+
}
416420
clk_ll_cpu_clk_src_lock_release();
417421
}
418422

0 commit comments

Comments
 (0)