mirror of https://github.com/arendst/Tasmota.git
Add ESP32 RTOS timesync
This commit is contained in:
parent
0a882f53ba
commit
aa943fc696
|
@ -400,6 +400,15 @@ void RtcSecond(void)
|
|||
} else {
|
||||
TasmotaGlobal.rules_flag.time_set = 1;
|
||||
}
|
||||
|
||||
#ifdef ESP32
|
||||
// Sync RTOS time to be used by SD Card time stamps
|
||||
struct timeval tv;
|
||||
tv.tv_sec = Rtc.local_time;
|
||||
tv.tv_usec = 0;
|
||||
settimeofday(&tv, nullptr);
|
||||
#endif // ESP32
|
||||
|
||||
} else {
|
||||
Rtc.utc_time++; // Increment every second
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue