|
| 1 | +Index: M5Unified/src/utility/Power_Class.cpp |
| 2 | +=================================================================== |
| 3 | +--- M5Unified.orig/src/utility/Power_Class.cpp |
| 4 | ++++ M5Unified/src/utility/Power_Class.cpp |
| 5 | +@@ -8,6 +8,7 @@ |
| 6 | + |
| 7 | + #include <esp_log.h> |
| 8 | + #include <esp_sleep.h> |
| 9 | ++#include "driver/rtc_io.h" |
| 10 | + #include <sdkconfig.h> |
| 11 | + |
| 12 | + #include <soc/soc_caps.h> |
| 13 | +@@ -989,7 +990,7 @@ namespace m5 |
| 14 | + (void)touch_wakeup; |
| 15 | + #else |
| 16 | + ESP_LOGD("Power","deepSleep"); |
| 17 | +-#if defined (CONFIG_IDF_TARGET_ESP32C3) || defined (CONFIG_IDF_TARGET_ESP32C6) || defined (CONFIG_IDF_TARGET_ESP32P4) |
| 18 | ++#if defined (CONFIG_IDF_TARGET_ESP32C3) || defined (CONFIG_IDF_TARGET_ESP32C6) // || defined (CONFIG_IDF_TARGET_ESP32P4) |
| 19 | + |
| 20 | + #else |
| 21 | + |
| 22 | +@@ -1003,7 +1004,14 @@ namespace m5 |
| 23 | + uint_fast8_t wpin = _wakeupPin; |
| 24 | + if (touch_wakeup && wpin < GPIO_NUM_MAX) |
| 25 | + { |
| 26 | ++#if SOC_PM_SUPPORT_EXT0_WAKEUP |
| 27 | + esp_sleep_enable_ext0_wakeup((gpio_num_t)wpin, false); |
| 28 | ++#elif SOC_PM_SUPPORT_EXT1_WAKEUP && SOC_RTCIO_PIN_COUNT > 0 |
| 29 | ++ const uint64_t ext_wakeup_pin_1_mask = 1ULL << _wakeupPin; |
| 30 | ++ ESP_ERROR_CHECK(esp_sleep_enable_ext1_wakeup_io(ext_wakeup_pin_1_mask, ESP_EXT1_WAKEUP_ANY_LOW)); |
| 31 | ++ ESP_ERROR_CHECK(rtc_gpio_pullup_dis((gpio_num_t)_wakeupPin)); |
| 32 | ++ ESP_ERROR_CHECK(rtc_gpio_pulldown_en((gpio_num_t)_wakeupPin)); |
| 33 | ++#endif |
| 34 | + while (m5gfx::gpio_in(wpin) == false) |
| 35 | + { |
| 36 | + // Issue #91, ( M5Paper wakes too soon from deep sleep when touch wakeup is enabled - with solution ) |
0 commit comments