From 23ecba0d480557aa022a33d6df42ff0f3c27eedc Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Sat, 20 Jul 2019 20:15:46 +0200 Subject: [PATCH] return if no ntp update possible --- src/XD0OTA.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/XD0OTA.cpp b/src/XD0OTA.cpp index 1d9f3f0..8586e93 100644 --- a/src/XD0OTA.cpp +++ b/src/XD0OTA.cpp @@ -18,11 +18,14 @@ void XD0OTA::setClock() { Serial.print(F("Waiting for NTP time sync: ")); time_t now = time(nullptr); + int tries = 0; while (now < 8 * 3600 * 2) { yield(); delay(500); Serial.print(F(".")); now = time(nullptr); + tries++; + if (tries>15) return; } Serial.println(F(""));