Fixed /json/cfg unable to set busses (fixes #2589)

This commit is contained in:
cschwinne 2022-03-19 14:21:14 +01:00
parent b93a9cb8bc
commit d280e16723
5 changed files with 12 additions and 4 deletions

View File

@ -2,6 +2,11 @@
### Builds after release 0.13.1
#### Build 2203190
- Fixed `/json/cfg` unable to set busses (#2589)
- Fixed Peek with odd LED counts > 255 (#2586)
#### Build 2203160
- Version bump to v0.13.2-a0 "Toki"

View File

@ -82,6 +82,7 @@ void WS2812FX::finalizeInit(void)
//if busses failed to load, add default (fresh install, FS issue, ...)
if (busses.getNumBusses() == 0) {
DEBUG_PRINTLN(F("No busses, init default"));
const uint8_t defDataPins[] = {DATA_PINS};
const uint16_t defCounts[] = {PIXEL_COUNTS};
const uint8_t defNumBusses = ((sizeof defDataPins) / (sizeof defDataPins[0]));

View File

@ -116,7 +116,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
bool reversed = elm["rev"];
bool refresh = elm["ref"] | false;
ledType |= refresh << 7; // hack bit 7 to indicate strip requires off refresh
s++;
if (fromFS) {
BusConfig bc = BusConfig(ledType, pins, start, length, colorOrder, reversed, skipFirst);
mem += BusManager::memUsage(bc);
@ -126,6 +125,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
busConfigs[s] = new BusConfig(ledType, pins, start, length, colorOrder, reversed, skipFirst);
doInitBusses = true;
}
s++;
}
// finalization done in beginStrip()
}
@ -455,7 +455,9 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
}
if (fromFS) return needsSave;
// if from /json/cfg
doReboot = doc[F("rb")] | doReboot;
if (doInitBusses) return false; // no save needed, will do after bus init in wled.cpp loop
return (doc["sv"] | true);
}

View File

@ -28,7 +28,7 @@ void WLED::reset()
yield(); // enough time to send response to client
}
applyBri();
DEBUG_PRINTLN(F("MODULE RESET"));
DEBUG_PRINTLN(F("WLED RESET"));
ESP.restart();
}
@ -152,7 +152,7 @@ void WLED::loop()
yield();
if (doReboot)
if (doReboot && !doInitBusses) // if busses have to be inited & saved, wait until next iteration
reset();
if (doCloseFile) {
closeFile();

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2203160
#define VERSION 2203190
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG