ESP8266 Developer Zone The Official ESP8266 Forum 2015-08-15T21:38:41+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=956 2015-08-15T21:38:41+08:00 2015-08-15T21:38:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=956&p=3261#p3261 <![CDATA[Re: How to prevent GPIO Interrupt from keep firing]]>
https://github.com/eriksl/esp8266-unive ... ios.c#L209

In short: enable the interrupt "somewhere". When it fires you will get to the handler. At that point CLEAR ALL INTERRUPTS using gpio_intr_ack(pc). You cannot selectively ack one pin's interrupt and rely on the handler being called again for that interrupt. Now check the pc (mask) for all interrupts that fired set a flag for them "somewhere" and handle them later (not in the interrupt handler!). That "later" might a "posted" callback or a timer (or even better, a posted callback FROM a timer). At that point when you have actually handled the interrupt, you can enable it again, which is required. It's all one-shot, apparently.

Don't use the examples you'll find with google, they're for older SDK-versions.

Statistics: Posted by eriksl — Sat Aug 15, 2015 9:38 pm


]]>
2015-08-15T19:22:47+08:00 2015-08-15T19:22:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=956&p=3258#p3258 <![CDATA[How to prevent GPIO Interrupt from keep firing]]>
Could anyone guide me on the following issue.
I am pairing ds3231 RTC with esp-12. GPIO4 is SCL, GPIO5 is SDA. GPIO12 is setup as input to detect falling-edge with pull-up enabled.
When RTC alarm1 matches, it sends neg signal, interrupt callback fires. But it keeps firing until watchdog takes over. I can disable the interrupt and code in callback works fine. But I can not trap the second alarm interrupt as interrupt is disabled.

Thanks.

Statistics: Posted by mojhggn — Sat Aug 15, 2015 7:22 pm


]]>