Added two comments to explain the while-loop in now()

This commit is contained in:
Karl-Petter Åkesson
2015-04-09 09:23:03 +02:00
parent 5aa1667b44
commit c2c5c5bf76

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