From ffab9bb8935c76eab58deb9e6f524990172434c9 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 5 Apr 2021 21:14:36 +0200 Subject: [PATCH 1/3] Ledmap multisegment fix. --- wled00/FX_fcn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 58343c089..1a07dc1a5 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -192,8 +192,8 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) for (uint16_t j = 0; j < SEGMENT.grouping; j++) { int16_t indexSet = realIndex + (reversed ? -j : j); - if (indexSet < customMappingSize) indexSet = customMappingTable[indexSet]; if (indexSet >= SEGMENT.start && indexSet < SEGMENT.stop) { + if (indexSet < customMappingSize) indexSet = customMappingTable[indexSet]; busses.setPixelColor(indexSet + skip, col); if (IS_MIRROR) { //set the corresponding mirrored pixel uint16_t indexMir = SEGMENT.stop - indexSet + SEGMENT.start - 1; From 90da471084238fde83741c161e457bf93044bc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Tue, 6 Apr 2021 07:48:12 +0200 Subject: [PATCH 2/3] Fix for mirrored segments. --- wled00/FX_fcn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 1a07dc1a5..257307d96 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -193,13 +193,13 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) for (uint16_t j = 0; j < SEGMENT.grouping; j++) { int16_t indexSet = realIndex + (reversed ? -j : j); if (indexSet >= SEGMENT.start && indexSet < SEGMENT.stop) { - if (indexSet < customMappingSize) indexSet = customMappingTable[indexSet]; - busses.setPixelColor(indexSet + skip, col); if (IS_MIRROR) { //set the corresponding mirrored pixel uint16_t indexMir = SEGMENT.stop - indexSet + SEGMENT.start - 1; if (indexMir < customMappingSize) indexMir = customMappingTable[indexMir]; busses.setPixelColor(indexMir + skip, col); } + if (indexSet < customMappingSize) indexSet = customMappingTable[indexSet]; + busses.setPixelColor(indexSet + skip, col); } } } else { //live data, etc. From 789c00dde12634a9db415e012d06550f3d0370e5 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Tue, 6 Apr 2021 11:42:21 +0200 Subject: [PATCH 3/3] Change indexSet to signed 32 bit --- wled00/FX_fcn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 257307d96..9e0e7990e 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -191,7 +191,7 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) uint16_t realIndex = realPixelIndex(i); for (uint16_t j = 0; j < SEGMENT.grouping; j++) { - int16_t indexSet = realIndex + (reversed ? -j : j); + int indexSet = realIndex + (reversed ? -j : j); if (indexSet >= SEGMENT.start && indexSet < SEGMENT.stop) { if (IS_MIRROR) { //set the corresponding mirrored pixel uint16_t indexMir = SEGMENT.stop - indexSet + SEGMENT.start - 1;