Commit Graph

493 Commits

Author SHA1 Message Date
Frank
49130c9ec9 (chores) cleanup some compiler warnings
* switch-cases that fall through
* potential buffer overflow in improv.cpp
* potentially uninitialized variables in FX.cpp
* potential array out-of-range on segment::col[]
* minor optimization: only apply gamma correction when result is needed
* tag some possibly unused variables with   [[maybe_unused]]
2026-03-11 13:54:58 +01:00
Frank
b994cf5b95 make CHSV32 availeable to effects 2026-03-11 12:37:01 +01:00
Frank
7f889763d1 flow effect bugfix
effect was showing blak when using default palette
2026-03-03 23:13:34 +01:00
Frank Möhle
cce3c0b5d3 psram-aware malloc functions (backport of upstream #4895) (#342)
Introduces new memory allocation functions, based on wled#4895 by @DedeHai

* keep a minimum of 15KB RAM available to UI - improves stability
* S3/S2/C3 automatically use "fast RTC Ram" for small data (reduces fragmentation)
* auto-detects PSRAM (or no PSRAM) when firmware was built with -D BOARD_HAS_PSRAM
* d_malloc() and d_calloc() prefer DRAM if possible (faster), but fall back to PSRAM when free RAM gets low.
2026-02-18 17:57:47 +01:00
netmindz
bf4aae8e60 Merge pull request #4682 from DedeHai/PS_galaxy
Add new effect: PS Galaxy
2026-01-17 11:52:46 +01:00
Frank
428becc301 inline segment palette functions for speed
* make currentMode() inline
* move currentColor() to FX.h
* move Segment::color_wheel() and Segment::color_from_palette() to FX.h
* add a little helper function to fx.h, so it can access strip.paletteBlend which is not defined yet
2026-01-10 01:25:24 +01:00
Frank
39344382c7 WS2812FX::service() cleanup
- _isServicing is not critical any more -> move back into bitfield
- remove experimental deactivated code from WS2812FX::service()
2025-12-22 18:10:51 +01:00
Frank
c25f082231 improve stability of DDP via tcp_task (websockets)
* protect pixel buffer changes with critical section
* protect segment list modification with critical section
* make _isServicing and _triggered atomic (move out of packed bitarray)
* allow custom timeout for waitUntilIdle - DDP needs a longer timeout
* protect strip.show() and effect drawing functions with mutex, to prevent crashes
2025-12-19 18:13:20 +01:00
Frank
87fc226213 more segment data for PSRAM boards 2025-12-17 01:10:05 +01:00
Frank
3ac0a0a619 segment functions for better upstream compatibility
* added vLength(), vHeight(), vWidth() and mapped them to their WLED-MM counterparts
* added SEG_W and SEG_H macros
* minor variable renaming to avoid name clashes with vWidth, vHeight, vLength
2025-12-16 23:22:38 +01:00
Damian Schneider
b08f5a43c4 Adding Shimmer FX (#4923)
Sends a shimmer across the strip at defined (or random) intervals
Optional brightness modulators: sine or perlin noise
Can be used as an overlay to other effects.
2025-12-15 22:52:34 +01:00
Frank
e6676372d8 refactor / cleanup font selection logic
* centralize font selection logic into  getFontInfo()
* removed unneeded parameter "numberOfChars" from drawText()
* new file: wled_fonts.hpp to centralize font management logic (inline)
* only compile wchar16ToCodepage437 when WLED_ENABLE_FULL_FONTS
* minor cleanup
2025-11-21 17:04:08 +01:00
Frank
45f793b338 first light 👍😅
* idea seems to work
* scrolling is broken, probably I need to create a unicode-aware ``strlen``
2025-11-20 13:57:55 +01:00
Frank
6a4716e490 decoder robustness improvements, and some nitpick 2025-11-20 00:12:26 +01:00
Frank
8219feb41e more dummies
just to sketch out the final implementation
2025-11-19 18:04:09 +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
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
d5dee6f58a small segment level setPixelColor and getPixelColor optimization
replaced CRGB -> RGBW32 conversion with FastLED native ``uint32_t(c) & 0x00FFFFFF`` operator.  `
`& 0x00FFFFFF`` is needed to cut out the "alpha" channel, because the fastLED operator return RGBA not RGBW.

--> slightly faster
2025-11-01 17:06:58 +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
13331e3de0 const WS2812FX::setPixelColorXY
small optimization for speed
2025-10-31 11:09:45 +01:00
netmindz
a9cdc56f51 Merge pull request #226 from netmindz/gif-MM
GIF Playback
2025-06-29 20:12:20 +01:00
Damian Schneider
d6406540a2 reverted FX re-enumeration 2025-04-27 12:19:36 +02:00
Damian Schneider
66e2e4d900 Adding Particle System (port from AC)
- port from AC
- also adding hardware random functions
2025-04-18 17:04:14 +02:00
Will Tatam
132244cb42 Fix build errors 2025-02-22 12:53:37 +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
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
6e14dac049 ripple and rain effect fixes (for large fixtures)
* made timing calculations work with large led counts
* improve randomness by injecting esp_random()
* ripple 2D: avoid ugly artifacts, by limiting circles to on-screen coordibnates
2024-12-12 17:25:46 +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
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
0dbde5a257 audioreactive multi-comet (backported from WELD-SR 0.13.4) 2024-12-03 13:06:47 +01:00
Frank
5a2096ab21 partly inline getPixelColorXY
allows the compiler to inline access to ledsrgb[] , while still keeping the "no buffer" case in a separate function so program size does not blow up.

--> up to 10% faster
2024-11-24 19:09:35 +01:00
Frank
ce8fc8930e const const const
small speedup by declaring some functions "const"
2024-11-24 17:45:25 +01:00
Frank
202255849f fix errors when width>255 or height>255
some effects still don't work when x y dimensions do not fit into 8bit
2024-11-13 23:06:27 +01:00
Frank
aafebf7aad bugfix: make pseudo-1D segments (width=1, height=x) work again 2024-11-07 19:34:19 +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
d0f90d0dd2 effect FPS tinkering 2024-11-04 16:28:13 +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
1c782aa369 improvement for non-fastpath 2024-11-01 14:58:12 +01:00
Frank
7c0ecdf7c4 make "target FPS" work 2024-11-01 14:51:12 +01:00
Frank
e652bd7064 do not restart effects after LEDs off/on 2024-10-27 17:26:04 +01:00
Frank
a99a54c9fa cache SEGMENT
actually its just a minor speedup, at least with -O2
2024-10-20 01:06:18 +02:00
Frank
7c6178418a cache virtualLength() and some cleanup
speedup for 1D->2D mapping
2024-10-19 23:29:53 +02:00
Frank
22b16ab542 Align all licensing statements with EUPL-1.2 2024-10-14 21:52:52 +02:00
Frank
e103a96eea Merge pull request #147 from Brandon502/mdev
2D Effect Snow Fall
2024-10-03 00:21:33 +02:00
Frank
1e5b246871 small fixes
very minor changes:
* HUB75 bus don't leave _len uninitialized, handle display == nullptr before using display members
* __attribute__((pure)) was in the wrong location
* wled00.ino: made lps (loops-per-second) calculation a bit more accurate
2024-10-03 00:19:18 +02:00
Brandon502
18e22f5b5f Merge remote-tracking branch 'upstream/mdev' into mdev 2024-10-02 17:43:15 -04:00
Frank
a0f07cabcb make a few getters "constexpr" as they just return a constant
constexpr ensures that the compiler will replace the "getter" call with the value return, saving function call overhead.

based on an idea from @blazoncek
2024-09-29 14:59:54 +02:00
Frank
2aa0d47036 adding getPixelColorRestored()
similar to getPixelColor, but returns the original pixel without brightness adjustments.

* getPixelColorRestored is used by segment::sPC and segment::gPC
* getPixelColor is still used by ABL (auto brightness limiter)
2024-09-28 02:43:12 +02:00
Frank
3a506aded2 trying to keep scrolling text readable
the problem (partly solved) is that scrolling text does not erase any previous text, but simply paints pixels in addition.

* add a "shadow" area around each letter, which is explicitly painted black
* only possible when  Trail=0, and overlay option selected
2024-09-28 02:12:53 +02:00