Skip to content

Commit 2ac4d03

Browse files
committed
Fixes first pixel not being set in Stream FX (#4542)
* Fixes first pixel not being set * added fix to Stream 2 as well
1 parent cc4a4c4 commit 2ac4d03

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wled00/FX.cpp

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

10921092
unsigned z = it % zoneSize;
10931093
bool nzone = (!z && it != SEGENV.aux1);
1094-
for (unsigned i=SEGLEN-1; i > 0; i--) {
1094+
for (int i=SEGLEN-1; i >= 0; i--) {
10951095
if (nzone || z >= zoneSize) {
10961096
unsigned lastrand = PRNG16 >> 8;
10971097
int16_t diff = 0;
@@ -1739,7 +1739,7 @@ uint16_t mode_random_chase(void) {
17391739
uint32_t color = SEGENV.step;
17401740
random16_set_seed(SEGENV.aux0);
17411741

1742-
for (unsigned i = SEGLEN -1; i > 0; i--) {
1742+
for (int i = SEGLEN -1; i >= 0; i--) {
17431743
uint8_t r = random8(6) != 0 ? (color >> 16 & 0xFF) : random8();
17441744
uint8_t g = random8(6) != 0 ? (color >> 8 & 0xFF) : random8();
17451745
uint8_t b = random8(6) != 0 ? (color & 0xFF) : random8();

0 commit comments

Comments
 (0)