Skip to content

Commit d0f0185

Browse files
authored
bugfix
comparing uint32_t to fastled CRGB does not work.
1 parent e886ece commit d0f0185

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

wled00/FX_2Dfcn.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM:
220220
bool sameColor = false;
221221
if (ledsrgb) { // WLEDMM small optimization
222222
i = XY(x,y);
223-
if ((i < UINT_MAX) && (ledsrgb[i] == col)) sameColor = true;
224-
else ledsrgb[i] = col;
223+
CRGB fastled_col = CRGB(col);
224+
if (ledsrgb[i] == fastled_col) sameColor = true;
225+
else ledsrgb[i] = fastled_col;
225226
}
226227
uint8_t _bri_t = currentBri(on ? opacity : 0);
227228
if (!_bri_t && !transitional) return;
@@ -230,7 +231,7 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM:
230231
}
231232

232233
#if 0 // this is a dangerous optimization
233-
if ((i < UINT_MAX) && sameColor && (ledsrgb[i] == col) && (_globalLeds == nullptr)) return; // WLEDMM looks like nothing to do (but we don't trust globalleds)
234+
if ((i < UINT_MAX) && sameColor && (ledsrgb[i] == CRGB(col)) && (_globalLeds == nullptr)) return; // WLEDMM looks like nothing to do (but we don't trust globalleds)
234235
#endif
235236

236237
if (reverse ) x = virtualWidth() - x - 1;

0 commit comments

Comments
 (0)