Merge pull request #1729 from rjmcdougall/pcf8563rtc

Adjust year, hour, minute for PCF8563
raytac-diy
Thomas Göttgens 2022-10-04 13:40:40 +02:00 zatwierdzone przez GitHub
commit dc097c7230
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -47,8 +47,8 @@ void readFromRTC()
rtc.begin();
auto tc = rtc.getDateTime();
tm t;
t.tm_year = tc.year;
t.tm_mon = tc.month;
t.tm_year = tc.year - 1900;
t.tm_mon = tc.month - 1;
t.tm_mday = tc.day;
t.tm_hour = tc.hour;
t.tm_min = tc.minute;
@ -112,7 +112,7 @@ bool perhapsSetRTC(RTCQuality q, const struct timeval *tv)
PCF8563_Class rtc;
rtc.begin();
tm *t = localtime(&tv->tv_sec);
rtc.setDateTime(t->tm_year + 1900, t->tm_mon + 1, t->tm_wday, t->tm_hour, t->tm_min, t->tm_sec);
rtc.setDateTime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
DEBUG_MSG("PCF8563_RTC setDateTime %02d-%02d-%02d %02d:%02d:%02d %ld\n", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, tv->tv_sec);
}
#elif defined(ARCH_ESP32)

Wyświetl plik

@ -12,7 +12,7 @@ build_flags =
lib_deps =
${esp32_base.lib_deps}
zinggjm/GxEPD2@^1.4.9
lewisxhe/PCF8563_Library@^0.0.1
https://github.com/lewisxhe/PCF8563_Library.git#91399f254651537c5ab338dacc7c10d1f087fd09
board_build.f_cpu = 240000000L
upload_protocol = esptool
upload_port = /dev/ttyACM*

Wyświetl plik

@ -14,5 +14,5 @@ lib_deps =
${nrf52840_base.lib_deps}
https://github.com/meshtastic/GxEPD2#afce87a97dda1ac31d8a28dc8fa7c6f55dc96a61
adafruit/Adafruit BusIO@^1.13.2
lewisxhe/PCF8563_Library@^0.0.1
https://github.com/lewisxhe/PCF8563_Library.git#91399f254651537c5ab338dacc7c10d1f087fd09
;upload_protocol = fs