diff --git a/wled00/FX.h b/wled00/FX.h
index a518317f..abb8c6f0 100644
--- a/wled00/FX.h
+++ b/wled00/FX.h
@@ -591,6 +591,7 @@ class WS2812FX {
uint8_t _brightness;
static uint16_t _usedSegmentData;
+ void load_gradient_palette(uint8_t);
void handle_palette(void);
void fill(uint32_t);
diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp
index b495de64..ee0ca73a 100644
--- a/wled00/FX_fcn.cpp
+++ b/wled00/FX_fcn.cpp
@@ -324,7 +324,7 @@ uint8_t WS2812FX::getModeCount()
uint8_t WS2812FX::getPaletteCount()
{
- return 13 + gGradientPaletteCount;
+ return 13 + GRADIENT_PALETTE_COUNT;
}
//TODO transitions
@@ -707,6 +707,15 @@ CRGB WS2812FX::col_to_crgb(uint32_t color)
}
+void WS2812FX::load_gradient_palette(uint8_t index)
+{
+ byte i = constrain(index, 0, GRADIENT_PALETTE_COUNT -1);
+ byte tcp[72]; //support gradient palettes with up to 18 entries
+ memcpy_P(tcp, (byte*)pgm_read_dword(&(gGradientPalettes[i])), 72);
+ targetPalette.loadDynamicGradientPalette(tcp);
+}
+
+
/*
* FastLED palette modes helper function. Limitation: Due to memory reasons, multiple active segments with FastLED will disable the Palette transitions
*/
@@ -724,13 +733,13 @@ void WS2812FX::handle_palette(void)
case 0: {//default palette. Differs depending on effect
switch (SEGMENT.mode)
{
- case FX_MODE_FIRE_2012 : targetPalette = gGradientPalettes[22]; break;//heat palette
- case FX_MODE_COLORWAVES : targetPalette = gGradientPalettes[13]; break;//landscape 33
+ case FX_MODE_FIRE_2012 : load_gradient_palette(22); break;//heat palette
+ case FX_MODE_COLORWAVES : load_gradient_palette(13); break;//landscape 33
case FX_MODE_FILLNOISE8 : targetPalette = OceanColors_p; break;
- case FX_MODE_NOISE16_1 : targetPalette = gGradientPalettes[17]; break;//Drywet
- case FX_MODE_NOISE16_2 : targetPalette = gGradientPalettes[30]; break;//Blue cyan yellow
- case FX_MODE_NOISE16_3 : targetPalette = gGradientPalettes[22]; break;//heat palette
- case FX_MODE_NOISE16_4 : targetPalette = gGradientPalettes[13]; break;//landscape 33
+ case FX_MODE_NOISE16_1 : load_gradient_palette(17); break;//Drywet
+ case FX_MODE_NOISE16_2 : load_gradient_palette(30); break;//Blue cyan yellow
+ case FX_MODE_NOISE16_3 : load_gradient_palette(22); break;//heat palette
+ case FX_MODE_NOISE16_4 : load_gradient_palette(13); break;//landscape 33
//case FX_MODE_GLITTER : targetPalette = RainbowColors_p; break;
default: targetPalette = PartyColors_p; break;//palette, bpm
@@ -787,7 +796,7 @@ void WS2812FX::handle_palette(void)
case 12: //Rainbow stripe colors
targetPalette = RainbowStripeColors_p; break;
default: //progmem palettes
- targetPalette = gGradientPalettes[constrain(SEGMENT.palette -13, 0, gGradientPaletteCount -1)];
+ load_gradient_palette(SEGMENT.palette -13);
}
if (singleSegmentMode && paletteFade) //only blend if just one segment uses FastLED mode
diff --git a/wled00/NpbWrapper.h b/wled00/NpbWrapper.h
index 9709d8aa..f12d057f 100644
--- a/wled00/NpbWrapper.h
+++ b/wled00/NpbWrapper.h
@@ -4,7 +4,7 @@
//PIN CONFIGURATION
#ifndef LEDPIN
-#define LEDPIN 2 //strip pin. Any for ESP32, gpio2 or 3 is recommended for ESP8266 (gpio2/3 are labeled D4/RX on NodeMCU and Wemos)
+#define LEDPIN 5 //strip pin. Any for ESP32, gpio2 or 3 is recommended for ESP8266 (gpio2/3 are labeled D4/RX on NodeMCU and Wemos)
#endif
//#define USE_APA102 // Uncomment for using APA102 LEDs.
//#define USE_WS2801 // Uncomment for using WS2801 LEDs (make sure you have NeoPixelBus v2.5.6 or newer)
diff --git a/wled00/const.h b/wled00/const.h
index 242536c9..b54215ca 100644
--- a/wled00/const.h
+++ b/wled00/const.h
@@ -61,4 +61,13 @@
#define TYPE_ANALOG_4CH 9 //analog RGBW
#define TYPE_ANALOG_5CH 10 //analog RGB + WW + CW
+//Hue error codes
+#define HUE_ERROR_INACTIVE 0
+#define HUE_ERROR_UNAUTHORIZED 1
+#define HUE_ERROR_LIGHTID 3
+#define HUE_ERROR_PUSHLINK 101
+#define HUE_ERROR_JSON_PARSING 250
+#define HUE_ERROR_TIMEOUT 251
+#define HUE_ERROR_ACTIVE 255
+
#endif
diff --git a/wled00/html_settings.h b/wled00/html_settings.h
index 157d6b4c..7340e62d 100644
--- a/wled00/html_settings.h
+++ b/wled00/html_settings.h
@@ -335,7 +335,7 @@ Hue Bridge IP:
Press the pushlink button on the bridge, after that save this page!
(when first connecting)
-Hue status: Internal ESP Error!