Skip to content

Commit 530fd9f

Browse files
authoredMay 15, 2023
Merge pull request #359 from pennam/esp8266-drift-fix
TimeService: Fix esp8266 time drift
2 parents 89d3c92 + 068107a commit 530fd9f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/utility/time/RTCMillis.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ unsigned long RTCMillis::get()
5454
{
5555
unsigned long current_tick = millis();
5656
unsigned long const elapsed_s = (current_tick - _last_rtc_update_tick) / 1000;
57-
if(elapsed_s) {
58-
set(_last_rtc_update_value + elapsed_s);
59-
}
57+
_last_rtc_update_value += elapsed_s;
58+
_last_rtc_update_tick += elapsed_s * 1000;
6059
return _last_rtc_update_value;
6160
}
6261

0 commit comments

Comments
 (0)
Please sign in to comment.