Skip to content

Commit 18d4ac7

Browse files
authored
Merge pull request #62 from jbrown123/master
Added packet flush before request in forceUpdate(). Fixes issue #49 - random clock delay
2 parents 9c16cb7 + cfbe88a commit 18d4ac7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

NTPClient.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ bool NTPClient::forceUpdate() {
6565
Serial.println("Update from NTP Server");
6666
#endif
6767

68+
// flush any existing packets
69+
while(this->_udp->parsePacket() != 0)
70+
this->_udp->flush();
71+
6872
this->sendNTPPacket();
6973

7074
// Wait till data is there or timeout...

0 commit comments

Comments
 (0)