Merge branch 'bugfix/fix_ledc_unable_to_work_in_light_sleep_mode' into 'master'

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

See merge request espressif/esp-idf!8392
This commit is contained in:
Michael (XIAO Xufeng) 2020-06-08 14:25:43 +08:00
commit 1a6191debe

View file

@ -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);