Ledmaps bugfix
This commit is contained in:
@@ -95,8 +95,10 @@ void WS2812FX::setUpMatrix(bool reset) {
|
|||||||
x = p.serpentine && j%2 ? h-x-1 : x;
|
x = p.serpentine && j%2 ? h-x-1 : x;
|
||||||
uint16_t index = (p.yOffset + (p.vertical?x:y)) * Segment::maxWidth + p.xOffset + (p.vertical?y:x);
|
uint16_t index = (p.yOffset + (p.vertical?x:y)) * Segment::maxWidth + p.xOffset + (p.vertical?y:x);
|
||||||
if (loadedLedmap > 0) {
|
if (loadedLedmap > 0) {
|
||||||
if (index < customMappingSizeLedmap)
|
if (index < customMappingSizeLedmap) {
|
||||||
customMappingTableCombi[customMappingTable[index]] = pix; //WLEDMM: allow for 2 transitions if reset = false (ledmap and logical to physical)
|
if (customMappingTable[index] < customMappingSize)
|
||||||
|
customMappingTableCombi[customMappingTable[index]] = pix; //WLEDMM: allow for 2 transitions if reset = false (ledmap and logical to physical)
|
||||||
|
}
|
||||||
else
|
else
|
||||||
customMappingTableCombi[index] = pix;
|
customMappingTableCombi[index] = pix;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1971,14 +1971,15 @@ void WS2812FX::deserializeMap(uint8_t n) {
|
|||||||
customMappingTable[i] = (uint16_t) 0xFFFFU; //fill the map entirely
|
customMappingTable[i] = (uint16_t) 0xFFFFU; //fill the map entirely
|
||||||
}
|
}
|
||||||
loadedLedmap = n;
|
loadedLedmap = n;
|
||||||
#ifdef WLED_DEBUG
|
|
||||||
|
#ifdef WLED_DEBUG
|
||||||
DEBUG_PRINTF("Custom ledmap: %d\n", loadedLedmap);
|
DEBUG_PRINTF("Custom ledmap: %d\n", loadedLedmap);
|
||||||
for (uint16_t i=0; i<customMappingSize; i++) {
|
for (uint16_t i=0; i<customMappingSize; i++) {
|
||||||
if (!(i%Segment::maxWidth)) DEBUG_PRINTLN();
|
if (!(i%Segment::maxWidth)) DEBUG_PRINTLN();
|
||||||
DEBUG_PRINTF("%4d,", customMappingTable[i]);
|
DEBUG_PRINTF("%4d,", customMappingTable[i]);
|
||||||
}
|
}
|
||||||
DEBUG_PRINTLN();
|
DEBUG_PRINTLN();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setUpMatrix(false); //WLEDMM: apply logical to physical mapping after the ledmap
|
setUpMatrix(false); //WLEDMM: apply logical to physical mapping after the ledmap
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user