Preset 16 working
This commit is contained in:
parent
89a54e31f1
commit
334783f89a
@ -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];
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user