Merge branch 'bugfix/fix_cannot_lslp_again_after_ulp_wakeup' into 'master'

sleep: fix cannot lightsleep again after a wakeup from ULP

Closes IDFGH-4396

See merge request espressif/esp-idf!17970
This commit is contained in:
Jing Li
2022-05-13 22:25:23 +08:00
14 changed files with 164 additions and 68 deletions

View File

@@ -688,8 +688,8 @@ typedef struct {
uint32_t rtc_dbias_slp : 3; //!< set bias for RTC domain, in sleep mode
uint32_t vddsdio_pd_en : 1; //!< power down VDDSDIO regulator
uint32_t xtal_fpu : 1; //!< keep main XTAL powered up in sleep
uint32_t deep_slp_reject : 1;
uint32_t light_slp_reject : 1;
uint32_t deep_slp_reject : 1; //!< enable deep sleep reject
uint32_t light_slp_reject : 1; //!< enable light sleep reject
} rtc_sleep_config_t;
/**
@@ -780,6 +780,25 @@ void rtc_sleep_low_init(uint32_t slowclk_period);
#define RTC_COCPU_TRAP_TRIG_EN BIT(13)
#define RTC_USB_TRIG_EN BIT(14)
/**
* RTC_SLEEP_REJECT_MASK records sleep reject sources supported by chip
*/
#define RTC_SLEEP_REJECT_MASK (RTC_EXT0_TRIG_EN | \
RTC_EXT1_TRIG_EN | \
RTC_GPIO_TRIG_EN | \
RTC_TIMER_TRIG_EN | \
RTC_SDIO_TRIG_EN | \
RTC_WIFI_TRIG_EN | \
RTC_UART0_TRIG_EN | \
RTC_UART1_TRIG_EN | \
RTC_TOUCH_TRIG_EN | \
RTC_ULP_TRIG_EN | \
RTC_BT_TRIG_EN | \
RTC_COCPU_TRIG_EN | \
RTC_XTAL32K_DEAD_TRIG_EN | \
RTC_COCPU_TRAP_TRIG_EN | \
RTC_USB_TRIG_EN)
/**
* @brief Enter deep or light sleep mode
*