sntp problem
This commit is contained in:
@ -142,12 +142,13 @@ uint64_t wizSntpQuery() {
|
|||||||
uint8_t ntpServer[4];
|
uint8_t ntpServer[4];
|
||||||
if (wizDnsQuery(config->ntpServer, ntpServer)) {
|
if (wizDnsQuery(config->ntpServer, ntpServer)) {
|
||||||
SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer);
|
SNTP_init(SNTP_SOCK, ntpServer, 0, sntpBuffer);
|
||||||
for (uint8_t i = 0; i < 16; i++) {
|
uint32_t cycles = 0;
|
||||||
|
while (1) {
|
||||||
|
cycles++;
|
||||||
datetime curTime;
|
datetime curTime;
|
||||||
int8_t res = SNTP_run(&curTime);
|
if (1 == SNTP_run(&curTime)) {
|
||||||
if (res == 1) {
|
|
||||||
seconds = curTime.seconds - UNIX_NTP_EPOCH_DIFF;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user