ESP32 HELP interrupt hanlder dead after DEEP SLEEP WAKE UP.

jerryy123
Posts: 3
Joined: Mon Jan 08, 2018 6:32 pm

ESP32 HELP interrupt hanlder dead after DEEP SLEEP WAKE UP.

Postby jerryy123 » Mon Jan 08, 2018 6:39 pm

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;
}

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

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

Postby WiFive » Tue Jan 09, 2018 3:56 am

rtc_gpio_deinit

jerryy123
Posts: 3
Joined: Mon Jan 08, 2018 6:32 pm

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

Postby jerryy123 » Wed Jan 10, 2018 7:42 pm

Thanks, it worked.

Who is online

Users browsing this forum: No registered users and 93 guests