sntp problem

This commit is contained in:
2021-02-24 19:35:53 +01:00
parent f16b38ffd5
commit f220e15afe

View File

@ -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;
}
}