5284 Commits

Author SHA1 Message Date
Frank
0536d22685 optimizations as per reviewer recommendations
* removed unneeded initializations in blur() and blur2D()
* remove check for _t in progress()
* code readability: if (_t) --> if(isInTransition())
* add `isInTransition()` checks to currentBri() and currentMode()
* added missing `_transitionprogress = 0xFFFFU` in stopTransition()
2025-01-16 17:56:11 +01:00
Blaž Kristan
84dbbc2ea9 Merge branch 'code_robustness' of https://github.com/Aircoookie/WLED into code_robustness 2025-01-09 14:40:56 +01:00
Blaž Kristan
7b43dbd1fe Missing const fix 2025-01-09 14:39:59 +01:00
Frank
f5d87c123b align some function declariations with their implementation
This is purely a "clean code" thing, no impact on function -  it helps to avoid confusion when reading the code.

C++ allows declaration and implementation to use different variable names.
2025-01-09 14:39:54 +01:00
Frank
e9d4e3cd48 fix compile error
"const" was missing in the function implementation
2025-01-09 14:36:02 +01:00
Blaž Kristan
aa2c4f8cd5 More tuning
- replaced POD new/delete with malloc/free
- some more SEGLEN <= 1
- some gnu::pure
- more const attributes
- some static attributes
2025-01-09 13:29:06 +01:00
Frank
60991970d6 typo in comments 2025-01-09 12:21:56 +01:00
Frank
601c260146 implement recommendations from reviewers
* simplified transition bugfix
* removed cast same type
* isIp parameter changed to pass-by-reference, to avoid copy constructor
2025-01-09 12:12:53 +01:00
Frank
5acbb85748 making some parameters const, plus minor improvements
* changed some parameters to "pointer to const", so compiler can better optimize code size and performance -  because data behind a const pointer will never be modified by the called function.
* made setPixelColor `const`

* fixed a few potentially uninitialized local vars (the may have random values if not initialized)

* avoid shadowing "state" in handleSerial()
* plus a few very minor improvements
2025-01-07 20:33:10 +01:00
Frank
19feaba706 avoid using keywords for variables: module, final
these are reserved names and future compilers may reject them.
2025-01-07 20:22:52 +01:00
Frank
e00695e7a5 bugfix: indexOf() returns -1 if string not found
... so we must use `int` instead of `unsigned`
2025-01-07 20:18:42 +01:00
Frank
0e5601fcf7 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:09:29 +01:00
Frank
2e06f5b1e8
Merge pull request #4450 from adafruit/main
Add correct pin availability for ESP32 Mini modules
2025-01-06 22:33:31 +01:00
Damian Schneider
3adcbb7904
Playlist output glitchfix update: found it also happens on S3 (#4462)
* Fix output glitches when playlist changes preset update: glitches also happen on S3
2025-01-06 22:24:28 +01:00
netmindz
27e98147ef
Swap from dev to alpha for our current work in progress builds whilst working towards the next version 2025-01-05 18:49:51 +00:00
Frank
48958cc638
Merge pull request #4439 from dosipod/Upstream_PRs
Update readme.md for rgb-rotary-encoder usermod
2025-01-04 17:49:15 +01:00
Damian Schneider
ae4de2782a
DeepSleep usermod (#4190)
* DeepSleep Usermod

- sleep delay is now 1 by default, disabling sleep at powerup
- renamed bootup variable to powerup
- using delay counter for proper bootup
- changed power-up and bootup logic
- added fallback to always power-on at boot except at powerup
- fixed bug in settings page
2025-01-04 08:07:11 +01:00
ladyada
dcf89e0dbd simplify logic 2025-01-03 16:37:26 -05:00
ladyada
35d92f43c0 >sigh< https://github.com/espressif/arduino-esp32/issues/10683 2025-01-02 20:54:19 -05:00
ladyada
12db60885f try debug 2024-12-31 17:02:52 -05:00
ladyada
d637260dc3 typo fix 2024-12-31 16:42:49 -05:00
ladyada
0937064e18 fix pin availability calculations for ESP32-mini modules 2024-12-31 16:40:11 -05:00
Damian Schneider
6a1d3de75b
Fix output glitches when playlist changes preset (#4442)
same issue as with https://github.com/Aircoookie/WLED/pull/4386
waiting on bus to finish updating before file access fixes the glitches.
this issue is only present on S2 and C3, not on ESP8266 or dual-core ESPs, the fix is only applied for these two.
2024-12-30 12:58:38 +01:00
AlDIY
3fc8c7d560
Update readme.md
Updated the readme to use lennarthennigs/ESP Rotary@^2.1.1 as the old lib fail to compile
2024-12-29 15:46:49 +03:00
Damian Schneider
88738327fd
Merge pull request #4419 from DedeHai/PWM_brightness_fix
BUGFIX PWM brightness discontinuity (fixes #4396)
2024-12-23 15:24:23 +01:00
Damian Schneider
0ad65f4748 fixed CIE brightness calculation for PWM outputs 2024-12-23 14:57:22 +01:00
Frank
9dad436f72
Merge pull request #4414 from shafingazi/main
fixing a typo in LED Preferences
2024-12-22 11:23:16 +01:00
shafingazi
ebdc38fff2
Merge pull request #1 from shafingazi/led-typo-fix
fixed typo in LED Preferences
2024-12-21 21:19:35 -08:00
shafingazi
97bbe6f305
fixed typo in LED Preferences
Changed "poweing" to "powering" within a text block of LED Preferences.
2024-12-21 21:18:57 -08:00
Frank
2f0dbef1e5
Merge pull request #4413 from wled-install/patch-2
Update usermods_list.cpp:  usermod_BH1750.h --> usermod_bh1750.h
2024-12-21 23:21:53 +01:00
wled-install
1711286ef0
Update usermods_list.cpp 2024-12-21 23:05:13 +01:00
Will Tatam
099d3f7b41 version bump 2024-12-20 18:15:12 +00:00
Damian Schneider
5f77478841
Replace PRNG with hardware RNG (#4225)
Both ESP8266 and ESP32 have a hardware random register. This update makes use of that. It is slightly faster than the fastled variants but mostly it is truly random, even when the timing limitations stated in the datasheet are disregarded. Also saves a bit on code size.

- Replaced all random8() and random16() calls with new hw_random() versions
- Not replaced in FX where PRNG is required
2024-12-20 19:12:29 +01:00
Damian Schneider
07cc3aa5c0
FX improvements and cleanup (#4145)
Improvements & merges of FX

- Scrolling Text: Gradient Palette support added
- Waving Cell: Improved with higher temporal resolution (smoother at lower speeds) and added additional mode setting and optional blurring
- Julia: added blur option
- Squared Swirl: added fade option

- Added smearing option to:
    - DNA
    - DNA Spiral
    - Drift
    - Drift Rose
    - Crazy Bees
    - Ripple
    - Colored Bursts
    - Frizzles
    - Lissajous
    - Sindots
    - Spaceships

- Added palette support to:
    - Crazy Bees
    - Polar Lights
    - Drift Rose

- Changed default palette handling (no more special treatment for some FX)
- Merged puddles and puddlepeak
- Merged Gravcenter, Gravcentric, Gravfreq and Gravimeter (saves 1.2k of flash)
- Merged meteor and meteor smooth
- Renamed police_base into mode_two_dots as that was just an alias
- Added 'Traffic Light' palette (originally defined in Polar Lights FX)
-  Firenoise: removed local palette, use fire palette -> slight change in looks (+bugfix)
- Some code cleanup (removed unused / commented stuff)
- Moved dev info for AR to the top so ist easier to find as a reference, also added link to KB there
2024-12-20 14:13:53 +01:00
Damian Schneider
ff26f54bfd
Merge pull request #4138 from DedeHai/0_15__speed_improvements
Speed improvements in many core functions
2024-12-20 09:45:56 +01:00
Damian Schneider
3323d2ed37 another merge fix 2024-12-20 09:37:41 +01:00
Damian Schneider
7b9b3f1ee2 merge fix 2024-12-20 09:12:20 +01:00
Damian Schneider
cae98451e3 Merge remote-tracking branch 'upstream/main' into 0_15__speed_improvements 2024-12-20 09:12:01 +01:00
Damian Schneider
83da7569f5
code consolidation in drawCircle() (#4302)
- saves about 600bytes of flash
- speed tradoff: drawing is now a tiny bit slower but insignificant in my tests
2024-12-19 20:19:42 +01:00
Damian Schneider
26397ee8ad
Optimization: color_blend() (#4245)
Removing the bool saves on code size and makes the function a tiny bit faster. Also this is a cleaner solution IMHO.

-updated blend function to optimized 8bit calculation
- efficient color blend calculation in fews operations possible
- omitting min / max checks makes it faster on average
- using 8bit for "blend" variable does not significantly influence the resulting color, just transition points are slightly shifted but yield very good results (and better than the original 16bit version using the old fastled math with improper rounding)
- updated drawCircle and drawLine to use 8bit directly instead of 16bit with a shift
2024-12-19 18:20:56 +01:00
Damian Schneider
217d2aeb7f
Merge pull request #4407 from DedeHai/fairy_FX_fix
BUGFIX for Fairy & Fairytwinkle FX
2024-12-19 09:24:27 +01:00
Damian Schneider
e57c701837 fix for repeating glitch
glitch appeared every 65s due to missing uint16_t overflow.
2024-12-19 09:21:57 +01:00
Blaž Kristan
b4aa8376de
Idle current bugfix (#4402) 2024-12-17 18:59:53 +01:00
Frank
d4976ac47a
Merge pull request #4398 from Aircoookie/4395-platformio_override
update platformio override example file (solves #4395)
2024-12-16 17:52:33 +01:00
Frank
b8a96d9a77 workaround for elekstube_ips compile error
the trick is to pin TFT_eSPI version 2.5.33
2024-12-16 15:46:59 +01:00
Frank
f75d582eee Merge branch 'main' into 4395-platformio_override 2024-12-16 15:27:12 +01:00
netmindz
18e0ec9a55
PRs to main now 2024-12-16 13:21:07 +00:00
Will Tatam
68b80cdadc Merge branch '0_15' 2024-12-16 13:12:38 +00:00
Frank
3d3c475d1b define board_build.partitions and build_unflags in standard envs
to ensure that build_unflags and board_build.partitions are always having a useful default value. Values can be overridden in custom buildenvs.

saves us a few lines lin platformio_override.sample.ini.
2024-12-15 22:20:52 +01:00
Frank
6668e72351 fix typo 2024-12-15 21:35:13 +01:00