I am trying to get the Heltec WiFi Kit32 to wake up from deep sleep with both a touch pad, or a low level on an ext0 pin. Either of these singly activated by my program will work. But when I attempt to activate both, only the touchpad works. I find nothing in all the tutorial material that indicates that this should happen. My code is below
void setup()
{
Serial.begin(115200);
//Increment boot number and print it every reboot
++bootCount;
Serial.println("Boot number: " + String(bootCount));
//touchAttachInterrupt(T4, Wakeup, 40);
//esp_sleep_enable_touchpad_wakeup();
//Print the wakeup reason for ESP32
print_wakeup_reason();
//Configure GPIO39 as ext0 wake up source for LOW logic level
esp_sleep_enable_ext0_wakeup(GPIO_NUM_39, LOW);
//Go to sleep now
esp_deep_sleep_start();
}
void loop()
{
}
//Function that prints the reason by which ESP32 has been awaken from sleep
void print_wakeup_reason(){
esp_sleep_wakeup_cause_t wakeup_reason;
wakeup_reason = esp_sleep_get_wakeup_cause();
switch(wakeup_reason)
{
case 1 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
case 2 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
case 3 : Serial.println("Wakeup caused by timer"); break;
case 4 : Serial.println("Wakeup caused by touchpad"); break;
case 5 : Serial.println("Wakeup caused by ULP program"); break;
default : Serial.println("Wakeup was not caused by deep sleep"); break;
}
}
void Wakeup()
{
//placeholder
}
If anyone sees my error, I thank you in advance for explaining it to me.
jrdoner