mirror of
https://github.com/scottchiefbaker/ESP-WebOTA.git
synced 2024-08-30 18:12:33 +00:00
Add an alternate if your HTTP server isn't OTAServer
This commit is contained in:
parent
a933ec00da
commit
962f9153b8
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user