1) Key down (gpio 25 turn to low )
2) USB plug in ( gpio 35 turn to high )
So i and below codes on main.c
Code: Select all
[Codebox=c file=Untitled.c]
#define WAKE_UP_GPIO_25_MASK 0x2000000
esp_sleep_enable_ext0_wakeup(35,1) // wake up when USB connected ,gpio 35 is high
esp_sleep_enable_ext1_wakeup(WAKE_UP_GPIO_25_MASK,ESP_EXT1_WAKEUP_ALL_LOW ) // wake up when the key pressed ,gpio 25 is low
[/Codebox]
And , each one can work if i remove the other one
Ext0 work :
Code: Select all
[Codebox=c file=Untitled.c]
#define WAKE_UP_GPIO_25_MASK 0x2000000
esp_sleep_enable_ext0_wakeup(35,1) // wake up when USB connected ,gpio 35 is high
//esp_sleep_enable_ext1_wakeup(WAKE_UP_GPIO_25_MASK,ESP_EXT1_WAKEUP_ALL_LOW ) // wake up when the key pressed ,gpio 25 is low
[/Codebox]
Code: Select all
[Codebox=c file=Untitled.c]
#define WAKE_UP_GPIO_25_MASK 0x2000000
//esp_sleep_enable_ext0_wakeup(35,1) // wake up when USB connected ,gpio 35 is high
esp_sleep_enable_ext1_wakeup(WAKE_UP_GPIO_25_MASK,ESP_EXT1_WAKEUP_ALL_LOW ) // wake up when the key pressed ,gpio 25 is low
[/Codebox]
My board is using ESP-IDF 3.3.1 to build the firmware.