ESP32 HELP interrupt hanlder dead after DEEP SLEEP WAKE UP.
Posted: 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;
}
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;
}