From 081256eb517c5fad0b4112a39147b89b50bc84cc Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 24 Feb 2021 19:45:50 +0100 Subject: [PATCH] sntp --- cube/User/Src/wizHelper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cube/User/Src/wizHelper.c b/cube/User/Src/wizHelper.c index 642bab0..60bf387 100644 --- a/cube/User/Src/wizHelper.c +++ b/cube/User/Src/wizHelper.c @@ -142,13 +142,13 @@ uint64_t wizSntpQuery() { uint8_t ntpServer[4]; if (wizDnsQuery(config->ntpServer, ntpServer)) { SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer); - uint32_t cycles = 0; + uint16_t cycles = 0; while (1) { - cycles++; + cycles += 1; datetime curTime; if (1 == SNTP_run(&curTime)) { seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF; - coloredMsg(LOG_BLUE, "wizsq, curTime: %lu, cycles: %lu", seconds, cycles); + coloredMsg(LOG_BLUE, "wizsq, cycles: %u, curTime: %lu", cycles, seconds); break; } }