I use an ESP32-S3 board with LCD and GT911 touch. I want to use the light sleep function. The touch IRQ should be used for wakeup.
I use this shortend core, similar to the GPIO example for light sleep:
Code: Select all
gpio_config_t config = {
.pin_bit_mask = (1ULL<<GPIO_NUM_4),
.mode = GPIO_MODE_INPUT,
.pull_down_en = false,
.pull_up_en = false,
.intr_type = GPIO_INTR_DISABLE
};
gpio_config(&config);
gpio_wakeup_enable(GPIO_NUM_4, GPIO_INTR_LOW_LEVEL );
esp_sleep_enable_gpio_wakeup();
/* Wait for pin to settle down. TODO: This could cause a stall. */
while (gpio_get_level(GPIO_NUM_4) == 0) {
vTaskDelay(pdMS_TO_TICKS(10));
}
/* Start light sleep. */
err = esp_light_sleep_start();
if (err != ESP_OK) {
ESP_LOGI(RTC_TAG,"rtc_sleep: esp_light_sleep_start failed: %s", esp_err_to_name(err));
return err;
}
Therefore, I tried to reset to GPIO before going into sleep. For this, I added the following code in front:
Code: Select all
gpio_reset_pin(GPIO_NUM_4);
gpio_intr_disable(GPIO_NUM_4);
gpio_isr_handler_remove(GPIO_NUM_4);
Thank you very much.