From 12626941ce10b645d8118f94f06c39aa672fb17c Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 16 Feb 2021 11:06:45 +0100 Subject: [PATCH] fix --- cube/User/Src/wizHelper.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cube/User/Src/wizHelper.c b/cube/User/Src/wizHelper.c index bb2e0ca..d671d91 100644 --- a/cube/User/Src/wizHelper.c +++ b/cube/User/Src/wizHelper.c @@ -134,7 +134,6 @@ bool wizDnsQuery(char *name, uint8_t *ip) { uint64_t wizSntpQuery() { - bool success = false; uint64_t seconds = 0; if (networkAvailable) { @@ -143,20 +142,17 @@ uint64_t wizSntpQuery() { uint8_t ntpServer[4]; if (wizDnsQuery(config->ntpServer, ntpServer)) { SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer); - bool updated = false; for (uint8_t i = 0; i < 16; i++) { datetime curTime; int8_t res = SNTP_run(&curTime); if (res == 1) { seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF; - updated = true; - success = true; coloredMsg(LOG_BLUE, "wizsq, curTime: %lu", seconds); break; } } - if (! updated) { + if (seconds == 0) { coloredMsg(LOG_BLUE, "wizsq, time update failed"); } } else {