3820 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
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
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
Damian Schneider
0ad65f4748 fixed CIE brightness calculation for PWM outputs 2024-12-23 14:57:22 +01: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
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
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
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
Will Tatam
68b80cdadc Merge branch '0_15' 2024-12-16 13:12:38 +00:00
Damian Schneider
3261c5b071
replaced repeated progress() calculation calls with a variable (#4256)
progress() is called in setPixelColor(), calculating the transition progress for each pixel. Replaced that call with an inline function to get the new segment variable.
The progress is updated in service() when handleTransition() is called.
The new variable is in a spot where padding is added, so this should not use more RAM.
Result: over 10% increase in FPS on 16x16 matrix

* removed IRAM_ATTR: `updateTransitionProgress()` is called only once per frame, no need to put it in RAM.
* changed transitionprogress to static, private variable, this is now more aligned with other variables using the same logic
* added inline: the function is only used in one place
2024-12-15 13:46:18 +01:00
netmindz
2c58a87982
Merge pull request #4356 from blazoncek/json-cycle
Proper fix for #3605 & #4346
2024-12-12 15:53:03 +00:00
Will Tatam
a705ae5278 Merge branch '0_15' 2024-12-10 22:12:02 +00:00
Blaž Kristan
1c220d25ca WiFi reconnect bugfix
- additional debug info
2024-12-07 16:47:50 +01:00
Blaž Kristan
039858dca2 Incorrect limit fix 2024-12-07 10:14:11 +01:00
Blaž Kristan
4758b5efe8 Proper fix for #3605 & #4346
- allow incrementing/decrementing as specified in API
2024-12-07 10:11:25 +01:00
Frank
36e065ab4d
Merge pull request #4336 from willmmiles/4280-limiter-not-saving
settings_leds: always initialize current limiter field (partly solves #4280 )
2024-12-05 13:40:14 +01:00
Damian Schneider
076497e14d Fix update for #4193 (twinkle fox & cat)
- previous fix worked but there was still an overflow after some time passed. there were still missing roll-overs apparently: reverting these two variables back to 16bit/8bit should fix it for good.
2024-12-05 06:54:30 +01:00
Will Tatam
e8d9891d13 set version to dev 2024-12-04 18:57:32 +00:00
Damian Schneider
4902d7fb9e Fix for #4193 (twinkle fox & cat) 2024-12-04 17:10:44 +01:00
netmindz
a873ca6a3e
Merge pull request #4244 from MoonModules/framerate_ac015
Improved framerate control code - strip.show(), strip.service()
2024-12-04 07:48:19 +00:00
Will Miles
a86cb27cfe settings_leds: Init current limiter
Supersedes previous approach; this should use less space and be more robust to future changes.
2024-12-03 21:48:08 +00:00
Will Miles
d620930f10 settings_leds: Remove unused variables
Remove a couple of leftover variables from previous revisions.
2024-12-02 21:52:41 +00:00
Will Miles
8db8ecfef3 settings_leds: Fix quotes on LA value 2024-12-02 21:50:29 +00:00
Frank
ae8c3b02d0
blends FX - hotfix for black pixels
fixing an off-by-one error to solve #4335
2024-12-02 21:35:48 +01:00
netmindz
99427c2ef7
Merge pull request #4210 from 1Prototype1/dist-cpal
Added Distribute Horizontally for cpal
2024-12-01 19:09:34 +00:00
netmindz
334f16c0b6
Merge pull request #4203 from maxi4329/minor-webui-enhancements
minor webui enhancements
2024-12-01 19:03:36 +00:00