Skip to content

Commit

Permalink
Merge branch 'main' into 0_14_2
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Jan 4, 2024
2 parents d56e49c + 51b3d7c commit 812c3bd
Show file tree
Hide file tree
Showing 11 changed files with 376 additions and 337 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## WLED changelog

#### Build 2312290
- Fix for #3622, #3613, #3609
- Various tweaks and fixes
- changelog update

#### Build 2312230
- Version bump: 0.14.1-b2
- Fix for Pixel Magic button
Expand Down
8 changes: 8 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32d
; default_envs = esp32s2_saola
; default_envs = esp32c3dev
; default_envs = lolin_s2_mini
; default_envs = esp32s3dev_16MB_PSRAM_opi

src_dir = ./wled00
data_dir = ./wled00/data
Expand Down Expand Up @@ -524,6 +525,11 @@ board_build.f_flash = 80000000L
board_build.flash_mode = qio
monitor_filters = esp32_exception_decoder

[env:esp32s3dev_16MB_PSRAM_opi]
extends = env:esp32s3dev_8MB_PSRAM_opi
board_build.partitions = tools/WLED_ESP32_16MB.csv
board_upload.flash_size = 16MB

[env:esp32s3dev_8MB_PSRAM_qspi]
;; ESP32-TinyS3 development board, with 8MB FLASH and PSRAM (memory_type: qio_qspi)
extends = env:esp32s3dev_8MB_PSRAM_opi
Expand Down Expand Up @@ -642,6 +648,8 @@ upload_speed = 115200
lib_deps = ${esp32c3.lib_deps}
board_build.partitions = tools/WLED_ESP32_2MB_noOTA.csv
board_build.flash_mode = dio
board_upload.flash_size = 2MB
board_upload.maximum_size = 2097152

[env:wemos_shield_esp32]
board = esp32dev
Expand Down
2 changes: 1 addition & 1 deletion usermods/Animated_Staircase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Animated Staircase can be controlled by the WLED API. Change settings such a
speed, on/off time and distance by sending an HTTP request, see below.

## WLED integration
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).
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/).

Before compiling, you have to make the following modifications:

Expand Down
2 changes: 1 addition & 1 deletion usermods/quinled-an-penta/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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.

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

## Usermod installation
Expand Down
34 changes: 14 additions & 20 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,21 @@ Segment::Segment(const Segment &orig) {
//DEBUG_PRINTF("-- Copy segment constructor: %p -> %p\n", &orig, this);
memcpy((void*)this, (void*)&orig, sizeof(Segment));
_t = nullptr; // copied segment cannot be in transition
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); } else { name = nullptr; }
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); } else { data = nullptr; _dataLen = 0; }
name = nullptr;
data = nullptr;
_dataLen = 0;
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); }
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
}

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

// copy assignment
Expand All @@ -110,21 +113,15 @@ Segment& Segment::operator= (const Segment &orig) {
if (this != &orig) {
// clean destination
if (name) { delete[] name; name = nullptr; }
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); }
if (_t) {
#ifndef WLED_DISABLE_MODE_BLEND
if (_t->_segT._dataT) free(_t->_segT._dataT);
#endif
delete _t;
_t = nullptr; // copied segment cannot be in transition
}
stopTransition();
deallocateData();
// copy source
memcpy((void*)this, (void*)&orig, sizeof(Segment));
// erase pointers to allocated data
data = nullptr;
_dataLen = 0;
// copy source data
if (orig.name) { name = new char[strlen(orig.name)+1]; if (name) strcpy(name, orig.name); }
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
}
return *this;
Expand All @@ -135,13 +132,7 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
//DEBUG_PRINTF("-- Moving segment: %p -> %p\n", &orig, this);
if (this != &orig) {
if (name) { delete[] name; name = nullptr; } // free old name
if (_t) {
#ifndef WLED_DISABLE_MODE_BLEND
if (_t->_segT._dataT) free(_t->_segT._dataT);
#endif
delete _t;
_t = nullptr;
}
stopTransition();
deallocateData(); // free old runtime data
memcpy((void*)this, (void*)&orig, sizeof(Segment));
orig.name = nullptr;
Expand All @@ -153,10 +144,13 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
}

bool Segment::allocateData(size_t len) {
if (data && _dataLen == len) return true; //already allocated
if (data && _dataLen >= len) { // already allocated enough (reduce fragmentation)
if (call == 0) memset(data, 0, len); // erase buffer if called during effect initialisation
return true;
}
//DEBUG_PRINTF("-- Allocating data (%d): %p\n", len, this);
deallocateData();
if (len == 0) return(false); // nothing to do
if (len == 0) return false; // nothing to do
if (Segment::getUsedSegmentData() + len > MAX_SEGMENT_DATA) {
// not enough memory
DEBUG_PRINT(F("!!! Effect RAM depleted: "));
Expand Down
32 changes: 26 additions & 6 deletions wled00/data/cpal/cpal.htm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
Expand Down Expand Up @@ -45,6 +46,7 @@
width: 7px;
top: 50%;
transform: translateY(-50%);
touch-action: none;
}
.color-picker-marker {
height: 7px;
Expand Down Expand Up @@ -94,9 +96,14 @@
line-height: 1;
}
.wrap {
width: 800px;
width: 100%;
margin: 0 auto;
}
@media (min-width: 800px) {
.wrap {
width: 800px;
}
}
.palette {
height: 20px;
}
Expand Down Expand Up @@ -136,6 +143,9 @@
.sendSpan, .editSpan{
cursor: pointer;
}
h1 {
font-size: 1.6rem;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -349,24 +359,31 @@ <h1 style="display: flex; align-items: center;">
var gradientLength = maxX - minX + 1;

elmnt.onmousedown = dragMouseDown;
elmnt.ontouchstart = dragMouseDown;

function dragMouseDown(e) {
removeTrashcan(event)
e = e || window.event;
e.preventDefault();
var isTouch = e.type.startsWith('touch');
if (!isTouch) e.preventDefault();
// get the mouse cursor position at startup:
mousePos = e.clientX;
mousePos = isTouch ? e.touches[0].clientX : e.clientX;
d.onmouseup = closeDragElement;
d.ontouchcancel = closeDragElement;
d.ontouchend = closeDragElement;
// call a function whenever the cursor moves:
d.onmousemove = elementDrag;
d.ontouchmove = elementDrag;
}

function elementDrag(e) {
e = e || window.event;
e.preventDefault();
var isTouch = e.type.startsWith('touch');
if (!isTouch) e.preventDefault();
// calculate the new cursor position:
posNew = mousePos - e.clientX;
mousePos = e.clientX;
var clientX = isTouch ? e.touches[0].clientX : e.clientX;
posNew = mousePos - clientX;
mousePos = clientX;
mousePosInGradient = mousePos - (minX + 1)

truePos = Math.round((mousePosInGradient/gradientLength)*256);
Expand All @@ -393,7 +410,10 @@ <h1 style="display: flex; align-items: center;">
function closeDragElement() {
/* stop moving when mouse button is released:*/
d.onmouseup = null;
d.ontouchcancel = null;
d.ontouchend = null;
d.onmousemove = null;
d.ontouchmove = null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion wled00/data/settings_leds.htm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
// success event
scE.addEventListener("load", () => {
GetV();
setABL();
checkSi();
setABL();
d.Sf.addEventListener("submit", trySubmit);
if (d.um_p[0]==-1) d.um_p.shift();
pinDropdowns();
Expand Down
Loading

0 comments on commit 812c3bd

Please sign in to comment.