From 4d53e0adde054519e84b5bc1b637452980ff9975 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Sat, 8 Feb 2025 16:45:33 +0100 Subject: [PATCH] Fixes first pixel not being set in Stream FX (#4542) * Fixes first pixel not being set * added fix to Stream 2 as well --- wled00/FX.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 216cd7a3fd..e8a674b4f7 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -1134,7 +1134,7 @@ uint16_t mode_running_random(void) { unsigned z = it % zoneSize; bool nzone = (!z && it != SEGENV.aux1); - for (unsigned i=SEGLEN-1; i > 0; i--) { + for (int i=SEGLEN-1; i >= 0; i--) { if (nzone || z >= zoneSize) { unsigned lastrand = PRNG16 >> 8; int16_t diff = 0; @@ -1768,7 +1768,7 @@ uint16_t mode_random_chase(void) { uint32_t color = SEGENV.step; random16_set_seed(SEGENV.aux0); - for (unsigned i = SEGLEN -1; i > 0; i--) { + for (int i = SEGLEN -1; i >= 0; i--) { uint8_t r = random8(6) != 0 ? (color >> 16 & 0xFF) : random8(); uint8_t g = random8(6) != 0 ? (color >> 8 & 0xFF) : random8(); uint8_t b = random8(6) != 0 ? (color & 0xFF) : random8();