From c5d7e42faac79fd7832e1a07c974b576ef90547c Mon Sep 17 00:00:00 2001 From: Troy <5659019+troyhacks@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:39:19 -0500 Subject: [PATCH] Quick hack to adjust color balance on some LEDs --- wled00/bus_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 14e0888a..ba564158 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -74,7 +74,7 @@ uint8_t IRAM_ATTR ColorOrderMap::getPixelColorOrder(uint16_t pix, uint8_t defaul uint8_t swapW = defaultColorOrder >> 4; for (uint8_t i = 0; i < _count; i++) { if (pix >= _mappings[i].start && pix < (_mappings[i].start + _mappings[i].len)) { - return _mappings[i].colorOrder | (swapW << 4); + return _mappings[i].colorOrder | (swapW << 4); // WLED-MM/TroyHacks: Disabling this disables color order mapping. } } return defaultColorOrder; @@ -172,6 +172,10 @@ void IRAM_ATTR BusDigital::setPixelColor(uint16_t pix, uint32_t c) { case 2: c = RGBW32(R(cOld), G(cOld), W(c) , 0); break; } } + if (_colorOrder != co) { + 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 + co = _colorOrder; // keep the original color order, as this is a hack. :) + } PolyBus::setPixelColor(_busPtr, _iType, pix, c, co); }