diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d86c8b2d..e835e2222 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,26 @@
## WLED changelog
-#### Build 2404050
-- Blending styles (with help from @tkadauke)
+#### Build 2404120
+- v0.15.0-b3
+- fix for #3896 & WS2815 current saving
+- conditional compile for AA setPixelColor()
+
+#### Build 2404100
+- Internals: #3859, #3862, #3873, #3875
+- Prefer I2S1 over RMT on ESP32
+- usermod for Adafruit MAX17048 (#3667 by @ccruz09)
+- Runtime detection of ESP32 PICO, general PSRAM support
+- Extend JSON API "info" object
+ - add "clock" - CPU clock in MHz
+ - add "flash" - flash size in MB
+- Fix for #3879
+- Analog PWM fix for ESP8266 (#3887 by @gaaat98)
+- Fix for #3870 (#3880 by @DedeHai)
+- ESP32 S3/S2 touch fix (#3798 by @DedeHai)
+- PIO env. PSRAM fix for S3 & S3 with 4M flash
+ - audioreactive always included for S3 & S2
+- Fix for #3889
+- BREAKING: Effect: modified KITT (Scanner) (#3763)
#### Build 2403280
- Individual color channel control for JSON API (fixes #3860)
diff --git a/package-lock.json b/package-lock.json
index db66b554b..b9dc5e0e3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "wled",
- "version": "0.15.0-b2",
+ "version": "0.15.0-b3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "wled",
- "version": "0.15.0-b2",
+ "version": "0.15.0-b3",
"license": "ISC",
"dependencies": {
"clean-css": "^5.3.3",
diff --git a/package.json b/package.json
index 6f7d634d3..b19ecc48a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "wled",
- "version": "0.15.0-b2",
+ "version": "0.15.0-b3",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
diff --git a/wled00/FX.cpp b/wled00/FX.cpp
index 14341f5b9..5592f7ba8 100644
--- a/wled00/FX.cpp
+++ b/wled00/FX.cpp
@@ -1125,57 +1125,62 @@ uint16_t mode_running_random(void) {
static const char _data_FX_MODE_RUNNING_RANDOM[] PROGMEM = "Stream@!,Zone size;;!";
-uint16_t larson_scanner(bool dual) {
- if (SEGLEN == 1) return mode_static();
- uint16_t counter = strip.now * ((SEGMENT.speed >> 2) +8);
- uint16_t index = (counter * SEGLEN) >> 16;
-
- SEGMENT.fade_out(SEGMENT.intensity);
-
- if (SEGENV.step > index && SEGENV.step - index > SEGLEN/2) {
- SEGENV.aux0 = !SEGENV.aux0;
- }
-
- for (int i = SEGENV.step; i < index; i++) {
- uint16_t j = (SEGENV.aux0)?i:SEGLEN-1-i;
- SEGMENT.setPixelColor( j, SEGMENT.color_from_palette(j, true, PALETTE_SOLID_WRAP, 0));
- }
- if (dual) {
- uint32_t c;
- if (SEGCOLOR(2) != 0) {
- c = SEGCOLOR(2);
- } else {
- c = SEGMENT.color_from_palette(index, true, PALETTE_SOLID_WRAP, 0);
- }
-
- for (int i = SEGENV.step; i < index; i++) {
- uint16_t j = (SEGENV.aux0)?SEGLEN-1-i:i;
- SEGMENT.setPixelColor(j, c);
- }
- }
-
- SEGENV.step = index;
- return FRAMETIME;
-}
-
-
/*
* K.I.T.T.
*/
uint16_t mode_larson_scanner(void){
- return larson_scanner(false);
-}
-static const char _data_FX_MODE_LARSON_SCANNER[] PROGMEM = "Scanner@!,Fade rate;!,!;!;;m12=0";
+ if (SEGLEN == 1) return mode_static();
+ const unsigned speed = FRAMETIME * map(SEGMENT.speed, 0, 255, 96, 2); // map into useful range
+ const unsigned pixels = SEGLEN / speed; // how many pixels to advance per frame
+
+ SEGMENT.fade_out(255-SEGMENT.intensity);
+
+ if (SEGENV.step > strip.now) return FRAMETIME; // we have a pause
+
+ unsigned index = SEGENV.aux1 + pixels;
+ // are we slow enough to use frames per pixel?
+ if (pixels == 0) {
+ const unsigned frames = speed / SEGLEN; // how many frames per 1 pixel
+ if (SEGENV.step++ < frames) return FRAMETIME;
+ SEGENV.step = 0;
+ index++;
+ }
+
+ if (index > SEGLEN) {
+
+ SEGENV.aux0 = !SEGENV.aux0; // change direction
+ SEGENV.aux1 = 0; // reset position
+ // set delay
+ if (SEGENV.aux0 || SEGMENT.check2) SEGENV.step = strip.now + SEGMENT.custom1 * 25; // multiply by 25ms
+ else SEGENV.step = 0;
+
+ } else {
+
+ // paint as many pixels as needed
+ for (unsigned i = SEGENV.aux1; i < index; i++) {
+ unsigned j = (SEGENV.aux0) ? i : SEGLEN - 1 - i;
+ uint32_t c = SEGMENT.color_from_palette(j, true, PALETTE_SOLID_WRAP, 0);
+ SEGMENT.setPixelColor(j, c);
+ if (SEGMENT.check1) {
+ SEGMENT.setPixelColor(SEGLEN - 1 - j, SEGCOLOR(2) ? SEGCOLOR(2) : c);
+ }
+ }
+ SEGENV.aux1 = index;
+ }
+ return FRAMETIME;
+}
+static const char _data_FX_MODE_LARSON_SCANNER[] PROGMEM = "Scanner@!,Trail,Delay,,,Dual,Bi-delay;!,!,!;!;;m12=0,c1=0";
/*
* Creates two Larson scanners moving in opposite directions
* Custom mode by Keith Lord: https://github.com/kitesurfer1404/WS2812FX/blob/master/src/custom/DualLarson.h
*/
uint16_t mode_dual_larson_scanner(void){
- return larson_scanner(true);
+ SEGMENT.check1 = true;
+ return mode_larson_scanner();
}
-static const char _data_FX_MODE_DUAL_LARSON_SCANNER[] PROGMEM = "Scanner Dual@!,Fade rate;!,!,!;!;;m12=0";
+static const char _data_FX_MODE_DUAL_LARSON_SCANNER[] PROGMEM = "Scanner Dual@!,Trail,Delay,,,Dual,Bi-delay;!,!,!;!;;m12=0,c1=0";
/*
@@ -3013,8 +3018,12 @@ uint16_t mode_bouncing_balls(void) {
}
int pos = roundf(balls[i].height * (SEGLEN - 1));
+ #ifdef WLED_USE_AA_PIXELS
if (SEGLEN<32) SEGMENT.setPixelColor(indexToVStrip(pos, stripNr), color); // encode virtual strip into index
else SEGMENT.setPixelColor(balls[i].height + (stripNr+1)*10.0f, color);
+ #else
+ SEGMENT.setPixelColor(indexToVStrip(pos, stripNr), color); // encode virtual strip into index
+ #endif
}
}
};
@@ -6047,8 +6056,8 @@ uint16_t mode_2Dfloatingblobs(void) {
}
}
uint32_t c = SEGMENT.color_from_palette(blob->color[i], false, false, 0);
- if (blob->r[i] > 1.f) SEGMENT.fill_circle(blob->x[i], blob->y[i], roundf(blob->r[i]), c);
- else SEGMENT.setPixelColorXY(blob->x[i], blob->y[i], c);
+ if (blob->r[i] > 1.f) SEGMENT.fill_circle(roundf(blob->x[i]), roundf(blob->y[i]), roundf(blob->r[i]), c);
+ else SEGMENT.setPixelColorXY((int)roundf(blob->x[i]), (int)roundf(blob->y[i]), c);
// move x
if (blob->x[i] + blob->r[i] >= cols - 1) blob->x[i] += (blob->sX[i] * ((cols - 1 - blob->x[i]) / blob->r[i] + 0.005f));
else if (blob->x[i] - blob->r[i] <= 0) blob->x[i] += (blob->sX[i] * (blob->x[i] / blob->r[i] + 0.005f));
diff --git a/wled00/FX.h b/wled00/FX.h
index fd0bb297b..6508566f2 100644
--- a/wled00/FX.h
+++ b/wled00/FX.h
@@ -182,7 +182,7 @@
#define FX_MODE_LIGHTNING 57
#define FX_MODE_ICU 58
#define FX_MODE_MULTI_COMET 59
-#define FX_MODE_DUAL_LARSON_SCANNER 60
+#define FX_MODE_DUAL_LARSON_SCANNER 60 // candidate for removal (use Scanner with with check 1)
#define FX_MODE_RANDOM_CHASE 61
#define FX_MODE_OSCILLATE 62
#define FX_MODE_PRIDE_2015 63
@@ -597,9 +597,11 @@ typedef struct Segment {
inline void setPixelColor(unsigned n, uint32_t c) { setPixelColor(int(n), c); }
inline void setPixelColor(int n, byte r, byte g, byte b, byte w = 0) { setPixelColor(n, RGBW32(r,g,b,w)); }
inline void setPixelColor(int n, CRGB c) { setPixelColor(n, RGBW32(c.r,c.g,c.b,0)); }
+ #ifdef WLED_USE_AA_PIXELS
void setPixelColor(float i, uint32_t c, bool aa = true);
inline void setPixelColor(float i, uint8_t r, uint8_t g, uint8_t b, uint8_t w = 0, bool aa = true) { setPixelColor(i, RGBW32(r,g,b,w), aa); }
inline void setPixelColor(float i, CRGB c, bool aa = true) { setPixelColor(i, RGBW32(c.r,c.g,c.b,0), aa); }
+ #endif
#ifndef WLED_DISABLE_MODE_BLEND
static inline void setClippingRect(int startX, int stopX, int startY = 0, int stopY = 1) { _clipStart = startX; _clipStop = stopX; _clipStartY = startY; _clipStopY = stopY; };
#endif
@@ -629,9 +631,11 @@ typedef struct Segment {
inline void setPixelColorXY(unsigned x, unsigned y, uint32_t c) { setPixelColorXY(int(x), int(y), c); }
inline void setPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0) { setPixelColorXY(x, y, RGBW32(r,g,b,w)); }
inline void setPixelColorXY(int x, int y, CRGB c) { setPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0)); }
+ #ifdef WLED_USE_AA_PIXELS
void setPixelColorXY(float x, float y, uint32_t c, bool aa = true);
inline void setPixelColorXY(float x, float y, byte r, byte g, byte b, byte w = 0, bool aa = true) { setPixelColorXY(x, y, RGBW32(r,g,b,w), aa); }
inline void setPixelColorXY(float x, float y, CRGB c, bool aa = true) { setPixelColorXY(x, y, RGBW32(c.r,c.g,c.b,0), aa); }
+ #endif
bool isPixelXYClipped(int x, int y);
uint32_t getPixelColorXY(uint16_t x, uint16_t y);
// 2D support functions
@@ -662,11 +666,14 @@ typedef struct Segment {
#else
inline uint16_t XY(uint16_t x, uint16_t y) { return x; }
inline void setPixelColorXY(int x, int y, uint32_t c) { setPixelColor(x, c); }
+ inline void setPixelColorXY(unsigned x, unsigned y, uint32_t c) { setPixelColor(int(x), c); }
inline void setPixelColorXY(int x, int y, byte r, byte g, byte b, byte w = 0) { setPixelColor(x, RGBW32(r,g,b,w)); }
inline void setPixelColorXY(int x, int y, CRGB c) { setPixelColor(x, RGBW32(c.r,c.g,c.b,0)); }
+ #ifdef WLED_USE_AA_PIXELS
inline void setPixelColorXY(float x, float y, uint32_t c, bool aa = true) { setPixelColor(x, c, aa); }
inline void setPixelColorXY(float x, float y, byte r, byte g, byte b, byte w = 0, bool aa = true) { setPixelColor(x, RGBW32(r,g,b,w), aa); }
inline void setPixelColorXY(float x, float y, CRGB c, bool aa = true) { setPixelColor(x, RGBW32(c.r,c.g,c.b,0), aa); }
+ #endif
inline bool isPixelXYClipped(int x, int y) { return isPixelClipped(x); }
inline uint32_t getPixelColorXY(uint16_t x, uint16_t y) { return getPixelColor(x); }
inline void blendPixelColorXY(uint16_t x, uint16_t y, uint32_t c, uint8_t blend) { blendPixelColor(x, c, blend); }
diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp
index 65054da70..fdcda88af 100644
--- a/wled00/FX_2Dfcn.cpp
+++ b/wled00/FX_2Dfcn.cpp
@@ -249,6 +249,7 @@ void IRAM_ATTR Segment::setPixelColorXY(int x, int y, uint32_t col)
}
}
+#ifdef WLED_USE_AA_PIXELS
// anti-aliased version of setPixelColorXY()
void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa)
{
@@ -292,6 +293,7 @@ void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa)
setPixelColorXY(uint16_t(roundf(fX)), uint16_t(roundf(fY)), col);
}
}
+#endif
// returns RGBW values of pixel
uint32_t IRAM_ATTR Segment::getPixelColorXY(uint16_t x, uint16_t y) {
diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp
index 4a3cccdfe..24d3415ac 100644
--- a/wled00/FX_fcn.cpp
+++ b/wled00/FX_fcn.cpp
@@ -818,6 +818,7 @@ void IRAM_ATTR Segment::setPixelColor(int i, uint32_t col)
}
}
+#ifdef WLED_USE_AA_PIXELS
// anti-aliased normalized version of setPixelColor()
void Segment::setPixelColor(float i, uint32_t col, bool aa)
{
@@ -850,6 +851,7 @@ void Segment::setPixelColor(float i, uint32_t col, bool aa)
setPixelColor(uint16_t(roundf(fC)) | (vStrip<<16), col);
}
}
+#endif
uint32_t IRAM_ATTR Segment::getPixelColor(int i)
{
diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm
index 2a5267825..c9a056f29 100644
--- a/wled00/data/settings_leds.htm
+++ b/wled00/data/settings_leds.htm
@@ -153,7 +153,7 @@
{
const t = parseInt(d.Sf["LT"+n].value); // LED type SELECT
gId('LAdis'+n).style.display = s.selectedIndex==5 ? "inline" : "none";
- d.Sf["LA"+n].value = s.value==="0" ? 55 : s.value;
+ if (s.value!=="0") d.Sf["LA"+n].value = s.value;
d.Sf["LA"+n].min = (isVir(t) || isAna(t)) ? 0 : 1;
}
function setABL()
@@ -417,7 +417,7 @@ mA/LED:
-