Waking up from deep sleep - ESP32

Hi guys,

It might be a really silly question, but here it goes:

How can I wake up ESP32 from deep sleep using the external source function esp_sleep_enable_ext0_wakeup() whenever pin goes 0 AND 1.

I have a momentary button connected to pin 15 in ESP32, and I would like to wake up the device whenever both scenarios occur. Like:

if PIN = 0 {
Wake up
do something...
sleep again...
}

if PIN = 1 {
Wake up
do something...
sleep again...
}

How can I achieve that?

Thank you.

What is 'PIN'?
If it's the state of the pin 15, then it will always wake up and the test does not make any sense...

Have a look at this and study the "ext0 External Wake-up Source"

Thank you.

ESP32 Sleep API Sleep Modes - ESP32 - — ESP-IDF Programming Guide latest documentation