From c0dd98b6d74581c25e5a717589ba47f69e7be90d Mon Sep 17 00:00:00 2001 From: cschwinne Date: Thu, 4 Mar 2021 12:10:18 +0100 Subject: [PATCH 1/4] Fixed relay mode inverted when upgrading from 0.11.0 --- CHANGELOG.md | 14 ++++++++++++++ wled00/cfg.cpp | 22 +++++++++++++--------- wled00/json.cpp | 4 ++-- wled00/wled.h | 5 +++-- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cbda3f6..b90934d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ ### Development versions after 0.11.1 release +#### Build 2103040 + +- Fixed relay mode inverted when upgrading from 0.11.0 +- Fixed no more than 2 pins per bus configurable in UI +- Changed to non-linear IR brightness steps (PR #1742) +- Fixed various warnings (PR #1744) +- Added UDP DNRGBW Mode (PR #1704) +- Added dynamic LED mapping with ledmap.json file (PR #1738) +- Added support for QuinLED-ESP32-Ethernet board +- Added support for WESP32 ethernet board (PR #1764) +- Added Caching for main UI (PR #1704) +- Added Tetrix mode (PR #1729) +- Added memory check on Bus creation + #### Build 2102050 - Version bump to 0.12.0-a0 "Hikari" diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index a3d690dc..e5c00b34 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -30,8 +30,8 @@ void deserializeConfig() { return; } - //int rev_major = doc[F("rev")][0]; // 1 - //int rev_minor = doc[F("rev")][1]; // 0 + //int rev_major = doc["rev"][0]; // 1 + //int rev_minor = doc["rev"][1]; // 0 //long vid = doc[F("vid")]; // 2010020 @@ -95,7 +95,7 @@ void deserializeConfig() { CJSON(strip.ablMilliampsMax, hw_led[F("maxpwr")]); CJSON(strip.milliampsPerLed, hw_led[F("ledma")]); - CJSON(strip.reverseMode, hw_led[F("rev")]); + CJSON(strip.reverseMode, hw_led["rev"]); CJSON(strip.rgbwMode, hw_led[F("rgbwm")]); JsonArray ins = hw_led["ins"]; @@ -126,7 +126,7 @@ void deserializeConfig() { //limit length of strip if it would exceed total configured LEDs if (start + length > ledCount) length = ledCount - start; uint8_t ledType = elm[F("type")] | TYPE_WS2812_RGB; - bool reversed = elm[F("rev")]; + bool reversed = elm["rev"]; //RGBW mode is enabled if at least one of the strips is RGBW useRGBW = (useRGBW || BusManager::isRgbw(ledType)); s++; @@ -163,14 +163,18 @@ void deserializeConfig() { #endif CJSON(irEnabled, hw[F("ir")][F("type")]); - int hw_relay_pin = hw[F("relay")][F("pin")]; + JsonObject relay = hw[F("relay")]; + + int hw_relay_pin = relay[F("pin")]; if (pinManager.allocatePin(hw_relay_pin,true)) { rlyPin = hw_relay_pin; pinMode(rlyPin, OUTPUT); } else { rlyPin = -1; } - CJSON(rlyMde, hw[F("relay")][F("rev")]); + if (relay.containsKey("rev")) { + rlyMde = !relay["rev"]; + } //int hw_status_pin = hw[F("status")][F("pin")]; // -1 @@ -443,7 +447,7 @@ void serializeConfig() { hw_led[F("total")] = ledCount; hw_led[F("maxpwr")] = strip.ablMilliampsMax; hw_led[F("ledma")] = strip.milliampsPerLed; - hw_led[F("rev")] = strip.reverseMode; + hw_led["rev"] = strip.reverseMode; hw_led[F("rgbwm")] = strip.rgbwMode; JsonArray hw_led_ins = hw_led.createNestedArray("ins"); @@ -460,7 +464,7 @@ void serializeConfig() { uint8_t nPins = bus->getPins(pins); for (uint8_t i = 0; i < nPins; i++) ins_pin.add(pins[i]); ins[F("order")] = bus->getColorOrder(); - ins[F("rev")] = bus->reversed; + ins["rev"] = bus->reversed; ins[F("skip")] = (skipFirstLed && s == 0) ? 1 : 0; ins[F("type")] = bus->getType(); } @@ -491,7 +495,7 @@ void serializeConfig() { JsonObject hw_relay = hw.createNestedObject("relay"); hw_relay[F("pin")] = rlyPin; - hw_relay[F("rev")] = rlyMde; + hw_relay["rev"] = !rlyMde; //JsonObject hw_status = hw.createNestedObject("status"); //hw_status[F("pin")] = -1; diff --git a/wled00/json.cpp b/wled00/json.cpp index 4b4714ac..0b14bc90 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -87,7 +87,7 @@ void deserializeSegment(JsonObject elem, byte it) //if (pal != seg.palette && pal < strip.getPaletteCount()) strip.setPalette(pal); seg.setOption(SEG_OPTION_SELECTED, elem[F("sel")] | seg.getOption(SEG_OPTION_SELECTED)); - seg.setOption(SEG_OPTION_REVERSED, elem[F("rev")] | seg.getOption(SEG_OPTION_REVERSED)); + seg.setOption(SEG_OPTION_REVERSED, elem["rev"] | seg.getOption(SEG_OPTION_REVERSED)); seg.setOption(SEG_OPTION_MIRROR , elem[F("mi")] | seg.getOption(SEG_OPTION_MIRROR )); //temporary, strip object gets updated via colorUpdated() @@ -327,7 +327,7 @@ void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id, bool fo root[F("ix")] = seg.intensity; root[F("pal")] = seg.palette; root[F("sel")] = seg.isSelected(); - root[F("rev")] = seg.getOption(SEG_OPTION_REVERSED); + root["rev"] = seg.getOption(SEG_OPTION_REVERSED); root[F("mi")] = seg.getOption(SEG_OPTION_MIRROR); } diff --git a/wled00/wled.h b/wled00/wled.h index b6e8cfff..2a239b9c 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2102050 +#define VERSION 2103040 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -197,8 +197,9 @@ WLED_GLOBAL int8_t rlyPin _INIT(-1); #else WLED_GLOBAL int8_t rlyPin _INIT(RLYPIN); #endif +//Relay mode (1 = active high, 0 = active low, flipped in cfg.json) #ifndef RLYMDE -WLED_GLOBAL bool rlyMde _INIT(1); +WLED_GLOBAL bool rlyMde _INIT(true); #else WLED_GLOBAL bool rlyMde _INIT(RLYMDE); #endif From 05521bfd3a73393d6c7066931e08fcc85e1c3ff6 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Thu, 4 Mar 2021 22:17:25 +0100 Subject: [PATCH 2/4] Added destructor for BusPwm (fixes #1789) --- CHANGELOG.md | 4 ++++ wled00/bus_manager.h | 4 ++++ wled00/wled.h | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b90934d8..ef77e9e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Development versions after 0.11.1 release +#### Build 2103041 + +- Added destructor for BusPwm (fixes #1789) + #### Build 2103040 - Fixed relay mode inverted when upgrading from 0.11.0 diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index 51965150..bc04452d 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -268,6 +268,10 @@ class BusPwm : public Bus { deallocatePins(); } + ~BusPwm() { + cleanup(); + } + private: uint8_t _pins[5] = {255, 255, 255, 255, 255}; uint8_t _data[5] = {255, 255, 255, 255, 255}; diff --git a/wled00/wled.h b/wled00/wled.h index 2a239b9c..e9a779a4 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2103040 +#define VERSION 2103041 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG From 71edc3a084cd496d7ca27c68d961d39202b96bc9 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sat, 6 Mar 2021 02:35:49 +0100 Subject: [PATCH 3/4] Fixed incorrect over-memory indication in LED settings on ESP32 --- CHANGELOG.md | 4 ++++ wled00/bus_manager.h | 1 - wled00/data/settings_leds.htm | 24 ++++++++++++++---------- wled00/html_settings.h | 2 +- wled00/set.cpp | 1 - wled00/wled.cpp | 5 ++--- wled00/wled.h | 2 +- wled00/xml.cpp | 6 ++++-- 8 files changed, 26 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef77e9e4..b2ceceb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Development versions after 0.11.1 release +#### Build 2103050 + +- Fixed incorrect over-memory indication in LED settings on ESP32 + #### Build 2103041 - Added destructor for BusPwm (fixes #1789) diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index bc04452d..d668f1ae 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -47,7 +47,6 @@ class Bus { virtual void cleanup() {}; virtual ~Bus() { //throw the bus under the bus - //Serial.println("Destructor!"); } virtual uint8_t getPins(uint8_t* pinArray) { return 0; } diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 9c92af3b..49638abf 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -5,7 +5,7 @@ LED Settings