esp32: Deactivate wakeup trigger after first wakeup

The files updated according to code review discussions.
In the sleep_modes.c removed immidiate disable of ULP  mode and leave just trigger deactivation.
The esp_sleep.h is updated to have the same defines for source as esp_sleep_wakeup_cause_t.
Updated documentation in sleep_modes.rst file to include cross references.
Some minor changes in test_sleep.c unit test.

(TW#18952)
Closes https://github.com/espressif/esp-idf/issues/1677
This commit is contained in:
Alex Lisitsyn
2018-03-20 11:43:48 +05:00
parent ce09cfd99b
commit 1e9bb5bb7c
5 changed files with 32 additions and 61 deletions

View File

@@ -18,7 +18,6 @@
#include "esp_err.h"
#include "driver/gpio.h"
#include "driver/touch_pad.h"
#include "soc/rtc.h"
#ifdef __cplusplus
extern "C" {
@@ -61,20 +60,11 @@ typedef enum {
ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer
ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad
ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program
} esp_sleep_wakeup_cause_t;
/**
* @brief Sleep wakeup sources for esp_sleep_disable_wakeup_source function
*/
typedef enum {
ESP_SLEEP_SOURCE_UNDEFINED, //!< Wakeup source is not defined
ESP_SLEEP_SOURCE_EXT0, //!< Wakeup source for external signal using RTC_IO
ESP_SLEEP_SOURCE_EXT1, //!< Wakeup source for external signal using RTC_CNTL
ESP_SLEEP_SOURCE_TIMER, //!< Wakeup source for timer
ESP_SLEEP_SOURCE_TOUCHPAD, //!< Wakeup source for touchpad
ESP_SLEEP_SOURCE_ULP, //!< Wakeup source for ULP program
} esp_sleep_source_t;
/* Leave this type define for compatibility */
typedef esp_sleep_source_t esp_sleep_wakeup_cause_t;
/**
* @brief Disable wakeup source
*