Skip to content

Commit f3c832d

Browse files
committed
gettime: avoid blocking if no internet connection
1 parent d844373 commit f3c832d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

UNOR4USBBridge/cmds_esp_generic.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,8 @@ void CAtHandler::add_cmds_esp_generic() {
373373
configTime(0, 0, "pool.ntp.org");
374374
time_t now = time(nullptr);
375375

376-
while (now < SECS_YR_2000) {
377-
delay(100);
378-
now = time(nullptr);
376+
if (now < SECS_YR_2000) {
377+
now = 0;
379378
}
380379

381380
srv.write_response_prompt();

0 commit comments

Comments
 (0)