Here is my code:
Code: Select all
/*
* Add hardware interrupt handler.
*/
gpio_evt_queue = xQueueCreate(10, sizeof(gpio_num_t));
xTaskCreate(gpio_task_example, "gpio_task_example", 2048, NULL, 10, NULL);
gpio_config_t gpioConfig;
gpioConfig.pin_bit_mask = GPIO_SEL_27;
gpioConfig.mode = GPIO_MODE_INPUT;
gpioConfig.pull_up_en = GPIO_PULLUP_ENABLE;
gpioConfig.pull_down_en = GPIO_PULLDOWN_DISABLE;
gpioConfig.intr_type = GPIO_INTR_NEGEDGE;
gpio_config(&gpioConfig);
gpio_install_isr_service(0);
gpio_isr_handler_add(gpio_num_t_INT_PIN, gpio_isr_handler, NULL);
/*
* Configure sensor interrupts.
*/
this->setIntEnable(interrupt_flags);
uint16_t int_config = this->getIntEnable();
printf("Int enable: %d\n", int_config);
Code: Select all
static void IRAM_ATTR gpio_isr_handler(void* arg)
{
uint32_t gpio_num = (uint32_t) arg;
xQueueSendFromISR(gpio_evt_queue, &gpio_num, NULL);
}
static void gpio_task_example(void* arg)
{
uint32_t io_num;
for(;;) {
if(xQueueReceive(gpio_evt_queue, &io_num, portMAX_DELAY)) {
printf("Interrupt!\n");
}
}
}
Q1: Was that silicon bug fixed (have the chips that are produced now a different layout?) ?
Q2: If GPIO27 does not work as a pull up, which does?
Thanks guys!