Skip to content
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

Add support of counting of interrupts #2149

Merged
merged 3 commits into from
Dec 17, 2017
Merged

Conversation

pjsg
Copy link
Member

@pjsg pjsg commented Oct 27, 2017

Fixes #2142.

  • This PR is for the dev branch rather than for master.
  • This PR is compliant with the other contributing guidelines as well (if not, please describe why).
  • I have thoroughly tested my contribution.
  • The code changes are reflected in the documentation at docs/en/*.

This code adds another callback argument to the gpio interrupt callback function that says how many interrupts happened on this pin. This will allow you to count edges without worrying that you can service each edge.

This adds 4 bytes per pin (i.e. 52 bytes of RAM) to store the two counters (one to count the number of interrupts and the other to indicate the number reported to the lua callback function).

@devsaurus devsaurus merged commit 9aebc84 into nodemcu:dev Dec 17, 2017
@devsaurus devsaurus added this to the 2.1 follow-up II milestone Dec 17, 2017
crasu pushed a commit to crasu/nodemcu-firmware that referenced this pull request Jan 11, 2018
* Add support of counting of interrupts

* Update the timestamp when interrupt happens during dispatch. Also
clear out interrupts when setting up a new callback
dnc40085 pushed a commit to dnc40085/nodemcu-firmware that referenced this pull request Mar 3, 2018
* Add support of counting of interrupts

* Update the timestamp when interrupt happens during dispatch. Also
clear out interrupts when setting up a new callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants