Skip to content

Commit c5d7e42

Browse files
committed
Quick hack to adjust color balance on some LEDs
1 parent e6395e8 commit c5d7e42

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wled00/bus_manager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ uint8_t IRAM_ATTR ColorOrderMap::getPixelColorOrder(uint16_t pix, uint8_t defaul
7474
uint8_t swapW = defaultColorOrder >> 4;
7575
for (uint8_t i = 0; i < _count; i++) {
7676
if (pix >= _mappings[i].start && pix < (_mappings[i].start + _mappings[i].len)) {
77-
return _mappings[i].colorOrder | (swapW << 4);
77+
return _mappings[i].colorOrder | (swapW << 4); // WLED-MM/TroyHacks: Disabling this disables color order mapping.
7878
}
7979
}
8080
return defaultColorOrder;
@@ -172,6 +172,10 @@ void IRAM_ATTR BusDigital::setPixelColor(uint16_t pix, uint32_t c) {
172172
case 2: c = RGBW32(R(cOld), G(cOld), W(c) , 0); break;
173173
}
174174
}
175+
if (_colorOrder != co) {
176+
c = RGBW32(dim8_lin(R(c)), dim8_lin(G(c)), dim8_lin(B(c)), 0); // WLED-MM/TroyHacks - remap pixels not in the default color order
177+
co = _colorOrder; // keep the original color order, as this is a hack. :)
178+
}
175179
PolyBus::setPixelColor(_busPtr, _iType, pix, c, co);
176180
}
177181

0 commit comments

Comments
 (0)