Skip to content

Commit

Permalink
Fixed /json/cfg unable to set busses (fixes Aircoookie#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Mar 19, 2022
1 parent b93a9cb commit d280e16
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
Expand Down
4 changes: 3 additions & 1 deletion wled00/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
}
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions wled00/wled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d280e16

Please sign in to comment.