mirror of
https://github.com/wled/WLED.git
synced 2025-07-23 10:46:33 +00:00
Fix for #3926
This commit is contained in:
parent
6f3d7e76c9
commit
127ea7e351
@ -1664,12 +1664,18 @@ bool WS2812FX::deserializeMap(uint8_t n) {
|
|||||||
return false; // if file does not load properly then exit
|
return false; // if file does not load properly then exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JsonObject root = pDoc->as<JsonObject>();
|
||||||
|
// if we are loading default ledmap (at boot) set matrix width and height from the ledmap (compatible with WLED MM ledmaps)
|
||||||
|
if (isMatrix && n == 0 && (!root[F("width")].isNull() || !root[F("height")].isNull())) {
|
||||||
|
Segment::maxWidth = min(max(root[F("width")].as<int>(), 1), 128);
|
||||||
|
Segment::maxHeight = min(max(root[F("height")].as<int>(), 1), 128);
|
||||||
|
}
|
||||||
|
|
||||||
if (customMappingTable) delete[] customMappingTable;
|
if (customMappingTable) delete[] customMappingTable;
|
||||||
customMappingTable = new uint16_t[getLengthTotal()];
|
customMappingTable = new uint16_t[getLengthTotal()];
|
||||||
|
|
||||||
if (customMappingTable) {
|
if (customMappingTable) {
|
||||||
DEBUG_PRINT(F("Reading LED map from ")); DEBUG_PRINTLN(fileName);
|
DEBUG_PRINT(F("Reading LED map from ")); DEBUG_PRINTLN(fileName);
|
||||||
JsonObject root = pDoc->as<JsonObject>();
|
|
||||||
JsonArray map = root[F("map")];
|
JsonArray map = root[F("map")];
|
||||||
if (!map.isNull() && map.size()) { // not an empty map
|
if (!map.isNull() && map.size()) { // not an empty map
|
||||||
customMappingSize = min((unsigned)map.size(), (unsigned)getLengthTotal());
|
customMappingSize = min((unsigned)map.size(), (unsigned)getLengthTotal());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user