Skip to content

Can not use attachinterrupt on ESP8266 and variants? #6142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maikbasso opened this issue May 25, 2019 · 2 comments
Closed

Can not use attachinterrupt on ESP8266 and variants? #6142

maikbasso opened this issue May 25, 2019 · 2 comments

Comments

@maikbasso
Copy link

maikbasso commented May 25, 2019

Can not use interrupts because of the condition on this link below. With this condition, when using interrupts the hardware goes into an infinite loop of reboots. If we commenting on this condition, the hardware works normally using interruptions.

if ((uint32_t)userFunc >= 0x40200000)

@d-a-v
Copy link
Collaborator

d-a-v commented May 25, 2019

There is a very recent addition that requires ICACHE_RAM_ATTR in front of your interrupt function definition.

https://github.com/esp8266/Arduino/blob/master/doc/reference.rst#digital-io (end of paragraph)
https://arduino-esp8266.readthedocs.io/en/latest/reference.html#digital-io
#6141

@devyte
Copy link
Collaborator

devyte commented May 25, 2019

To be clear, the requirement has always been there. The referenced condition was added to enforce it, otherwise it was a matter of cache luck whether it would work or not, and hence we'd get a bunch of issues from users who weren't using it.
The referenced PR just documents the requirement.
Closing as not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants