Commit Graph

1078 Commits

Author SHA1 Message Date
Damian Schneider
d1ed547a7c Improved bus handling: free choice of bus driver in any order and improved memory calculations (#5303)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
2026-02-14 19:00:37 +01:00
Frank Möhle
f830ea498c Clean up global variables namespace, save a few 100 bytes of flash (#5368)
* reduce scope of some variables to "static"

these are not used anywhere else. Making them static avoid name conflicts, cleans up the global scope and in some cases allows for better  optimization by the compiler.

* remove unused reference ``tz``from analog clock usermod

* side-catch: remove two "local var shadows global var" warnings

* reduce scope of functions declared globally, but not used anywhere else
Safe to make static
* declared in fcn_declare.h, only used locally in one file
* not declared in fcn_declare.h, only used locally

* HUB75 small optimization
make bit array functions "static inline"
-> better for optimization, saves some bytes because the compiler does not need to preserve a non-inline function copy for external references.

* a few more static functions
as suggested by the rabbit.
2026-02-11 22:24:06 +01:00
Damian Schneider
6b70c6ae91 Remove FRAMETIME return value from all FX (#5314)
* remove "return FRAMETIME" from all FX, fix timing for some FX

- all FX now render every frame, no more "speed up" during transitions

* fix missing return by adding FS_FALLBACK_STATIC macro

* add FX_FALLBACK_STATIC also to user_fx

* remove obsolete seg.next_time
2026-02-09 07:57:49 +01:00
gustebeast
0120b1ab79 Add user_fx installation instructions and a usermod config example (#5327)
* Update user_fx to include installation instructions and a usermod config example
* Explain installation when using multiple usermods
2026-02-06 07:16:25 +01:00
Damian Schneider
1ca55e42af fix relay not turning on at boot (#5315)
These changes eliminate an elaborate race condition
* add dedicated function to handle on/off and relay
* add clarifying comment on output set order
* add define for relay delay, honor forceOff in all cases
2026-01-31 17:40:53 +01:00
Damian Schneider
2c4ed4249d New custom palettes editor (#5010)
* full refactoring, added live preview, better minifying in cdata.js
* update main UI buttons, support for gaps in cpal files, cpal UI cleanup
* fixed some layout issues, added un-ordered cpal deletion
* changed to tab indentation, paste button border color now holds stored color
* fix preview to work properly and some other fixes in UI
* always unfreeze
* new approach to loading iro.js, add harmonic random palette, many fixes.
* decoupling iro.j, update UI of cpal.htm
- load iro.js sequentially
- no parallel requests in cpal.htm
- update UI buttons
- fix showing sequential loading of palettes (using opacity)
- better UX for mobile (larger markers, larger editor)
- various fixes
* small change to buttons
* load iro.js dynamically, remove iro.js from index.htm, revert changes to cdata.js
* improved visibility for very dark/black palettes and markers
2026-01-30 20:35:15 +01:00
Damian Schneider
1031e70d70 Replace buffer lock magic numbers with defines (#5217)
* replace magic numbers with defines
2026-01-30 08:14:53 +01:00
Frank Möhle
9683896a21 Merge pull request #5317 from gustebeast/wled-gtb-flash-size
Reduce flash size of TetrisAI_V2 by 97%, by removing includes of iostream, iterator and algorithm headers
2026-01-27 17:14:41 +01:00
Martin Fritzsche
ca1d6614b2 Add option to save unmodified presets to autosave usermod (#5175)
* Add option to save unmodified presets to autosave usermod

* Fix lastRun never being assigned
2026-01-24 16:26:47 -05:00
gustebeast
96f423438b Reduce flash size of TetrisAI_V2 by 97%
Main branch without Tetris
Flash: [========  ]  79.8% (used 1255301 bytes from 1572864 bytes)

Main branch with Tetris (+196kb)
Flash: [========= ]  92.3% (used 1452049 bytes from 1572864 bytes)

This commit with Tetris (+6kb, 97% less flash)
Flash: [========  ]  80.2% (used 1261625 bytes from 1572864 bytes)
2026-01-24 19:34:32 +00:00
Damian Schneider
6e9dc181e1 deepsleep cleanup, use toki to check for valid time 2026-01-10 12:36:07 +01:00
elanworld
fe3a158264 Improvements to deepsleep UM (#4456)
- add touch pin option
- add wake-up on timer macro
- fix powerup behaviour: now works as intended i.e. if no sleep delay set, it enters deepsleep on powerup but only then
- apply macro after wake up even if the window is missed
- respect date-range setting of macro
- removed non-existing pin from touch list
- removed non existing voltageCheck setting
- fixed incorrect threshold setting
- code cleanup
- fix pullup/pulldown for deep-sleep GPIOs

pin init is now working correctly, tested on all platforms

* remove unused statement

---------

Co-authored-by: Damian Schneider <daedae@gmx.ch>
2026-01-10 11:28:07 +01:00
Damian Schneider
5cfb6f984b Palettes fix (#5263)
* Fix for #5201
- use constants instead of magic numbers

Authored-by: Blaž Kristan <blaz@kristan-sp.si>
2026-01-03 10:07:04 +01:00
Damian Schneider
fa868568af minor bugfixes as suggested by the rabbit
- PulLightControl UM: dont release a lock you do not own
- off-by-one error in extractModeSlider (used only in rotary in UM)
- safety check in playlist in case something goes horribly wrong
2025-12-29 12:56:06 +01:00
nename0
8a2a7054ab Usermod Temperature: use full 12-bit precision (#4916)
* Usermod Temperature: use full 12-bit precision

* Temperature Usermod: fix DS1822 and DS18B20 family code

* Add Dropdown to select 9 or 12 bit resolution

* Add 10 and 11 bit resolution, Correct rounding towards negativ inf
2025-12-26 15:32:24 -05:00
Damian Schneider
624763cbc8 Bugfix in rotary encoder UM: off-by-1 in palette count 2025-12-17 18:49:19 +01:00
Frank
b452370be7 Merge pull request #5096 from netmindz/no-dmx-ar-conflict
fix for #4298 - no conflict with DMX output
Removes a compile-time error that was blocking compilation when DMX output mode was enabled, allowing successful builds with DMX support.

Important: this fix does not address the output buffer congestion problems that usually make WLED unstable with >100 LEDs on DMX Serial output. It only removes the compile-time blocker in audioreactive.
2025-12-15 21:54:54 +01:00
Frank
c114ea6b30 AR bugfix
prevents crash in case that audioSource creation (audio startup) failed
2025-12-02 22:57:45 +01:00
Blaž Kristan
a9811c2020 Variable button count (up to 32) (#4757)
* Variable button count (up to 32)
- adds ability to configure variable number of buttons during runtime
- fixes #4692
2025-11-27 17:00:58 +01:00
Frank
730205ded5 AR: SR_DMTYPE=254 => UDP sound receive only (experimental)
additional dmtype = 254 "driver" that keeps AR enabled in "sound sync only" mode.
2025-11-23 00:24:49 +01:00
Frank
90ca6ccf8b AR: handle stupid build flag SR_DMTYPE=-1
I don't know how the bad example "-D SR_DMTYPE=-1" made it into platformio_override.sample.ini  🫣
mic type -1 = 255 was never supported by AR, and lead to undefined behavior due to a missing "case" in setup().

Fixed. Its still a stupid build_flags option, but at least now its handled properly.
2025-11-23 00:02:56 +01:00
Will Tatam
d1ed5844e3 fix for #4298 - no conflict with DMX output 2025-11-17 17:43:25 +00:00
danewhero
d5002cce25 Update user_fx usermod README.md (#4754)
* turned into a fully fletched tutorial
2025-09-25 16:26:05 +02:00
Damian Schneider
529edfc39b "unrestricted" number of custom palettes (#4932)
- allow more than 10 custom palettes
- move palettes into CPP file
- Fix for minimizing cpal.htm (saves 2k of flash)
- shortened names in cpal, saves about 400 bytes of Flash after packing
- removed async from common.js loading to prevent errors on page loads if the file is not cached
- restricted nubmer of user palettes on ESP8266 to 10
- unrestricted number of user palettes on all other platforms (total max palettes: 256)
- added a warning when adding more than 10 palettes to let the user decide to risk it
- Bugfixes in palette enumeration, fixed AR palette adding
- AR palettes are now also added if there are more than 10 custom palettes

Co-authored-by: Blaž Kristan <blaz@kristan-sp.si>
2025-09-22 20:09:54 +02:00
Will Tatam
3a7de8275f Merge pull request #3777 from netmindz/HUB75-AC
Add HUB75 support
2025-09-20 13:05:48 +01:00
Damian Schneider
76cb2e9988 Improvements to heap-memory and PSRAM handling (#4791)
* Improved heap and PSRAM handling

- Segment `allocateData()` uses more elaborate DRAM checking to reduce fragmentation and allow for larger setups to run on low heap
- Segment data allocation fails if minimum contiguous block size runs low to keep the UI working
- Increased `MAX_SEGMENT_DATA` to account for better segment data handling
- Memory allocation functions try to keep enough DRAM for segment data
- Added constant `PSRAM_THRESHOLD` to improve PSARM usage
- Increase MIN_HEAP_SIZE to reduce risk of breaking UI due to low memory for JSON response
- ESP32 makes use of IRAM (no 8bit access) for pixeluffers, freeing up to 50kB of RAM
- Fix to properly get available heap on all platforms: added function `getFreeHeapSize()`
- Bugfix for effects that divide by SEGLEN: don't run FX in service() if segment is not active
-Syntax fix in AR: calloc() uses (numelements, size) as arguments

* Added new functions for allocation and heap checking

- added `allocate_buffer()` function that can be used to allocate large buffers: takes parameters to set preferred ram location, including 32bit accessible RAM on ESP32. Returns null if heap runs low or switches to PSRAM
- getFreeHeapSize() and getContiguousFreeHeap() helper functions for all platforms to correctly report free useable heap
- updated some constants
- updated segment data allocation to free the data if it is large

- replaced "psramsafe" variable with it's #ifdef: BOARD_HAS_PSRAM and made accomodating changes
- added some compile-time checks to handle invalid env. definitions
- updated all allocation functions and some of the logic behind them
- added use of fast RTC-Memory where available
- increased MIN_HEAP_SIZE for all systems (improved stability in tests)
- updated memory calculation in web-UI to account for required segment buffer
- added UI alerts if buffer allocation fails
- made getUsedSegmentData() non-private (used in buffer alloc function)
- changed MAX_SEGMENT_DATA
- added more detailed memory log to DEBUG output
- added debug output to buffer alloc function
2025-09-16 19:46:16 +02:00
Will Miles
a0321170d0 Merge pull request #4859 from Liliputech/udp_name_sync_rework
new usermod hooks "onUdpPacket"
2025-09-04 22:29:21 -04:00
netmindz
666a59ff53 Update platformio_override configuration for esp32 2025-09-02 08:06:41 +01:00
Will Tatam
199bc45ae2 Merge branch 'main' into HUB75-AC 2025-08-31 12:53:25 +01:00
Arthur Suzuki
c8757d45c8 fix more nitpicks comments 2025-08-30 04:12:46 +02:00
Arthur Suzuki
62fad4dcdf applied coderabbit suggestions 2025-08-30 01:52:36 +02:00
Liliputech
da7f107273 fix POV Display usermod (#4427)
* POV Display usermod

this usermod adds a new effect called "POV Image".
To get it to work:
- read the README :)
- upload a bmp image to the ESP filesystem using "/edit" url.
- select "POV Image" effect.
- set the filename (ie: "/myimage.bmp") as segment name.
- rotate the segment at approximately 20 RPM.
- enjoy the show!
* improve file extension checks
* improve README, remove PNGdec reference, clean usermod
* restrain to esp32 platform + reduce memory footprint with malloc
2025-08-29 20:42:54 +02:00
Arthur Suzuki
a60be251d2 fix nitpicks from coderabbit 2025-08-28 10:56:57 +02:00
Arthur Suzuki
4b5c3a396d applied suggestions from review 2025-08-25 22:22:51 +02:00
Arthur Suzuki
550b4d9dea fix comments for usermod hooks "onUdpPacket" 2025-08-24 15:54:45 +02:00
Liliputech
f3e3f585df usermod udp_name_sync : properly initialize packet if segment name is empty
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-24 13:52:39 +02:00
netmindz
2082b01a3c Apply suggestions from code review
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-21 08:53:11 +01:00
Arthur Suzuki
4de6656bc4 new usermod hooks "onUdpPacket"
this new hooks will help you implement new and custom protocols in
usermods.
I've provided an example (see usermods/udp_name_sync).
The example will help you share the main segment name across different
WLED instances.
The segment name can be useful to sync with some effects like GIF
image or scrolling text.

If you define new packet format in your usermod, make sure it will
either not collide with already used version of wled udp packet :
- 0 is for udp sync
- 1 is for AudioReactive data
- 2 is for udp_name_sync :)

Also, the onUdpPacket will override "parseNotification" if it returns "true".
Have fun!
2025-08-21 01:00:22 +02:00
quake1508
3fc653bbff Typo correction (#4756)
Compiling doesn't work because it doesn't find LD2410 in usermods.
The correct usermod is LD2410_v2
2025-07-06 16:22:44 +01:00
Will Tatam
beee4e9293 Fix deps for Si7021_MQTT_HA 2025-07-06 16:22:44 +01:00
Will Tatam
697ef4bdb7 Update buzzer to default to 21 if GPIO 32 is not defined 2025-07-06 16:22:44 +01:00
Will Tatam
ce323bed7a use extreme_partitions 2025-07-06 16:22:44 +01:00
Will Tatam
db8b378ee0 Fixing Si7021_MQTT_HA 2025-07-06 16:22:44 +01:00
Will Miles
63c3d5c89d Use existing board envs for usermod build 2025-07-06 16:22:44 +01:00
netmindz
b43f85c305 Update usermods/platformio_override.usermods.ini
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-07-06 16:22:44 +01:00
Will Tatam
f12840218e Add missing ${esp32_idf_V4.lib_deps} to usermods lib_deps 2025-07-06 16:22:44 +01:00
Will Tatam
5f224fa5f9 Fix build_flags and lib_deps for usermods# 2025-07-06 16:22:44 +01:00
Will Tatam
263150aeb3 fix envs 2025-07-06 16:22:44 +01:00
Will Tatam
164f213094 fix envs 2025-07-06 16:22:44 +01:00
Will Tatam
a6ce136843 fix custom_usermods setting 2025-07-06 16:22:44 +01:00