Correctly using NTPClient. Now with callback.
This commit is contained in:
11
src/ntp.cpp
11
src/ntp.cpp
@ -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