Skip to content

Commit 0825e0c

Browse files
pabloandresmsandeepmistry
authored andcommitted
fixes updateInterval & lastUpdate variable type
1 parent 9dc9ad1 commit 0825e0c

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;
@@ -144,7 +144,7 @@ void NTPClient::setTimeOffset(int timeOffset) {
144144
this->_timeOffset = timeOffset;
145145
}
146146

147-
void NTPClient::setUpdateInterval(int updateInterval) {
147+
void NTPClient::setUpdateInterval(unsigned long updateInterval) {
148148
this->_updateInterval = updateInterval;
149149
}
150150

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
@@ -31,7 +31,7 @@ class NTPClient {
3131
NTPClient(UDP& udp, int timeOffset);
3232
NTPClient(UDP& udp, const char* poolServerName);
3333
NTPClient(UDP& udp, const char* poolServerName, int timeOffset);
34-
NTPClient(UDP& udp, const char* poolServerName, int timeOffset, int updateInterval);
34+
NTPClient(UDP& udp, const char* poolServerName, int timeOffset, unsigned long updateInterval);
3535

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

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

0 commit comments

Comments
 (0)