esp_wifi: When WiFi TSF is active, skip light sleep

* Add an API for peripherals to set callbacks to skip light sleep

* Make WiFi power save example work
This commit is contained in:
Xia Xiaotian
2020-05-07 16:15:56 +08:00
parent bd920d22b0
commit 526a3e49ed
12 changed files with 140 additions and 10 deletions

View File

@@ -64,6 +64,7 @@ typedef enum {
ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program
ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only)
ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only)
ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only)
} esp_sleep_source_t;
/* Leave this type define for compatibility */
@@ -239,6 +240,13 @@ esp_err_t esp_sleep_enable_uart_wakeup(int uart_num);
*/
uint64_t esp_sleep_get_ext1_wakeup_status(void);
/**
* @brief Enable wakeup by WiFi MAC
* @return
* - ESP_OK on success
*/
esp_err_t esp_sleep_enable_wifi_wakeup(void);
/**
* @brief Set power down mode for an RTC power domain in sleep mode
*
@@ -349,7 +357,6 @@ esp_deep_sleep_wake_stub_fn_t esp_get_deep_sleep_wake_stub(void);
*/
void esp_default_wake_deep_sleep(void);
#ifdef __cplusplus
}
#endif