diff --git a/wled00/const.h b/wled00/const.h index d5bcd55d..66085019 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -5,7 +5,7 @@ * Readability defines and their associated numerical values + compile-time constants */ -#define GRADIENT_PALETTE_COUNT 61 //WLEDMM netmindz ar palette +2 +#define GRADIENT_PALETTE_COUNT 61 //WLEDMM netmindz ar palette +2, ewowi second Random Cycle palette +1 //Defaults #define DEFAULT_CLIENT_SSID "Your_Network" diff --git a/wled00/json.cpp b/wled00/json.cpp index caa4316d..1d97f259 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[13 + GRADIENT_PALETTE_COUNT]; //WLEDMM use real count instead of fixed number 72 (strip.getPaletteCount() not working on 8266) + byte tcp[72]; //WLEDMM use real count instead of fixed number 72 (strip.getPaletteCount() not working on 8266) #ifdef ESP8266 int itemPerPage = 5; #else @@ -990,7 +990,13 @@ void serializePalettes(JsonObject root, AsyncWebServerRequest* request) case 0: //default palette setPaletteColors(curPalette, PartyColors_p); break; - case 1: //random + case 1: //WLEDMM random MM + curPalette.add("r"); + curPalette.add("r"); + curPalette.add("r"); + curPalette.add("r"); + break; + case 73: //WLEDMM random AC curPalette.add("r"); curPalette.add("r"); curPalette.add("r"); @@ -1054,7 +1060,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])), 13 + GRADIENT_PALETTE_COUNT); //WLEDMM use real count instead of fixed number 72 (strip.getPaletteCount() not working on 8266) + memcpy_P(tcp, (byte*)pgm_read_dword(&(gGradientPalettes[i - 13])), 72); //WLEDMM use real count instead of fixed number 72 (strip.getPaletteCount() not working on 8266) setPaletteColors(curPalette, tcp); } }