Skip to content

Commit

Permalink
Only log RTC adjustments > 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
boblemaire committed Oct 22, 2018
1 parent 5205f8a commit 9ce112f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Firmware/IotaWatt/timeServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ uint32_t timeSync(struct serviceBlock* _serviceBlock) {
}
if(timeDiff != 0){
trace(T_timeSync, 13);
//log("UNIXtime: %u, RTC: %u, timeDiff: %d", UNIXtime(), rtc.now().unixtime(), timeDiff);
log("timeSync: adjusting RTC by %d", timeDiff);
if(abs(timeDiff > 1)){
log("timeSync: adjusting RTC by %d", timeDiff);
}
rtc.adjust(rtc.now().unixtime() + timeDiff);
}
}
Expand Down

0 comments on commit 9ce112f

Please sign in to comment.