Reduce difference between NTP and DS3231 before re-sync

Changed a re-write of DS3231 time from a 60 second difference to a 10 second difference.
This commit is contained in:
pkkrusty 2022-01-07 08:35:00 -08:00 committed by GitHub
parent f78130319a
commit c244965186
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ void DS3231EverySecond(void)
TasmotaGlobal.rules_flag.time_set = 1;
}
}
else if (!ds3231WriteStatus && Rtc.utc_time > START_VALID_TIME && abs((int32_t)(Rtc.utc_time - ReadFromDS3231())) > 60) { // If time is valid and is drift from RTC in more that 60 second
else if (!ds3231WriteStatus && Rtc.utc_time > START_VALID_TIME && abs((int32_t)(Rtc.utc_time - ReadFromDS3231())) > 10) { // If time is valid and has drifted from RTC more than 10 seconds
AddLog(LOG_LEVEL_INFO, PSTR("Write Time TO DS3231 from NTP (" D_UTC_TIME ") %s, (" D_DST_TIME ") %s, (" D_STD_TIME ") %s"),
GetDateAndTime(DT_UTC).c_str(), GetDateAndTime(DT_DST).c_str(), GetDateAndTime(DT_STD).c_str());
SetDS3231Time (Rtc.utc_time); //update the DS3231 time