Skip to content

Commit 812c3bd

Browse files
committed
Merge branch 'main' into 0_14_2
2 parents d56e49c + 51b3d7c commit 812c3bd

File tree

11 files changed

+376
-337
lines changed

11 files changed

+376
-337
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## WLED changelog
22

3+
#### Build 2312290
4+
- Fix for #3622, #3613, #3609
5+
- Various tweaks and fixes
6+
- changelog update
7+
38
#### Build 2312230
49
- Version bump: 0.14.1-b2
510
- Fix for Pixel Magic button

platformio.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32d
4242
; default_envs = esp32s2_saola
4343
; default_envs = esp32c3dev
4444
; default_envs = lolin_s2_mini
45+
; default_envs = esp32s3dev_16MB_PSRAM_opi
4546

4647
src_dir = ./wled00
4748
data_dir = ./wled00/data
@@ -524,6 +525,11 @@ board_build.f_flash = 80000000L
524525
board_build.flash_mode = qio
525526
monitor_filters = esp32_exception_decoder
526527

528+
[env:esp32s3dev_16MB_PSRAM_opi]
529+
extends = env:esp32s3dev_8MB_PSRAM_opi
530+
board_build.partitions = tools/WLED_ESP32_16MB.csv
531+
board_upload.flash_size = 16MB
532+
527533
[env:esp32s3dev_8MB_PSRAM_qspi]
528534
;; ESP32-TinyS3 development board, with 8MB FLASH and PSRAM (memory_type: qio_qspi)
529535
extends = env:esp32s3dev_8MB_PSRAM_opi
@@ -642,6 +648,8 @@ upload_speed = 115200
642648
lib_deps = ${esp32c3.lib_deps}
643649
board_build.partitions = tools/WLED_ESP32_2MB_noOTA.csv
644650
board_build.flash_mode = dio
651+
board_upload.flash_size = 2MB
652+
board_upload.maximum_size = 2097152
645653

646654
[env:wemos_shield_esp32]
647655
board = esp32dev

usermods/Animated_Staircase/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Animated Staircase can be controlled by the WLED API. Change settings such a
1111
speed, on/off time and distance by sending an HTTP request, see below.
1212

1313
## WLED integration
14-
To include this usermod in your WLED setup, you have to be able to [compile WLED from source](https://github.com/Aircoookie/WLED/wiki/Compiling-WLED).
14+
To include this usermod in your WLED setup, you have to be able to [compile WLED from source](https://kno.wled.ge/advanced/compiling-wled/).
1515

1616
Before compiling, you have to make the following modifications:
1717

usermods/quinled-an-penta/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
The (un)official usermod to get the best out of the QuinLED-An-Penta (https://quinled.info/quinled-an-penta/), e.g. using the OLED and the SHT30 temperature/humidity sensor.
33

44
## Requirements
5-
* "u8gs" by olikraus, v2.28 or higher: https://github.com/olikraus/u8g2
5+
* "u8g2" by olikraus, v2.28 or higher: https://github.com/olikraus/u8g2
66
* "SHT85" by Rob Tillaart, v0.2 or higher: https://github.com/RobTillaart/SHT85
77

88
## Usermod installation

wled00/FX_fcn.cpp

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,21 @@ Segment::Segment(const Segment &orig) {
9090
//DEBUG_PRINTF("-- Copy segment constructor: %p -> %p\n", &orig, this);
9191
memcpy((void*)this, (void*)&orig, sizeof(Segment));
9292
_t = nullptr; // copied segment cannot be in transition
93-
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); } else { name = nullptr; }
94-
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); } else { data = nullptr; _dataLen = 0; }
93+
name = nullptr;
94+
data = nullptr;
95+
_dataLen = 0;
96+
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); }
97+
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
9598
}
9699

97100
// move constructor
98101
Segment::Segment(Segment &&orig) noexcept {
99102
//DEBUG_PRINTF("-- Move segment constructor: %p -> %p\n", &orig, this);
100103
memcpy((void*)this, (void*)&orig, sizeof(Segment));
104+
orig._t = nullptr; // old segment cannot be in transition any more
101105
orig.name = nullptr;
102106
orig.data = nullptr;
103107
orig._dataLen = 0;
104-
orig._t = nullptr; // old segment cannot be in transition any more
105108
}
106109

107110
// copy assignment
@@ -110,21 +113,15 @@ Segment& Segment::operator= (const Segment &orig) {
110113
if (this != &orig) {
111114
// clean destination
112115
if (name) { delete[] name; name = nullptr; }
113-
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); }
114-
if (_t) {
115-
#ifndef WLED_DISABLE_MODE_BLEND
116-
if (_t->_segT._dataT) free(_t->_segT._dataT);
117-
#endif
118-
delete _t;
119-
_t = nullptr; // copied segment cannot be in transition
120-
}
116+
stopTransition();
121117
deallocateData();
122118
// copy source
123119
memcpy((void*)this, (void*)&orig, sizeof(Segment));
124120
// erase pointers to allocated data
125121
data = nullptr;
126122
_dataLen = 0;
127123
// copy source data
124+
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); }
128125
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
129126
}
130127
return *this;
@@ -135,13 +132,7 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
135132
//DEBUG_PRINTF("-- Moving segment: %p -> %p\n", &orig, this);
136133
if (this != &orig) {
137134
if (name) { delete[] name; name = nullptr; } // free old name
138-
if (_t) {
139-
#ifndef WLED_DISABLE_MODE_BLEND
140-
if (_t->_segT._dataT) free(_t->_segT._dataT);
141-
#endif
142-
delete _t;
143-
_t = nullptr;
144-
}
135+
stopTransition();
145136
deallocateData(); // free old runtime data
146137
memcpy((void*)this, (void*)&orig, sizeof(Segment));
147138
orig.name = nullptr;
@@ -153,10 +144,13 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
153144
}
154145

155146
bool Segment::allocateData(size_t len) {
156-
if (data && _dataLen == len) return true; //already allocated
147+
if (data && _dataLen >= len) { // already allocated enough (reduce fragmentation)
148+
if (call == 0) memset(data, 0, len); // erase buffer if called during effect initialisation
149+
return true;
150+
}
157151
//DEBUG_PRINTF("-- Allocating data (%d): %p\n", len, this);
158152
deallocateData();
159-
if (len == 0) return(false); // nothing to do
153+
if (len == 0) return false; // nothing to do
160154
if (Segment::getUsedSegmentData() + len > MAX_SEGMENT_DATA) {
161155
// not enough memory
162156
DEBUG_PRINT(F("!!! Effect RAM depleted: "));

wled00/data/cpal/cpal.htm

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
45
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
56
<meta http-equiv="Pragma" content="no-cache">
67
<meta http-equiv="Expires" content="0">
@@ -45,6 +46,7 @@
4546
width: 7px;
4647
top: 50%;
4748
transform: translateY(-50%);
49+
touch-action: none;
4850
}
4951
.color-picker-marker {
5052
height: 7px;
@@ -94,9 +96,14 @@
9496
line-height: 1;
9597
}
9698
.wrap {
97-
width: 800px;
99+
width: 100%;
98100
margin: 0 auto;
99101
}
102+
@media (min-width: 800px) {
103+
.wrap {
104+
width: 800px;
105+
}
106+
}
100107
.palette {
101108
height: 20px;
102109
}
@@ -136,6 +143,9 @@
136143
.sendSpan, .editSpan{
137144
cursor: pointer;
138145
}
146+
h1 {
147+
font-size: 1.6rem;
148+
}
139149
</style>
140150
</head>
141151
<body>
@@ -349,24 +359,31 @@ <h1 style="display: flex; align-items: center;">
349359
var gradientLength = maxX - minX + 1;
350360

351361
elmnt.onmousedown = dragMouseDown;
362+
elmnt.ontouchstart = dragMouseDown;
352363

353364
function dragMouseDown(e) {
354365
removeTrashcan(event)
355366
e = e || window.event;
356-
e.preventDefault();
367+
var isTouch = e.type.startsWith('touch');
368+
if (!isTouch) e.preventDefault();
357369
// get the mouse cursor position at startup:
358-
mousePos = e.clientX;
370+
mousePos = isTouch ? e.touches[0].clientX : e.clientX;
359371
d.onmouseup = closeDragElement;
372+
d.ontouchcancel = closeDragElement;
373+
d.ontouchend = closeDragElement;
360374
// call a function whenever the cursor moves:
361375
d.onmousemove = elementDrag;
376+
d.ontouchmove = elementDrag;
362377
}
363378

364379
function elementDrag(e) {
365380
e = e || window.event;
366-
e.preventDefault();
381+
var isTouch = e.type.startsWith('touch');
382+
if (!isTouch) e.preventDefault();
367383
// calculate the new cursor position:
368-
posNew = mousePos - e.clientX;
369-
mousePos = e.clientX;
384+
var clientX = isTouch ? e.touches[0].clientX : e.clientX;
385+
posNew = mousePos - clientX;
386+
mousePos = clientX;
370387
mousePosInGradient = mousePos - (minX + 1)
371388

372389
truePos = Math.round((mousePosInGradient/gradientLength)*256);
@@ -393,7 +410,10 @@ <h1 style="display: flex; align-items: center;">
393410
function closeDragElement() {
394411
/* stop moving when mouse button is released:*/
395412
d.onmouseup = null;
413+
d.ontouchcancel = null;
414+
d.ontouchend = null;
396415
d.onmousemove = null;
416+
d.ontouchmove = null;
397417
}
398418
}
399419

wled00/data/settings_leds.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
// success event
2727
scE.addEventListener("load", () => {
2828
GetV();
29-
setABL();
3029
checkSi();
30+
setABL();
3131
d.Sf.addEventListener("submit", trySubmit);
3232
if (d.um_p[0]==-1) d.um_p.shift();
3333
pinDropdowns();

0 commit comments

Comments
 (0)