File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ static int deep_sleep(int argc, char **argv)
228
228
if (deep_sleep_args .wakeup_gpio_num -> count )
229
229
{
230
230
int io_num = deep_sleep_args .wakeup_gpio_num -> ival [0 ];
231
- if (!rtc_gpio_is_valid_gpio (io_num ))
231
+ if (!GPIO_IS_VALID_DIGITAL_IO_PAD (io_num ))
232
232
{
233
233
ESP_LOGE (TAG , "GPIO %d is not an RTC IO" , io_num );
234
234
return 1 ;
@@ -245,15 +245,16 @@ static int deep_sleep(int argc, char **argv)
245
245
}
246
246
ESP_LOGI (TAG , "Enabling wakeup on GPIO%d, wakeup on %s level" ,
247
247
io_num , level ? "HIGH" : "LOW" );
248
- ESP_ERROR_CHECK (esp_sleep_enable_wifi_wakeup ());
248
+
249
+ #if defined(CONFIG_IDF_TARGET_ESP32 ) || defined(CONFIG_IDF_TARGET_ESP32S2 )
250
+ ESP_ERROR_CHECK (esp_sleep_enable_ext1_wakeup (1ULL << io_num , level ));
251
+ #endif
249
252
}
250
- #if SOC_RTCIO_HOLD_SUPPORTED
253
+ #if defined( CONFIG_IDF_TARGET_ESP32 ) || defined( CONFIG_IDF_TARGET_ESP32S2 )
251
254
rtc_gpio_isolate (GPIO_NUM_12 );
252
- #endif // WITH_TASKS_INFO
255
+ #endif
253
256
esp_deep_sleep_start ();
254
- return 0 ;
255
257
}
256
-
257
258
static void register_deep_sleep (void )
258
259
{
259
260
deep_sleep_args .wakeup_time =
You can’t perform that action at this time.
0 commit comments