Closed
Description
Board
esp32-h2
Device Description
Hello. While working on deep-sleep wakeup finds problem with gpio wakeup on esp32-h2. In API guide wrote using esp_deep_sleep_enable_gpio_wakeup to wakeup, but in ide this function not available for esp32-h2 board
Hardware Configuration
GPIO 12 connecting via button to GND
Version
latest stable Release (if not listed below)
IDE Name
VScode
Operating System
windows 11
Flash frequency
40MHz
PSRAM enabled
yes
Upload speed
115200
Description
Hello. While working on deep-sleep wakeup finds problem with gpio wakeup on esp32-h2. In API guide wrote using esp_deep_sleep_enable_gpio_wakeup to wakeup, but in ide this function not available for esp32-h2 board
Sketch
static void deep_sleep_task(void *pvParameters){
gpio_wakeup_enable(GPIO_PIN_BUTON,GPIO_INTR_LOW_LEVEL);
esp_deep_sleep_enable_gpio_wakeup(GPIO_PIN_BUTON);
bool button_st;
while(1){
if (xQueueReceive(button_queue, &button_st, portMAX_DELAY)) {
gpio_intr_disable(GPIO_PIN_BUTON);
int64_t timer = 0;
vTaskDelay(pdMS_TO_TICKS(50));
if (gpio_get_level(GPIO_PIN_BUTON) == 0){
ESP_LOGI("ISR", "Button is pressed");
timer = esp_timer_get_time();
}
while(gpio_get_level(GPIO_PIN_BUTON) == 0);
vTaskDelay(pdMS_TO_TICKS(50));
if (gpio_get_level(GPIO_PIN_BUTON) == 1){
ESP_LOGI("ISR", "Button is released");
if((esp_timer_get_time() - timer)>= 3000000){
ESP_LOGI("ESP", "Entering in Deep Sleep");
esp_deep_sleep_start();
}else{timer = 0;}
}
gpio_intr_enable(GPIO_PIN_BUTON);
}
}
}
Debug Message
C:/Users/fedot/Documents/X-TechProjects/X-RT/main/esp_zb_light.c:1740:5: error: implicit declaration of function 'esp_deep_sleep_enable_gpio_wakeup'; did you mean 'esp_sleep_enable_gpio_wakeup'? [-Wimplicit-function-declaration]
1740 | esp_deep_sleep_enable_gpio_wakeup(GPIO_PIN_BUTON);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| esp_sleep_enable_gpio_wakeup
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.