Skip to content

Commit

Permalink
Fix segments when reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Feb 16, 2020
1 parent 92a9d7d commit 3b52770
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w)
/* Set all the pixels in the group, ensuring _skipFirstMode is honored */
bool reversed = reverseMode ^ IS_REVERSE;
uint16_t realIndex = realPixelIndex(i);

for (uint16_t j = 0; j < SEGMENT.grouping; j++) {
int16_t indexSet = realIndex + (reversed ? -j : j);
if (indexSet >= SEGMENT.start && indexSet < SEGMENT.stop) bus->SetPixelColor(indexSet + skip, col);
int16_t indexSetRev = indexSet;
if (reverseMode) indexSetRev = _length - 1 - indexSet;
if (indexSetRev >= SEGMENT.start && indexSetRev < SEGMENT.stop) bus->SetPixelColor(indexSet + skip, col);
}
} else { //live data, etc.
if (reverseMode) i = _length - 1 - i;
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#endif

//version code in format yymmddb (b = daily build)
#define VERSION 2002021
#define VERSION 2002161

char versionString[] = "0.9.1";

Expand Down

0 comments on commit 3b52770

Please sign in to comment.