BUGFIX: Use unsigned variables for things that can't be negative (#8)

This commit is contained in:
Scott Baker 2020-04-29 10:25:40 -07:00
parent ca6c74bf17
commit 323ccbead5
2 changed files with 3 additions and 3 deletions

View File

@ -201,8 +201,8 @@ int WebOTA::add_http_routes(WebServer *server, const char *path) {
// If the MCU is in a delay() it cannot respond to HTTP OTA requests
// We do a "fake" looping delay and listen for incoming HTTP requests while waiting
void WebOTA::delay(int ms) {
int last = millis();
void WebOTA::delay(unsigned int ms) {
unsigned int last = millis();
while ((millis() - last) < ms) {
OTAServer.handleClient();

View File

@ -16,7 +16,7 @@ class WebOTA {
int init(const unsigned int port, const char *path);
int init(const unsigned int port);
int init();
void delay(int ms);
void delay(unsigned int ms);
#ifdef ESP8266
int add_http_routes(ESP8266WebServer *server, const char *path);