This commit is contained in:
J. Nick Koston
2026-01-15 13:19:11 -10:00
parent df260b13ab
commit 58ad49ec0a
+2 -1
View File
@@ -31,7 +31,8 @@ void RealTimeClock::dump_config() {
void RealTimeClock::synchronize_epoch_(uint32_t epoch) {
ESP_LOGVV(TAG, "Got epoch %" PRIu32, epoch);
// Skip if time is already synchronized to avoid unnecessary writes and log spam
// Skip if time is already synchronized to avoid unnecessary writes, log spam,
// and prevent clock jumping backwards due to network latency
auto current = this->utcnow();
if (current.is_valid()) {
int32_t diff = static_cast<int32_t>(epoch) - static_cast<int32_t>(current.timestamp);