diff --git a/cube/User/Src/wizHelper.c b/cube/User/Src/wizHelper.c index 2e9cd52..642bab0 100644 --- a/cube/User/Src/wizHelper.c +++ b/cube/User/Src/wizHelper.c @@ -142,12 +142,13 @@ uint64_t wizSntpQuery() { uint8_t ntpServer[4]; if (wizDnsQuery(config->ntpServer, ntpServer)) { SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer); - for (uint8_t i = 0; i < 16; i++) { + uint32_t cycles = 0; + while (1) { + cycles++; datetime curTime; - int8_t res = SNTP_run(&curTime); - if (res == 1) { + if (1 == SNTP_run(&curTime)) { seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF; - coloredMsg(LOG_BLUE, "wizsq, curTime: %lu", seconds); + coloredMsg(LOG_BLUE, "wizsq, curTime: %lu, cycles: %lu", seconds, cycles); break; } }