diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c5eed51..f9b4a9e96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Builds after release 0.12.0 +#### Build 2104150 + +- Added ability to add multiple busses as compile time defaults using the esp32_multistrip usermod define syntax + #### Build 2104141 - Reduced memory usage by 540b by switching to a different trigonometric approximation diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 26619f641..5b0ea4dc7 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -43,6 +43,23 @@ 19, 18, 17, 16, 15, 20, 21, 22, 23, 24, 29, 28, 27, 26, 25]} */ +//factory defaults LED setup (for multistrip boards) +//#define PIXEL_COUNTS 30, 30, 30, 30 +//#define DATA_PINS 16, 1, 3, 4 +//#define DEFAULT_LED_TYPE TYPE_WS2812_RGB + +#ifndef PIXEL_COUNTS + #define PIXEL_COUNTS 30 +#endif + +#ifndef DATA_PINS + #define DATA_PINS LEDPIN +#endif + +#ifndef DEFAULT_LED_TYPE + #define DEFAULT_LED_TYPE TYPE_WS2812_RGB +#endif + //do not call this method from system context (network callback) void WS2812FX::finalizeInit(void) { @@ -51,24 +68,19 @@ void WS2812FX::finalizeInit(void) //if busses failed to load, add default (fresh install, FS issue, ...) if (busses.getNumBusses() == 0) { - uint8_t defPin[] = {LEDPIN}; - BusConfig defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false); - busses.add(defCfg); - #ifdef LEDPIN1 - defPin[0] = {LEDPIN1}; - defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false); - busses.add(defCfg); - #endif - #ifdef LEDPIN2 - defPin[0] = {LEDPIN2}; - defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false); - busses.add(defCfg); - #endif - #ifdef LEDPIN3 - defPin[0] = {LEDPIN3}; - defCfg = BusConfig(TYPE_WS2812_RGB, defPin, 0, 30, COL_ORDER_GRB, false, false); - busses.add(defCfg); - #endif + const uint8_t defDataPins[] = {DATA_PINS}; + const uint16_t defCounts[] = {PIXEL_COUNTS}; + const uint8_t defDataPinsNo = ((sizeof defDataPins) / (sizeof defDataPins[0])); + const uint8_t defCountsNo = ((sizeof defCounts) / (sizeof defCounts[0])); + uint16_t prevLen = 0; + for (uint8_t i = 0; i < defDataPinsNo; i++) { + uint8_t defPin[] = {defDataPins[i]}; + uint16_t start = prevLen; + uint16_t count = (i < defCountsNo) ? defCounts[i] : defCounts[i>0?i-1:0]; + prevLen += count; + BusConfig defCfg = BusConfig(DEFAULT_LED_TYPE, defPin, start, count, COL_ORDER_GRB); + busses.add(defCfg); + } } deserializeMap(); @@ -81,6 +93,7 @@ void WS2812FX::finalizeInit(void) isRgbw |= bus->isRgbw(); _length += bus->getLength(); } + ledCount = _length; // or we can use busses.getTotalLength() /* //make segment 0 cover the entire strip _segments[0].start = 0; diff --git a/wled00/data/settings_sec.htm b/wled00/data/settings_sec.htm index a5a2a9dcb..df537086a 100644 --- a/wled00/data/settings_sec.htm +++ b/wled00/data/settings_sec.htm @@ -41,7 +41,7 @@ Settings on this page are only changable if OTA lock is disabled!
Deny access to WiFi settings if locked:

Factory reset:
- All EEPROM content (settings) will be erased.

+ All settings and presets will be erased.

HTTP traffic is unencrypted. An attacker in the same network can intercept form data!

Software Update


diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 6fda930da..59d6d5557 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -376,7 +376,7 @@ Disable OTA when not in use, otherwise an attacker can reflash device software!
Settings on this page are only changable if OTA lock is disabled!
Deny access to WiFi settings if locked:

Factory reset:
-All EEPROM content (settings) will be erased.

+All settings and presets will be erased.

HTTP traffic is unencrypted. An attacker in the same network can intercept form data!

Software Update


Enable ArduinoOTA:

About diff --git a/wled00/set.cpp b/wled00/set.cpp index 72f4f58e7..3c595fd17 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -85,7 +85,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) strip.isRgbw = false; -// uint8_t skip = request->hasArg(F("SL")) ? LED_SKIP_AMOUNT : 0; uint8_t colorOrder, type, skip; uint16_t length, start; uint8_t pins[5] = {255, 255, 255, 255, 255}; diff --git a/wled00/wled.h b/wled00/wled.h index 1cb31f66e..2fc5de359 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2104141 +#define VERSION 2104150 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG @@ -228,7 +228,7 @@ WLED_GLOBAL bool noWifiSleep _INIT(false); // disabling #endif // LED CONFIG -WLED_GLOBAL uint16_t ledCount _INIT(30); // overcurrent prevented by ABL +WLED_GLOBAL uint16_t ledCount _INIT(0); // overcurrent prevented by ABL (filled in cfg.cpp, set.cpp or FX_fcn.cpp) WLED_GLOBAL bool turnOnAtBoot _INIT(true); // turn on LEDs at power-up WLED_GLOBAL byte bootPreset _INIT(0); // save preset to load after power-up