We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbe6efd commit 1502d75Copy full SHA for 1502d75
src/SinricProNTP.h
@@ -24,10 +24,22 @@ class myNTP {
24
myNTP() : _timeClient(_udpClient) {}
25
void begin() { _timeClient.begin(); _timeClient.update(); }
26
void update() { _timeClient.update(); }
27
- unsigned long getTimestamp() { return _timeClient.getEpochTime(); }
+ unsigned long getTimestamp();
28
private:
29
WiFiUDP _udpClient;
30
NTPClient _timeClient;
31
};
32
33
+
34
+unsigned long myNTP::getTimestamp() {
35
+ unsigned long timestamp;
36
+ timestamp = _timeClient.getEpochTime();
37
+ while (timestamp < 1572040800) {
38
+ _timeClient.forceUpdate();
39
40
+ yield();
41
+ }
42
+ return timestamp;
43
+}
44
45
#endif // _TIMESTAMP_H_
0 commit comments