Skip to content

Commit 1ae89b7

Browse files
committed
fix(wifi): fix the issue of wifipwr losing its clock during sleep on the esp32c6 eco1
1 parent 31439df commit 1ae89b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/esp_hw_support/modem_clock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpcl
390390
if (efuse_hal_chip_revision() != 0) {
391391
if (src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
392392
pmu_sleep_enable_hp_sleep_sysclk(true);
393+
modem_clock_hal_enable_wifipwr_clock(MODEM_CLOCK_instance()->hal, true);
394+
modem_clock_domain_clk_gate_disable(MODEM_CLOCK_DOMAIN_WIFIPWR, PMU_HP_ICG_MODEM_CODE_SLEEP);
393395
}
394-
modem_clock_hal_enable_wifipwr_clock(MODEM_CLOCK_instance()->hal, true);
395-
modem_clock_domain_clk_gate_disable(MODEM_CLOCK_DOMAIN_WIFIPWR, PMU_HP_ICG_MODEM_CODE_SLEEP);
396396
}
397397
#endif
398398
break;
@@ -452,9 +452,9 @@ void modem_clock_deselect_lp_clock_source(periph_module_t module)
452452
if (efuse_hal_chip_revision() != 0) {
453453
if (last_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
454454
pmu_sleep_enable_hp_sleep_sysclk(false);
455+
modem_clock_hal_enable_wifipwr_clock(MODEM_CLOCK_instance()->hal, false);
456+
modem_clock_domain_clk_gate_enable(MODEM_CLOCK_DOMAIN_WIFIPWR, PMU_HP_ICG_MODEM_CODE_SLEEP);
455457
}
456-
modem_clock_hal_enable_wifipwr_clock(MODEM_CLOCK_instance()->hal, false);
457-
modem_clock_domain_clk_gate_enable(MODEM_CLOCK_DOMAIN_WIFIPWR, PMU_HP_ICG_MODEM_CODE_SLEEP);
458458
}
459459
#endif
460460
break;

0 commit comments

Comments
 (0)