ext0 can't work together with ext1?

lolomarx
Posts: 2
Joined: Sat Feb 22, 2020 1:40 am

ext0 can't work together with ext1?

Postby lolomarx » Sat Feb 22, 2020 1:43 am

I want to wake up esp32 from deepsleep mode by below cases:
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]
I found that i can't get above ext0 and ext1 work together while the last one ext work only.
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]
Ext1 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]
Does i miss any other config?

My board is using ESP-IDF 3.3.1 to build the firmware.

mikemoy
Posts: 604
Joined: Fri Jan 12, 2018 9:10 pm

Re: ext0 can't work together with ext1?

Postby mikemoy » Wed Feb 26, 2020 7:11 pm

Try esp_sleep_enable_gpio_wakeup() in pace for your esp_sleep_enable_ext1_wakeup()

Who is online

Users browsing this forum: Bing [Bot] and 107 guests