From fc1dd2daac2890e13a1dda4958a6bead38927b45 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Fri, 25 Aug 2023 18:34:11 +0200 Subject: [PATCH] Fix for #3346 --- wled00/bus_manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 7ea44b15..e526ea67 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -144,8 +144,8 @@ void BusDigital::show() { c = RGBW32(_data[offset],_data[offset+1],_data[offset+2],(Bus::hasWhite(_type)?_data[offset+3]:0)); } uint16_t pix = i; - if (_reversed) pix = _len - pix -1; - else pix += _skip; + if (_reversed) pix = _len - pix -1; + pix += _skip; PolyBus::setPixelColor(_busPtr, _iType, pix, c, co); } } @@ -206,8 +206,8 @@ void IRAM_ATTR BusDigital::setPixelColor(uint16_t pix, uint32_t c) { } if (Bus::hasWhite(_type)) _data[offset] = W(c); } else { - if (_reversed) pix = _len - pix -1; - else pix += _skip; + if (_reversed) pix = _len - pix -1; + pix += _skip; uint8_t co = _colorOrderMap.getPixelColorOrder(pix+_start, _colorOrder); if (_type == TYPE_WS2812_1CH_X3) { // map to correct IC, each controls 3 LEDs uint16_t pOld = pix; @@ -237,8 +237,8 @@ uint32_t BusDigital::getPixelColor(uint16_t pix) { } return c; } else { - if (_reversed) pix = _len - pix -1; - else pix += _skip; + if (_reversed) pix = _len - pix -1; + pix += _skip; uint8_t co = _colorOrderMap.getPixelColorOrder(pix+_start, _colorOrder); uint32_t c = restoreColorLossy(PolyBus::getPixelColor(_busPtr, _iType, (_type==TYPE_WS2812_1CH_X3) ? IC_INDEX_WS2812_1CH_3X(pix) : pix, co),_bri); if (_type == TYPE_WS2812_1CH_X3) { // map to correct IC, each controls 3 LEDs