diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c04cdae8..56c722e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ### Builds after release 0.12.0 +#### Build 2105200 + +- Fixed WS281x output on ESP32 +- Fixed potential out-of-bounds write in MQTT +- Fixed IR pin not changeable if IR disabled +- Fixed XML API containing -1 on Manual only RGBW mode (see #888, #1783) + #### Build 2105171 - Always copy MQTT payloads to prevent non-0-terminated strings diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index e8e6fc654..e5e5db54c 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -837,7 +837,7 @@ class PolyBus { } //gives back the internal type index (I_XX_XXX_X above) for the input - static uint8_t getI(uint8_t busType, uint8_t* pins, uint8_t num = 0, bool rgbwOverride = false) { + static uint8_t getI(uint8_t busType, uint8_t* pins, uint8_t num = 0) { if (!IS_DIGITAL(busType)) return I_NONE; if (IS_2PIN(busType)) { //SPI LED chips bool isHSPI = false; @@ -863,7 +863,7 @@ class PolyBus { switch (busType) { case TYPE_WS2812_RGB: case TYPE_WS2812_WWA: - return (rgbwOverride ? I_8266_U0_NEO_4 : I_8266_U0_NEO_3) + offset; + return I_8266_U0_NEO_3 + offset; case TYPE_SK6812_RGBW: return I_8266_U0_NEO_4 + offset; case TYPE_WS2811_400KHZ: @@ -877,7 +877,7 @@ class PolyBus { switch (busType) { case TYPE_WS2812_RGB: case TYPE_WS2812_WWA: - return (rgbwOverride ? I_32_R0_NEO_3 : I_32_R0_NEO_4) + offset; + return I_32_R0_NEO_3 + offset; case TYPE_SK6812_RGBW: return I_32_R0_NEO_4 + offset; case TYPE_WS2811_400KHZ: diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 20e25da21..a65d04346 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -165,7 +165,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { } CJSON(touchThreshold,hw[F("btn")][F("tt")]); - #ifndef WLED_DISABLE_INFRARED int hw_ir_pin = hw["ir"]["pin"] | -2; // 4 if (hw_ir_pin > -2) { if (pinManager.allocatePin(hw_ir_pin,false)) { @@ -174,7 +173,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { irPin = -1; } } - #endif CJSON(irEnabled, hw["ir"]["type"]); JsonObject relay = hw[F("relay")]; @@ -555,7 +553,7 @@ void serializeConfig() { JsonObject hw_ir = hw.createNestedObject("ir"); hw_ir["pin"] = irPin; - hw_ir["type"] = irEnabled; // the byte 'irEnabled' does contain the IR-Remote Type ( 0=disabled ) + hw_ir[F("type")] = irEnabled; // the byte 'irEnabled' does contain the IR-Remote Type ( 0=disabled ) JsonObject hw_relay = hw.createNestedObject(F("relay")); hw_relay["pin"] = rlyPin; diff --git a/wled00/mqtt.cpp b/wled00/mqtt.cpp index 23a1bd039..79de0afb8 100644 --- a/wled00/mqtt.cpp +++ b/wled00/mqtt.cpp @@ -64,9 +64,9 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties } //make a copy of the payload to 0-terminate it char* payloadStr = new char[len+1]; + if (payloadStr == nullptr) return; //no mem strncpy(payloadStr, payload, len); payloadStr[len] = '\0'; - if (payloadStr == nullptr) return; //no mem DEBUG_PRINTLN(payloadStr); size_t topicPrefixLen = strlen(mqttDeviceTopic); diff --git a/wled00/set.cpp b/wled00/set.cpp index 8c3de6821..cbeae9d59 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -78,9 +78,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) int t = 0; if (rlyPin>=0 && pinManager.isPinAllocated(rlyPin)) pinManager.deallocatePin(rlyPin); - #ifndef WLED_DISABLE_INFRARED if (irPin>=0 && pinManager.isPinAllocated(irPin)) pinManager.deallocatePin(irPin); - #endif for (uint8_t s=0; s=0 && pinManager.isPinAllocated(btnPin[s])) pinManager.deallocatePin(btnPin[s]); diff --git a/wled00/wled.h b/wled00/wled.h index fb12c7611..9b469fad1 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2105171 +#define VERSION 2105200 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -224,7 +224,11 @@ WLED_GLOBAL bool rlyMde _INIT(true); WLED_GLOBAL bool rlyMde _INIT(RLYMDE); #endif #ifndef IRPIN -WLED_GLOBAL int8_t irPin _INIT(-1); + #ifdef WLED_DISABLE_INFRARED + WLED_GLOBAL int8_t irPin _INIT(-1); + #else + WLED_GLOBAL int8_t irPin _INIT(4); + #endif #else WLED_GLOBAL int8_t irPin _INIT(IRPIN); #endif diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 2650ebf06..79d5c6194 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -51,7 +51,7 @@ void XML_response(AsyncWebServerRequest *request, char* dest) oappend(SET_F("")); oappendi(effectPalette); oappend(SET_F("")); - if (strip.rgbwMode) { + if (strip.isRgbw) { oappendi(col[3]); } else { oappend("-1");