mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 00:03:45 +08:00
boardd: log system and RTC time before sync (#28461)
old-commit-hash: 6bf1f81859bc03456a9a49245b434dbd35cc4442
This commit is contained in:
@@ -94,11 +94,12 @@ void sync_time(Panda *panda, SyncTimeDir dir) {
|
||||
}
|
||||
}
|
||||
} else if (dir == SyncTimeDir::FROM_PANDA) {
|
||||
LOGW("System time: %s, RTC time: %s", get_time_str(sys_time).c_str(), get_time_str(rtc_time).c_str());
|
||||
|
||||
if (!util::time_valid(sys_time) && util::time_valid(rtc_time)) {
|
||||
const struct timeval tv = {mktime(&rtc_time), 0};
|
||||
settimeofday(&tv, 0);
|
||||
LOGE("System time wrong, setting from RTC. System: %s RTC: %s",
|
||||
get_time_str(sys_time).c_str(), get_time_str(rtc_time).c_str());
|
||||
LOGE("System time wrong, setting from RTC.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user