kopia lustrzana https://github.com/lora-aprs/LoRa_APRS_iGate
format check in ntp client
rodzic
9d6ce8dfac
commit
74e01a76a7
|
@ -44,7 +44,7 @@ jobs:
|
|||
- 'lib/BoardFinder'
|
||||
- 'lib/ConfigurationManagement'
|
||||
#- 'lib/Display'
|
||||
#- 'lib/NTPClient'
|
||||
- 'lib/NTPClient'
|
||||
- 'lib/PowerManagement'
|
||||
- 'lib/System'
|
||||
#- 'lib/TimeLib'
|
||||
|
|
|
@ -90,7 +90,8 @@ bool NTPClient::forceUpdate() {
|
|||
do {
|
||||
delay(10);
|
||||
cb = this->_udp.parsePacket();
|
||||
if (timeout > 100) return false; // timeout after 1000 ms
|
||||
if (timeout > 100)
|
||||
return false; // timeout after 1000 ms
|
||||
timeout++;
|
||||
} while (cb == 0);
|
||||
|
||||
|
@ -112,7 +113,8 @@ bool NTPClient::forceUpdate() {
|
|||
bool NTPClient::update() {
|
||||
if ((millis() - this->_lastUpdate >= this->_updateInterval) // Update after _updateInterval
|
||||
|| this->_lastUpdate == 0) { // Update if there was no update yet.
|
||||
if (!this->_udpSetup || this->_port != NTP_DEFAULT_LOCAL_PORT) this->begin(this->_port); // setup the UDP client if needed
|
||||
if (!this->_udpSetup || this->_port != NTP_DEFAULT_LOCAL_PORT)
|
||||
this->begin(this->_port); // setup the UDP client if needed
|
||||
return this->forceUpdate();
|
||||
}
|
||||
return false; // return false if update does not occur
|
||||
|
|
Ładowanie…
Reference in New Issue