Compile fix

This commit is contained in:
Blaž Kristan 2025-05-26 18:19:20 +02:00
parent dcd3e07273
commit a147f4120c
2 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@ static bool isIp(const String &str) {
}
static bool inSubnet(const IPAddress &ip, const IPAddress &subnet, const IPAddress &mask) {
return ((ip & mask) == (subnet & mask));
return (((uint32_t)ip & (uint32_t)mask) == ((uint32_t)subnet & (uint32_t)mask));
}
static bool inSameSubnet(const IPAddress &client) {
@ -653,6 +653,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
#endif
case SUBPAGE_UM : content = PAGE_settings_um; len = PAGE_settings_um_length; break;
case SUBPAGE_UPDATE : content = PAGE_update; len = PAGE_update_length;
#ifdef ARDUINO_ARCH_ESP32
if (request->hasArg(F("revert")) && inLocalSubnet(request->client()->remoteIP()) && Update.canRollBack()) {
doReboot = Update.rollBack();
if (doReboot) {
@ -662,6 +663,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
}
return;
}
#endif
break;
#ifndef WLED_DISABLE_2D
case SUBPAGE_2D : content = PAGE_settings_2D; len = PAGE_settings_2D_length; break;

View File

@ -663,6 +663,9 @@ void getSettingsJS(byte subPage, Print& settingsScript)
VERSION);
printSetClassElementHTML(settingsScript,PSTR("sip"),0,tmp_buf);
#ifndef ARDUINO_ARCH_ESP32
settingsScript.print(F("toggle('rev');")); // hide revert button on ESP8266
#endif
}
if (subPage == SUBPAGE_2D) // 2D matrices