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

possible improvements? #2

Open
jscrane opened this issue May 13, 2019 · 1 comment
Open

possible improvements? #2

jscrane opened this issue May 13, 2019 · 1 comment

Comments

@jscrane
Copy link

jscrane commented May 13, 2019

Great idea, really cleans up event-loop code!

Was wondering if the following ideas might improve it a little?

  • volatile T (for interrupt handlers)
  • replace msSinceLastAssign by msLastChange?

(I guess my main use-case so far is just switch debouncing in software though.)

@timonsku
Copy link
Owner

Hey thank for your suggestion. volatile for interrupt handlers is something I haven't thought about so far, thanks for bringing it up.

Regarding the naming of 'msSinceLastAssign'. The thing that I wanted to avoid is that it would be seen as functionally equivalent to 'changed()' just with the added info when the last change happened.
This function just tracks the last assignment, whether the value actually changed or stayed the same.

I could drop the 'since' though, it may be clear enough without that.

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

No branches or pull requests

2 participants