soc/rtc: restore dbg attenuation when waking from sleep

This fixes inability to enter deep sleep after waking up from light sleep
This commit is contained in:
Ivan Grokhotkov
2018-04-04 15:05:16 +08:00
parent d38b22b11b
commit ac623a9756
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -219,5 +219,8 @@ uint32_t rtc_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt)
uint32_t reject = REG_GET_FIELD(RTC_CNTL_INT_RAW_REG, RTC_CNTL_SLP_REJECT_INT_RAW);
SET_PERI_REG_MASK(RTC_CNTL_INT_CLR_REG,
RTC_CNTL_SLP_REJECT_INT_CLR | RTC_CNTL_SLP_WAKEUP_INT_CLR);
/* restore DBG_ATTEN to the default value */
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_DBG_ATTEN, RTC_CNTL_DBG_ATTEN_DEFAULT);
return reject;
}