Commit Graph

6264 Commits

Author SHA1 Message Date
Frank
c185f37791 improved mutex error handling
- debug message in case of "unexpected" mutex errors
- removed experimental delay() in requestJSONBufferLock
2025-12-23 00:33:28 +01:00
Frank
1c2e6aac6e oppsie 2025-12-23 00:11:40 +01:00
Frank
d3076c43ec use a mutex to make requestJSONBufferLock / releaseJSONBufferLock robust
similar to upstream https://github.com/wled/WLED/pull/4089,
but with slightly different "failure" logic.
2025-12-23 00:05:16 +01:00
Frank
9b5ae9fff9 bugfix: suspendStripService held too long across stateUpdated() call
see discussion in https://github.com/MoonModules/WLED-MM/pull/293#issuecomment-3684424421
2025-12-22 23:58:19 +01:00
Frank
4345b32f97 protect WS2812FX::resetSegments boundsOnly path
the "boundsOnly" case can lead to ldsrgb re-allocation - better to protect it with segmentMux, too
2025-12-22 18:33:46 +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
68a76ff442 minor refactoring of critical sections
- define dummy macros for 8266, to avoid #ifdef ESP32
- small hint for readers who were not able to play arcade games in the 1980's ;-)
2025-12-22 17:59:22 +01:00
Frank
7459cbd2e2 setRealtimePixel robustness improvement
avoid drawing negative pixel addresses (could happen when  arlsOffset is < 0)
2025-12-22 01:38:49 +01:00
Frank
d3291cc5e5 fix off-by-one in dnrgbw handler 2025-12-22 01:32:47 +01:00
Frank
6993de1c8a debug message when realtimeLock fails, and fixing a few typos 2025-12-22 01:21:33 +01:00
Frank
f510bb075c bugfix: allow udp realtime mode 5 (dnrgbw)
previous condition would prevent the existing handler from actually executing
2025-12-22 01:07:42 +01:00
Frank
cb94cfafae extra debug message when Segment::setUp cannot get the mutex 2025-12-22 00:59:57 +01:00
Frank
bf6dbf0da4 fix realtimeOverride behaviour
the previous condition was not aligned with the override condition used in other places
2025-12-22 00:52:24 +01:00
Frank
fe63ebf1b7 deSerializeSegment robustness improvement
avoid creating an inconsistent configuration in case the mutex acquisition fails.
2025-12-22 00:39:11 +01:00
Frank
1038421544 atomic pointer swap in allocLeds() 2025-12-22 00:31:53 +01:00
Frank
af8eba6dfa use critical section in exitRealtime
the critical section ensures that cache clearing is performed as an atomic operation without task switch
2025-12-22 00:20:34 +01:00
Frank
50cc6f4c28 comment correction 2025-12-22 00:07:27 +01:00
Frank
73c54d7a57 replace potentially infinite wait with 2100ms max
better to end with an inconsistent state, than risk a lock-up until reset
2025-12-22 00:05:54 +01:00
Frank
30fcd6efad segment & bus.show mutex redesign
* separate mutexes for improved performance:
  - busses.show and effect drawing
  - critical changes to segment vector
  - block out critical segment changes while strip.service() loops over segments
* UDP realtime acquires mutex before drawing
  - prevents corrupted outputs, caused by parallel tasks updating pixels while busses.show() runs
2025-12-21 23:56:09 +01:00
Frank
c520d75729 prevent race conditions in realtimeLock / exitRealtime 2025-12-21 23:48:19 +01:00
Frank
21a452333e setRealtimePixel speedup
cache strip.getMainSegment(),  strip.getLengthTotal()), seg.length() instead of re-calculating them for each pixel
2025-12-21 23:11:15 +01:00
Frank
577d80d2ef segment drawing robustness improvements
* segment::fill() is also called outside the service loop - make sure that size is always calculated correctly
* leave _currentSeg in a meaningful state after strip.service()
2025-12-21 23:08:50 +01:00
Frank
b9e7621cd6 platformio.ini updates to include PixelForge
unrelated: enable some features that still fit into flash
2025-12-21 01:11:18 +01:00
Frank
ab4ae9a6b8 Merge branch 'mdev' into pixelforge_backport 2025-12-21 00:31:54 +01:00
Frank
62d938d8ba Add build info display for github builds
Added checks for release build environment and updated build info display.
2025-12-21 00:29:52 +01:00
Frank
37764ec3b9 UX improvements
- add buttons for PixelForge and PixelArt (settings page, below "file system" button
- abort build when PixelForge requested but GIF support missing
- "support" PixelMagic with error message - known issues with bigger images
2025-12-20 23:55:59 +01:00
Frank
855e6737be minor html and JS fixes
* avoid implicit creation of global vars
* removed stray </small>
* fix assignment with undefined variables
2025-12-20 21:19:55 +01:00
Frank
7df63db744 and mutex for all
revised mutex and critical section handling for segment drawing
- simplified code with macros (no more #if ESP32 ... #endif)
- remove some critical sections (prevents interrupt stalling)
- added mutex to functions that change the list of segments
- added mutexes to all (potential) background drawing code
- use recursive mutexes to prevent accidental self-locking of tasks
2025-12-20 17:13:52 +01:00
Frank
e5a3942610 fix for "giving a semaphore never taken" 2025-12-20 01:14:13 +01:00
Frank
0d24bb3b73 E1.31 kill switch
unchecking "Receive UDP realtime" in Sync settings will immediately end realtime display, also over webSockets.
2025-12-20 00:31:43 +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
10c20b7a4b serve common.js via serveSettingsJS
this got lost while backporting upstream code
2025-12-19 13:25:15 +01:00
Frank
eeb4973a2e support common.js (future support for VideoLab tool) 2025-12-19 00:51:39 +01:00
Frank
45b97e8028 PixelForge adaptations for version 14.x
* different call for listing images
* different call for deleting images
* minor cleanups
2025-12-18 23:51:48 +01:00
Damian Schneider
0f5c1d5a0f "WLEDPixelForge": new image & scrolling text interface (#4982)
replaces the pixel magic tool with a much more feature-rich tool for handling gif images. Also adds a scrolling text interface and the possibility to add more tools with a single button click like the classic pixel magic tool and the pixel-painter tool.
2025-12-18 23:44:01 +01:00
Frank
114bdb416f upgrade HTML data build system - use same tools as in upstream WLED
align with tools/cdata.js from upstream WLED

--> prerequisite for pixelforge tool !
2025-12-18 23:40:23 +01:00
Copilot
5deaf92373 Fix TypeError when loading UI with custom palette selected (#5205)
* Add null check to fix circular dependency with custom palettes

Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>

* Refactor: move null check earlier for better efficiency

Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
2025-12-18 23:22:03 +01:00
Frank
bc7cf062e8 effect math sppedup - up to 3x faster
-> distortion waves 3x speedup
-> hiphotic 2x speedup
-> waving cell 1.5x speedup

* replace sin8_t by lookup-table with pre-computed values
* moved integer sin and cos to fcn_declare.h (inlined by the compiler)
* moved gamma32 to fcn_declare.h (inlined by the compiler)
* a few other small tweaks
2025-12-17 21:59:22 +01:00
Frank
49e6de33c7 soap effect speedup (MM specific)
* postpone LEDs pixel drawing to the end of effect -> up to 30% faster
* some minor optimizations: reduce heap fragmentation, use "fast" types
2025-12-17 16:55:09 +01:00
Frank
4ec939cb4c build 2512171 2025-12-17 01:21:17 +01:00
Frank
5849e02e23 no effect data limits for PSRAM boards (upstream backport) 2025-12-17 01:19:24 +01:00
Frank
87fc226213 more segment data for PSRAM boards 2025-12-17 01:10:05 +01:00
Frank
6138def82f use WLED-MM error effect instead of plain orange 2025-12-17 01:09:29 +01:00
Frank
02d23b3316 fixing some compiler warnings
signed vs. unsigned, deprecated functions, printf parameter size mismatch
2025-12-17 00:03:18 +01:00
Frank
f4fd244808 comment updated 2025-12-16 23:26:26 +01:00
Frank
1ba2749343 more renaming
to avoid name clashes with vLength()
2025-12-16 23:26:02 +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
Will Tatam
db5f3f7461 Merge pull request #5156 from Aogu181/main
Add Gledopto Series With Ethernet
2025-12-16 20:09:48 +01:00
Damian Schneider
69d4970a6b clear enable bit on unused time macros (#5134)
disables the checkmark in UI on unused macros
2025-12-16 19:56:58 +01:00
Frank
fde6aa888e post-merge
* align meteor effect with upstream code
* unified meteor & meteor smooth
2025-12-16 02:40:02 +01:00