WiFi Lora V3.1 Deep Sleep External Wakup

Hello.

I am using the Lora V3 Board and trying to send it to deep sleep.

#include <heltec_unofficial.h>

const int sleepSwitch = 20;

pinMode(sleepSwitch, INPUT_PULLUP);

if (digitalRead(sleepSwitch) == LOW){
esp_sleep_enable_ext0_wakeup(GPIO_NUM_20, HIGH);
heltec_deep_sleep();
}

Pin 20 to GND is connected via a switch. If the switch is open the board functions as normal, as I close the switch the board goes to deep sleep. But it does not wake up again after opening the switch again.
How could I solve this issue?

Thank you very much!

You are using an unofficial library that we don’t know - what does the function do that sends it to deep sleep?

This is the function from the library:

void heltec_deep_sleep(int seconds = 0) {
  #ifdef WiFi_h
    WiFi.disconnect(true);
  #endif
  #ifndef HELTEC_NO_DISPLAY_INSTANCE
    display.displayOff();
  #endif
  #ifndef HELTEC_NO_RADIO_INSTANCE
    // It seems to make no sense to do a .begin() here, but in case the radio is
    // not interacted with at all before sleep, it will not respond to just
    // .sleep() and then consumes 800 µA more than it should in deep sleep.
    radio.begin();
    // 'false' here is to not have a warm start, we re-init the after sleep.
    radio.sleep(false);
  #endif
  // Turn off external power
  heltec_ve(false);
  // Turn off LED
  heltec_led(0);
  // Set all pins to input to save power
  pinMode(VBAT_CTRL, INPUT);
  pinMode(VBAT_ADC, INPUT);
  pinMode(DIO1, INPUT);
  pinMode(RST_LoRa, INPUT);
  pinMode(BUSY_LoRa, INPUT);
  pinMode(SS, INPUT);
  pinMode(MISO, INPUT);
  pinMode(MOSI, INPUT);
  pinMode(SCK, INPUT);
  pinMode(SDA_OLED, INPUT);
  pinMode(SCL_OLED, INPUT);
  pinMode(RST_OLED, INPUT);
  // Set button wakeup if applicable
  #ifdef HELTEC_POWER_BUTTON
    esp_sleep_enable_ext0_wakeup(BUTTON, LOW);
    button.waitForRelease();
  #endif
  // Set timer wakeup if applicable
  if (seconds > 0) {
    esp_sleep_enable_timer_wakeup((int64_t)seconds * 1000000);
  }
  // and off to bed we go
  esp_deep_sleep_start();
}