format check in ntp client

pull/293/head
Peter Buchegger 2023-05-17 21:34:25 +02:00
rodzic 9d6ce8dfac
commit 74e01a76a7
3 zmienionych plików z 124 dodań i 122 usunięć

Wyświetl plik

@ -44,7 +44,7 @@ jobs:
- 'lib/BoardFinder'
- 'lib/ConfigurationManagement'
#- 'lib/Display'
#- 'lib/NTPClient'
- 'lib/NTPClient'
- 'lib/PowerManagement'
- 'lib/System'
#- 'lib/TimeLib'

Wyświetl plik

@ -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