Skip to content

Commit 195e167

Browse files
committed
move ntp configuration during setup
1 parent 61367b2 commit 195e167

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

UNOR4USBBridge/UNOR4USBBridge.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ void setup() {
162162
/* Set up wifi event */
163163
WiFi.onEvent(CAtHandler::onWiFiEvent);
164164

165+
/* Configure ntp */
166+
configTime(0, 0, "pool.ntp.org");
167+
165168
Debug.setDebugOutputStream(&USBSerial);
166169
Debug.setDebugLevel(DBG_ERROR);
167170

UNOR4USBBridge/cmds_esp_generic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ void CAtHandler::add_cmds_esp_generic() {
369369
case chAT::CommandMode::Write: {
370370
char epoch[12]; // gettime
371371
constexpr uint32_t SECS_YR_2000 = 946684800UL; // the time at the start of y2k
372-
configTime(0, 0, "pool.ntp.org");
373372
time_t now = time(nullptr);
374373

375374
if (now < SECS_YR_2000) {

0 commit comments

Comments
 (0)