Initialize last value to millis()

This commit is contained in:
James Fowkes 2020-07-23 15:06:01 +01:00
parent 59033c620e
commit 830a1d4a29

View File

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