From 830a1d4a2930bd56c8db76ae27cc85064f585fcc Mon Sep 17 00:00:00 2001 From: James Fowkes Date: Thu, 23 Jul 2020 15:06:01 +0100 Subject: [PATCH] Initialize last value to millis() --- src/WebOTA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebOTA.cpp b/src/WebOTA.cpp index ea6ad17..46d824a 100644 --- a/src/WebOTA.cpp +++ b/src/WebOTA.cpp @@ -203,7 +203,7 @@ int WebOTA::add_http_routes(WebServer *server, const char *path) { // We do a "fake" looping delay and listen for incoming HTTP requests while waiting void WebOTA::delay(unsigned int ms) { // Borrowed from mshoe007 @ https://github.com/scottchiefbaker/ESP-WebOTA/issues/8 - decltype(millis()) last; + decltype(millis()) last = millis(); while ((millis() - last) < ms) { OTAServer.handleClient();