Merge branch 'expand-1DEffects' into mdev

This commit is contained in:
Ewowi
2022-10-16 11:04:23 +02:00
19 changed files with 3215 additions and 3098 deletions

View File

@@ -417,6 +417,8 @@ platform_packages = ${esp32.platformV4_packages}
build_flags = ${common.build_flags} ${esp32c3.build_flags} build_flags = ${common.build_flags} ${esp32c3.build_flags}
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
build_flags = ${common.build_flags} ${esp32c3.build_flags} #-D WLED_RELEASE_NAME=ESP32-C3
-D WLED_WATCHDOG_TIMEOUT=0
upload_speed = 460800 upload_speed = 460800
build_unflags = ${common.build_unflags} build_unflags = ${common.build_unflags}
lib_deps = ${esp32c3.lib_deps} lib_deps = ${esp32c3.lib_deps}

View File

@@ -293,8 +293,8 @@ class MultiRelay : public Usermod {
json[F("stat_t")] = "~"; json[F("stat_t")] = "~";
json[F("cmd_t")] = F("~/command"); json[F("cmd_t")] = F("~/command");
json[F("pl_off")] = F("off"); json[F("pl_off")] = "off";
json[F("pl_on")] = F("on"); json[F("pl_on")] = "on";
json[F("uniq_id")] = uid; json[F("uniq_id")] = uid;
strcpy(buf, mqttDeviceTopic); //max length: 33 + 7 = 40 strcpy(buf, mqttDeviceTopic); //max length: 33 + 7 = 40

View File

@@ -4108,14 +4108,14 @@ uint16_t mode_dancing_shadows(void)
if (spotlights[i].width <= 1) { if (spotlights[i].width <= 1) {
if (start >= 0 && start < SEGLEN) { if (start >= 0 && start < SEGLEN) {
SEGMENT.blendPixelColor(start, color, 128); // TODO SEGMENT.blendPixelColor(start, color, 128);
} }
} else { } else {
switch (spotlights[i].type) { switch (spotlights[i].type) {
case SPOT_TYPE_SOLID: case SPOT_TYPE_SOLID:
for (size_t j = 0; j < spotlights[i].width; j++) { for (size_t j = 0; j < spotlights[i].width; j++) {
if ((start + j) >= 0 && (start + j) < SEGLEN) { if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO SEGMENT.blendPixelColor(start + j, color, 128);
} }
} }
break; break;
@@ -4123,7 +4123,7 @@ uint16_t mode_dancing_shadows(void)
case SPOT_TYPE_GRADIENT: case SPOT_TYPE_GRADIENT:
for (size_t j = 0; j < spotlights[i].width; j++) { for (size_t j = 0; j < spotlights[i].width; j++) {
if ((start + j) >= 0 && (start + j) < SEGLEN) { if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, cubicwave8(map(j, 0, spotlights[i].width - 1, 0, 255))); // TODO SEGMENT.blendPixelColor(start + j, color, cubicwave8(map(j, 0, spotlights[i].width - 1, 0, 255)));
} }
} }
break; break;
@@ -4131,7 +4131,7 @@ uint16_t mode_dancing_shadows(void)
case SPOT_TYPE_2X_GRADIENT: case SPOT_TYPE_2X_GRADIENT:
for (size_t j = 0; j < spotlights[i].width; j++) { for (size_t j = 0; j < spotlights[i].width; j++) {
if ((start + j) >= 0 && (start + j) < SEGLEN) { if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, cubicwave8(2 * map(j, 0, spotlights[i].width - 1, 0, 255))); // TODO SEGMENT.blendPixelColor(start + j, color, cubicwave8(2 * map(j, 0, spotlights[i].width - 1, 0, 255)));
} }
} }
break; break;
@@ -4139,7 +4139,7 @@ uint16_t mode_dancing_shadows(void)
case SPOT_TYPE_2X_DOT: case SPOT_TYPE_2X_DOT:
for (size_t j = 0; j < spotlights[i].width; j += 2) { for (size_t j = 0; j < spotlights[i].width; j += 2) {
if ((start + j) >= 0 && (start + j) < SEGLEN) { if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO SEGMENT.blendPixelColor(start + j, color, 128);
} }
} }
break; break;
@@ -4147,7 +4147,7 @@ uint16_t mode_dancing_shadows(void)
case SPOT_TYPE_3X_DOT: case SPOT_TYPE_3X_DOT:
for (size_t j = 0; j < spotlights[i].width; j += 3) { for (size_t j = 0; j < spotlights[i].width; j += 3) {
if ((start + j) >= 0 && (start + j) < SEGLEN) { if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO SEGMENT.blendPixelColor(start + j, color, 128);
} }
} }
break; break;
@@ -4155,7 +4155,7 @@ uint16_t mode_dancing_shadows(void)
case SPOT_TYPE_4X_DOT: case SPOT_TYPE_4X_DOT:
for (size_t j = 0; j < spotlights[i].width; j += 4) { for (size_t j = 0; j < spotlights[i].width; j += 4) {
if ((start + j) >= 0 && (start + j) < SEGLEN) { if ((start + j) >= 0 && (start + j) < SEGLEN) {
SEGMENT.blendPixelColor(start + j, color, 128); // TODO SEGMENT.blendPixelColor(start + j, color, 128);
} }
} }
break; break;
@@ -4165,7 +4165,7 @@ uint16_t mode_dancing_shadows(void)
return FRAMETIME; return FRAMETIME;
} }
static const char _data_FX_MODE_DANCING_SHADOWS[] PROGMEM = "Dancing Shadows@!,# of shadows;!,,;!;1d"; static const char _data_FX_MODE_DANCING_SHADOWS[] PROGMEM = "Dancing Shadows@!,# of shadows;!,!,!;!;1d";
/* /*
@@ -4526,7 +4526,7 @@ uint16_t mode_perlinmove(void) {
return FRAMETIME; return FRAMETIME;
} // mode_perlinmove() } // mode_perlinmove()
static const char _data_FX_MODE_PERLINMOVE[] PROGMEM = "Perlin Move@!,# of pixels,fade rate;,!;!;1d"; static const char _data_FX_MODE_PERLINMOVE[] PROGMEM = "Perlin Move@!,# of pixels,fade rate;!,!;!;1d";
///////////////////////// /////////////////////////

View File

@@ -172,14 +172,12 @@
#define FX_MODE_FIRE_FLICKER 45 #define FX_MODE_FIRE_FLICKER 45
#define FX_MODE_GRADIENT 46 #define FX_MODE_GRADIENT 46
#define FX_MODE_LOADING 47 #define FX_MODE_LOADING 47
//#define FX_MODE_POLICE 48 // candidate for removal (after below three) // #define FX_MODE_POLICE 48 // removed in 0.14!
#define FX_MODE_WAVESINS 48 // was Police prior to 0.14 (use Two Dots with Red/Blue)
#define FX_MODE_FAIRY 49 //was Police All prior to 0.13.0-b6 (use "Two Dots" with Red/Blue and full intensity) #define FX_MODE_FAIRY 49 //was Police All prior to 0.13.0-b6 (use "Two Dots" with Red/Blue and full intensity)
#define FX_MODE_TWO_DOTS 50 #define FX_MODE_TWO_DOTS 50
#define FX_MODE_FAIRYTWINKLE 51 //was Two Areas prior to 0.13.0-b6 (use "Two Dots" with full intensity) #define FX_MODE_FAIRYTWINKLE 51 //was Two Areas prior to 0.13.0-b6 (use "Two Dots" with full intensity)
#define FX_MODE_RUNNING_DUAL 52 #define FX_MODE_RUNNING_DUAL 52
//#define FX_MODE_HALLOWEEN 53 // candidate for removal // #define FX_MODE_HALLOWEEN 53 // removed in 0.14!
#define FX_MODE_PERLINMOVE 53 // was Halloween prior to 0.14 (use Cahse 2 with Purple/Orange)
#define FX_MODE_TRICOLOR_CHASE 54 #define FX_MODE_TRICOLOR_CHASE 54
#define FX_MODE_TRICOLOR_WIPE 55 #define FX_MODE_TRICOLOR_WIPE 55
#define FX_MODE_TRICOLOR_FADE 56 #define FX_MODE_TRICOLOR_FADE 56
@@ -240,74 +238,87 @@
#define FX_MODE_CHUNCHUN 111 #define FX_MODE_CHUNCHUN 111
#define FX_MODE_DANCING_SHADOWS 112 #define FX_MODE_DANCING_SHADOWS 112
#define FX_MODE_WASHING_MACHINE 113 #define FX_MODE_WASHING_MACHINE 113
//#define FX_MODE_CANDY_CANE 114 // candidate for removal // #define FX_MODE_CANDY_CANE 114 // removed in 0.14!
#define FX_MODE_FLOWSTRIPE 114 // was Cany Cane prior to 0.14 (use Cahse 2 with Red/White)
#define FX_MODE_BLENDS 115 #define FX_MODE_BLENDS 115
#define FX_MODE_TV_SIMULATOR 116 #define FX_MODE_TV_SIMULATOR 116
#define FX_MODE_DYNAMIC_SMOOTH 117 #define FX_MODE_DYNAMIC_SMOOTH 117
#ifndef WLED_DISABLE_2D
// new 2D effects
#define FX_MODE_2DSPACESHIPS 118
#define FX_MODE_2DCRAZYBEES 119
#define FX_MODE_2DGHOSTRIDER 120
#define FX_MODE_2DBLOBS 121
#define FX_MODE_2DSCROLLTEXT 122
#define FX_MODE_2DDRIFTROSE 123
// WLED-SR effects (non SR compatible IDs)
#define FX_MODE_2DBLACKHOLE 124 // non audio
#define FX_MODE_2DDNASPIRAL 125 // non audio
#define FX_MODE_2DHIPHOTIC 126 // non audio
#define FX_MODE_2DPLASMABALL 127 // non audio
#define FX_MODE_2DSINDOTS 128 // non audio
#define FX_MODE_2DFRIZZLES 129 // non audio
#define FX_MODE_2DLISSAJOUS 130 // non audio
#define FX_MODE_2DPOLARLIGHTS 131 // non audio
#define FX_MODE_2DTARTAN 132 // non audio
#define FX_MODE_2DGAMEOFLIFE 133 // non audio
#define FX_MODE_2DJULIA 134 // non audio
#define FX_MODE_2DCOLOREDBURSTS 135 // non audio
#define FX_MODE_2DSUNRADIATION 136 // non audio
#define FX_MODE_2DNOISE 137 // non audio
#define FX_MODE_2DFIRENOISE 138 // non audio
#define FX_MODE_2DSQUAREDSWIRL 139 // non audio
#define FX_MODE_2DDNA 140 // non audio
#define FX_MODE_2DMATRIX 141 // non audio
#define FX_MODE_2DMETABALLS 142 // non audio
#define FX_MODE_2DPULSER 143 // non audio
#define FX_MODE_2DDRIFT 144 // non audio
#define FX_MODE_2DWAVERLY 145 // audio enhanced
#define FX_MODE_2DSWIRL 146 // audio enhanced
#define FX_MODE_2DAKEMI 147 // audio enhanced
#define FX_MODE_2DGEQ 148 // audio enhanced
#define FX_MODE_2DFUNKYPLANK 149 // audio enhanced
#endif //WLED_DISABLE_2D
#define FX_MODE_PIXELWAVE 150 // audio enhanced
#define FX_MODE_JUGGLES 151 // audio enhanced
#define FX_MODE_MATRIPIX 152 // audio enhanced
#define FX_MODE_GRAVIMETER 153 // audio enhanced
#define FX_MODE_PLASMOID 154 // audio enhanced
#define FX_MODE_PUDDLES 155 // audio enhanced
#define FX_MODE_MIDNOISE 156 // audio enhanced
#define FX_MODE_NOISEMETER 157 // audio enhanced
#define FX_MODE_NOISEFIRE 158 // audio enhanced
#define FX_MODE_PUDDLEPEAK 159 // audio enhanced
#define FX_MODE_RIPPLEPEAK 160 // audio enhanced
#define FX_MODE_GRAVCENTER 161 // audio enhanced
#define FX_MODE_GRAVCENTRIC 162 // audio enhanced
#define FX_MODE_PIXELS 163 // audio enhanced
#define FX_MODE_FREQWAVE 164 // audio enhanced
#define FX_MODE_FREQMATRIX 165 // audio enhanced
#define FX_MODE_WATERFALL 166 // audio enhanced
#define FX_MODE_FREQPIXELS 167 // audio enhanced
#define FX_MODE_BINMAP 168 // audio enhanced
#define FX_MODE_NOISEMOVE 169 // audio enhanced
#define FX_MODE_FREQMAP 170 // audio enhanced
#define FX_MODE_GRAVFREQ 171 // audio enhanced
#define FX_MODE_DJLIGHT 172 // audio enhanced
#define FX_MODE_BLURZ 173 // audio enhanced
#define FX_MODE_ROCKTAVES 174 // audio enhanced
#define MODE_COUNT 175 //WLED SR READ THIS!:
//these id's should never change as they are saved in api commands of presets and used in sync
//118 to 127 was reserved for future AC effects in SR 0.13 and partly filled in 0.14
//numbering reflects the order in which they were added
//there are still gaps which can be filled by future effects
// new 0.14 2D effects
#define FX_MODE_2DSPACESHIPS 118 //gap fill
#define FX_MODE_2DCRAZYBEES 119 //gap fill
#define FX_MODE_2DGHOSTRIDER 120 //gap fill
#define FX_MODE_2DBLOBS 121 //gap fill
#define FX_MODE_2DSCROLLTEXT 122 //gap fill
#define FX_MODE_2DDRIFTROSE 123 //gap fill
// WLED-SR effects (SR compatible IDs !!!)
#define FX_MODE_PIXELS 128
#define FX_MODE_PIXELWAVE 129
#define FX_MODE_JUGGLES 130
#define FX_MODE_MATRIPIX 131
#define FX_MODE_GRAVIMETER 132
#define FX_MODE_PLASMOID 133
#define FX_MODE_PUDDLES 134
#define FX_MODE_MIDNOISE 135
#define FX_MODE_NOISEMETER 136
#define FX_MODE_FREQWAVE 137
#define FX_MODE_FREQMATRIX 138
#define FX_MODE_2DGEQ 139
#define FX_MODE_WATERFALL 140
#define FX_MODE_FREQPIXELS 141
#define FX_MODE_BINMAP 142
#define FX_MODE_NOISEFIRE 143
#define FX_MODE_PUDDLEPEAK 144
#define FX_MODE_NOISEMOVE 145
#define FX_MODE_2DNOISE 146
#define FX_MODE_PERLINMOVE 147
#define FX_MODE_RIPPLEPEAK 148
#define FX_MODE_2DFIRENOISE 149
#define FX_MODE_2DSQUAREDSWIRL 150
#define FX_MODE_2DFIRE2012 151
#define FX_MODE_2DDNA 152
#define FX_MODE_2DMATRIX 153
#define FX_MODE_2DMETABALLS 154
#define FX_MODE_FREQMAP 155
#define FX_MODE_GRAVCENTER 156
#define FX_MODE_GRAVCENTRIC 157
#define FX_MODE_GRAVFREQ 158
#define FX_MODE_DJLIGHT 159
#define FX_MODE_2DFUNKYPLANK 160
#define FX_MODE_2DCENTERBARS 161
#define FX_MODE_2DPULSER 162
#define FX_MODE_BLURZ 163
#define FX_MODE_2DDRIFT 164
#define FX_MODE_2DWAVERLY 165
#define FX_MODE_2DSUNRADIATION 166
#define FX_MODE_2DCOLOREDBURSTS 167
#define FX_MODE_2DJULIA 168
#define FX_MODE_2DPOOLNOISE 169 //have been removed in WLED SR in the past because of low mem but should be added back
#define FX_MODE_2DTWISTER 170 //have been removed in WLED SR in the past because of low mem but should be added back
#define FX_MODE_2DCAELEMENTATY 171 //have been removed in WLED SR in the past because of low mem but should be added back
#define FX_MODE_2DGAMEOFLIFE 172
#define FX_MODE_2DTARTAN 173
#define FX_MODE_2DPOLARLIGHTS 174
#define FX_MODE_2DSWIRL 175
#define FX_MODE_2DLISSAJOUS 176
#define FX_MODE_2DFRIZZLES 177
#define FX_MODE_2DPLASMABALL 178
#define FX_MODE_FLOWSTRIPE 179
#define FX_MODE_2DHIPHOTIC 180
#define FX_MODE_2DSINDOTS 181
#define FX_MODE_2DDNASPIRAL 182
#define FX_MODE_2DBLACKHOLE 183
#define FX_MODE_WAVESINS 184
#define FX_MODE_ROCKTAVES 185
#define FX_MODE_2DAKEMI 186
#define MODE_COUNT 187
typedef enum mapping1D2D { typedef enum mapping1D2D {
M12_Pixels = 0, M12_Pixels = 0,

View File

@@ -4,9 +4,12 @@
#include "NeoPixelBrightnessBus.h" #include "NeoPixelBrightnessBus.h"
// temporary - these defines should actually be set in platformio.ini // temporary - these defines should actually be set in platformio.ini
// C3: I2S0 and I2S1 methods not supported // C3: I2S0 and I2S1 methods not supported (has one I2S bus)
// S2: I2S1 methods not supported // S2: I2S1 methods not supported (has one I2S bus)
// S3: I2S0 and I2S1 methods not supported yet // S3: I2S0 and I2S1 methods not supported yet (has two I2S buses)
// https://github.com/Makuna/NeoPixelBus/blob/b32f719e95ef3c35c46da5c99538017ef925c026/src/internal/Esp32_i2s.h#L4
// https://github.com/Makuna/NeoPixelBus/blob/b32f719e95ef3c35c46da5c99538017ef925c026/src/internal/NeoEsp32RmtMethod.h#L857
#if !defined(WLED_NO_I2S0_PIXELBUS) && (defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)) #if !defined(WLED_NO_I2S0_PIXELBUS) && (defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3))
#define WLED_NO_I2S0_PIXELBUS #define WLED_NO_I2S0_PIXELBUS
#endif #endif
@@ -46,54 +49,57 @@
#define I_8266_DM_TM1_4 15 #define I_8266_DM_TM1_4 15
#define I_8266_BB_TM1_4 16 #define I_8266_BB_TM1_4 16
//TM1829 (RGB) //TM1829 (RGB)
#define I_8266_U0_TM2_3 39 #define I_8266_U0_TM2_3 17
#define I_8266_U1_TM2_3 40 #define I_8266_U1_TM2_3 18
#define I_8266_DM_TM2_3 41 #define I_8266_DM_TM2_3 19
#define I_8266_BB_TM2_3 42 #define I_8266_BB_TM2_3 20
/*** ESP32 Neopixel methods ***/ /*** ESP32 Neopixel methods ***/
//RGB //RGB
#define I_32_RN_NEO_3 17 #define I_32_RN_NEO_3 21
#define I_32_I0_NEO_3 18 #define I_32_I0_NEO_3 22
#define I_32_I1_NEO_3 19 #define I_32_I1_NEO_3 23
#define I_32_BB_NEO_3 24 // bitbangging on ESP32 not recommended
//RGBW //RGBW
#define I_32_RN_NEO_4 20 #define I_32_RN_NEO_4 25
#define I_32_I0_NEO_4 21 #define I_32_I0_NEO_4 26
#define I_32_I1_NEO_4 22 #define I_32_I1_NEO_4 27
#define I_32_BB_NEO_4 28 // bitbangging on ESP32 not recommended
//400Kbps //400Kbps
#define I_32_RN_400_3 23 #define I_32_RN_400_3 29
#define I_32_I0_400_3 24 #define I_32_I0_400_3 30
#define I_32_I1_400_3 25 #define I_32_I1_400_3 31
#define I_32_BB_400_3 32 // bitbangging on ESP32 not recommended
//TM1814 (RGBW) //TM1814 (RGBW)
#define I_32_RN_TM1_4 26 #define I_32_RN_TM1_4 33
#define I_32_I0_TM1_4 27 #define I_32_I0_TM1_4 34
#define I_32_I1_TM1_4 28 #define I_32_I1_TM1_4 35
//Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S) //Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S)
//TM1829 (RGB) //TM1829 (RGB)
#define I_32_RN_TM2_3 43 #define I_32_RN_TM2_3 36
#define I_32_I0_TM2_3 44 #define I_32_I0_TM2_3 37
#define I_32_I1_TM2_3 45 #define I_32_I1_TM2_3 38
//Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S) //Bit Bang theoratically possible, but very undesirable and not needed (no pin restrictions on RMT and I2S)
//APA102 //APA102
#define I_HS_DOT_3 29 //hardware SPI #define I_HS_DOT_3 39 //hardware SPI
#define I_SS_DOT_3 30 //soft SPI #define I_SS_DOT_3 40 //soft SPI
//LPD8806 //LPD8806
#define I_HS_LPD_3 31 #define I_HS_LPD_3 41
#define I_SS_LPD_3 32 #define I_SS_LPD_3 42
//WS2801 //WS2801
#define I_HS_WS1_3 33 #define I_HS_WS1_3 43
#define I_SS_WS1_3 34 #define I_SS_WS1_3 44
//P9813 //P9813
#define I_HS_P98_3 35 #define I_HS_P98_3 45
#define I_SS_P98_3 36 #define I_SS_P98_3 46
//LPD6803 //LPD6803
#define I_HS_LPO_3 37 #define I_HS_LPO_3 47
#define I_SS_LPO_3 38 #define I_SS_LPO_3 48
/*** ESP8266 Neopixel methods ***/ /*** ESP8266 Neopixel methods ***/
@@ -135,6 +141,7 @@
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
#define B_32_I1_NEO_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32I2s1800KbpsMethod> #define B_32_I1_NEO_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32I2s1800KbpsMethod>
#endif #endif
//#define B_32_BB_NEO_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32BitBang800KbpsMethod>
//RGBW //RGBW
#define B_32_RN_NEO_4 NeoPixelBrightnessBus<NeoGrbwFeature, NeoEsp32RmtNWs2812xMethod> #define B_32_RN_NEO_4 NeoPixelBrightnessBus<NeoGrbwFeature, NeoEsp32RmtNWs2812xMethod>
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -143,6 +150,7 @@
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
#define B_32_I1_NEO_4 NeoPixelBrightnessBus<NeoGrbwFeature, NeoEsp32I2s1800KbpsMethod> #define B_32_I1_NEO_4 NeoPixelBrightnessBus<NeoGrbwFeature, NeoEsp32I2s1800KbpsMethod>
#endif #endif
//#define B_32_BB_NEO_4 NeoPixelBrightnessBus<NeoGrbwFeature, NeoEsp32BitBang800KbpsMethod>
//400Kbps //400Kbps
#define B_32_RN_400_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32RmtN400KbpsMethod> #define B_32_RN_400_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32RmtN400KbpsMethod>
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -151,6 +159,7 @@
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
#define B_32_I1_400_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32I2s1400KbpsMethod> #define B_32_I1_400_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32I2s1400KbpsMethod>
#endif #endif
//#define B_32_BB_400_3 NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32BitBang400KbpsMethod>
//TM1814 (RGBW) //TM1814 (RGBW)
#define B_32_RN_TM1_4 NeoPixelBrightnessBus<NeoWrgbTm1814Feature, NeoEsp32RmtNTm1814Method> #define B_32_RN_TM1_4 NeoPixelBrightnessBus<NeoWrgbTm1814Feature, NeoEsp32RmtNTm1814Method>
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -255,6 +264,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->Begin(); break; case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->Begin(); break;
#endif #endif
// case I_32_BB_NEO_3: (static_cast<B_32_BB_NEO_3*>(busPtr))->Begin(); break;
case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->Begin(); break; case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->Begin(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->Begin(); break; case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->Begin(); break;
@@ -262,6 +272,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->Begin(); break; case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->Begin(); break;
#endif #endif
// case I_32_BB_NEO_4: (static_cast<B_32_BB_NEO_4*>(busPtr))->Begin(); break;
case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->Begin(); break; case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->Begin(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->Begin(); break; case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->Begin(); break;
@@ -269,6 +280,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->Begin(); break; case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->Begin(); break;
#endif #endif
// case I_32_BB_400_3: (static_cast<B_32_BB_400_3*>(busPtr))->Begin(); break;
case I_32_RN_TM1_4: beginTM1814<B_32_RN_TM1_4*>(busPtr); break; case I_32_RN_TM1_4: beginTM1814<B_32_RN_TM1_4*>(busPtr); break;
case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->Begin(); break; case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->Begin(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -327,6 +339,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: busPtr = new B_32_I1_NEO_3(len, pins[0]); break; case I_32_I1_NEO_3: busPtr = new B_32_I1_NEO_3(len, pins[0]); break;
#endif #endif
// case I_32_BB_NEO_3: busPtr = new B_32_BB_NEO_3(len, pins[0], (NeoBusChannel)channel); break;
case I_32_RN_NEO_4: busPtr = new B_32_RN_NEO_4(len, pins[0], (NeoBusChannel)channel); break; case I_32_RN_NEO_4: busPtr = new B_32_RN_NEO_4(len, pins[0], (NeoBusChannel)channel); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: busPtr = new B_32_I0_NEO_4(len, pins[0]); break; case I_32_I0_NEO_4: busPtr = new B_32_I0_NEO_4(len, pins[0]); break;
@@ -334,6 +347,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: busPtr = new B_32_I1_NEO_4(len, pins[0]); break; case I_32_I1_NEO_4: busPtr = new B_32_I1_NEO_4(len, pins[0]); break;
#endif #endif
// case I_32_BB_NEO_4: busPtr = new B_32_BB_NEO_4(len, pins[0], (NeoBusChannel)channel); break;
case I_32_RN_400_3: busPtr = new B_32_RN_400_3(len, pins[0], (NeoBusChannel)channel); break; case I_32_RN_400_3: busPtr = new B_32_RN_400_3(len, pins[0], (NeoBusChannel)channel); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: busPtr = new B_32_I0_400_3(len, pins[0]); break; case I_32_I0_400_3: busPtr = new B_32_I0_400_3(len, pins[0]); break;
@@ -341,6 +355,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: busPtr = new B_32_I1_400_3(len, pins[0]); break; case I_32_I1_400_3: busPtr = new B_32_I1_400_3(len, pins[0]); break;
#endif #endif
// case I_32_BB_400_3: busPtr = new B_32_BB_400_3(len, pins[0], (NeoBusChannel)channel); break;
case I_32_RN_TM1_4: busPtr = new B_32_RN_TM1_4(len, pins[0], (NeoBusChannel)channel); break; case I_32_RN_TM1_4: busPtr = new B_32_RN_TM1_4(len, pins[0], (NeoBusChannel)channel); break;
case I_32_RN_TM2_3: busPtr = new B_32_RN_TM2_3(len, pins[0], (NeoBusChannel)channel); break; case I_32_RN_TM2_3: busPtr = new B_32_RN_TM2_3(len, pins[0], (NeoBusChannel)channel); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -400,6 +415,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->Show(); break; case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->Show(); break;
#endif #endif
// case I_32_BB_NEO_3: (static_cast<B_32_BB_NEO_3*>(busPtr))->Show(); break;
case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->Show(); break; case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->Show(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->Show(); break; case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->Show(); break;
@@ -407,6 +423,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->Show(); break; case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->Show(); break;
#endif #endif
// case I_32_BB_NEO_4: (static_cast<B_32_BB_NEO_4*>(busPtr))->Show(); break;
case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->Show(); break; case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->Show(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->Show(); break; case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->Show(); break;
@@ -414,6 +431,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->Show(); break; case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->Show(); break;
#endif #endif
// case I_32_BB_400_3: (static_cast<B_32_BB_400_3*>(busPtr))->Show(); break;
case I_32_RN_TM1_4: (static_cast<B_32_RN_TM1_4*>(busPtr))->Show(); break; case I_32_RN_TM1_4: (static_cast<B_32_RN_TM1_4*>(busPtr))->Show(); break;
case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->Show(); break; case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->Show(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -470,6 +488,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: return (static_cast<B_32_I1_NEO_3*>(busPtr))->CanShow(); break; case I_32_I1_NEO_3: return (static_cast<B_32_I1_NEO_3*>(busPtr))->CanShow(); break;
#endif #endif
// case I_32_BB_NEO_3: return (static_cast<B_32_BB_NEO_3*>(busPtr))->CanShow(); break;
case I_32_RN_NEO_4: return (static_cast<B_32_RN_NEO_4*>(busPtr))->CanShow(); break; case I_32_RN_NEO_4: return (static_cast<B_32_RN_NEO_4*>(busPtr))->CanShow(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: return (static_cast<B_32_I0_NEO_4*>(busPtr))->CanShow(); break; case I_32_I0_NEO_4: return (static_cast<B_32_I0_NEO_4*>(busPtr))->CanShow(); break;
@@ -477,6 +496,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: return (static_cast<B_32_I1_NEO_4*>(busPtr))->CanShow(); break; case I_32_I1_NEO_4: return (static_cast<B_32_I1_NEO_4*>(busPtr))->CanShow(); break;
#endif #endif
// case I_32_BB_NEO_4: return (static_cast<B_32_BB_NEO_4*>(busPtr))->CanShow(); break;
case I_32_RN_400_3: return (static_cast<B_32_RN_400_3*>(busPtr))->CanShow(); break; case I_32_RN_400_3: return (static_cast<B_32_RN_400_3*>(busPtr))->CanShow(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: return (static_cast<B_32_I0_400_3*>(busPtr))->CanShow(); break; case I_32_I0_400_3: return (static_cast<B_32_I0_400_3*>(busPtr))->CanShow(); break;
@@ -484,6 +504,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: return (static_cast<B_32_I1_400_3*>(busPtr))->CanShow(); break; case I_32_I1_400_3: return (static_cast<B_32_I1_400_3*>(busPtr))->CanShow(); break;
#endif #endif
// case I_32_BB_400_3: return (static_cast<B_32_BB_400_3*>(busPtr))->CanShow(); break;
case I_32_RN_TM1_4: return (static_cast<B_32_RN_TM1_4*>(busPtr))->CanShow(); break; case I_32_RN_TM1_4: return (static_cast<B_32_RN_TM1_4*>(busPtr))->CanShow(); break;
case I_32_RN_TM2_3: return (static_cast<B_32_RN_TM2_3*>(busPtr))->CanShow(); break; case I_32_RN_TM2_3: return (static_cast<B_32_RN_TM2_3*>(busPtr))->CanShow(); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -564,6 +585,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
#endif #endif
// case I_32_BB_NEO_3: (static_cast<B_32_BB_NEO_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->SetPixelColor(pix, col); break; case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->SetPixelColor(pix, col); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->SetPixelColor(pix, col); break; case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->SetPixelColor(pix, col); break;
@@ -571,6 +593,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->SetPixelColor(pix, col); break; case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->SetPixelColor(pix, col); break;
#endif #endif
// case I_32_BB_NEO_4: (static_cast<B_32_BB_NEO_4*>(busPtr))->SetPixelColor(pix, col); break;
case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
@@ -578,6 +601,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
#endif #endif
// case I_32_BB_400_3: (static_cast<B_32_BB_400_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
case I_32_RN_TM1_4: (static_cast<B_32_RN_TM1_4*>(busPtr))->SetPixelColor(pix, col); break; case I_32_RN_TM1_4: (static_cast<B_32_RN_TM1_4*>(busPtr))->SetPixelColor(pix, col); break;
case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break; case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->SetPixelColor(pix, RgbColor(col.R,col.G,col.B)); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -634,6 +658,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->SetBrightness(b); break; case I_32_I1_NEO_3: (static_cast<B_32_I1_NEO_3*>(busPtr))->SetBrightness(b); break;
#endif #endif
// case I_32_BB_NEO_3: (static_cast<B_32_BB_NEO_3*>(busPtr))->SetBrightness(b); break;
case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->SetBrightness(b); break; case I_32_RN_NEO_4: (static_cast<B_32_RN_NEO_4*>(busPtr))->SetBrightness(b); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->SetBrightness(b); break; case I_32_I0_NEO_4: (static_cast<B_32_I0_NEO_4*>(busPtr))->SetBrightness(b); break;
@@ -641,6 +666,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->SetBrightness(b); break; case I_32_I1_NEO_4: (static_cast<B_32_I1_NEO_4*>(busPtr))->SetBrightness(b); break;
#endif #endif
// case I_32_BB_NEO_4: (static_cast<B_32_BB_NEO_4*>(busPtr))->SetBrightness(b); break;
case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->SetBrightness(b); break; case I_32_RN_400_3: (static_cast<B_32_RN_400_3*>(busPtr))->SetBrightness(b); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->SetBrightness(b); break; case I_32_I0_400_3: (static_cast<B_32_I0_400_3*>(busPtr))->SetBrightness(b); break;
@@ -648,6 +674,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->SetBrightness(b); break; case I_32_I1_400_3: (static_cast<B_32_I1_400_3*>(busPtr))->SetBrightness(b); break;
#endif #endif
// case I_32_BB_400_3: (static_cast<B_32_BB_400_3*>(busPtr))->SetBrightness(b); break;
case I_32_RN_TM1_4: (static_cast<B_32_RN_TM1_4*>(busPtr))->SetBrightness(b); break; case I_32_RN_TM1_4: (static_cast<B_32_RN_TM1_4*>(busPtr))->SetBrightness(b); break;
case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->SetBrightness(b); break; case I_32_RN_TM2_3: (static_cast<B_32_RN_TM2_3*>(busPtr))->SetBrightness(b); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -705,6 +732,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: col = (static_cast<B_32_I1_NEO_3*>(busPtr))->GetPixelColor(pix); break; case I_32_I1_NEO_3: col = (static_cast<B_32_I1_NEO_3*>(busPtr))->GetPixelColor(pix); break;
#endif #endif
// case I_32_BB_NEO_3: col = (static_cast<B_32_BB_NEO_3*>(busPtr))->GetPixelColor(pix); break;
case I_32_RN_NEO_4: col = (static_cast<B_32_RN_NEO_4*>(busPtr))->GetPixelColor(pix); break; case I_32_RN_NEO_4: col = (static_cast<B_32_RN_NEO_4*>(busPtr))->GetPixelColor(pix); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: col = (static_cast<B_32_I0_NEO_4*>(busPtr))->GetPixelColor(pix); break; case I_32_I0_NEO_4: col = (static_cast<B_32_I0_NEO_4*>(busPtr))->GetPixelColor(pix); break;
@@ -712,6 +740,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: col = (static_cast<B_32_I1_NEO_4*>(busPtr))->GetPixelColor(pix); break; case I_32_I1_NEO_4: col = (static_cast<B_32_I1_NEO_4*>(busPtr))->GetPixelColor(pix); break;
#endif #endif
// case I_32_BB_NEO_4: col = (static_cast<B_32_BB_NEO_4*>(busPtr))->GetPixelColor(pix); break;
case I_32_RN_400_3: col = (static_cast<B_32_RN_400_3*>(busPtr))->GetPixelColor(pix); break; case I_32_RN_400_3: col = (static_cast<B_32_RN_400_3*>(busPtr))->GetPixelColor(pix); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: col = (static_cast<B_32_I0_400_3*>(busPtr))->GetPixelColor(pix); break; case I_32_I0_400_3: col = (static_cast<B_32_I0_400_3*>(busPtr))->GetPixelColor(pix); break;
@@ -719,6 +748,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: col = (static_cast<B_32_I1_400_3*>(busPtr))->GetPixelColor(pix); break; case I_32_I1_400_3: col = (static_cast<B_32_I1_400_3*>(busPtr))->GetPixelColor(pix); break;
#endif #endif
// case I_32_BB_400_3: col = (static_cast<B_32_BB_400_3*>(busPtr))->GetPixelColor(pix); break;
case I_32_RN_TM1_4: col = (static_cast<B_32_RN_TM1_4*>(busPtr))->GetPixelColor(pix); break; case I_32_RN_TM1_4: col = (static_cast<B_32_RN_TM1_4*>(busPtr))->GetPixelColor(pix); break;
case I_32_RN_TM2_3: col = (static_cast<B_32_RN_TM2_3*>(busPtr))->GetPixelColor(pix); break; case I_32_RN_TM2_3: col = (static_cast<B_32_RN_TM2_3*>(busPtr))->GetPixelColor(pix); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -795,6 +825,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_3: delete (static_cast<B_32_I1_NEO_3*>(busPtr)); break; case I_32_I1_NEO_3: delete (static_cast<B_32_I1_NEO_3*>(busPtr)); break;
#endif #endif
// case I_32_BB_NEO_3: delete (static_cast<B_32_BB_NEO_3*>(busPtr)); break;
case I_32_RN_NEO_4: delete (static_cast<B_32_RN_NEO_4*>(busPtr)); break; case I_32_RN_NEO_4: delete (static_cast<B_32_RN_NEO_4*>(busPtr)); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_NEO_4: delete (static_cast<B_32_I0_NEO_4*>(busPtr)); break; case I_32_I0_NEO_4: delete (static_cast<B_32_I0_NEO_4*>(busPtr)); break;
@@ -802,6 +833,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_NEO_4: delete (static_cast<B_32_I1_NEO_4*>(busPtr)); break; case I_32_I1_NEO_4: delete (static_cast<B_32_I1_NEO_4*>(busPtr)); break;
#endif #endif
// case I_32_BB_NEO_4: delete (static_cast<B_32_BB_NEO_4*>(busPtr)); break;
case I_32_RN_400_3: delete (static_cast<B_32_RN_400_3*>(busPtr)); break; case I_32_RN_400_3: delete (static_cast<B_32_RN_400_3*>(busPtr)); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
case I_32_I0_400_3: delete (static_cast<B_32_I0_400_3*>(busPtr)); break; case I_32_I0_400_3: delete (static_cast<B_32_I0_400_3*>(busPtr)); break;
@@ -809,6 +841,7 @@ class PolyBus {
#ifndef WLED_NO_I2S1_PIXELBUS #ifndef WLED_NO_I2S1_PIXELBUS
case I_32_I1_400_3: delete (static_cast<B_32_I1_400_3*>(busPtr)); break; case I_32_I1_400_3: delete (static_cast<B_32_I1_400_3*>(busPtr)); break;
#endif #endif
// case I_32_BB_400_3: delete (static_cast<B_32_BB_400_3*>(busPtr)); break;
case I_32_RN_TM1_4: delete (static_cast<B_32_RN_TM1_4*>(busPtr)); break; case I_32_RN_TM1_4: delete (static_cast<B_32_RN_TM1_4*>(busPtr)); break;
case I_32_RN_TM2_3: delete (static_cast<B_32_RN_TM2_3*>(busPtr)); break; case I_32_RN_TM2_3: delete (static_cast<B_32_RN_TM2_3*>(busPtr)); break;
#ifndef WLED_NO_I2S0_PIXELBUS #ifndef WLED_NO_I2S0_PIXELBUS
@@ -875,12 +908,22 @@ class PolyBus {
} }
#else //ESP32 #else //ESP32
uint8_t offset = 0; //0 = RMT (num 0-7) 8 = I2S0 9 = I2S1 uint8_t offset = 0; //0 = RMT (num 0-7) 8 = I2S0 9 = I2S1
#ifndef CONFIG_IDF_TARGET_ESP32S2 #if defined(CONFIG_IDF_TARGET_ESP32S2)
// ESP32-S2 only has 4 RMT channels
if (num > 4) return I_NONE;
if (num > 3) offset = 1; // only one I2S
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
// On ESP32-C3 only the first 2 RMT channels are usable for transmitting
if (num > 1) return I_NONE;
//if (num > 1) offset = 1; // I2S not supported yet (only 1 I2S)
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
// On ESP32-S3 only the first 4 RMT channels are usable for transmitting
if (num > 3) return I_NONE;
//if (num > 3) offset = num -4; // I2S not supported yet
#else
// standard ESP32 has 8 RMT and 2 I2S channels
if (num > 9) return I_NONE; if (num > 9) return I_NONE;
if (num > 7) offset = num -7; if (num > 7) offset = num -7;
#else //ESP32 S2 only has 4 RMT channels
if (num > 5) return I_NONE;
if (num > 4) offset = num -4;
#endif #endif
switch (busType) { switch (busType) {
case TYPE_WS2812_RGB: case TYPE_WS2812_RGB:

View File

@@ -25,10 +25,18 @@
#ifdef ESP8266 #ifdef ESP8266
#define WLED_MAX_BUSSES 3 #define WLED_MAX_BUSSES 3
#else #else
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(CONFIG_IDF_TARGET_ESP32C3) // 2 RMT, only has 1 I2S but NPB does not support it ATM
#define WLED_MAX_BUSSES 5 #define WLED_MAX_BUSSES 2
#elif defined(CONFIG_IDF_TARGET_ESP32S2) // 4 RMT, only has 1 I2S bus, supported in NPB
#if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
#define WLED_MAX_BUSSES 4
#else
#define WLED_MAX_BUSSES 5
#endif
#elif defined(CONFIG_IDF_TARGET_ESP32S3) // 4 RMT, has 2 I2S but NPB does not support them ATM
#define WLED_MAX_BUSSES 4
#else #else
#if defined(CONFIG_IDF_TARGET_ESP32S3) #if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
#define WLED_MAX_BUSSES 8 #define WLED_MAX_BUSSES 8
#else #else
#define WLED_MAX_BUSSES 10 #define WLED_MAX_BUSSES 10
@@ -289,7 +297,7 @@
#ifdef ESP8266 #ifdef ESP8266
#define MAX_LED_MEMORY 4000 #define MAX_LED_MEMORY 4000
#else #else
#ifdef ARDUINO_ARCH_ESP32S2 #if defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3)
#define MAX_LED_MEMORY 32000 #define MAX_LED_MEMORY 32000
#else #else
#define MAX_LED_MEMORY 64000 #define MAX_LED_MEMORY 64000
@@ -358,7 +366,7 @@
//this is merely a default now and can be changed at runtime //this is merely a default now and can be changed at runtime
#ifndef LEDPIN #ifndef LEDPIN
#if defined(ESP8266) || (defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM)) #if defined(ESP8266) || (defined(ARDUINO_ARCH_ESP32) && defined(WLED_USE_PSRAM)) || defined(CONFIG_IDF_TARGET_ESP32C3)
#define LEDPIN 2 // GPIO2 (D4) on Wemod D1 mini compatible boards #define LEDPIN 2 // GPIO2 (D4) on Wemod D1 mini compatible boards
#else #else
#define LEDPIN 16 // aligns with GPIO2 (D4) on Wemos D1 mini32 compatible boards #define LEDPIN 16 // aligns with GPIO2 (D4) on Wemos D1 mini32 compatible boards

View File

@@ -399,7 +399,7 @@ function presetError(empty)
if (bckstr.length > 10) hasBackup = true; if (bckstr.length > 10) hasBackup = true;
} catch (e) {} } catch (e) {}
var cn = `<div class="pres c" ${empty?'style="padding:8px;margin-top: 16px;"':'onclick="loadPresets()" style="cursor:pointer;padding:8px;margin-top: 16px;"'}>`; var cn = `<div class="pres c" ${empty?'style="padding:8px;margin-top: 16px;"':'onclick="pmtLast=0;loadPresets();" style="cursor:pointer;padding:8px;margin-top: 16px;"'}>`;
if (empty) if (empty)
cn += `You have no presets yet!`; cn += `You have no presets yet!`;
else else
@@ -2257,7 +2257,7 @@ function saveP(i,pl)
} }
populatePresets(); populatePresets();
resetPUtil(); resetPUtil();
setTimeout(()=>{pmtLast=0; loadPresets();}, 500); // force reloading of presets setTimeout(()=>{pmtLast=0; loadPresets();}, 750); // force reloading of presets
} }
function testPl(i,bt) { function testPl(i,bt) {
@@ -2286,6 +2286,7 @@ function delP(i) {
requestJson(obj); requestJson(obj);
delete pJson[i]; delete pJson[i];
populatePresets(); populatePresets();
gId('putil').classList.add("staybot");
} else { } else {
bt.style.color = "var(--c-r)"; bt.style.color = "var(--c-r)";
bt.innerHTML = "<i class='icons btn-icon'>&#xe037;</i>Delete!"; bt.innerHTML = "<i class='icons btn-icon'>&#xe037;</i>Delete!";

View File

@@ -135,7 +135,7 @@ void handleIR();
void deserializeSegment(JsonObject elem, byte it, byte presetId = 0); void deserializeSegment(JsonObject elem, byte it, byte presetId = 0);
bool deserializeState(JsonObject root, byte callMode = CALL_MODE_DIRECT_CHANGE, byte presetId = 0); bool deserializeState(JsonObject root, byte callMode = CALL_MODE_DIRECT_CHANGE, byte presetId = 0);
void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset = false, bool segmentBounds = true); void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset = false, bool segmentBounds = true);
void serializeState(JsonObject root, bool forPreset = false, bool includeBri = true, bool segmentBounds = true); void serializeState(JsonObject root, bool forPreset = false, bool includeBri = true, bool segmentBounds = true, bool selectedSegmentsOnly = false);
void serializeInfo(JsonObject root); void serializeInfo(JsonObject root);
void serializeModeNames(JsonArray arr, const char *qstring); void serializeModeNames(JsonArray arr, const char *qstring);
void serializeModeData(JsonObject root); void serializeModeData(JsonObject root);
@@ -192,6 +192,7 @@ void shufflePlaylist();
void unloadPlaylist(); void unloadPlaylist();
int16_t loadPlaylist(JsonObject playlistObject, byte presetId = 0); int16_t loadPlaylist(JsonObject playlistObject, byte presetId = 0);
void handlePlaylist(); void handlePlaylist();
void serializePlaylist(JsonObject obj);
//presets.cpp //presets.cpp
void handlePresets(); void handlePresets();

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
// Autogenerated from wled00/data/style.css, do not edit!! // Autogenerated from wled00/data/style.css, do not edit!!
const uint16_t PAGE_settingsCss_length = 824; const uint16_t PAGE_settingsCss_length = 824;
const uint8_t PAGE_settingsCss[] PROGMEM = { const uint8_t PAGE_settingsCss[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x55, 0x5d, 0x8b, 0x9c, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x55, 0x5d, 0x8b, 0x9c, 0x30,
0x14, 0xfd, 0x2b, 0x96, 0x61, 0x61, 0x0b, 0xa3, 0xa8, 0xa3, 0xb3, 0xd3, 0x48, 0xa1, 0xf4, 0xbd, 0x14, 0xfd, 0x2b, 0x96, 0x61, 0x61, 0x0b, 0xa3, 0xa8, 0xa3, 0xb3, 0xd3, 0x48, 0xa1, 0xf4, 0xbd,
0x6f, 0xa5, 0x14, 0xca, 0x3e, 0x44, 0x73, 0x1d, 0xc3, 0xe4, 0x43, 0x92, 0xd8, 0x75, 0x2a, 0xfe, 0x6f, 0xa5, 0x14, 0xca, 0x3e, 0x44, 0x73, 0x1d, 0xc3, 0xe4, 0x43, 0x92, 0xd8, 0x75, 0x2a, 0xfe,
0xf7, 0x26, 0x7e, 0xac, 0xce, 0xac, 0x6c, 0x5f, 0xca, 0xe0, 0xa0, 0xde, 0x98, 0x7b, 0xee, 0xb9, 0xf7, 0x26, 0x7e, 0xac, 0xce, 0xac, 0x6c, 0x5f, 0xca, 0xe0, 0xa0, 0xde, 0x98, 0x7b, 0xee, 0xb9,
@@ -66,7 +66,7 @@ const uint8_t PAGE_settingsCss[] PROGMEM = {
// Autogenerated from wled00/data/settings.htm, do not edit!! // Autogenerated from wled00/data/settings.htm, do not edit!!
const uint16_t PAGE_settings_length = 1231; const uint16_t PAGE_settings_length = 1231;
const uint8_t PAGE_settings[] PROGMEM = { const uint8_t PAGE_settings[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x56, 0xef, 0x6f, 0xdb, 0x36, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x56, 0xef, 0x6f, 0xdb, 0x36,
0x10, 0xfd, 0xee, 0xbf, 0x82, 0x61, 0xb7, 0x44, 0x42, 0x65, 0xd9, 0x49, 0x87, 0x61, 0x93, 0x2d, 0x10, 0xfd, 0xee, 0xbf, 0x82, 0x61, 0xb7, 0x44, 0x42, 0x65, 0xd9, 0x49, 0x87, 0x61, 0x93, 0x2d,
0x17, 0x6d, 0x92, 0xae, 0x19, 0x12, 0x24, 0x40, 0x92, 0x76, 0xc3, 0x36, 0xa0, 0xb4, 0x78, 0xb2, 0x17, 0x6d, 0x92, 0xae, 0x19, 0x12, 0x24, 0x40, 0x92, 0x76, 0xc3, 0x36, 0xa0, 0xb4, 0x78, 0xb2,
0xd9, 0x48, 0xa4, 0x40, 0x9e, 0x9c, 0x78, 0xae, 0xff, 0xf7, 0x1d, 0x69, 0x27, 0x71, 0xda, 0xa0, 0xd9, 0x48, 0xa4, 0x40, 0x9e, 0x9c, 0x78, 0xae, 0xff, 0xf7, 0x1d, 0x69, 0x27, 0x71, 0xda, 0xa0,
@@ -149,7 +149,7 @@ const uint8_t PAGE_settings[] PROGMEM = {
// Autogenerated from wled00/data/settings_wifi.htm, do not edit!! // Autogenerated from wled00/data/settings_wifi.htm, do not edit!!
const uint16_t PAGE_settings_wifi_length = 1557; const uint16_t PAGE_settings_wifi_length = 1557;
const uint8_t PAGE_settings_wifi[] PROGMEM = { const uint8_t PAGE_settings_wifi[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x57, 0xff, 0x4f, 0xdb, 0x38, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x57, 0xff, 0x4f, 0xdb, 0x38,
0x14, 0xff, 0x3d, 0x7f, 0x85, 0xf1, 0x49, 0x53, 0xa3, 0x85, 0x94, 0xb6, 0xc7, 0x6e, 0x62, 0x49, 0x14, 0xff, 0x3d, 0x7f, 0x85, 0xf1, 0x49, 0x53, 0xa3, 0x85, 0x94, 0xb6, 0xc7, 0x6e, 0x62, 0x49,
0x76, 0x5d, 0xdb, 0x0d, 0xee, 0x18, 0xeb, 0x29, 0x68, 0xe8, 0xa4, 0x93, 0x26, 0x37, 0x79, 0x6d, 0x76, 0x5d, 0xdb, 0x0d, 0xee, 0x18, 0xeb, 0x29, 0x68, 0xe8, 0xa4, 0x93, 0x26, 0x37, 0x79, 0x6d,
0x3d, 0x9c, 0x38, 0x17, 0x3b, 0x2d, 0x88, 0xf1, 0xbf, 0xdf, 0xb3, 0x93, 0x96, 0x16, 0xe8, 0x36, 0x3d, 0x9c, 0x38, 0x17, 0x3b, 0x2d, 0x88, 0xf1, 0xbf, 0xdf, 0xb3, 0x93, 0x96, 0x16, 0xe8, 0x36,
@@ -253,7 +253,7 @@ const uint8_t PAGE_settings_wifi[] PROGMEM = {
// Autogenerated from wled00/data/settings_leds.htm, do not edit!! // Autogenerated from wled00/data/settings_leds.htm, do not edit!!
const uint16_t PAGE_settings_leds_length = 7414; const uint16_t PAGE_settings_leds_length = 7414;
const uint8_t PAGE_settings_leds[] PROGMEM = { const uint8_t PAGE_settings_leds[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xdd, 0x3c, 0xdb, 0x76, 0xe2, 0x48, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xdd, 0x3c, 0xdb, 0x76, 0xe2, 0x48,
0x92, 0xef, 0x7c, 0x45, 0x3a, 0xbb, 0xdb, 0x2d, 0x0d, 0x32, 0x48, 0x5c, 0xdc, 0x2e, 0x40, 0x78, 0x92, 0xef, 0x7c, 0x45, 0x3a, 0xbb, 0xdb, 0x2d, 0x0d, 0x32, 0x48, 0x5c, 0xdc, 0x2e, 0x40, 0x78,
0x8d, 0xeb, 0xd2, 0x9e, 0xb1, 0xdb, 0x3e, 0xc6, 0xdd, 0x35, 0x73, 0xaa, 0xeb, 0x54, 0x09, 0x29, 0x8d, 0xeb, 0xd2, 0x9e, 0xb1, 0xdb, 0x3e, 0xc6, 0xdd, 0x35, 0x73, 0xaa, 0xeb, 0x54, 0x09, 0x29,
0x01, 0x95, 0x85, 0x44, 0x4b, 0xc2, 0x36, 0x6b, 0xb3, 0xdf, 0xb4, 0xdf, 0xb0, 0x5f, 0xb6, 0x11, 0x01, 0x95, 0x85, 0x44, 0x4b, 0xc2, 0x36, 0x6b, 0xb3, 0xdf, 0xb4, 0xdf, 0xb0, 0x5f, 0xb6, 0x11,
@@ -723,7 +723,7 @@ const uint8_t PAGE_settings_leds[] PROGMEM = {
// Autogenerated from wled00/data/settings_dmx.htm, do not edit!! // Autogenerated from wled00/data/settings_dmx.htm, do not edit!!
const uint16_t PAGE_settings_dmx_length = 1612; const uint16_t PAGE_settings_dmx_length = 1612;
const uint8_t PAGE_settings_dmx[] PROGMEM = { const uint8_t PAGE_settings_dmx[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0x95, 0x57, 0xdb, 0x72, 0xdb, 0x36, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x95, 0x57, 0xdb, 0x72, 0xdb, 0x36,
0x10, 0x7d, 0xd7, 0x57, 0x20, 0x78, 0x88, 0xc9, 0x31, 0x43, 0x4a, 0x4e, 0x95, 0x36, 0x32, 0x49, 0x10, 0x7d, 0xd7, 0x57, 0x20, 0x78, 0x88, 0xc9, 0x31, 0x43, 0x4a, 0x4e, 0x95, 0x36, 0x32, 0x49,
0x37, 0x56, 0x5c, 0xdb, 0x1d, 0xdb, 0xf5, 0x44, 0x49, 0xd3, 0x4e, 0xd3, 0xe9, 0x40, 0xe4, 0x4a, 0x37, 0x56, 0x5c, 0xdb, 0x1d, 0xdb, 0xf5, 0x44, 0x49, 0xd3, 0x4e, 0xd3, 0xe9, 0x40, 0xe4, 0x4a,
0x44, 0x4c, 0x02, 0x2c, 0x00, 0x4a, 0x76, 0x2e, 0xff, 0xde, 0x05, 0x48, 0x5d, 0xec, 0xd8, 0x69, 0x44, 0x4c, 0x02, 0x2c, 0x00, 0x4a, 0x76, 0x2e, 0xff, 0xde, 0x05, 0x48, 0x5d, 0xec, 0xd8, 0x69,
@@ -830,7 +830,7 @@ const uint8_t PAGE_settings_dmx[] PROGMEM = {
// Autogenerated from wled00/data/settings_ui.htm, do not edit!! // Autogenerated from wled00/data/settings_ui.htm, do not edit!!
const uint16_t PAGE_settings_ui_length = 3090; const uint16_t PAGE_settings_ui_length = 3090;
const uint8_t PAGE_settings_ui[] PROGMEM = { const uint8_t PAGE_settings_ui[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xad, 0x59, 0x6b, 0x73, 0xda, 0x48, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xad, 0x59, 0x6b, 0x73, 0xda, 0x48,
0x16, 0xfd, 0xce, 0xaf, 0xe8, 0x74, 0x52, 0x1e, 0x54, 0x56, 0x04, 0x4e, 0x66, 0x6b, 0x13, 0x40, 0x16, 0xfd, 0xce, 0xaf, 0xe8, 0x74, 0x52, 0x1e, 0x54, 0x56, 0x04, 0x4e, 0x66, 0x6b, 0x13, 0x40,
0x78, 0x63, 0xc7, 0x93, 0x78, 0xca, 0xd9, 0x64, 0x83, 0xbd, 0x99, 0xad, 0xac, 0xcb, 0x23, 0xa4, 0x78, 0x63, 0xc7, 0x93, 0x78, 0xca, 0xd9, 0x64, 0x83, 0xbd, 0x99, 0xad, 0xac, 0xcb, 0x23, 0xa4,
0x06, 0x3a, 0x16, 0x92, 0x46, 0xdd, 0x32, 0x66, 0x09, 0xff, 0x7d, 0xcf, 0xed, 0x96, 0x40, 0x60, 0x06, 0x3a, 0x16, 0x92, 0x46, 0xdd, 0x32, 0x66, 0x09, 0xff, 0x7d, 0xcf, 0xed, 0x96, 0x40, 0x60,
@@ -1030,7 +1030,7 @@ const uint8_t PAGE_settings_ui[] PROGMEM = {
// Autogenerated from wled00/data/settings_sync.htm, do not edit!! // Autogenerated from wled00/data/settings_sync.htm, do not edit!!
const uint16_t PAGE_settings_sync_length = 3146; const uint16_t PAGE_settings_sync_length = 3146;
const uint8_t PAGE_settings_sync[] PROGMEM = { const uint8_t PAGE_settings_sync[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0x9d, 0x5a, 0x6d, 0x77, 0xda, 0xb8, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x9d, 0x5a, 0x6d, 0x77, 0xda, 0xb8,
0x12, 0xfe, 0xee, 0x5f, 0xa1, 0xfa, 0xc3, 0x2e, 0x6c, 0x08, 0x18, 0x12, 0xd2, 0x94, 0x60, 0xf7, 0x12, 0xfe, 0xee, 0x5f, 0xa1, 0xfa, 0xc3, 0x2e, 0x6c, 0x08, 0x18, 0x12, 0xd2, 0x94, 0x60, 0xf7,
0x86, 0x90, 0x26, 0xec, 0x36, 0x0d, 0x85, 0x64, 0x5f, 0xce, 0xb9, 0xe7, 0xec, 0x11, 0xb6, 0x00, 0x86, 0x90, 0x26, 0xec, 0x36, 0x0d, 0x85, 0x64, 0x5f, 0xce, 0xb9, 0xe7, 0xec, 0x11, 0xb6, 0x00,
0x25, 0xb6, 0xe5, 0xb5, 0xe5, 0xbc, 0x9c, 0x6e, 0xff, 0xfb, 0x9d, 0x91, 0x6c, 0x03, 0x06, 0x02, 0x25, 0xb6, 0xe5, 0xb5, 0xe5, 0xbc, 0x9c, 0x6e, 0xff, 0xfb, 0x9d, 0x91, 0x6c, 0x03, 0x06, 0x02,
@@ -1233,7 +1233,7 @@ const uint8_t PAGE_settings_sync[] PROGMEM = {
// Autogenerated from wled00/data/settings_time.htm, do not edit!! // Autogenerated from wled00/data/settings_time.htm, do not edit!!
const uint16_t PAGE_settings_time_length = 3302; const uint16_t PAGE_settings_time_length = 3302;
const uint8_t PAGE_settings_time[] PROGMEM = { const uint8_t PAGE_settings_time[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xd5, 0x1a, 0x6b, 0x57, 0xdb, 0x3a, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xd5, 0x1a, 0x6b, 0x57, 0xdb, 0x3a,
0xf2, 0x7b, 0x7e, 0x85, 0x50, 0x7b, 0xb8, 0xf1, 0xc5, 0x79, 0x42, 0x5a, 0x48, 0x62, 0x77, 0x43, 0xf2, 0x7b, 0x7e, 0x85, 0x50, 0x7b, 0xb8, 0xf1, 0xc5, 0x79, 0x42, 0x5a, 0x48, 0x62, 0x77, 0x43,
0x48, 0x0b, 0x2d, 0x09, 0x9c, 0x26, 0xbd, 0xec, 0xf6, 0x71, 0x6e, 0x15, 0x5b, 0x49, 0x0c, 0x8e, 0x48, 0x0b, 0x2d, 0x09, 0x9c, 0x26, 0xbd, 0xec, 0xf6, 0x71, 0x6e, 0x15, 0x5b, 0x49, 0x0c, 0x8e,
0xe4, 0xb5, 0x65, 0x02, 0x4b, 0xf9, 0xef, 0x3b, 0x92, 0x1c, 0xe7, 0x85, 0x81, 0xf6, 0xde, 0xfd, 0xe4, 0xb5, 0x65, 0x02, 0x4b, 0xf9, 0xef, 0x3b, 0x92, 0x1c, 0xe7, 0x85, 0x81, 0xf6, 0xde, 0xfd,
@@ -1446,7 +1446,7 @@ const uint8_t PAGE_settings_time[] PROGMEM = {
// Autogenerated from wled00/data/settings_sec.htm, do not edit!! // Autogenerated from wled00/data/settings_sec.htm, do not edit!!
const uint16_t PAGE_settings_sec_length = 2406; const uint16_t PAGE_settings_sec_length = 2406;
const uint8_t PAGE_settings_sec[] PROGMEM = { const uint8_t PAGE_settings_sec[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xa5, 0x58, 0x6d, 0x53, 0xdb, 0x48, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xa5, 0x58, 0x6d, 0x53, 0xdb, 0x48,
0x12, 0xfe, 0xee, 0x5f, 0x31, 0x4c, 0xaa, 0x58, 0xeb, 0x22, 0x2c, 0x43, 0x72, 0x5b, 0x09, 0x20, 0x12, 0xfe, 0xee, 0x5f, 0x31, 0x4c, 0xaa, 0x58, 0xeb, 0x22, 0x2c, 0x43, 0x72, 0x5b, 0x09, 0x20,
0xe7, 0x20, 0x90, 0x0d, 0x57, 0x10, 0x28, 0x6c, 0x36, 0x77, 0x95, 0x4b, 0xa5, 0xc6, 0xd2, 0xd8, 0xe7, 0x20, 0x90, 0x0d, 0x57, 0x10, 0x28, 0x6c, 0x36, 0x77, 0x95, 0x4b, 0xa5, 0xc6, 0xd2, 0xd8,
0x9a, 0x58, 0xd6, 0x68, 0x67, 0x46, 0x38, 0xbe, 0xec, 0xfe, 0xf7, 0x7b, 0x7a, 0x24, 0xd9, 0x86, 0x9a, 0x58, 0xd6, 0x68, 0x67, 0x46, 0x38, 0xbe, 0xec, 0xfe, 0xf7, 0x7b, 0x7a, 0x24, 0xd9, 0x86,
@@ -1603,7 +1603,7 @@ const uint8_t PAGE_settings_sec[] PROGMEM = {
// Autogenerated from wled00/data/settings_um.htm, do not edit!! // Autogenerated from wled00/data/settings_um.htm, do not edit!!
const uint16_t PAGE_settings_um_length = 2721; const uint16_t PAGE_settings_um_length = 2721;
const uint8_t PAGE_settings_um[] PROGMEM = { const uint8_t PAGE_settings_um[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xcd, 0x59, 0x5b, 0x73, 0xdb, 0xb8, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xcd, 0x59, 0x5b, 0x73, 0xdb, 0xb8,
0x15, 0x7e, 0xd7, 0xaf, 0xa0, 0x11, 0x8f, 0x4d, 0x8e, 0x69, 0x4a, 0x4e, 0x76, 0x3b, 0x59, 0x49, 0x15, 0x7e, 0xd7, 0xaf, 0xa0, 0x11, 0x8f, 0x4d, 0x8e, 0x69, 0x4a, 0x4e, 0x76, 0x3b, 0x59, 0x49,
0x90, 0x9b, 0x38, 0xc9, 0x46, 0x8d, 0xb3, 0xf6, 0x54, 0x7b, 0x99, 0x8e, 0xeb, 0x89, 0x69, 0x11, 0x90, 0x9b, 0x38, 0xc9, 0x46, 0x8d, 0xb3, 0xf6, 0x54, 0x7b, 0x99, 0x8e, 0xeb, 0x89, 0x69, 0x11,
0x92, 0x10, 0x53, 0x00, 0x4b, 0x80, 0xbe, 0x54, 0xd6, 0x7f, 0xef, 0x77, 0x40, 0x52, 0xa2, 0x7c, 0x92, 0x10, 0x53, 0x00, 0x4b, 0x80, 0xbe, 0x54, 0xd6, 0x7f, 0xef, 0x77, 0x40, 0x52, 0xa2, 0x7c,
@@ -1780,7 +1780,7 @@ const uint8_t PAGE_settings_um[] PROGMEM = {
// Autogenerated from wled00/data/settings_2D.htm, do not edit!! // Autogenerated from wled00/data/settings_2D.htm, do not edit!!
const uint16_t PAGE_settings_2D_length = 1754; const uint16_t PAGE_settings_2D_length = 1754;
const uint8_t PAGE_settings_2D[] PROGMEM = { const uint8_t PAGE_settings_2D[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0x8d, 0x58, 0x6d, 0x73, 0xdb, 0x36, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x8d, 0x58, 0x6d, 0x73, 0xdb, 0x36,
0x12, 0xfe, 0xce, 0x5f, 0x01, 0x63, 0x3a, 0x2d, 0xd9, 0x50, 0x94, 0xe4, 0xde, 0x75, 0x3a, 0x16, 0x12, 0xfe, 0xce, 0x5f, 0x01, 0x63, 0x3a, 0x2d, 0xd9, 0x50, 0x94, 0xe4, 0xde, 0x75, 0x3a, 0x16,
0x49, 0x37, 0x6e, 0xdc, 0xda, 0x1d, 0x7b, 0xe2, 0x89, 0x72, 0xce, 0xdc, 0x5c, 0x3a, 0x29, 0x44, 0x49, 0x37, 0x6e, 0xdc, 0xda, 0x1d, 0x7b, 0xe2, 0x89, 0x72, 0xce, 0xdc, 0x5c, 0x3a, 0x29, 0x44,
0xae, 0x44, 0xc4, 0x24, 0xc0, 0x01, 0x20, 0xd9, 0xae, 0xe2, 0xff, 0x7e, 0x0b, 0x90, 0x12, 0x25, 0xae, 0x44, 0xc4, 0x24, 0xc0, 0x01, 0x20, 0xd9, 0xae, 0xe2, 0xff, 0x7e, 0x0b, 0x90, 0x12, 0x25,
@@ -1896,7 +1896,7 @@ const uint8_t PAGE_settings_2D[] PROGMEM = {
// Autogenerated from wled00/data/settings_pin.htm, do not edit!! // Autogenerated from wled00/data/settings_pin.htm, do not edit!!
const uint16_t PAGE_settings_pin_length = 471; const uint16_t PAGE_settings_pin_length = 471;
const uint8_t PAGE_settings_pin[] PROGMEM = { const uint8_t PAGE_settings_pin[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0x5d, 0x52, 0x4d, 0x6f, 0x13, 0x31, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x5d, 0x52, 0x4d, 0x6f, 0x13, 0x31,
0x10, 0xbd, 0xef, 0xaf, 0x30, 0x73, 0x69, 0x82, 0x92, 0x6c, 0xa8, 0xa8, 0x04, 0xaa, 0xbd, 0x42, 0x10, 0xbd, 0xef, 0xaf, 0x30, 0x73, 0x69, 0x82, 0x92, 0x6c, 0xa8, 0xa8, 0x04, 0xaa, 0xbd, 0x42,
0x81, 0x1e, 0xb8, 0x94, 0x48, 0xe5, 0x52, 0x55, 0x55, 0xe5, 0xd8, 0xb3, 0x89, 0x55, 0x7f, 0x2c, 0x81, 0x1e, 0xb8, 0x94, 0x48, 0xe5, 0x52, 0x55, 0x55, 0xe5, 0xd8, 0xb3, 0x89, 0x55, 0x7f, 0x2c,
0xb6, 0x37, 0x21, 0x54, 0xfc, 0x77, 0xc6, 0xbb, 0xa1, 0xa0, 0x5c, 0xd6, 0x7e, 0x33, 0xe3, 0x37, 0xb6, 0x37, 0x21, 0x54, 0xfc, 0x77, 0xc6, 0xbb, 0xa1, 0xa0, 0x5c, 0xd6, 0x7e, 0x33, 0xe3, 0x37,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -344,7 +344,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
receiveNotifications = udpn["recv"] | receiveNotifications; receiveNotifications = udpn["recv"] | receiveNotifications;
if ((bool)udpn[F("nn")]) callMode = CALL_MODE_NO_NOTIFY; //send no notification just for this request if ((bool)udpn[F("nn")]) callMode = CALL_MODE_NO_NOTIFY; //send no notification just for this request
unsigned long timein = root[F("time")] | UINT32_MAX; //backup time source if NTP not synced unsigned long timein = root["time"] | UINT32_MAX; //backup time source if NTP not synced
if (timein != UINT32_MAX) { if (timein != UINT32_MAX) {
setTimeFromAPI(timein); setTimeFromAPI(timein);
if (presetsModifiedTime == 0) presetsModifiedTime = timein; if (presetsModifiedTime == 0) presetsModifiedTime = timein;
@@ -431,10 +431,11 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
// b) preset ID only or preset that does not change state (use embedded cycling limits if they exist in getVal()) // b) preset ID only or preset that does not change state (use embedded cycling limits if they exist in getVal())
presetCycCurr = ps; presetCycCurr = ps;
presetId = ps; presetId = ps;
root.remove(F("v")); // may be added in UI call root.remove("v"); // may be added in UI call
root.remove(F("time")); // may be added in UI call root.remove("time"); // may be added in UI call
root.remove("ps"); root.remove("ps");
if (root.size() == 0) { if (root.size() == 0) {
unloadPlaylist(); // we need to unload playlist
applyPreset(ps, callMode); // async load (only preset ID was specified) applyPreset(ps, callMode); // async load (only preset ID was specified)
return stateResponse; return stateResponse;
} }
@@ -516,7 +517,7 @@ void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset, b
root["mp12"] = seg.map1D2D; root["mp12"] = seg.map1D2D;
} }
void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segmentBounds) void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segmentBounds, bool selectedSegmentsOnly)
{ {
if (includeBri) { if (includeBri) {
root["on"] = (bri > 0); root["on"] = (bri > 0);
@@ -552,11 +553,10 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
root[F("mainseg")] = strip.getMainSegmentId(); root[F("mainseg")] = strip.getMainSegmentId();
bool selectedSegmentsOnly = root[F("sc")] | false;
JsonArray seg = root.createNestedArray("seg"); JsonArray seg = root.createNestedArray("seg");
for (size_t s = 0; s < strip.getMaxSegments(); s++) { for (size_t s = 0; s < strip.getMaxSegments(); s++) {
if (s >= strip.getSegmentsNum()) { if (s >= strip.getSegmentsNum()) {
if (forPreset && segmentBounds) { //disable segments not part of preset if (forPreset && segmentBounds && !selectedSegmentsOnly) { //disable segments not part of preset
JsonObject seg0 = seg.createNestedObject(); JsonObject seg0 = seg.createNestedObject();
seg0["stop"] = 0; seg0["stop"] = 0;
continue; continue;
@@ -564,7 +564,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
break; break;
} }
Segment &sg = strip.getSegment(s); Segment &sg = strip.getSegment(s);
if (!forPreset && selectedSegmentsOnly && !sg.isSelected()) continue; if (forPreset && selectedSegmentsOnly && !sg.isSelected()) continue;
if (sg.isActive()) { if (sg.isActive()) {
JsonObject seg0 = seg.createNestedObject(); JsonObject seg0 = seg.createNestedObject();
serializeSegment(seg0, sg, s, forPreset, segmentBounds); serializeSegment(seg0, sg, s, forPreset, segmentBounds);

View File

@@ -93,12 +93,12 @@ void updateTimezone() {
break; break;
} }
case TZ_AUSTRALIA_EASTERN : { case TZ_AUSTRALIA_EASTERN : {
tcrDaylight = {Second, Sun, Oct, 2, 660}; //AEDT = UTC + 11 hours tcrDaylight = {First, Sun, Oct, 2, 660}; //AEDT = UTC + 11 hours
tcrStandard = {First, Sun, Apr, 3, 600}; //AEST = UTC + 10 hours tcrStandard = {First, Sun, Apr, 3, 600}; //AEST = UTC + 10 hours
break; break;
} }
case TZ_NEW_ZEALAND : { case TZ_NEW_ZEALAND : {
tcrDaylight = {Second, Sun, Sep, 2, 780}; //NZDT = UTC + 13 hours tcrDaylight = {Last, Sun, Sep, 2, 780}; //NZDT = UTC + 13 hours
tcrStandard = {First, Sun, Apr, 3, 720}; //NZST = UTC + 12 hours tcrStandard = {First, Sun, Apr, 3, 720}; //NZST = UTC + 12 hours
break; break;
} }

View File

@@ -149,3 +149,19 @@ void handlePlaylist() {
applyPreset(playlistEntries[playlistIndex].preset); applyPreset(playlistEntries[playlistIndex].preset);
} }
} }
void serializePlaylist(JsonObject sObj) {
JsonObject playlist = sObj.createNestedObject(F("playlist"));
JsonArray ps = playlist.createNestedArray("ps");
JsonArray dur = playlist.createNestedArray("dur");
JsonArray transition = playlist.createNestedArray(F("transition"));
playlist[F("repeat")] = playlistRepeat;
playlist["end"] = playlistEndPreset;
playlist["r"] = playlistOptions & PL_OPTION_SHUFFLE;
for (int i=0; i<playlistLen; i++) {
ps.add(playlistEntries[i].preset);
dur.add(playlistEntries[i].dur);
transition.add(playlistEntries[i].tr);
}
}

View File

@@ -10,6 +10,70 @@ static char *tmpRAMbuffer = nullptr;
static volatile byte presetToApply = 0; static volatile byte presetToApply = 0;
static volatile byte callModeToApply = 0; static volatile byte callModeToApply = 0;
static volatile byte presetToSave = 0;
static char quickLoad[3];
static char saveName[33];
static bool includeBri = true, segBounds = true, selectedOnly = false, playlistSave = false;;
static const char *getName(bool persist = true) {
return persist ? "/presets.json" : "/tmp.json";
}
static void doSaveState() {
bool persist = (presetToSave < 251);
const char *filename = getName(persist);
if (!requestJSONBufferLock(10)) return; // will set fileDoc
JsonObject sObj = doc.to<JsonObject>();
DEBUG_PRINTLN(F("Serialize current state"));
if (playlistSave) {
serializePlaylist(sObj);
if (includeBri) sObj["on"] = true;
} else {
serializeState(sObj, true, includeBri, segBounds, selectedOnly);
}
sObj["n"] = saveName;
if (quickLoad[0]) sObj[F("ql")] = quickLoad;
/*
#ifdef WLED_DEBUG
DEBUG_PRINTLN(F("Serialized preset"));
serializeJson(doc,Serial);
DEBUG_PRINTLN();
#endif
*/
#if defined(ARDUINO_ARCH_ESP32)
if (!persist) {
if (tmpRAMbuffer!=nullptr) free(tmpRAMbuffer);
size_t len = measureJson(*fileDoc) + 1;
DEBUG_PRINTLN(len);
// if possible use SPI RAM on ESP32
#ifdef WLED_USE_PSRAM
if (psramFound())
tmpRAMbuffer = (char*) ps_malloc(len);
else
#endif
tmpRAMbuffer = (char*) malloc(len);
if (tmpRAMbuffer!=nullptr) {
serializeJson(*fileDoc, tmpRAMbuffer, len);
} else {
writeObjectToFileUsingId(filename, presetToSave, fileDoc);
}
} else
#endif
writeObjectToFileUsingId(filename, presetToSave, fileDoc);
if (persist) presetsModifiedTime = toki.second(); //unix time
releaseJSONBufferLock();
updateFSInfo();
// clean up
presetToSave = 0;
saveName[0] = '\0';
quickLoad[0] = '\0';
playlistSave = false;
}
bool applyPreset(byte index, byte callMode) bool applyPreset(byte index, byte callMode)
{ {
@@ -17,16 +81,16 @@ bool applyPreset(byte index, byte callMode)
DEBUG_PRINTLN(index); DEBUG_PRINTLN(index);
presetToApply = index; presetToApply = index;
callModeToApply = callMode; callModeToApply = callMode;
/*
// the following is needed in case of HTTP JSON API call to return correct state to the caller
// fromJson is true in case when deserializeState() was called with presetId==0
if (fromJson) handlePresets(true); // force immediate processing
*/
return true; return true;
} }
void handlePresets() void handlePresets()
{ {
if (presetToSave) {
doSaveState();
return;
}
bool changePreset = false; bool changePreset = false;
uint8_t tmpPreset = presetToApply; // store temporary since deserializeState() may call applyPreset() uint8_t tmpPreset = presetToApply; // store temporary since deserializeState() may call applyPreset()
uint8_t tmpMode = callModeToApply; uint8_t tmpMode = callModeToApply;
@@ -34,7 +98,7 @@ void handlePresets()
if (tmpPreset == 0 || (fileDoc /*&& !force*/)) return; // JSON buffer already allocated and not force apply or no preset waiting if (tmpPreset == 0 || (fileDoc /*&& !force*/)) return; // JSON buffer already allocated and not force apply or no preset waiting
JsonObject fdo; JsonObject fdo;
const char *filename = tmpPreset < 255 ? "/presets.json" : "/tmp.json"; const char *filename = getName(tmpPreset < 255);
/* /*
* The following code is no longer needed as handlePreset() is never run from * The following code is no longer needed as handlePreset() is never run from
@@ -150,72 +214,53 @@ void handlePresets()
} }
//called from handleSet(PS=) [network callback (fileDoc==nullptr), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)] //called from handleSet(PS=) [network callback (fileDoc==nullptr), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)]
void savePreset(byte index, const char* pname, JsonObject saveobj) void savePreset(byte index, const char* pname, JsonObject sObj)
{ {
if (index == 0 || (index > 250 && index < 255)) return; if (index == 0 || (index > 250 && index < 255)) return;
char tmp[12]; if (pname) strlcpy(saveName, pname, 33);
JsonObject sObj = saveobj; else {
bool bufferAllocated = false; if (sObj["n"].is<const char*>()) strlcpy(saveName, sObj["n"].as<const char*>(), 33);
else sprintf_P(saveName, PSTR("Preset %d"), index);
bool persist = (index != 255);
const char *filename = persist ? "/presets.json" : "/tmp.json";
if (!fileDoc) {
// called from handleSet() HTTP API
if (!requestJSONBufferLock(10)) return;
sObj = fileDoc->to<JsonObject>();
bufferAllocated = true;
} }
if (sObj["n"].isNull() && pname == nullptr) {
sprintf_P(tmp, PSTR("Preset %d"), index);
sObj["n"] = tmp;
} else if (pname) sObj["n"] = pname;
sObj.remove(F("psave")); DEBUG_PRINT(F("Saving preset (")); DEBUG_PRINT(index); DEBUG_PRINT(F(") ")); DEBUG_PRINTLN(saveName);
sObj.remove(F("v"));
if (!sObj["o"]) { presetToSave = index;
DEBUGFS_PRINTLN(F("Serialize current state")); playlistSave = false;
if (sObj["ib"].isNull() && sObj["sb"].isNull()) serializeState(sObj, true); if (sObj[F("ql")].is<const char*>()) strlcpy(quickLoad, sObj[F("ql")].as<const char*>(), 3); // only 2 chars for QL
else serializeState(sObj, true, sObj["ib"], sObj["sb"]); sObj.remove("v");
if (persist) currentPreset = index; sObj.remove("time");
}
sObj.remove("o");
sObj.remove("ib");
sObj.remove("sb");
sObj.remove(F("sc"));
sObj.remove(F("error")); sObj.remove(F("error"));
sObj.remove(F("time")); sObj.remove(F("psave"));
if (sObj["o"].isNull()) { // "o" marks a playlist or manually entered API
#if defined(ARDUINO_ARCH_ESP32) includeBri = sObj["ib"].as<bool>() || index==255; // temporary preset needs brightness
if (index==255) { segBounds = sObj["sb"].as<bool>() || index==255; // temporary preset needs bounds
if (tmpRAMbuffer!=nullptr) free(tmpRAMbuffer); selectedOnly = sObj[F("sc")].as<bool>();
size_t len = measureJson(*fileDoc) + 1; sObj.remove("ib");
DEBUG_PRINTLN(len); sObj.remove("sb");
// if possible use SPI RAM on ESP32 sObj.remove(F("sc"));
#ifdef WLED_USE_PSRAM } else {
if (psramFound()) // this is a playlist or API
tmpRAMbuffer = (char*) ps_malloc(len); sObj.remove("o");
else if (sObj[F("playlist")].isNull()) {
#endif presetToSave = 0; // we will save API immediately
tmpRAMbuffer = (char*) malloc(len); if (index < 251 && fileDoc) {
if (tmpRAMbuffer!=nullptr) { if (sObj["n"].isNull()) sObj["n"] = saveName;
serializeJson(*fileDoc, tmpRAMbuffer, len); writeObjectToFileUsingId(getName(index), index, fileDoc);
presetsModifiedTime = toki.second(); //unix time
updateFSInfo();
}
} else { } else {
writeObjectToFileUsingId(filename, index, fileDoc); // store playlist
includeBri = true; // !sObj["on"].isNull();
playlistSave = true;
} }
} else }
#endif
writeObjectToFileUsingId(filename, index, fileDoc);
if (persist) presetsModifiedTime = toki.second(); //unix time
if (bufferAllocated) releaseJSONBufferLock();
updateFSInfo();
} }
void deletePreset(byte index) { void deletePreset(byte index) {
StaticJsonDocument<24> empty; StaticJsonDocument<24> empty;
writeObjectToFileUsingId("/presets.json", index, &empty); writeObjectToFileUsingId(getName(), index, &empty);
presetsModifiedTime = toki.second(); //unix time presetsModifiedTime = toki.second(); //unix time
updateFSInfo(); updateFSInfo();
} }

View File

@@ -158,9 +158,9 @@ bool oappend(const char* txt)
void prepareHostname(char* hostname) void prepareHostname(char* hostname)
{ {
sprintf_P(hostname, "wled-%*s", 6, escapedMac.c_str() + 6);
const char *pC = serverDescription; const char *pC = serverDescription;
uint8_t pos = 5; uint8_t pos = 5; // keep "wled-"
while (*pC && pos < 24) { // while !null and not over length while (*pC && pos < 24) { // while !null and not over length
if (isalnum(*pC)) { // if the current char is alpha-numeric append it to the hostname if (isalnum(*pC)) { // if the current char is alpha-numeric append it to the hostname
hostname[pos] = *pC; hostname[pos] = *pC;
@@ -169,18 +169,14 @@ void prepareHostname(char* hostname)
hostname[pos] = '-'; hostname[pos] = '-';
pos++; pos++;
} }
// else do nothing - no leading hyphens and do not include hyphens for all other characters. // else do nothing - no leading hyphens and do not include hyphens for all other characters.
pC++; pC++;
} }
// if the hostname is left blank, use the mac address/default mdns name //last character must not be hyphen
if (pos < 6) { if (pos > 5) {
sprintf(hostname + 5, "%*s", 6, escapedMac.c_str() + 6); while (pos > 4 && hostname[pos -1] == '-') pos--;
} else { //last character must not be hyphen hostname[pos] = '\0'; // terminate string (leave at least "wled")
while (pos > 0 && hostname[pos -1] == '-') { }
hostname[pos -1] = 0;
pos--;
}
}
} }

View File

@@ -647,7 +647,7 @@ void WLED::initConnection()
DEBUG_PRINTLN("..."); DEBUG_PRINTLN("...");
// convert the "serverDescription" into a valid DNS hostname (alphanumeric) // convert the "serverDescription" into a valid DNS hostname (alphanumeric)
char hostname[25] = "wled-"; char hostname[25];
prepareHostname(hostname); prepareHostname(hostname);
#ifdef ESP8266 #ifdef ESP8266

View File

@@ -367,12 +367,7 @@ void getSettingsJS(byte subPage, char* dest)
// set limits // set limits
oappend(SET_F("bLimits(")); oappend(SET_F("bLimits("));
#if defined(ESP32) && defined(USERMOD_AUDIOREACTIVE) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C3)
// requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
oappend(itoa(WLED_MAX_BUSSES-2,nS,10)); oappend(","); // prevent use of I2S buses if audio installed. ESP32-S3 currently does not support these busses.
#else
oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(","); oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(",");
#endif
oappend(itoa(MAX_LEDS_PER_BUS,nS,10)); oappend(","); oappend(itoa(MAX_LEDS_PER_BUS,nS,10)); oappend(",");
oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(","); oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(",");
oappend(itoa(MAX_LEDS,nS,10)); oappend(itoa(MAX_LEDS,nS,10));