driver(Ledc): fix the bug that ledc low-sleep channel can not work when chip in light-sleep mode

`esp_light_sleep_start` will disable the RTC8M_CLK, which will cause the LEDC low-speed channel to not work in light-sleep mode
pull/5452/head
houwenxiang 2020-04-17 22:20:10 +08:00
rodzic b52ed2d2a5
commit 73384adfbe
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -201,6 +201,11 @@ void rtc_sleep_init(rtc_sleep_config_t cfg)
} else {
REG_CLR_BIT(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_CK8M_FORCE_PU);
}
//Keep the RTC8M_CLK on in light_sleep mode if the ledc low-speed channel is clocked by RTC8M_CLK.
if (!cfg.deep_slp && GET_PERI_REG_MASK(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_DIG_CLK8M_EN_M)) {
REG_CLR_BIT(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_CK8M_FORCE_PD);
REG_SET_BIT(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_CK8M_FORCE_PU);
}
/* enable VDDSDIO control by state machine */
REG_CLR_BIT(RTC_CNTL_SDIO_CONF_REG, RTC_CNTL_SDIO_FORCE);