bugfix: ledmap.json discarded too early

* added missing check for "ledmap.json" file => always applied
* added missing check for ledmap1...10
* setupMatrix test for "unity" ledmap was too early - removed (need to find a better place for this)
This commit is contained in:
Frank
2025-12-30 15:46:47 +01:00
committed by GitHub
parent 4521ba848c
commit 617ea8fa04

View File

@@ -48,8 +48,7 @@ void WS2812FX::setUpMatrix() {
// WLEDMM check if mapping table is necessary (avoiding heap fragmentation)
//#if defined(WLED_ENABLE_HUB75MATRIX)
bool needLedMap = (loadedLedmap >0); // ledmap loaded
needLedMap |= WLED_FS.exists(F("/2d-gaps.json")); // gapFile found
bool needLedMap = (loadedLedmap >0); // ledmap loaded
needLedMap |= panel.size() > 1; // 2D config: more than one panel
if (panel.size() == 1) {
Panel &p = panel[0];
@@ -58,6 +57,11 @@ void WS2812FX::setUpMatrix() {
needLedMap |= p.bottomStart | p.rightStart; // panel not top left, or not left->light
needLedMap |= (p.xOffset > 0) || (p.yOffset > 0); // panel does not start at (0,0)
}
needLedMap |= (ledMaps >1) && (loadedLedmap >0); // ledmap1...10 loaded
if (!needLedMap) { // only perform file cheking if we must (may cause flicker)
needLedMap |= WLED_FS.exists(F("/2d-gaps.json")); // gapFile found
needLedMap |= WLED_FS.exists(F("/ledmap.json")); // global ledmap found
}
//#else
// bool needLedMap = true; // un-comment to always use ledMaps on non-HUB75 builds
//#endif
@@ -172,6 +176,7 @@ void WS2812FX::setUpMatrix() {
}
}
#if 0 // WLEDMM this test is too early - ledmap will be loaded later
#ifdef WLED_ENABLE_HUB75MATRIX
// softhack007 hack: delete mapping table in case it only contains "identity"
if (customMappingTable != nullptr && customMappingTableSize > 0) {
@@ -188,6 +193,7 @@ void WS2812FX::setUpMatrix() {
}
}
#endif
#endif
#else
isMatrix = false; // no matter what config says