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

millis() overflow isn't handled properly #9

Open
bneedhamia opened this issue Oct 2, 2017 · 0 comments
Open

millis() overflow isn't handled properly #9

bneedhamia opened this issue Oct 2, 2017 · 0 comments
Labels

Comments

@bneedhamia
Copy link
Owner

All lines of the form
if ((millis() - changedButtonOnMs) > MAX_BOUNCE_MS) {
should instead read
if ((long) (millis() - changedButtonOnMs) > MAX_BOUNCE_MS) {
to match the pattern described in https://playground.arduino.cc/Code/TimingRollover

The bug will cause strange things to happen after running constantly for a few days.

@bneedhamia bneedhamia added the bug label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant