From d0f018586e76ee0da35b35cd82437223b03d0ef2 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sat, 20 Apr 2024 22:42:26 +0200 Subject: [PATCH] bugfix comparing uint32_t to fastled CRGB does not work. --- wled00/FX_2Dfcn.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp index 515bbb73..ea61d9ab 100644 --- a/wled00/FX_2Dfcn.cpp +++ b/wled00/FX_2Dfcn.cpp @@ -220,8 +220,9 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: bool sameColor = false; if (ledsrgb) { // WLEDMM small optimization i = XY(x,y); - if ((i < UINT_MAX) && (ledsrgb[i] == col)) sameColor = true; - else ledsrgb[i] = col; + CRGB fastled_col = CRGB(col); + if (ledsrgb[i] == fastled_col) sameColor = true; + else ledsrgb[i] = fastled_col; } uint8_t _bri_t = currentBri(on ? opacity : 0); if (!_bri_t && !transitional) return; @@ -230,7 +231,7 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: } #if 0 // this is a dangerous optimization - if ((i < UINT_MAX) && sameColor && (ledsrgb[i] == col) && (_globalLeds == nullptr)) return; // WLEDMM looks like nothing to do (but we don't trust globalleds) + if ((i < UINT_MAX) && sameColor && (ledsrgb[i] == CRGB(col)) && (_globalLeds == nullptr)) return; // WLEDMM looks like nothing to do (but we don't trust globalleds) #endif if (reverse ) x = virtualWidth() - x - 1;