Commit Graph

6092 Commits

Author SHA1 Message Date
Frank
e4f4294233 strlen => strnlen 2025-11-20 00:41:21 +01:00
Frank
0b1d22b8f1 error codes 2025-11-20 00:34:33 +01:00
Frank
6a4716e490 decoder robustness improvements, and some nitpick 2025-11-20 00:12:26 +01:00
Frank
5597695865 UFT-8 to UTF-16 decoder
* should properly decode all unicodes that fit into 2bytes UTF-16
* with error handling for well-known "malformed UTF-8" expoits
* puh, this stuff looks simple but the details are CRAZY 😝
2025-11-19 23:48:30 +01:00
Frank
8219feb41e more dummies
just to sketch out the final implementation
2025-11-19 18:04:09 +01:00
Frank
55c9741f01 new functions prototypes, minor fixes
* prototypes for UTF-8 ==> wchar16 conversion
* minor fixes
2025-11-19 17:40:11 +01:00
Frank
43ab0dd468 Full Codepage 437 support
part1:

* enable all bitmaps already defined in the font files (increases firmware by ~7KB)
* add traslation for unicode -> codepage437 (as used by font files)
2025-11-19 17:07:30 +01:00
Frank
219355d047 AR audio sync: improved sequence check for audio packet handling
currently just a comment so I don't forget about it :-) needs some testing but very sure this will work.
2025-11-18 23:57:44 +01:00
Frank
0a0ca506eb Add WLEDMM_FASTPATH definition for all esp32 builds
force all esp32 builds to use WLEDMM_FASTPATH.
The code is proven in use, while non-fastpath is becoming obsolete.
2025-11-18 23:35:15 +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
Frank
872c38f3c2 (experimental) HUB75 small speedups
* removed unnecessary sanity checks from sPC and gPC
* gPC: use  inline color_fade() instead of FastLED .scale8()
in my tests on -S3 this gives a small speedup, 2% up to 6%
2025-11-17 19:30:52 +01:00
Frank
deaee37559 (experimental) 2D drawPixel optimizations
* add a dedicated callback for 2D downscaling only (no nested for loop)
   -> up to 10% faster
* minor optimizations for 2D up/downscale drawpixel - move repeated calculations out of the inner loop
  -> small speedup
2025-11-17 14:30:29 +01:00
Frank
d6ee51841b image loader: avoid message flood on error
in case that several "bad" image effect segments competing to use the GIF decoder, we had a flood of repeating user_print messages
2025-11-17 14:27:08 +01:00
Frank
eab946ea87 image loader: allow graceful takeover after error
Allow decoder "takeover" by another segment
a) when last segment has decoding error (unsupported file, etc.)
b) when last segment became inactive
2025-11-17 12:29: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
47153baa0c brackets (typo)
does the same thing as before, but looks clearer.
2025-11-16 19:30:34 +01:00
Frank
16540f58b3 (experimental) adjust image scaling when segment options change during playback
* move scaling calculation and decoder.setDrawPixelCallback() into a separate function
*re-calculate scaling before decoding a new frame
* reset gifWidth and gifHeight to zero in endplayback
2025-11-16 19:18:21 +01:00
Frank
2a120e81f8 image effect: flicker fixer for WS2812b leds driven by RMT
Large file read operations can cause RMT stall leading to flicker.
* wait for RMT driver when lading a new gif, and when decoding a new frame.
2025-11-16 16:08:16 +01:00
Frank
b443c13ad8 revert safety check in cfg.cpp
this leads to UI problems in the LEDs setting page.
2025-11-16 15:28:57 +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
5b52ee612f clean up handling of USB-CDC Serial
when ARDUINO_USB_CDC_ON_BOOT is set, USB-CDC pins are always assigned to 'Serial'.
2025-11-16 14:05:30 +01:00
Frank
53130f7216 conditional USB mode: first check build_unflags
* build_unflags have priority over build_flags, so we first check if the flag is already "unflaged"
This finally seems to catch all cases properly :)
2025-11-16 13:28:28 +01:00
Frank
14f0d0a03c re-enable raw build flags checks for USB mode
only checking CPPDEFINES sometimes misses the flag
2025-11-16 03:02:12 +01:00
Frank
870dc728f1 Disable raw build flags checks for USB mode
Commented out raw build flags checks for USB mode. The results would be wrong, because raw build_flags ignore build_unflags.
2025-11-16 02:13:29 +01:00
Frank
2b0179850c Merge pull request #263 from MoonModules/copilot/fix-255 (fixes #255)
Implement conditional ARDUINO_USB_MODE: dev=1, release=removed for USB-OTG boards with production warnings
2025-11-16 01:25:59 +01:00
Frank
9860dc5ca0 Disable CDC USB on boot for older framework compatibility
Changed ARDUINO_USB_CDC_ON_BOOT flag to disable CDC USB due to issues with the older framework.
2025-11-16 01:19:08 +01:00
Frank
6ccbfe61ab additional debug help 2025-11-16 01:08:27 +01:00
copilot-swe-agent[bot]
c785cb5f6c Fix Serial breakage: remove ARDUINO_USB_MODE instead of setting to 0
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
2025-11-15 23:51:04 +00:00
Frank
2869de215c USB mode script: updated print statements for clarity 2025-11-16 00:35:23 +01:00
copilot-swe-agent[bot]
3bc68c574e Fix conflicting ARDUINO_USB_MODE definitions using BUILD_UNFLAGS
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
2025-11-15 23:24:01 +00:00
Frank
43b0da03aa Update debug messages for USB mode detection 2025-11-15 23:15:44 +01:00
copilot-swe-agent[bot]
0c92e573e1 Improve messaging: conditional warnings and production alerts
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
2025-11-15 21:48:43 +00:00
copilot-swe-agent[bot]
2932644381 Add CDC_ON_BOOT=1 check: only modify USB_MODE for USB-OTG boards
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
2025-11-15 21:25:33 +00:00
Frank
8342679d4a Merge pull request #264 from MoonModules/copilot/fix-256 (fixes #256)
Fix AutoPlaylist race condition with AutoChange preset applications - avoid self-deactivation problem
2025-11-15 17:13:14 +01:00
Frank
4e2605b2a6 fix for 8266 build error 2025-11-15 00:17:16 +01:00
Frank
dc04ccbde7 another attempt to avoid LED glitches during file writing
* mark synchronization variables volatile (thread-safe)
* additional logic in closeFile() to avoid file write while leds are pushed out by NPB driver
* some comments and analysis
* replace "yield()" after file ops with "delay(0)" before operations.
2025-11-15 00:11:35 +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
47f96fdd4a post-merge adjustments 2025-11-14 19:51:17 +01:00
Damian Schneider
9b6ce948f2 Adding DDP over WS, moving duplicate WS-connection to common.js (#4997)
- Enabling DDP over WebSocket: this allows for UI or html tools to stream data to the LEDs much faster than through the JSON API.
- first byte of data array is used to determine protocol for future use
- Moved the duplicate function to establish a WS connection from the live-view htm files to common.js
- add better safety check for DDP: prevent OOB reads of buffer
2025-11-14 19:42:50 +01:00
Damian Schneider
ca35e9914a Improved 1D support for GIF images, bugfixes, blur option by @DedeHai & @softhack007
- add better support for 1D gifs: use the full gif, row by row, scale if needed
- add blur slider to image FX
- improved safety checks to avoid crashes
- add "fast path" if image size matches virtual segment size
2025-11-14 19:30:26 +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
Frank
36648d1936 hot path optimization: make gamma correction inline
* make sure that gamma LUT is always initialized
* remove some unnecessary safety checks
* make gamma8() inline, for more speed
* use fast unGamma8 for preview
* add super-fast unGamma8 for HUB75 - old function lost 3-10 fps, this version does not reduce fps at all *grins*
2025-11-10 23:17:16 +01:00
Frank
4a323ba057 align Release Strings with upstream
"server message" on OTA update page follows the new format used by upstream WLED.
2025-11-09 23:19:43 +01:00
netmindz
b94fc7c3f0 Merge pull request #4849 from Arcitec/0_15_x-improve-version-info
(0.15.2 backport): Make version information consistent across update interfaces
2025-11-09 22:05:41 +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
f9a2099240 always use same GifDecoder initialization
Removed conditional compilation for GifDecoder based on PSRAM availability.
After inspecting the library code, it became clear that any parameter changes for GifDecoder will not impact memory needs - decoder.alloc() always requires 24KB.
2025-11-09 20:30:43 +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