update RTC lib

This commit is contained in:
cyberman54 committed 2023-04-17 22:16:33 +02:00
1 parent 1561d6e028
commit 3145f9750f
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@ uint8_t rtc_init(void) {
#if (TIME_SYNC_COMPILEDATE)
// initialize a blank RTC without battery backup with build time
RtcDateTime tt = Rtc.GetDateTime();
time_t t = tt.Epoch32Time(); // sec2000 -> epoch
time_t t = tt.Unix32Time(); // sec2000 -> epoch
if (!Rtc.IsDateTimeValid() || !timeIsValid(t)) {
ESP_LOGW(TAG, "RTC has no recent time, setting to compiletime");
@@ -53,7 +53,7 @@ time_t get_rtctime(uint16_t *msec) {
*msec = 0;
if (Rtc.IsDateTimeValid() && Rtc.GetIsRunning()) {
RtcDateTime tt = Rtc.GetDateTime();
t = tt.Epoch32Time(); // sec2000 -> epoch
t = tt.Unix32Time(); // sec2000 -> epoch
}
// if we have a RTC pulse, we calculate msec