Skip to content

Commit 680bce8

Browse files
DedeHaiPluto1010
authored andcommitted
BUGFIX in oscillate FX (wled#4494)
effect was changed from int to uint but it relied on negative numbers. fixed by checking overflow and a cast.
1 parent c00ec3f commit 680bce8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wled00/FX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ uint16_t mode_oscillate(void) {
18771877
uint32_t color = BLACK;
18781878
for (unsigned j = 0; j < numOscillators; j++) {
18791879
if((int)i >= (int)oscillators[j].pos - oscillators[j].size && i <= oscillators[j].pos + oscillators[j].size) {
1880-
color = (color == BLACK) ? SEGCOLOR(j) : color_blend(color, SEGCOLOR(j), 128);
1880+
color = (color == BLACK) ? SEGCOLOR(j) : color_blend(color, SEGCOLOR(j), uint8_t(128));
18811881
}
18821882
}
18831883
SEGMENT.setPixelColor(i, color);

0 commit comments

Comments
 (0)