Correctly using NTPClient. Now with callback.
This commit is contained in:
1 parent
26761226d0
commit
158847d4c4
3 files changed
+14
-133
No files matched your search
+10
-1
@@ -1,4 +1,13 @@
|
||||
#include "ntp.h"
|
||||
#include <ntp.h>
|
||||
#include "my_fastled.h"
|
||||
|
||||
void updateCallback(NTPClient* c) {
|
||||
random16_add_entropy(c->getEpochMillis() & 0xFFFF);
|
||||
}
|
||||
|
||||
WiFiUDP ntpUDP;
|
||||
NTPClient ntpClient(ntpUDP, NTP_SERVER, NTP_OFFSET, NTP_INTERVAL);
|
||||
|
||||
void ntp_setup() {
|
||||
ntpClient.setUpdateCallback(updateCallback);
|
||||
}
|
||||
Reference in new issue
Block a user