From 8f8e00ee6c1c0fda814d8fcc1b57052fddfe7ef4 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Tue, 12 May 2020 14:04:25 +0800 Subject: [PATCH] esp32: disable ext0 wakeup source after test --- components/esp32/test/test_sleep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/esp32/test/test_sleep.c b/components/esp32/test/test_sleep.c index dc40af52c0..5754fb3ea3 100644 --- a/components/esp32/test/test_sleep.c +++ b/components/esp32/test/test_sleep.c @@ -359,7 +359,7 @@ TEST_CASE("disable source trigger behavior", "[deepsleep]") ESP_ERROR_CHECK(esp_sleep_enable_ext0_wakeup(GPIO_NUM_13, ESP_EXT0_WAKEUP_LEVEL_HIGH)); // Setup timer to wakeup with timeout - esp_sleep_enable_timer_wakeup(2000000); + esp_sleep_enable_timer_wakeup(2000000); // Save start time gettimeofday(&tv_start, NULL); @@ -412,6 +412,9 @@ TEST_CASE("disable source trigger behavior", "[deepsleep]") // Check error message when source is already disabled esp_err_t err_code = esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER); TEST_ASSERT(err_code == ESP_ERR_INVALID_STATE); + + // Disable ext0 wakeup source, as this might interfere with other tests + ESP_ERROR_CHECK(esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_EXT0)); } static RTC_DATA_ATTR struct timeval start;