mirror of https://github.com/arendst/Tasmota.git
Fix GPS time sync rules
This commit is contained in:
parent
bea7e67363
commit
7d8b4483d2
|
@ -748,7 +748,7 @@ void WifiPollNtp() {
|
|||
Rtc.utc_time = ntp_time;
|
||||
ntp_sync_minute = 60; // Sync so block further requests
|
||||
RtcSync();
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("NTP: Synched"));
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: Synched"));
|
||||
} else {
|
||||
ntp_sync_minute++; // Try again in next minute
|
||||
}
|
||||
|
|
|
@ -171,7 +171,8 @@ void DS3231EverySecond(void) {
|
|||
if (ds3231_time > START_VALID_TIME) {
|
||||
Rtc.utc_time = ds3231_time;
|
||||
RtcSync();
|
||||
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("DS3: Synched"));
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("DS3: Synched"));
|
||||
// Rtc.user_time_entry = true; // Stop NTP sync and DS3231 time write
|
||||
ds3231ReadStatus = true; // if time in DS3231 is valid, do not update again
|
||||
}
|
||||
}
|
||||
|
|
|
@ -677,9 +677,11 @@ void UBXHandleTIME()
|
|||
gpsTime.minute = UBX.Message.navTime.min;
|
||||
gpsTime.second = UBX.Message.navTime.sec;
|
||||
UBX.rec_buffer.values.time = MakeTime(gpsTime);
|
||||
if (UBX.mode.forceUTCupdate || Rtc.user_time_entry == false){
|
||||
AddLog(LOG_LEVEL_INFO, PSTR("UBX: UTC-Time is valid, set system time"));
|
||||
if (UBX.mode.forceUTCupdate || Rtc.user_time_entry == false) {
|
||||
// AddLog(LOG_LEVEL_INFO, PSTR("UBX: UTC-Time is valid, set system time"));
|
||||
Rtc.utc_time = UBX.rec_buffer.values.time;
|
||||
RtcSync();
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("UBX: Synched"));
|
||||
}
|
||||
Rtc.user_time_entry = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue