The setup is quite simple, I create a task that does the GPIO configuration and interrupt handler registration:
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_event_loop.h"
#include "nvs_flash.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
void input_handler(void *args){
printf("interrupted");
}
void configure_input(void *pvParameter){
gpio_config_t gpioConfig;
gpioConfig.pin_bit_mask = GPIO_SEL_17;
gpioConfig.mode = GPIO_MODE_INPUT;
gpioConfig.pull_up_en = GPIO_PULLUP_DISABLE;
gpioConfig.pull_down_en = GPIO_PULLDOWN_ENABLE;
gpioConfig.intr_type = GPIO_INTR_POSEDGE;
gpio_config(&gpioConfig);
gpio_install_isr_service(0);
gpio_isr_handler_add(GPIO_NUM_17, input_handler, NULL);
vTaskDelete(NULL);
}
void app_main()
{
nvs_flash_init();
xTaskCreate(&configure_input, "configure_input_task", 8000, NULL, 9, NULL);
}
Code: Select all
abort() was called at PC 0x40081e95 on core 1
Backtrace: 0x400858a8:0x3ffc07d0 0x400859a7:0x3ffc07f0 0x40081e95:0x3ffc0810 0x40081fb5:0x3ffc0840 0x400d6db2:0x3ffc0860 0x400d4115:0x3ffc0b70 0x400d060a:0x3ffc0bc0 0x40080c42:0x3ffc0be0 0x40081a6d:0x3ffc0c00
Rebooting...
I also tried to register the handler with a pointer `gpio_isr_handler_add(GPIO_NUM_17, &input_handler, NULL);` but that didn't really change anything.
Any ideas on how to get it sorted?