Skip to content

save 192 RAM bytes when attachInterrupt unused #4601

New issue

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

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

Already on GitHub? # to your account

Merged
merged 4 commits into from
Apr 17, 2018
Merged

Conversation

phoddie
Copy link
Contributor

@phoddie phoddie commented Apr 2, 2018

If an application doesn't use GPIO interrupts, the interrupt_handlers table (192 bytes of RAM) is still allocated as a global and the interrupt_handler ISR is included in the binary. By deferring installation of GPIO interrupts from initPins to attachInterrupt both can be eliminated by the linker.

@devyte devyte self-assigned this Apr 9, 2018
@devyte devyte added this to the 2.5.0 milestone Apr 9, 2018
@devyte
Copy link
Collaborator

devyte commented Apr 17, 2018

Confirmed. Heap goes up when attachInterrupt is not used in the sketch, remains the same as before when used.
Merging.

@devyte devyte merged commit 16a4f22 into esp8266:master Apr 17, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants