Skip to content

Commit

Permalink
Merge pull request arduino-libraries#62 from jbrown123/master
Browse files Browse the repository at this point in the history
Added packet flush before request in forceUpdate(). Fixes issue arduino-libraries#49 - random clock delay
  • Loading branch information
aentinger committed Sep 19, 2019
2 parents 9c16cb7 + cfbe88a commit 18d4ac7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ bool NTPClient::forceUpdate() {
Serial.println("Update from NTP Server");
#endif

// flush any existing packets
while(this->_udp->parsePacket() != 0)
this->_udp->flush();

this->sendNTPPacket();

// Wait till data is there or timeout...
Expand Down

0 comments on commit 18d4ac7

Please sign in to comment.