Page 1 of 1

ESP32 HELP interrupt hanlder dead after DEEP SLEEP WAKE UP.

Posted: Mon Jan 08, 2018 6:39 pm
by jerryy123
my sudo code:

After Deep Sleep, handler function(static void handler(void *args) ) will never be executed even I triggered GPIO_INTR_POSEDGE.

How to solve this?

Thanks.




static char tag[] = "test_intr";
static QueueHandle_t q1;


int d1=0;


static void handler(void *args) {
d1++;
}

void ClearIII(void *pvParameters)
{
vTaskDelay(10000);
esp_deep_sleep_enable_ext0_wakeup(PIN_NIRQ_915, 1);
esp_deep_sleep_start();
}


void MainTask(void *pvParameters)
{
gpio_install_isr_service(0);
gpio_isr_handler_add(GPIO_NUM_2, handler, (void*) PIN_NIRQ_915);
gpio_set_intr_type(GPIO_NUM_2, GPIO_INTR_POSEDGE);

gpio_intr_enable(GPIO_NUM_2_915);

while(1) {
vTaskDelay(500);
}

}

main(int argc, const char * argv[]){
gpio_set_direction(GPIO_NUM_2, GPIO_MODE_INPUT);

xTaskCreate(&MainTask, "MainTask", 10000, NULL, 10, NULL);
xTaskCreate(&ClearIII, "clearTask", 10000, NULL, 10, NULL);


return 0;
}

Re: ESP32 HELP interrupt hanlder dead after DEEP SLEEP WAKE UP.

Posted: Tue Jan 09, 2018 3:56 am
by WiFive
rtc_gpio_deinit

Re: ESP32 HELP interrupt hanlder dead after DEEP SLEEP WAKE UP.

Posted: Wed Jan 10, 2018 7:42 pm
by jerryy123
Thanks, it worked.