|
@ -18,11 +18,14 @@ void XD0OTA::setClock() { |
|
|
|
|
|
|
|
|
Serial.print(F("Waiting for NTP time sync: ")); |
|
|
Serial.print(F("Waiting for NTP time sync: ")); |
|
|
time_t now = time(nullptr); |
|
|
time_t now = time(nullptr); |
|
|
|
|
|
int tries = 0; |
|
|
while (now < 8 * 3600 * 2) { |
|
|
while (now < 8 * 3600 * 2) { |
|
|
yield(); |
|
|
yield(); |
|
|
delay(500); |
|
|
delay(500); |
|
|
Serial.print(F(".")); |
|
|
Serial.print(F(".")); |
|
|
now = time(nullptr); |
|
|
now = time(nullptr); |
|
|
|
|
|
tries++; |
|
|
|
|
|
if (tries>15) return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Serial.println(F("")); |
|
|
Serial.println(F("")); |
|
|