Libelium / waspmoteapi

Tested and stable Waspmote API repository
137 stars 129 forks source link

Millis rollover code #15

Open Emetz564 opened 8 years ago

Emetz564 commented 8 years ago
//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