|
|
@ -105,19 +105,19 @@ int XD0OTA::checkForUpdates() { |
|
|
|
} |
|
|
|
|
|
|
|
void XD0OTA::setClock() { |
|
|
|
configTime(0, 0, "pool.ntp.org", "time.nist.gov"); // UTC
|
|
|
|
DEBUG_MSG(F("Waiting for NTP time sync: ")); |
|
|
|
configTime(MY_TZ, "pool.ntp.org"); |
|
|
|
DEBUG_MSG("Waiting for NTP time sync: "); |
|
|
|
time_t now = time(nullptr); |
|
|
|
while (now < 8 * 3600 * 2) { |
|
|
|
yield(); |
|
|
|
delay(500); |
|
|
|
DEBUG_MSG(F(".")); |
|
|
|
DEBUG_MSG("."); |
|
|
|
now = time(nullptr); |
|
|
|
} |
|
|
|
|
|
|
|
DEBUG_MSG(F("")); |
|
|
|
DEBUG_MSG(""); |
|
|
|
struct tm timeinfo; |
|
|
|
gmtime_r(&now, &timeinfo); |
|
|
|
DEBUG_MSG(F("Current time: ")); |
|
|
|
DEBUG_MSG("Current time: "); |
|
|
|
Serial.print(asctime(&timeinfo)); |
|
|
|
} |
|
|
|