mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-26 20:26:32 +00:00
Add ESP32 RTOS timesync
This commit is contained in:
parent
0a882f53ba
commit
aa943fc696
@ -400,6 +400,15 @@ void RtcSecond(void)
|
|||||||
} else {
|
} else {
|
||||||
TasmotaGlobal.rules_flag.time_set = 1;
|
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 {
|
} else {
|
||||||
Rtc.utc_time++; // Increment every second
|
Rtc.utc_time++; // Increment every second
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user