Browse Source

return if no ntp update possible

split_files
Hendrik Langer 5 years ago
parent
commit
23ecba0d48
  1. 3
      src/XD0OTA.cpp

3
src/XD0OTA.cpp

@ -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(""));

Loading…
Cancel
Save