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 rollover code #15

Open
Emetz564 opened this issue Dec 26, 2015 · 0 comments
Open

Millis rollover code #15

Emetz564 opened this issue Dec 26, 2015 · 0 comments

Comments

@Emetz564
Copy link

//avoid millis overflow problem
if( millis() < previous ) previous = millis(); 

There is NO millis overflow problem. The variable previous is unsigned long, so even if Millis() overflows, code still works correctly. This line is scattered all over, and since unnecessary, a complete waste of precious space.

See - http://www.gammon.com.au/millis or http://playground.arduino.cc/Code/TimingRollover
or many other pages dispelling this myth

jdavid added a commit to spectraphilic/wasp_sketches that referenced this issue Sep 13, 2017
Found out here, Libelium/waspmoteapi#15 that
this could be much more simple.

If I have not removed the function enterily it's because it would take
more program memory, something I want to avoid now (we run out of
program memory). That's why the function is declared noinline.
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

1 participant