Bugfix for color transitioning.

Return palette option for Candle.
Fix for "* Color..." palette hiding.
Comment out debug output.
This commit is contained in:
Blaz Kristan 2022-11-09 20:09:01 +01:00
parent d097f8bf1e
commit 5f4199183c
7 changed files with 1017 additions and 1016 deletions

View File

@ -3087,14 +3087,14 @@ uint16_t mode_candle()
{
return candle(false);
}
static const char _data_FX_MODE_CANDLE[] PROGMEM = "Candle@Flicker rate,Flicker intensity;!,!,;;sx=96,ix=224,pal=0,1d";
static const char _data_FX_MODE_CANDLE[] PROGMEM = "Candle@Flicker rate,Flicker intensity;!,!,;!;sx=96,ix=224,pal=0,1d";
uint16_t mode_candle_multi()
{
return candle(true);
}
static const char _data_FX_MODE_CANDLE_MULTI[] PROGMEM = "Candle Multi@Flicker rate,Flicker intensity;!,!,;;sx=96,ix=224,pal=0,1d";
static const char _data_FX_MODE_CANDLE_MULTI[] PROGMEM = "Candle Multi@Flicker rate,Flicker intensity;!,!,;!;sx=96,ix=224,pal=0,1d";
/*

View File

@ -465,13 +465,13 @@ typedef struct Segment {
Segment(Segment &&orig) noexcept; // move constructor
~Segment() {
#ifdef WLED_DEBUG
Serial.print(F("Destroying segment:"));
if (name) Serial.printf(" %s (%p)", name, name);
if (data) Serial.printf(" %d (%p)", (int)_dataLen, data);
if (leds) Serial.printf(" [%u]", length()*sizeof(CRGB));
Serial.println();
#endif
//#ifdef WLED_DEBUG
//Serial.print(F("Destroying segment:"));
//if (name) Serial.printf(" %s (%p)", name, name);
//if (data) Serial.printf(" %d (%p)", (int)_dataLen, data);
//if (leds) Serial.printf(" [%u]", length()*sizeof(CRGB));
//Serial.println();
//#endif
if (!Segment::_globalLeds && leds) free(leds);
if (name) delete[] name;
if (_t) delete _t;

View File

@ -78,7 +78,7 @@ CRGB *Segment::_globalLeds = nullptr;
// copy constructor
Segment::Segment(const Segment &orig) {
DEBUG_PRINTLN(F("-- Copy segment constructor --"));
//DEBUG_PRINTLN(F("-- Copy segment constructor --"));
memcpy(this, &orig, sizeof(Segment));
name = nullptr;
data = nullptr;
@ -93,7 +93,7 @@ Segment::Segment(const Segment &orig) {
// move constructor
Segment::Segment(Segment &&orig) noexcept {
DEBUG_PRINTLN(F("-- Move segment constructor --"));
//DEBUG_PRINTLN(F("-- Move segment constructor --"));
memcpy(this, &orig, sizeof(Segment));
orig.name = nullptr;
orig.data = nullptr;
@ -104,7 +104,7 @@ Segment::Segment(Segment &&orig) noexcept {
// copy assignment
Segment& Segment::operator= (const Segment &orig) {
DEBUG_PRINTLN(F("-- Copying segment --"));
//DEBUG_PRINTLN(F("-- Copying segment --"));
if (this != &orig) {
// clean destination
if (name) delete[] name;
@ -130,7 +130,7 @@ Segment& Segment::operator= (const Segment &orig) {
// move assignment
Segment& Segment::operator= (Segment &&orig) noexcept {
DEBUG_PRINTLN(F("-- Moving segment --"));
//DEBUG_PRINTLN(F("-- Moving segment --"));
if (this != &orig) {
if (name) delete[] name; // free old name
deallocateData(); // free old runtime data
@ -868,8 +868,8 @@ uint8_t Segment::get_random_wheel_index(uint8_t pos) {
uint32_t Segment::color_from_palette(uint16_t i, bool mapping, bool wrap, uint8_t mcol, uint8_t pbri)
{
// default palette or no RGB support on segment
if ((palette == 0 && mcol < NUM_COLORS) || !(_capabilities & 0x01)) {
uint32_t color = (transitional && _t) ? _t->_colorT[mcol] : colors[mcol];
if ((palette == 0 && mcol < NUM_COLORS) || !_isRGB) {
uint32_t color = currentColor(mcol, colors[mcol]);
color = gamma32(color);
if (pbri == 255) return color;
return RGBW32(scale8_video(R(color),pbri), scale8_video(G(color),pbri), scale8_video(B(color),pbri), scale8_video(W(color),pbri));

View File

@ -1473,7 +1473,10 @@ function setEffectParameters(idx)
}
// not all color selectors shown, hide palettes created from color selectors
for (let e of (gId('pallist').querySelectorAll('.lstI')||[])) {
if (cslCnt < 3 && e.querySelector('.lstIname').innerText.indexOf("* C")>=0) e.classList.add('hide'); else e.classList.remove('hide');
let fltr = "* C";
if (cslCnt==1 && csel==0) fltr = "* Colors";
else if (cslCnt==2) fltr = "* Colors Only";
if (cslCnt < 3 && e.querySelector('.lstIname').innerText.indexOf(fltr)>=0) e.classList.add('hide'); else e.classList.remove('hide');
}
}

File diff suppressed because it is too large Load Diff

View File

@ -133,16 +133,16 @@ int getSignalQuality(int rssi)
void WiFiEvent(WiFiEvent_t event)
{
#ifdef WLED_USE_ETHERNET
char hostname[25] = "wled-";
char hostname[25];
#endif
switch (event) {
#if defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_ETHERNET)
case SYSTEM_EVENT_ETH_START:
DEBUG_PRINT(F("ETH Started"));
DEBUG_PRINTLN(F("ETH Started"));
break;
case SYSTEM_EVENT_ETH_CONNECTED:
DEBUG_PRINT(F("ETH Connected"));
DEBUG_PRINTLN(F("ETH Connected"));
if (!apActive) {
WiFi.disconnect(true);
}
@ -157,7 +157,7 @@ void WiFiEvent(WiFiEvent_t event)
showWelcomePage = false;
break;
case SYSTEM_EVENT_ETH_DISCONNECTED:
DEBUG_PRINT(F("ETH Disconnected"));
DEBUG_PRINTLN(F("ETH Disconnected"));
// This doesn't really affect ethernet per se,
// as it's only configured once. Rather, it
// may be necessary to reconnect the WiFi when

View File

@ -698,16 +698,11 @@ void getSettingsJS(byte subPage, char* dest)
sappends('m',SET_F("(\"sip\")[0]"),(char*)F("WLED "));
olen -= 2; //delete ";
oappend(versionString);
#if defined(CONFIG_IDF_TARGET_ESP32C3)
oappend(SET_F("<br>(ESP32-C3"));
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
oappend(SET_F("<br>(ESP32-S3"));
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
oappend(SET_F("<br>(ESP32-S2"));
#elif defined(ARDUINO_ARCH_ESP32)
oappend(SET_F("<br>(ESP32"));
oappend(SET_F("<br>("));
#if defined(ARDUINO_ARCH_ESP32)
oappend(ESP.getChipModel());
#else
oappend(SET_F("<br>(ESP8266"));
oappend("esp8266");
#endif
oappend(SET_F(" build "));
oappendi(VERSION);