Merge pull request #14 from YellowOrb/master

Added two comments to explain the while-loop in now()
This commit is contained in:
Paul Stoffregen
2015-04-09 12:58:39 -07:00

View File

@ -248,7 +248,9 @@ time_t sysUnsyncedTime = 0; // the time sysTime unadjusted by sync
time_t now() {
while (millis() - prevMillis >= 1000){
// calculate number of seconds passed since last call to now()
while (millis() - prevMillis >= 1000) {
// millis() and prevMillis are both unsigned ints thus the subtraction will always be the absolute value of the difference
sysTime++;
prevMillis += 1000;
#ifdef TIME_DRIFT_INFO