Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By papadeltasierra
#41492 I'm trying to use input interrupts and GPIO2 on an ESP8266-01 and it's not working - can anyone tell me why?
I'm using the FreeRTOS SDK, I have successfully created threads and semaphores and I've use the code below to try and enable interrupts to GPIO2:
Code: Select allGPIO_ConfigTypeDef gpio_def;

gpio_def.GPIO_IntrType = GPIO_PIN_INTR_ANYEDGE;
gpio_def.GPIO_Mode = GPIO_Mode_Input;
gpio_def.GPIO_Pin = GPIO_Pin_4;
gpio_def.GPIO_Pullup = GPIO_PullUp_DIS;

gpio_intr_handler_register(gpio_interrupt_handler, NULL);
gpio_config(&gpio_def);

I'm not getting any errors but I'm receiving interrupts either. I have tried GPIO_Pin_2 in case I've misunderstood when pins and when GPIOs are used but that didn't help.
I've tried 'manually' pulling GPIO2 high or low but that does nothing so I guess it's the code above that is simply not enabling the interrupts corrrectly - so what have I done wrong?
Thanks,
Papadeltasierra.