From 119c347ffa8d522183c293aeec2d8804dd62ca88 Mon Sep 17 00:00:00 2001 From: Ewoud Date: Sat, 4 Feb 2023 12:52:34 +0100 Subject: [PATCH] Fix getPaletteCount bug fix bug --- wled00/json.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/json.cpp b/wled00/json.cpp index 2cce3de0..caa4316d 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -959,7 +959,7 @@ void setPaletteColors(JsonArray json, byte* tcp) void serializePalettes(JsonObject root, AsyncWebServerRequest* request) { - byte tcp[strip.getPaletteCount()]; //WLEDMM use real count instead of fixed number 72 + byte tcp[13 + GRADIENT_PALETTE_COUNT]; //WLEDMM use real count instead of fixed number 72 (strip.getPaletteCount() not working on 8266) #ifdef ESP8266 int itemPerPage = 5; #else @@ -1054,7 +1054,7 @@ void serializePalettes(JsonObject root, AsyncWebServerRequest* request) if (i>=palettesCount) { setPaletteColors(curPalette, strip.customPalettes[i - palettesCount]); } else { - memcpy_P(tcp, (byte*)pgm_read_dword(&(gGradientPalettes[i - 13])), strip.getPaletteCount()); //WLEDMM use real count instead of fixed number 72 + memcpy_P(tcp, (byte*)pgm_read_dword(&(gGradientPalettes[i - 13])), 13 + GRADIENT_PALETTE_COUNT); //WLEDMM use real count instead of fixed number 72 (strip.getPaletteCount() not working on 8266) setPaletteColors(curPalette, tcp); } }