Skip to content

Commit

Permalink
Update modes_funcs.cpp - 'WS2812::running' - issue with lenght of sma…
Browse files Browse the repository at this point in the history
…ll segments (kitesurfer1404#337)

ISSUE for 'WS2812::running' : If the length of the Segment is not a multiple of the length of the small segments the small segments are displayed sometimes with a wrong length.
For example: with a Segment length of 60 LEDs and small segments set to SIZE_MEDIUM every 7th has a length of 8 LEDs, but all others are 4 LEDs (in 'Merry Christmas' for yellow color),
With SIZE_LARGE every 4th has a length of 4 LEDs, but all others are 8 LEDs (in 'Merry Christmas' for purpe color).
  • Loading branch information
BlockThor authored Jun 3, 2023
1 parent ef78954 commit 10e15f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modes_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ uint16_t WS2812FX::running(uint32_t color1, uint32_t color2) {
setPixelColor(_seg->start, color);
}

_seg_rt->counter_mode_step = (_seg_rt->counter_mode_step + 1) % _seg_len;
if(_seg_rt->counter_mode_step == 0) SET_CYCLE;
_seg_rt->counter_mode_step++;
if((_seg_rt->counter_mode_step % _seg_len) == 0) SET_CYCLE;
return (_seg->speed / 16);
}

Expand Down

0 comments on commit 10e15f0

Please sign in to comment.