POC to use leds array in strip.set/getPixelColor

This commit is contained in:
ewowi
2022-07-31 12:38:10 +02:00
parent a70717f2f7
commit 66da57f375
3 changed files with 33 additions and 3 deletions

View File

@@ -116,6 +116,8 @@ void IRAM_ATTR WS2812FX::setPixelColorXY(int x, int y, uint32_t col)
uint16_t index = y * matrixWidth + x;
if (index >= _length) return;
if (index < customMappingSize) index = customMappingTable[index];
if (useLedsArray)
leds[index] = col;
busses.setPixelColor(index, col);
#endif
}
@@ -126,7 +128,10 @@ uint32_t WS2812FX::getPixelColorXY(uint16_t x, uint16_t y) {
uint16_t index = (y * matrixWidth + x);
if (index >= _length) return 0;
if (index < customMappingSize) index = customMappingTable[index];
return busses.getPixelColor(index);
if (useLedsArray)
return leds[index];
else
return busses.getPixelColor(index);
#else
return 0;
#endif