NTPClient icon indicating copy to clipboard operation
NTPClient copied to clipboard

delay(10) to wait for NTP data messes interrupt routines

Open gibo77 opened this issue 5 years ago • 2 comments
trafficstars

Hi, Can you change the program that has delay (10) in waiting for NTP data and use millis() instead. So that our interrupt in the main program will not be delayed. Thanks!

  do {
    delay ( 10 );
    cb = this->_udp->parsePacket();
    if (timeout > 100) return false; // timeout after 1000 ms
    timeout++;
  }

gibo77 avatar Jul 26 '20 23:07 gibo77

I agree, this is a good suggestion.

DaleSchultz avatar Sep 21 '20 13:09 DaleSchultz

Hi guys, I've prepared a fix for this in PR https://github.com/arduino-libraries/NTPClient/pull/163

mlesniew avatar Jan 28 '22 21:01 mlesniew