diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 4e7c89f1c..8bd05857b 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -839,10 +839,10 @@ uint8_t WS2812FX::gamma8(uint8_t b) uint32_t WS2812FX::gamma32(uint32_t color) { if (!gammaCorrectCol) return color; - uint8_t w = (color >> 24) & 0xFF; - uint8_t r = (color >> 16) & 0xFF; - uint8_t g = (color >> 8) & 0xFF; - uint8_t b = color & 0xFF; + uint8_t w = (color >> 24); + uint8_t r = (color >> 16); + uint8_t g = (color >> 8); + uint8_t b = color; w = gammaT[w]; r = gammaT[r]; g = gammaT[g]; diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 7011bce92..8f3801f6b 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -97,7 +97,7 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1912013 +#define VERSION 1912033 char versionString[] = "0.8.7-dev"; @@ -431,6 +431,7 @@ AsyncClient* hueClient = NULL; AsyncMqttClient* mqtt = NULL; //function prototypes +void colorFromUint32(uint32_t,bool=false); void serveMessage(AsyncWebServerRequest*,uint16_t,String,String,byte); void handleE131Packet(e131_packet_t*, IPAddress); diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino index dd3bba8b0..cb32ae32b 100644 --- a/wled00/wled01_eeprom.ino +++ b/wled00/wled01_eeprom.ino @@ -565,6 +565,7 @@ bool applyPreset(byte index, bool loadBri = true, bool loadCol = true, bool load uint16_t i = 380 + index*20; if (index < 16) { if (EEPROM.read(i) != 1) return false; + strip.applyToAllSelected = true; if (loadBri) bri = EEPROM.read(i+1); if (loadCol) { @@ -583,9 +584,11 @@ bool applyPreset(byte index, bool loadBri = true, bool loadCol = true, bool load } } else { if (EEPROM.read(i) != 2) return false; + strip.applyToAllSelected = false; if (loadBri) bri = EEPROM.read(i+1); WS2812FX::Segment* seg = strip.getSegments(); memcpy(seg, EEPROM.getDataPtr() +i+2, 240); + setValuesFromMainSeg(); } currentPreset = index; isPreset = true; @@ -619,6 +622,7 @@ void savePreset(byte index) } commit(); + savedToPresets(); currentPreset = index; isPreset = true; } diff --git a/wled00/wled08_led.ino b/wled00/wled08_led.ino index 52320f057..f9852c043 100644 --- a/wled00/wled08_led.ino +++ b/wled00/wled08_led.ino @@ -1,6 +1,16 @@ /* * LED methods */ +void setValuesFromMainSeg() +{ + WS2812FX::Segment& seg = strip.getSegment(strip.getMainSegmentId()); + colorFromUint32(seg.colors[0]); + colorFromUint32(seg.colors[1], true); + effectCurrent = seg.mode; + effectSpeed = seg.speed; + effectIntensity = seg.intensity; + effectPalette = seg.palette; +} void toggleOnOff() { diff --git a/wled00/wled14_colors.ino b/wled00/wled14_colors.ino index de57be9eb..fae76d4b0 100644 --- a/wled00/wled14_colors.ino +++ b/wled00/wled14_colors.ino @@ -2,12 +2,19 @@ * Color conversion methods */ -void colorFromUint32(uint32_t in) +void colorFromUint32(uint32_t in, bool secondary) { - col[3] = in >> 24 & 0xFF; - col[0] = in >> 16 & 0xFF; - col[1] = in >> 8 & 0xFF; - col[2] = in & 0xFF; + if (secondary) { + colSec[3] = in >> 24 & 0xFF; + colSec[0] = in >> 16 & 0xFF; + colSec[1] = in >> 8 & 0xFF; + colSec[2] = in & 0xFF; + } else { + col[3] = in >> 24 & 0xFF; + col[0] = in >> 16 & 0xFF; + col[1] = in >> 8 & 0xFF; + col[2] = in & 0xFF; + } } void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb diff --git a/wled00/wled19_json.ino b/wled00/wled19_json.ino index 8b10b082d..e09e50c91 100644 --- a/wled00/wled19_json.ino +++ b/wled00/wled19_json.ino @@ -268,7 +268,7 @@ void serializeInfo(JsonObject root) #ifndef WLED_DISABLE_HUESYNC os += 0x04; #endif - #ifndef WLED_DISABLE_MOBILE_UI + #ifdef WLED_ENABLE_ADALIGHT os += 0x02; #endif #ifndef WLED_DISABLE_OTA