Skip to content

Commit

Permalink
Enumeration support.
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Nov 9, 2024
1 parent 9fa53cc commit ba5ec57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,6 @@ bool WS2812FX::deserializeMap(uint8_t n) {
StaticJsonDocument<64> filter;
filter[F("width")] = true;
filter[F("height")] = true;
filter[F("name")] = true;
if (!readObjectFromFile(fileName, nullptr, pDoc, &filter)) {
DEBUG_PRINT(F("ERROR Invalid ledmap in ")); DEBUG_PRINTLN(fileName);
releaseJSONBufferLock();
Expand Down
4 changes: 3 additions & 1 deletion wled00/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ um_data_t* simulateSound(uint8_t simulationId)
static const char s_ledmap_tmpl[] PROGMEM = "ledmap%d.json";
// enumerate all ledmapX.json files on FS and extract ledmap names if existing
void enumerateLedmaps() {
StaticJsonDocument<64> filter;
filter["n"] = true;
ledMaps = 1;
for (size_t i=1; i<WLED_MAX_LEDMAPS; i++) {
char fileName[33] = "/";
Expand All @@ -511,7 +513,7 @@ void enumerateLedmaps() {

#ifndef ESP8266
if (requestJSONBufferLock(21)) {
if (readObjectFromFile(fileName, nullptr, pDoc)) {
if (readObjectFromFile(fileName, nullptr, pDoc, &filter)) {
size_t len = 0;
JsonObject root = pDoc->as<JsonObject>();
if (!root["n"].isNull()) {
Expand Down

0 comments on commit ba5ec57

Please sign in to comment.