From f310f604a6e76b1b2ddbaf54d8db65dee1e3e2bc Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 1 Mar 2021 11:40:53 +0100 Subject: [PATCH] x --- cube/User/Src/networkAbstractionLayer_lan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cube/User/Src/networkAbstractionLayer_lan.c b/cube/User/Src/networkAbstractionLayer_lan.c index d043061..3df9ad2 100644 --- a/cube/User/Src/networkAbstractionLayer_lan.c +++ b/cube/User/Src/networkAbstractionLayer_lan.c @@ -151,7 +151,11 @@ void networkSntpEngine(void *handle) { srcPort); coloredMsg(LOG_BLUE, "nes, received in the %d. cycles", localHandle->retryCount); - uint32_t xmt_h = localHandle->ntpMsg.s.xmt_h; + uint32_t xmt_h = + (localHandle->ntpMsg.s.xmt_h & 0x0000000ff) << 24 | + (localHandle->ntpMsg.s.xmt_h & 0x00000ff00) << 8 | + (localHandle->ntpMsg.s.xmt_h & 0x00ff00000) >> 8 | + (localHandle->ntpMsg.s.xmt_h & 0xff0000000) >> 24; localHandle->seconds = ((uint64_t)xmt_h) - UNIX_NTP_EPOCH_DIFF; coloredMsg(LOG_BLUE, "nes, xmt: %08x", xmt_h); coloredMsg(LOG_BLUE, "nes, seconds: %lu", localHandle->seconds);