Merge branch 'conflicting_clocks_when_logging' into integration

This commit is contained in:
J. Nick Koston
2026-01-15 13:15:59 -10:00
@@ -31,6 +31,14 @@ 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
auto current = this->utcnow();
if (current.is_valid()) {
int32_t diff = static_cast<int32_t>(epoch) - static_cast<int32_t>(current.timestamp);
if (diff >= -1 && diff <= 1) {
return;
}
}
// Update UTC epoch time.
#ifdef USE_ZEPHYR
struct timespec ts;