Add an alternate if your HTTP server isn't OTAServer

This commit is contained in:
Scott Baker 2019-03-14 14:50:29 -07:00
parent a933ec00da
commit 962f9153b8
2 changed files with 12 additions and 0 deletions

View File

@ -161,3 +161,13 @@ void webota_delay(int ms) {
delay(5);
}
}
// Accept the HTTP server as a pointer
void webota_delay(int ms, WebServer *HTTPServer) {
int last = millis();
while ((millis() - last) < ms) {
HTTPServer->handleClient();
delay(5);
}
}

View File

@ -6,4 +6,6 @@ int init_wifi(const char *ssid, const char *password, const char *mdns_hostname)
String ip2string(IPAddress ip);
int init_mdns(const char *host);
int init_web_ota(WebServer *server);
void webota_delay(int ms);
void webota_delay(int ms, WebServer *HTTPServer);