Skip to content

Commit

Permalink
Merge pull request #359 from pennam/esp8266-drift-fix
Browse files Browse the repository at this point in the history
TimeService: Fix esp8266 time drift
  • Loading branch information
pennam authored May 15, 2023
2 parents 89d3c92 + 068107a commit 530fd9f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utility/time/RTCMillis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ unsigned long RTCMillis::get()
{
unsigned long current_tick = millis();
unsigned long const elapsed_s = (current_tick - _last_rtc_update_tick) / 1000;
if(elapsed_s) {
set(_last_rtc_update_value + elapsed_s);
}
_last_rtc_update_value += elapsed_s;
_last_rtc_update_tick += elapsed_s * 1000;
return _last_rtc_update_value;
}

Expand Down

0 comments on commit 530fd9f

Please sign in to comment.