Commit Graph

643 Commits

Author SHA1 Message Date
Frank
c36e493b47 Fix strlcpy destination size parameters 2025-11-21 00:16:25 +01:00
Frank
7ef94bc6c7 use strlcpy instead of strcpy 2025-11-21 00:08:15 +01:00
Frank
e63dc7e71e longer segment names
* introducing WLED_MAX_SEGNAME_LEN from upstream
* default: max name length = 48
* hopefully found all places where the segment name length was hardcoded (32, 33, 34)
* some comments still refer to "32" but wtf
2025-11-20 23:49:26 +01:00
Frank
1583452c86 oops
fixes a mistake in previous commit
2025-11-18 23:19:25 +01:00
Frank
bc7a96d7d4 strip wait function: increase idle wait time to 120ms
Updated strip wait function to use longer idle wait time (similar to the timeout used by upstream WLED 0.16)
2025-11-18 23:13:47 +01:00
Damian Schneider
e5ab0b6077 Bugfix for gif player WRT inactive segment and bugfix in copy FX
- if a segment is destroyed or turned inactive, disable the gif player: only one gif player instance can run at a time, if a inactive or destroyed segment uses it, the effect is broken for other segments.

- copy FX ironically copied the source segment on each call, should use reference not a copy!
2025-11-16 20:48:27 +01:00
Frank
737b7cc471 bus robustness improvement
ABL and SerializeConfig explicitly check bus->isOK(), instead of relying on bus->getLength() == 0
2025-11-16 14:52:18 +01:00
Frank
9f31f2444f some precautions to prevent buffer out-of-bounds access and concurrency problems
* make sure that filenames can hold 32chars of segment.name
* fix logic error in Segment::drawCharacter
* protect free(Segment::_globalLeds) with a critical section
2025-11-14 22:43:44 +01:00
Frank
a833cb5706 JMap robustness and use-after-free fixes
* increased ArrayAndSize.size from 8bit to 16bit
* prevent out-of-bounds access in JMapC::getPixelColor
* do not delete[] SEGMENT.name from outside of segment class !!
2025-11-11 23:17:50 +01:00
Frank
1e14e4b4e5 fix minor bug (errorflag reset not working)
typo: == instead of =
2025-11-11 23:09:09 +01:00
Frank
e4c964ebaf deserializeMap robustness improvements
* make sure that fileName is big enough for segmentName".json"
* fix possible buffer overflow in f.readBytesUntil
* stop reading map{ } entries when customMappingSize is reached
* raise "low mem" error when malloc failed
2025-11-11 21:59:19 +01:00
Damian Schneider
71b7121ded bugfix: do not reset segments if unchanged #4969
lines were swapped, causing segment reset on every preset call.
2025-11-09 21:57:12 +01:00
Frank
d78ea5ae2e prevent bad filenames in "segment names as ledmap names"
Increase buffer size for fileName to accommodate long segment names (max 32 chars) without producing broken filenames.
2025-11-07 15:07:13 +01:00
Frank
5177ebd271 fix false warnings when temporarily exceeding MAX_SEGMENT_DATA
The segment copy constructors can temporarily exceed the budget of MAX_SEGMENT_DATA. The original segment will be de-allocated a few milliseconds later.
This change introduced an "overdraft" budget of 50% that can be used for temporary segment copies.
2025-11-06 22:09:11 +01:00
Frank
bb44dd8616 robustness improvements for image presets
prevent errors / crashes when drawing "i" images from a preset.
- prevent out-of-bounds writing (segment smaller than image)
- make sure that segment properties are cached correctly
- always do "show" when strip was triggered (avoids lost frames)
2025-11-04 20:28:26 +01:00
Frank
40064490ad strip level setPixelColor and getPixelColor optimization
* moved sPC and gPC functions out of their .cpp files into FX.h, so the compiler can optimize better.

depending of effect used, this gives a 2% up to 8% speedup.
2025-11-01 16:50:20 +01:00
Frank
3752409b46 no more ORANGE on effect memory failure
For maintainers of custom effects: replace "return mode_solid()" with "return mode_oops()"

Effect errors fall back to Akemi (2D) or Rainbow(1D) instead of SOLID ORANGE.
2025-10-27 11:24:12 +01:00
Frank
56380ce04c slightly faster to keep IRAM_ATTR for sPC and color_add 2025-10-26 01:41:30 +02:00
Frank
4713f26bb8 additional constants to improve upstream compatibility
* a few new error constants
*  WLED_O2_ATTR - ask the compiler for stronger optimization of a single function
*  WLED_O3_ATTR (WLEDMM) optimize even more
2025-10-25 23:43:44 +02:00
Will Tatam
c5a28c2977 only call endImagePlayback if reset true in resetIfRequired 2025-06-15 12:13:16 +01:00
Will Tatam
d9ab878503 Swap to WLED_ENABLE_GIF 2025-02-22 12:56:47 +00:00
Christian Schwinne
9caa7cb4e9 Fix missing GIF enable macros 2025-02-22 12:40:42 +00:00
Christian Schwinne
b8a29bcbf8 GIFs work again in principle 2025-02-22 12:37:13 +00:00
Frank
2c0063dc5b tiny optimization
* use bitmask operations in getBitFromArray, setBitInArray
* make currentBri "const"
2025-01-17 21:13:27 +01:00
Frank
8daf9d9ffb transition optimization (small speedup)
* move "progress()" into FX.h so the compiler can inline it
* removed redundant checks in  currentBri()
2025-01-16 18:26:10 +01:00
Frank
8317c891c1 better transitions overspeed bugfix
when the user wants less than 42 fps, respect this limit during transitions.
2025-01-10 13:50:25 +01:00
Frank
d9153854c4 bugfix: avoid effect speedups during transitions 2025-01-10 13:09:19 +01:00
Frank
f8a673ce81 code robustness improvements plus minor speedup
* make  XY() and _setPixelColorXY_raw() const (minor speedup)
* segment is a struct not a class: friend class Segment --> friend struct Segment
* fix missing braces around two macros
* use non-throwing "new" where possible
* improve robustness of transition code
2025-01-07 15:58:38 +01:00
Frank
02f51d4582 realtime mode bugfixes
- busses: ignore not valid bus instances
- "use main segment only": prevent flickering du to intermitted strip.service().
2024-12-20 17:47:07 +01:00
Frank
40bfe619b9 bugfix: avoid double blanking segments
if both seg.reset and seg.needsBlank were set, this caused a second (unwanted) blanking in frame 1.
2024-12-11 18:52:02 +01:00
Frank
972257a7ee minor code cleanup
* removed dead code
* prevent promotion to double
* made constants constexpr
* made some methods const
* fixed a few typo's
2024-12-04 22:18:39 +01:00
Frank
102d098e28 bugfix #3 for ghostly appearing switched-off segments 2024-12-04 18:05:37 +01:00
Frank
23d41e66c9 bugfix #2 for switched-off segments
segments that are "off" were still rendered during transitions.
2024-12-03 16:04:21 +01:00
Frank
9922d2aa8d bugfix: don't render segments that are "off" 2024-12-03 14:44:46 +01:00
Frank
f21b2949f1 fix for effect double restart problem when cross-fade is enabled
we only use palette and brightness transitions, so effect restart at the transition end is not required.
2024-11-27 21:13:46 +01:00
Frank
ce8fc8930e const const const
small speedup by declaring some functions "const"
2024-11-24 17:45:25 +01:00
Frank
5ea3aa9ce5 misses one 2024-11-14 00:00:58 +01:00
Frank
c73ed486e9 effect bugfixes for width>255
* band-aid for ripple, matrix, crazy bee
* arc mapping fix for diameter > 255
* small speedup for "block" mapping
2024-11-13 23:57:53 +01:00
Frank
b1194f597c fix for a potential endless loop in palette blending
this bug is hard to trigger - when a palette transition is in progress and the main loop gets delayed (wifi connect, saving large preset files) then a calculation in setCurrentPalette() could overflow leading to an infinite loop.
2024-11-08 12:12:22 +01:00
Frank
aafebf7aad bugfix: make pseudo-1D segments (width=1, height=x) work again 2024-11-07 19:34:19 +01:00
Frank
53ecf16ab1 bugfix: make freeze work again
the last commit had a side-effect that cause "freeze" to first blank the screen, then freeze.
2024-11-07 16:43:20 +01:00
Frank
d1541b520f Bugfix: remove ghost pixels when changing segment options
... transpose, mirror, reverse, grouping, spacing, size

* unlike AC WLED, when calling seg.fill(BLACK) from webserver context this usually has no effect --> added  markForBlank() that shedules segment blanking at the next drawing cycle
* fill previous segment with black when size, grouping or spacing changes
2024-11-07 14:36:39 +01:00
Frank
7fb3fe65b2 experimental: strict framerate limit for strip.show() 2024-11-06 13:19:54 +01:00
Frank
d53c0a31e9 FPS calculation minor improvement
seems to work better without rounding
2024-11-06 13:18:33 +01:00
Frank
7f3d43bc57 WS2812FX::service() fix for non-fastpath builds 2024-11-05 18:50:22 +01:00
Frank
a2e9e77ca7 setTargetFps with rounding 2024-11-05 18:07:17 +01:00
Frank
b793c7cb9c trying to stabilze FPS for Art-Net 2024-11-05 17:44:57 +01:00
Frank
68c4b830a6 legacy code cleanup 2024-11-04 14:17:59 +01:00
Frank
dc4964a491 small update
based on feedback from the PR to upstream
* support "0 FPS" meaning "unlimited"
* keep FRAMETIME_FIXED fixed
2024-11-04 13:47:05 +01:00
Frank
6bae356789 renaming
upstream has renamed "now" to "showNow" - so we follow
2024-11-01 17:17:54 +01:00