mirror of
https://github.com/wled/WLED.git
synced 2025-07-27 12:46:38 +00:00
Allow matrix bigger than LED count (missing panels)
This commit is contained in:
parent
713509527a
commit
b6db86da50
@ -114,10 +114,11 @@ void IRAM_ATTR WS2812FX::setPixelColorXY(int x, int y, uint32_t col)
|
|||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
if (!isMatrix) return; // not a matrix set-up
|
if (!isMatrix) return; // not a matrix set-up
|
||||||
uint16_t index = y * matrixWidth + x;
|
uint16_t index = y * matrixWidth + x;
|
||||||
|
if (index >= customMappingSize) return; // customMappingSize is always W * H of matrix in 2D setup
|
||||||
#else
|
#else
|
||||||
uint16_t index = x;
|
uint16_t index = x;
|
||||||
#endif
|
|
||||||
if (index >= _length) return;
|
if (index >= _length) return;
|
||||||
|
#endif
|
||||||
if (index < customMappingSize) index = customMappingTable[index];
|
if (index < customMappingSize) index = customMappingTable[index];
|
||||||
busses.setPixelColor(index, col);
|
busses.setPixelColor(index, col);
|
||||||
}
|
}
|
||||||
@ -126,10 +127,11 @@ void IRAM_ATTR WS2812FX::setPixelColorXY(int x, int y, uint32_t col)
|
|||||||
uint32_t WS2812FX::getPixelColorXY(uint16_t x, uint16_t y) {
|
uint32_t WS2812FX::getPixelColorXY(uint16_t x, uint16_t y) {
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
uint16_t index = (y * matrixWidth + x);
|
uint16_t index = (y * matrixWidth + x);
|
||||||
|
if (index >= customMappingSize) return 0; // customMappingSize is always W * H of matrix in 2D setup
|
||||||
#else
|
#else
|
||||||
uint16_t index = x;
|
uint16_t index = x;
|
||||||
#endif
|
|
||||||
if (index >= _length) return 0;
|
if (index >= _length) return 0;
|
||||||
|
#endif
|
||||||
if (index < customMappingSize) index = customMappingTable[index];
|
if (index < customMappingSize) index = customMappingTable[index];
|
||||||
return busses.getPixelColor(index);
|
return busses.getPixelColor(index);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user