Skip to content

Commit 4d53e0a

Browse files
authored
Fixes first pixel not being set in Stream FX (wled#4542)
* Fixes first pixel not being set * added fix to Stream 2 as well
1 parent 35f8736 commit 4d53e0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wled00/FX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ uint16_t mode_running_random(void) {
11341134

11351135
unsigned z = it % zoneSize;
11361136
bool nzone = (!z && it != SEGENV.aux1);
1137-
for (unsigned i=SEGLEN-1; i > 0; i--) {
1137+
for (int i=SEGLEN-1; i >= 0; i--) {
11381138
if (nzone || z >= zoneSize) {
11391139
unsigned lastrand = PRNG16 >> 8;
11401140
int16_t diff = 0;
@@ -1768,7 +1768,7 @@ uint16_t mode_random_chase(void) {
17681768
uint32_t color = SEGENV.step;
17691769
random16_set_seed(SEGENV.aux0);
17701770

1771-
for (unsigned i = SEGLEN -1; i > 0; i--) {
1771+
for (int i = SEGLEN -1; i >= 0; i--) {
17721772
uint8_t r = random8(6) != 0 ? (color >> 16 & 0xFF) : random8();
17731773
uint8_t g = random8(6) != 0 ? (color >> 8 & 0xFF) : random8();
17741774
uint8_t b = random8(6) != 0 ? (color & 0xFF) : random8();

0 commit comments

Comments
 (0)