-->
Page 1 of 2

Working with GPIO interrupts using gpio_pin_intr_state_set()

PostPosted: Tue Jul 14, 2015 11:29 pm
by kolban
I'm attempting to register an interrupt handler to be called when a GPIO pin changes logic level. I am trying:

Code: Select allvoid intrHandler(uint32 interruptMask, void *arg) {
   os_printf("Interrupted: %x\n", interruptMask);
   lastIntr = system_get_time();
   gpio_intr_ack(interruptMask);
}

gpio_intr_handler_register(intrHandler, NULL);
gpio_pin_intr_state_set(4, GPIO_PIN_INTR_NEGEDGE);


But I'm not seeing the callback being invoked even though I am pretty sure that I am toggling the signal on the pin. Has anyone had any success using these functions?

Re: Working with GPIO interrupts using gpio_pin_intr_state_s

PostPosted: Wed Jul 15, 2015 7:56 am
by eriksl
Did you initialize and route (mux) the gpio properly? Some gpio's are not configured as gpio by default.

Re: Working with GPIO interrupts using gpio_pin_intr_state_s

PostPosted: Sat Aug 15, 2015 9:28 am
by paritosharya007
kolban wrote:I'm attempting to register an interrupt handler to be called when a GPIO pin changes logic level. I am trying:

Code: Select allvoid intrHandler(uint32 interruptMask, void *arg) {
   os_printf("Interrupted: %x\n", interruptMask);
   lastIntr = system_get_time();
   gpio_intr_ack(interruptMask);
}

gpio_intr_handler_register(intrHandler, NULL);
gpio_pin_intr_state_set(4, GPIO_PIN_INTR_NEGEDGE);


But I'm not seeing the callback being invoked even though I am pretty sure that I am toggling the signal on the pin. Has anyone had any success using these functions?


Did you manage to get it working? I am also facing similar problem and haven't managed to get it working.

Re: Working with GPIO interrupts using gpio_pin_intr_state_s

PostPosted: Tue Aug 18, 2015 11:45 pm
by kolban
Unfortunately I haven't tried again since my last post. There is enough mystery in the ESP8266 that when I get stuck, I have enough other things to go away and work on that I hope when I come back, more will be known :-)