Correctly using NTPClient. Now with callback.

This commit is contained in:
2019-06-06 06:43:01 +02:00
parent 26761226d0
commit 158847d4c4
3 changed files with 14 additions and 133 deletions

View File

@ -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);
}