Commit Graph

516 Commits

Author SHA1 Message Date
Frank
5fe12eef5a Merge branch 'mdev' into audio_fastpath 2023-07-08 19:23:36 +02:00
Frank
2562f308ca fix power calculation for NeoPixelBusLg
power estimation results from estimateCurrentAndLimitBri() were too low (example: estimated 1.3Amp, measured 1.6Amp). This change corrects the power calculation. Due to the changed behavior of getPixelColor, powerSum must be used as-is, not scaled down again by brightness.
2023-07-08 19:13:20 +02:00
Frank
7e34781212 ABL optimization
this optimization avoids to apply brightness two times .

NeoPixelBusLg has already applied global brightness at sPC. Due to internal working of the Lg bus, its sufficient to only post-apply scaling, and set the new (scaled) brightness for the next frame.
2023-07-03 19:41:51 +02:00
Frank
a71be02b89 de-optimization
first version still cased some flickering.
This de-optimization makes LEDs more stable.
2023-07-03 19:41:51 +02:00
Frank
358f37b7ca optimization for ABL hotfix
* adding an optional parameter to setBrightness(). ApplyPostAdjustments() will only be called if `immediate=true`. Only ABL will use immediate=true, to ensure electrical safety of equipment.

This allows some optimizations of performance, as ApplyPostAdjustments() is time consuming.

* busses.setBrightness(bri) --> applied to all future pixels (fast, lossless)
* busses.setBrightness(bri, true) --> applied directly to all previously set pixels (slower, lossy)
2023-07-03 19:41:50 +02:00
Frank
29644ccf79 ABL optimization
this optimization avoids to apply brightness two times .

NeoPixelBusLg has already applied global brightness at sPC. Due to internal working of the Lg bus, its sufficient to only post-apply scaling, and set the new (scaled) brightness for the next frame.
2023-07-03 19:26:02 +02:00
Frank
ecf331792b de-optimization
first version still cased some flickering.
This de-optimization makes LEDs more stable.
2023-07-03 19:26:02 +02:00
Frank
3cc1d30090 optimization for ABL hotfix
* adding an optional parameter to setBrightness(). ApplyPostAdjustments() will only be called if `immediate=true`. Only ABL will use immediate=true, to ensure electrical safety of equipment.

This allows some optimizations of performance, as ApplyPostAdjustments() is time consuming.

* busses.setBrightness(bri) --> applied to all future pixels (fast, lossless)
* busses.setBrightness(bri, true) --> applied directly to all previously set pixels (slower, lossy)
2023-07-01 20:23:39 +02:00
Frank
582b96f846 robustness improvements
* handling of stop = 0 when calculating sizes (avoid unsigned underflow)
* make sure groupLength() is never zero (to avoid div/0)
* gapmaps: check for "(gapSize > 0)" added.

not sure if all the checks are 100% needed, but they will improve robustness in corner cases.
2023-06-21 13:30:40 +02:00
Frank
310daa61a8 improve segment code robustness
* Avoid uint16 underflow in width() and height(): stop > start is possible, and means "inactive segment".

* use size_t for ledsrgbSize, _dataLen and _usedSegmentData -  uint16_t could overflow in some situations.

* try to catch attempts to allocate zero bytes (inactive segment => size 0)
2023-06-21 01:43:26 +02:00
Frank
3127c60b41 Merge branch 'mdev' into audio_fastpath 2023-06-15 20:54:57 +02:00
Ewoud
a450334e46 Part 3 2023-06-15 11:51:22 +02:00
Ewoud
3195606ca8 Part 2 2023-06-15 11:41:19 +02:00
Ewoud
117dd52ce4 Ledmap 1D / no width/height 2023-06-15 11:29:41 +02:00
Ewoud
07fdeb3ab7 Ledmaps without width and height specified 2023-06-13 17:58:00 +02:00
Frank
d4a37ecaea clean up ledmap names when directly reading from file 2023-06-09 17:26:44 +02:00
Frank
64139efc13 clean up ledmap names when directly reading from file 2023-06-09 17:03:04 +02:00
Frank
7dcc8f1d1f enumerateLedmaps improvements
improve reading on ledmap names
* remove trailing " " "," "\r"
* clear buffer between reads
* fix for a 1-byte buffer overflow
2023-06-08 22:31:39 +02:00
Frank
23ea201b43 enumerateLedmaps improvements
improve reading on ledmap names
* remove trailing " " "," "\r"
* clear buffer between reads
* fix for a 1-byte buffer overflow
2023-06-08 22:26:55 +02:00
Ewoud
b473a40037 Tiny things 2023-06-08 19:25:38 +02:00
Ewoud
5c7937507b Bug fix segment view, use ledmapMaxSize (TroyHack) 2023-06-08 19:24:37 +02:00
Ewoud
3560b27dc1 Tiny things 2023-06-08 18:47:56 +02:00
Ewoud
8d43af6acc Bug fix segment view, use ledmapMaxSize (TroyHack) 2023-06-08 18:34:10 +02:00
Ewoud
b95ff2d74f Merge remote-tracking branch 'upstream/main' into mdev 2023-06-07 20:54:04 +02:00
Frank
af6091b493 fixing some memory leaks
* audio_reactive.h: catch memory errors from WiFiUDP
* udp: explicitly flush unused receive buffers.
* wled.cpp: additional debug info about "largest available block"
* FX_fcn.cpp: free _globalLeds before running purgeSegments().
2023-06-07 17:10:32 +02:00
TroyHacks
143f84238f WLED_DEBUG_MAPS flag added 2023-06-06 19:44:02 -04:00
Frank
aded74d8b1 suspendStripService improvements
* also suspend Transitions, Notifications and Live LED updates while strip or segments are under update from the Web UI.
2023-06-04 20:30:03 +02:00
Frank
63b03a4139 Merge branch 'mdev' into audio_fastpath 2023-06-01 21:58:34 +02:00
Frank
404fb566fa partly disable waitUntilIdle() as its still work-in-progress
This disables parts of the new feature that might lead to delays, so basicially there is some detection, but no protection any more.

further development needed --> audio_fastpath branch

compile with -D WLEDMM_PROTECT_SERVICE to enable full protection.
2023-06-01 21:55:46 +02:00
Frank
333f5ac2a1 waitUntilIdle() improvements
* protect deserializeMap()
* better handling of recursion in deserializeSegment() and deserializeState
* don't use yield() on esp32
2023-06-01 21:28:46 +02:00
Frank
52fe8e28a3 Merge branch 'mdev' into audio_fastpath 2023-06-01 17:44:36 +02:00
Frank
0a5bfb656d avoid updating strip / segments while draving effects (ESP32 only)
💫 this is the way🌟
A new locking mechanism that allows to wait until strip.service() has completed.
2023-06-01 17:41:36 +02:00
Sebastian
9d22a06969 Changes for allowing Alexa to change light color to White when auto-calculating from RGB (#3211)
* Changes for allowing Alexa to change light color to White when auto-calculating from RGB

* Update alexa.cpp

Indention

* Do not rely on global auto white override

(gets white mode from segment light capabilities)

* alexa.cpp: Removed unnecessary whitespaces

---------

Co-authored-by: Aircoookie <21045690+Aircoookie@users.noreply.github.com>
2023-05-31 20:12:17 +02:00
Frank
1daeecc7dd Merge branch 'mdev' into audio_fastpath 2023-05-30 20:44:10 +02:00
Blaž Kristan
69ab2ce402 Merge branch 'main' into feature 2023-05-30 16:20:20 +02:00
Blaz Kristan
0a5aac724a Merge branch 'main' into seg-groups 2023-05-29 21:35:52 +02:00
Ewoud
5081cfb891 Bug fix, allocate string to store ledmap name 2023-05-29 19:16:17 +02:00
Ewoud
b1e9f825ca Bug fix, allocate string to store ledmap name 2023-05-29 18:33:49 +02:00
Blaz Kristan
5a8a8dc292 Feature implementation
- #2236
  - #1984
Better PSRAM handling
platformio.ini update
On/Off bus handling
2023-05-28 22:50:19 +02:00
Frank
6d78e46a47 strip.service() optimization
to have more stable frame times, the minimum delay should be calculated from the time BEFORE strip.show() not after.

This optimization increases CPU load and potentially has negative impact on usermods that check for strip.isUpdating(), so its only enabled with WLEDMM_FASTPATH.
2023-05-26 23:37:01 +02:00
Frank
9cb6189611 minor speedup for 2D
* robustness: Segment::height() should never return 0
* Segment::XY(), Segment::virtualWidth() and Segment::virtualHeight() declared inline in fx.h. The compiler will always inline these functions now, avoiding overhead of call/return. "Knowing" the function body might also enable other optimizations.
--> up to 10% speedup in 2D effects.
2023-05-26 23:12:49 +02:00
Frank
71153ee832 small debug improvements
- don't set -DNDEBUG -> this flag is "not recommended"
- minor change in deserializeMap() WLED_DEBUG code
2023-05-25 21:50:44 +02:00
Frank
0a826f10ad small debug improvements
- don't set -DNDEBUG -> this flag is "not recommended"
- minor change in deserializeMap() WLED_DEBUG code
2023-05-25 21:38:08 +02:00
Ewoud
305a5b19c4 leds(rgb): also adjusted if new ledmap + grow not shrink (unless...)
FX.h: add ledsrgbSize and allocLeds()
FX_fcn.cpp: 
- copy constructor: allocLeds()
- move constructor: no change
- copy assignment: reuse! + allocLeds()
- move asignment: no change
- resetIfRequired: no free
- setUpLeds/resetSegments: allocLeds()

unless...: copy constructor aften called. That is the bad boy causing re-allocs at every effect change!
2023-05-24 14:59:39 +02:00
Frank
d8726293bf Merge remote-tracking branch 'upstream/main' into mdev 2023-05-22 02:21:23 +02:00
Frank
eeb06e0f4d Merge remote-tracking branch 'upstream/main' into mdev 2023-05-22 02:03:56 +02:00
Frank
fc193408d8 (experimental) use malloc/realloc for customMappingTable
if this works better, we should cherry-pick it into mdev.
2023-05-21 19:38:04 +02:00
Blaz Kristan
bffeec1615 Remove PSRAM use from global LED buffer. 2023-05-21 18:37:18 +02:00
Frank
894fdce4b5 Merge remote-tracking branch 'upstream/main' into mdev 2023-05-21 15:21:22 +02:00
Frank
2cbdc55a85 Merge remote-tracking branch 'upstream/main' into mdev 2023-05-21 14:53:49 +02:00