Skip to content

Commit 47d0e56

Browse files
authored
fixes updateInterval & lastUpdate variable type (#3)
1 parent 13648ec commit 47d0e56

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

NTPClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ NTPClient::NTPClient(UDP& udp, const char* poolServerName, int timeOffset) {
4141
this->_poolServerName = poolServerName;
4242
}
4343

44-
NTPClient::NTPClient(UDP& udp, const char* poolServerName, int timeOffset, int updateInterval) {
44+
NTPClient::NTPClient(UDP& udp, const char* poolServerName, int timeOffset, unsigned long updateInterval) {
4545
this->_udp = &udp;
4646
this->_timeOffset = timeOffset;
4747
this->_poolServerName = poolServerName;
@@ -174,7 +174,7 @@ void NTPClient::setTimeOffset(int timeOffset) {
174174
this->_timeOffset = timeOffset;
175175
}
176176

177-
void NTPClient::setUpdateInterval(int updateInterval) {
177+
void NTPClient::setUpdateInterval(unsigned long updateInterval) {
178178
this->_updateInterval = updateInterval;
179179
}
180180

NTPClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class NTPClient {
1717
int _port = NTP_DEFAULT_LOCAL_PORT;
1818
int _timeOffset = 0;
1919

20-
unsigned int _updateInterval = 60000; // In ms
20+
unsigned long _updateInterval = 60000; // In ms
2121

2222
unsigned long _currentEpoc = 0; // In s
2323
unsigned long _lastUpdate = 0; // In ms
@@ -32,7 +32,7 @@ class NTPClient {
3232
NTPClient(UDP& udp, int timeOffset);
3333
NTPClient(UDP& udp, const char* poolServerName);
3434
NTPClient(UDP& udp, const char* poolServerName, int timeOffset);
35-
NTPClient(UDP& udp, const char* poolServerName, int timeOffset, int updateInterval);
35+
NTPClient(UDP& udp, const char* poolServerName, int timeOffset, unsigned long updateInterval);
3636

3737
/**
3838
* Starts the underlying UDP client with the default local port
@@ -73,7 +73,7 @@ class NTPClient {
7373
* Set the update interval to another frequency. E.g. useful when the
7474
* timeOffset should not be set in the constructor
7575
*/
76-
void setUpdateInterval(int updateInterval);
76+
void setUpdateInterval(unsigned long updateInterval);
7777

7878
/**
7979
* @return time formatted like `hh:mm:ss`

0 commit comments

Comments
 (0)