From cd2a52193b31b6acc09ca04c3e65e594cd1f71e2 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 21 Oct 2022 21:43:07 +0200 Subject: [PATCH] make 2D Pulser work again 2D_Pulser was broken. whodunit? This should make it work again. --- wled00/FX.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 42bc94d6..5dce1edb 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -5347,7 +5347,7 @@ static const char _data_FX_MODE_2DPOLARLIGHTS[] PROGMEM = "Polar Lights@Speed,Sc uint16_t mode_2DPulser(void) { // By: ldirko https://editor.soulmatelights.com/gallery/878-pulse-test , modifed by: Andrew Tuline if (!strip.isMatrix) return mode_static(); // not a 2D set-up - //const uint16_t cols = SEGMENT.virtualWidth(); + const uint16_t cols = SEGMENT.virtualWidth(); // WLEDSR bugfix const uint16_t rows = SEGMENT.virtualHeight(); if (SEGENV.call == 0) { @@ -5357,8 +5357,8 @@ uint16_t mode_2DPulser(void) { // By: ldirko https://edi SEGMENT.fadeToBlackBy(8 - (SEGMENT.intensity>>5)); - uint16_t a = strip.now / (18 - SEGMENT.speed / 16); - uint16_t x = (a / 14); + uint32_t a = strip.now / (18 - SEGMENT.speed / 16); + uint16_t x = (a / 14) % cols; // WLEDSR bugfix uint16_t y = map((sin8(a * 5) + sin8(a * 4) + sin8(a * 2)), 0, 765, rows-1, 0); SEGMENT.setPixelColorXY(x, y, ColorFromPalette(SEGPALETTE, map(y, 0, rows-1, 0, 255), 255, LINEARBLEND));