Compare commits

...

536 Commits

Author SHA1 Message Date
Damian Schneider
02f14baad4
Updates to particle system (#4630)
* added Sonic Boom AR FX, some tweaks to Sonic Stream
* added white color option to Sonic Stream
* improvements to collisions (speed look-ahead)
* code prettified
* added "playful" mode to PS Chase plus some minor speed optimizations
* Adding new FX: PS Springy with many config options
2025-04-15 19:07:21 +02:00
netmindz
e979c58c98
Merge pull request #4609 from willmmiles/usermod-cfg-live
Use live cfg json instead of file for usermod settings page
2025-04-06 09:28:45 +00:00
Will Miles
b0b3196e52
Merge pull request #4620 from gsieben/USERMOD-BME68X-Update-to-Version-1.0.2
Update USERMOD BME68X to version 1.0.2
2025-03-29 11:09:17 -04:00
Gabriel Sieben
7e87891701 Update USERMOD BME68X to version 1.0.2 2025-03-28 16:27:26 +01:00
Damian Schneider
e76e9a3e1f
Merge pull request #4594 from DedeHai/perlin_noise
Adding perlin noise replacement for fastled functions
2025-03-26 07:40:40 +01:00
Will Miles
36cb1cad36 settings_um: Use live config
Use json/cfg for the usermod settings page.  Should fix issues
with outdated content when a new firmware is loaded.
2025-03-23 15:20:16 -04:00
Will Miles
22e2b6f3c5 Have json/cfg return live config
Rather than reading the file off disk, have the json/cfg endpoint
return the live config from system state data.  This can improve
UI behaviour as it can never be out of date or include values that
do not apply to the current firmware install.
2025-03-23 15:18:08 -04:00
Will Miles
9c8f8c645e Rename 'doSerializeConfig' to 'configNeedsWrite'
Clarify the name and usage of this flag, as the function name has
changed out from underneath it.
2025-03-23 15:16:52 -04:00
Will Miles
e21a09cec9 Separate FS write from serializeConfig
Break the actual JSON assembly apart from the file writing code.  This
permits calling it in other contexts, allowing us to pull the live
config data even if the filesystem is out of date.
2025-03-23 15:15:52 -04:00
Will Miles
a0d1a8cbc4 Use enum class for json endpoint subtypes
Part of the ongoing quest to migrate macro definitions to typed
language constructs.  This actually yields a small improvement in
code size, likely from the byte->int conversion.
2025-03-23 15:08:12 -04:00
Blaž Kristan
86393e0b1d
Merge pull request #4608 from marcone/patch-2
Fix typo
2025-03-23 19:29:18 +01:00
marcone
f328713710
Fix typo 2025-03-23 11:11:34 -07:00
netmindz
ed6efe4c9e
Merge pull request #4551 from Brandon502/PinwheelRework
Pinwheel Rework
2025-03-23 09:29:54 +00:00
netmindz
befff2f034
Merge pull request #4605 from marcone/patch-1
Fix typo in build.yml
2025-03-22 17:55:15 +00:00
marcone
630315180d
Fix typo in build.yml 2025-03-22 10:28:38 -07:00
Blaž Kristan
a70bfa0c89 Merge pull request #4596 from Dschogo/patch-1
Fix wipe effect smoothness
2025-03-16 10:58:02 +01:00
Damian Schneider
d2b7e474d6 add legacy defines for compatibility, reverted test changes in rotozoomer 2025-03-14 06:48:18 +01:00
Damian Schneider
494b72c287 Merge remote-tracking branch 'upstream/main' into perlin_noise 2025-03-12 20:15:40 +01:00
Damian Schneider
229e7b940f added ranges, removed unused code 2025-03-12 19:58:32 +01:00
Damian Schneider
95dcb03f6d updated scaling 2025-03-12 06:56:33 +01:00
netmindz
a6d9a8220c
Merge pull request #4480 from willmmiles/usermod-libs
Convert usermods to static libraries
2025-03-11 22:37:36 +00:00
Will Tatam
0ba80ce61e Merge branch 'main' into usermod-libs 2025-03-11 22:31:52 +00:00
Will Tatam
7c23872e03 Add dmxInput.isConnected() 2025-03-11 22:31:19 +00:00
netmindz
507938be35
Update pr-merge.yaml - shell bash 2025-03-11 22:28:21 +00:00
netmindz
8bee304e4d
Merge pull request #4577 from DevJogger/main
Add apple-touch-icon Link Tag
2025-03-11 22:19:38 +00:00
netmindz
be239993f4
Update pr-merge.yaml 2025-03-11 22:15:48 +00:00
netmindz
f396dac1cc
Merge pull request #4266 from w00000dy/cdata
Migrate from inliner to web-resource-inliner
2025-03-11 22:14:03 +00:00
netmindz
ebba1f78ab
update secrets syntax for pr-merge action 2025-03-11 22:05:32 +00:00
netmindz
c8c3fc2bcc
Merge pull request #4591 from srg74/patch-4
Update README.md
2025-03-11 20:59:34 +00:00
srg74
14c6c05e00
Update README.md
Added record to change log according to latest update from @blazoncek
2025-03-11 16:24:55 -04:00
netmindz
3fbdd9635f
Merge pull request #4568 from blazoncek/multifix
Multifix
2025-03-11 08:34:23 +00:00
Blaž Kristan
d7be9c9a66 Address issues reported 2025-03-10 07:12:45 +01:00
Blaž Kristan
928c9fbacd Bugfix for #4590 2025-03-09 15:06:20 +01:00
Blaž Kristan
2b666ab9f7 Merge branch 'master' into multifix 2025-03-08 12:59:15 +01:00
Damian Schneider
4ecc531998 updated scaling, improved hashing, updated rotozoomer to not use a buffer 2025-03-08 12:48:27 +01:00
Blaž Kristan
b908384ba2
Merge pull request #4307 from blazoncek/compile-pin
Compile time lock PIN definition
2025-03-08 12:44:10 +01:00
Blaž Kristan
b27a4a94e4
Merge pull request #4529 from blazoncek/unlimited-bus
"Unlimited" buses
2025-03-08 12:43:25 +01:00
Damian Schneider
5e8073022b 3D works but needs finetuning to match old looks 2025-03-07 06:39:49 +01:00
Damian Schneider
9553425374 some speed improvements using better hash, scaling is still off...
needs a proper scaling analysis of all steps in all resolutions to minimize errors.
2025-03-04 07:55:41 +01:00
Damian Schneider
2012317bc9 initial version, basically working but repetitive patterns, work in progress 2025-03-03 06:57:16 +01:00
Will Miles
18a118bb7a Update platformio version
There is a necessary LDF fix in 6.1.17.
2025-03-01 20:53:43 +00:00
Will Miles
e00789f838 Merge remote-tracking branch 'upstream/main' into usermod-libs 2025-03-01 20:32:12 +00:00
Will Miles
20563e6306 usermod/Temperature: Update doc 2025-03-01 20:29:59 +00:00
Will Miles
580c2d8213 usermods/MY9291: Enable for ESP8266 2025-03-01 20:29:37 +00:00
DevJogger
c9b8789ea9 Reduce apple-touch-icon image size 2025-02-28 18:47:32 +00:00
Blaž Kristan
4271588ecd unique_ptr fix 2025-02-25 16:06:13 +01:00
Blaž Kristan
a5277ff4a0 Merge fix 2025-02-25 16:01:30 +01:00
Blaž Kristan
a66f5d660d Merge branch 'main' into unlimited-bus 2025-02-25 13:54:42 +01:00
Brandon502
80061e8d76 Pinwheel: Use sin/cos16_t 2025-02-24 21:51:49 -05:00
DevJogger
d07a057f04 Add an apple touch icon for better recognition on the home screen of Apple devices 2025-02-25 01:13:22 +00:00
netmindz
fa2949af7d
use npm ci 2025-02-22 17:39:00 +00:00
netmindz
a4680b7216
Update nightly.yml 2025-02-22 17:27:28 +00:00
netmindz
523eb910a6
Update nightly.yml 2025-02-22 16:43:09 +00:00
netmindz
2f21de79f7
Create test.yaml 2025-02-22 16:41:29 +00:00
netmindz
092d402ff8
Update nightly.yml 2025-02-22 16:38:18 +00:00
netmindz
12e8d6c4c6
Update nightly.yml 2025-02-22 15:20:23 +00:00
netmindz
8c1486d577
Update nightly.yml 2025-02-22 15:13:37 +00:00
netmindz
57e9199baa
Enable dispatch with PAT 2025-02-22 15:02:45 +00:00
netmindz
f4aac0bd8d
use onlyLastTag rather than hard coded lastTag 2025-02-22 14:49:01 +00:00
netmindz
664150811a
Generate changelog 2025-02-22 12:00:16 +00:00
netmindz
3cb4ae16ab
Create pr-merge.yaml 2025-02-22 10:21:19 +00:00
Damian Schneider
73fc9ea54d
Merge pull request #4543 from DedeHai/soap-FX-optimization
Soap FX optimization
2025-02-22 08:43:01 +01:00
Blaž Kristan
dd80919ed6
Merge pull request #4429 from blazoncek/use-bssid
Add ability to enter desired BSSID
2025-02-19 13:46:49 +01:00
Blaž Kristan
d7103cd75c
Merge pull request #4262 from blazoncek/large-ledmap
Large ledmap support
2025-02-19 13:43:52 +01:00
Blaž Kristan
29beee367c Cherry-pick fix 2025-02-19 12:27:10 +01:00
Blaž Kristan
d22fe9227b Prevent push transition if effect stays the same 2025-02-19 11:56:37 +01:00
Blaž Kristan
6ea9535463 Avoid shadowing global col[] 2025-02-19 11:54:03 +01:00
Blaž Kristan
bbd1b730b1 Add simulation modes (bugfix) 2025-02-19 11:52:58 +01:00
Blaž Kristan
6e138e4f79 Clarify use of index counter 2025-02-19 11:52:14 +01:00
Blaž Kristan
d6453bb53d Use constant CALL_MODE_INIT 2025-02-19 11:47:55 +01:00
Blaž Kristan
9bfd34e6b2 Rework color_from_palette()
- respect paletteBlend
- bugfix in ColorFromPaletteWLED()
2025-02-19 11:47:13 +01:00
Blaž Kristan
7b13771cfe Bugfix in settings 2025-02-19 11:42:00 +01:00
Blaž Kristan
b70b222f80 Replace magic with cosntant 2025-02-19 11:39:48 +01:00
Blaž Kristan
2ffc8dd228 W Hex entry bugfix & optiisation 2025-02-19 11:36:48 +01:00
Blaž Kristan
08d12f9ee6 Shifting bugfix & size tuning in fade_out 2025-02-19 11:35:51 +01:00
Blaž Kristan
7ce96c190f Manual advance playlist 2025-02-19 11:34:29 +01:00
Blaž Kristan
409b4b1963 Clear spaced segment
- also wait for strip before updating segment
2025-02-19 11:32:21 +01:00
Blaž Kristan
05cd7d753e Bugfix for color_blend 2025-02-19 11:26:51 +01:00
Blaž Kristan
7be460e8b1 Incorrect limit fix 2025-02-19 11:23:23 +01:00
Blaž Kristan
6dfbd07e86 retrun value fix 2025-02-19 11:21:17 +01:00
Blaž Kristan
7b56e53c47 Nested playlist 2025-02-19 11:19:59 +01:00
Blaž Kristan
a8cde3289a Minor speed & size tweaks
- new function fadeToSecondaryBy()
2025-02-19 11:13:52 +01:00
Blaž Kristan
f4e7202dd0 UI info 2025-02-19 11:12:12 +01:00
Damian Schneider
a2de3d33bf
intermediate fix for transition speedup (#4562)
- fixes FX speedup in fade transitions but its not a proper solution
2025-02-17 19:32:43 +01:00
Damian Schneider
46a3e3d353
Adding Particle System with many new FX (#4506)
* cleanup

* added collision handling back in

update from another commit that got lost

* reformat

* added latest version of functions

this somehow also got lost from an earlier commit

* Update platformio.ini

* updated particle box and firework effects

particle box now is more random in random mode (still a work in progress)
firework is now more configurable by sliders

* added preliminary functions and FX

* added particle attractor, added two new FX but still buggy

particle attractor animation does not work, somthing wrong with pointer allocation, it worked with static variables

* bugfixes, attracot now works

still unknown, why more than 256 particles are needed in memory allocation to not make it crash, but it works for now

* added angle emitter, added fireworks effect using it

* Added saturation to be set for each particle individually

at the expense of more ram usage, animations now have more options for color control (already used in fireworks now)

* bugfixes in impact animation

* added option to use fast color add, may improve performance a little

also fixed a bug in fire animation

* collision detection is now a function plus some improvements & fixes

* improved collision efficiency

improved efficiency for stackup (pushback), added code to correctly determine direction if particles meed (probably overkill but now its there)

* added fix for piling oscillations

untested, need to verify it works

* Improved collision handling (faster, less oscillations), changed variables to 32bit for faster calculation

32bit variables are faster on ESP32, so use them whenever a variable is used a lot, it saves one instruction per access.

* removed option for fastcolor add

it made very little difference in performance, but for ESP8266 it may matter so it is set permanently there. graphically the difference is also very small (sometimes a particle gets brighter or less saturated)

* Fixed some bugs in particle system, runs much smoother now

also tweaked some of the FX

* Bugfix in particle push, now piling is working again

particle pile-up did not work correctly, now fixed

* changed particle pile demo into waterfall plus some tweaks

* lots of bugfixes

* updated particle attractor animation parameters and added more user options to perlin noise

* removed TODOs

* added particle WrapUpdate function, added spray FX, some bugfixes

* fixed touch buttons for ESP32 S2 and S3

touch is implemented differently on S2 and S3, these changes make touch buttons work on S2 and S3

* some tuning for touch buttons on S2/S3

now better fits the default threshold value of 32

* updated rotating particle spray with more user options

* chaned rotating spray default parameters

* add todo

* Revert "some tuning for touch buttons on S2/S3"

This reverts commit d21ad8e7d1651a96f879d43ef1146a72a6ed8271.

* Revert "fixed touch buttons for ESP32 S2 and S3"

This reverts commit 09041551862361cd8c7444ca25403f5f96a9077b.

* removed comments, added comments

* cleanup

-removed wrap_update function, now integrated into move_update
-added more 'out of bounds' checking in fire functions, may speed it up a little

* cleanup session

-removed particle box 'rocking boat' (buggy) and replaced with random sloshing.
-removed comments
-changed some variables into 32bit for speed boost on ESP32
-added link to KB at the top of FX.cpp

* cleanup

removed / added comments

* added particle GEQ effect (untested)

* Particle GEQ fixes, it now actually works

* GEQ  FX parameter tuning

* added rotating GEQ, work in progress

-animation works but sliders are too sensitive. need to adjust the ranges

* FX update

- changed firework exhaust to low saturation
- updated rotating particle spray animation

* Cleanup & Bugfixes plus major improvements for ESP8266

-added particle reductions for ESP8266 for all FX
-Removed collisions from Particle Perlin Noise FX, slows things down and does not contribute to a better effect experience
-lots of optimizations for ESP8266, all FX now work (at least on 160MHz but still slow)
-Some bugfixes
-removed unused variables to make compiler happy

* Particle FX Rename, default parameter tuning, bugfix

-Now shorter names, 'PS' in front to filter the list
-Tuned default parameters to make them look better by default
-Bugfix in particle system (removed duplicate application of velocity)
-reduced PS fire RAM usage (less particles, less base flames, no noticeable difference)
-some variable renaming

* slight speed improvements in fire, like 1-2FPS

* Big update: lots of little fixes and big speed boost on fire animation

-fixed fire burning more on the left side
-fixed crash in particle attractor
-added many improvements for ESP8266
-improved particle rendering efficiency
-efficiency improvements in general
-changed the way fire is rendered, now more than 2x faster
-re-tuned fire to new rendering, also seperately tuned it for ESP8266
-changed all random8() to random16() as it runs faster on ESPs
-some reformating
-some renaming of effect stuff
-fine tuning on falling particle effect
-improvements to collision handling (faster and better)
-added a (temporary) function for speed tests, will be removed again

* bugfix

* updated PS Fireworks with many changes and fine-tuning of parameters

-removed spiral explosions
-added more versatility to circular explosions
-removed user selectable amount of rockets
-tuned explosion size of circular explosions to match random explosions (more or less, may need improvement)
-changed order of sliders in volcano animation

* put particle system in a class. work in progress.

another huge update to the particle system.
went through the whole code, rewrote many of the functions. many improvements over the previous code. fixed many bugs (and even an ancient one in rendering function). spent many hours optimizing the code for speed and usability.
still a work in progress, debugging is ongoing. more updates to come.

* many (many!) bugfixes, added fire FX back in (and improved it a lot) added local renderbuffer for huge speed boost

-lots of bugfixes in Particle system
-added local rendering buffer (renders to buffer in heap)
-added fast and accurate color-add function
-bugfixes in render function
-added improved 'sticky' particles in collision (unfinished business)
-added ballpit animation back
-lots of tweaks to fire FX and fire rendering functions, looks even better now (still unfinished)
-added palette render option to fire

still many debug print outputs around, needs cleanup at one point

* More Bugfixes, more converted FX

* more bugfixes, some animation tuning, added volcano back in

- fixed animation transitions with proper pointer setting in each FX call
- added color by age setting to particle system
- maybe fixed collision having a tendency to go to the left
- fixed bugs in fireworks FX
- added fire spread width as a slider
- changed max number of particles and sprays based on some ram calculations
- some other random fixes

* updated fire, added some functions to PS, ported attractor FX

- added turbulance to fire (after hours of fine-tuning) it now looks even more awesome
- added attractor animation back in and improved it with more functionality
- fixed the attractor function in the PS
- renamed FX: 'candy' is now called 'vortex'
- added new force function to apply a force immediately (and handle the timing in the FX)
- added update function to PS for size update to handle dynamic segment size change
- made waterfall width dynamic on segment width
- removed some debug stuff
- added #defines for maximum number of particles/sprays
- updated fire parameter to make it look better on ESP8266
- some little bugfixes

* another huge update, many improvements, fine-tune collision, fire and some other FX

-removed classic fire render as palette now looks much better
-tweaked fire parameters to more awesome
-added (optional) turbulence to fire using perlin-noise
-ported spray FX to use PS-class
-now definitely fixed asymmetrical collision issue: do not use bitshifts on negative numbers!
-changed piling behaviour of particles, full rework. looks way more natural now and works much better
-changed bouncing behavour: they now bounce at full diameter, making them stay fully in frame when laying on the floor
-replaced all relevant bitshifts with divisions for higher accuracy throughout the PS
-added new modes to particle box FX
-changed a lot of FX parameters (finetuning)
-changed all config strings to proper settings (matrix only)
-fixed newly introduced bugs
-added speedup/slowdown to vortex FX (aka candy, aka rotating sprays)
-some renaming
-fixed bugs… lots of bugs
-merged rendering functions, removed obsolete stuff

* Fixed Speed limit

limiting speed was incorrect, leading to overflows. fixed this.
also fixed bugs in GEQ, removed some debug stuff, added FPS limit to fire (just en experiment)

* work in progress, added motion blur and line attracto (non working)

* work in progress, added test function to increase particle size, also added wobbling test

* added more tests, non compiling at the moment

* in the middle of fixing FX to use new PS functions

* debugging going on

* bugfix in wrap function and firwork FX

* added local render blurring, boosting FPS, work in progress

- changed fast-add function to use pointers
- added fast-scaling function
- added simple (but fast) 2D blurring function
test shows that local blurring of full frame is almost double the speed (40FPS now is 80FPS).
lots of comments still there

* Bugfixes, improvements and added wall roughness setting

- fixed bug in PS fuzzy noise which made it asymmetric for some reason, seems to work better now
- added particle size option to attractor but had to remove speed setting (now fixed emit speed)
- some parameter tuning of FX
- improvements to code size in render function
- added smear option to blurring (not tested much, may be buggy without smear)
- speed improvement to caldForce_dv, added zero checking.

* removed zero inits

- removed zero initialisations in FX, segment.data is set to zero by alloc function

* added individual size particle rendering plus some fixes

- advanced particles can now be rendered to individual sizes. It is computationally intensive but it works well for up to 15 very large particles and more smaller ones
- added collision handling for individual sizes (walls and collisions)
- fixed bugs in particlebox
- fixed fire not transitioning properly (flickering) when frame skip is active
- removed 'wraparound' function as it can easily be done by casting to an unsigned and then modulo
- fixed ballpit particles wandering left and right very fast if wrapX is set

* Fixed some nasty memory bugs, fixed some FX parameters

- fixed memory alignment bug in PS pointer assignment by making sure only multiples of 4 are allowed for particles and sources
- added saturation back to particle struct, as it was aligned to 10 bytes anyway.
- fixed a bug where a null pointer could be accessed
- fixed rendering out of frame particles if buffer allocation failed
- improvements on ESP8266

* Replaced Ghost Rider FX with PS version

- new FX is kept close to original animation but added more user settings

* added walls to ghostride, fixed some bugs

* added 'perpetual' flag to particles

* Fixed another memory / pointer bug, but there is still one left...

-also some minor fixes

* Found and fixed crashes, it was wrongly assigned pointers

* Added advanced particle size control and new Blob FX

- advanced size control allows for growing, shrinking, wobbling
- render function updated to support asymmetric rendering
- various code improvements and bugfixes
- some FX parameter tuning
- bugfix: removed sli() sei() calls in render function that caused random flickering on S3/C3 (may add that back in but only for ESP8266 to reduce fragmentation)
- removed some debug / test stuff

* code cleanup, removed some unused stuff

* bugfix, sprayEmit() would not return and get stuck

- forgot default return value...

* remove esp_random() as it is not supported on ESP8266

* small bugfix for ESP32, cleanup / reformatting

* added WLED_DISABLE_PARTICLESYSTEM option, fixed volcano movement

use '-D WLED_DISABLE_PARTICLESYSTEM' to disable compiling

* a line got lost in the last commit

* - added WLED_DISABLE_PARTICLESYSTEM option & cleanup & bugfixes

- cleanup / reformatting
- fixed volcano movement
- small bugfix for ESP32 (random() does not work, using random16() )

* Added PS source option to emit more than one particle, addes AR to Blobs and Spray

* added center GEQ back in, changed AR behaviour of spray a little

center GEQ is a mix between the PS equalizer and vortex, tuned for AR. some more tuning may be needed, it can probably be extended and improved a little.

* Bugfix and minor improvements

- fixed bug in center GEQ
- added '2D washing machine' mode for particle box
- improved color-change rate in ghostrider
- added AR to attractor (experimental, may remove again)

* hacked in a 1D port of the 2D PS, untested code

* fixed first bugs in 1D system, added test FX

* fixed bug in wrapping (also was wrong for 2D system)

* fixed collisions, added bouncing ball replacement (work in progress)

* replaced more FX, some tweaks to 1D PS

- changed virtual particle size from 64 to 32, making them able to move faster
- added 'rolling balls' option to bouncing balls (i.e. no gravity plus some tweaks)
- added dancing shadows with PS (work in progress)
- temporarily removed native FX: bouncing balls, rolling balls, popcorn, dancing shadows
-and of course some bugfixes

* updated dancing shadows to more closely mimic original

* added drip FX, added #ifdefs, removed some common functions

#ifdefs to individually disable 1D and 2D system.

* fixed compile issue, removed replaced FX (again)

* added Fireworks1D replacement (unfinished)

also fixed a bug in `applyForce()` using uninitialized variable.

* added sparkler and hourglass (both work in progress) tried fixing 1D collisions

* many improvements in 1D collisions (fine tuned), hour glass FX is almost done

spent A LOT of time in fine-tuning collisions for best stacking without collipsing, ringing, oscillations or particle flips. still not perfect but probably as good as it can be with the limited time-resolution

* many bugfixes in PS and FX

* minor FX adjustments

* Improved 1D collisions, added 2 new 1D FX (work in progress)

* bugfixes

* added 'color by position' as a PS setting

 -made settings struct for 1D and 2D version to be different
 -added setting 'color by position' as that is used by multiple FX now

* added large size rendering to 1D PS, work in progress

* bugfix (forgot to free memory)

also: made random size a permanent option in 1D fireworks as it looks kind of cool

* Added PS based Chase, fixed some bugs

* minor update

* two new FX: Starburst and 1D GEQ

* Added more advanced (and proper) size handling in collisions, work in progress

 - copied and adapted some stuff from 2D system (out of bounds size rendering, dynamic collision detection distance, dynamic wall bounce distance)

* fixed some parameters in 1D FX

* added #ifndef to disable FX replaced by PS

- define DISABLE_1D_PS_REPLACEMENTS or DISABLE_2D_PS_REPLACEMENTS

* bugfixes

* default parameter change

* explicit cast to fix compile error

* Bugfixes

* added color-waves to PS chase, some parameter tuning plus bugfixes

* FX update and bugfixes

- fixed wall collisions on larger particle sizes
- update to bouncing balls:
 - added size setting
 - added proper updating on parameter change
 - bugfixes
added support for 'colorwaves' and 'pride' to PS Chase to save on code size. currently broken...

* minor update to rolling balls, fixed stuff in Chase, pride option still not working

* update on 'pride' now working again but needs finetuning

* SEGMENT -> SEGENV on data, aux0, aux1, step

also removed debug outputs

* added pride and colorwaves to 1D replacement list

* removed unused variables

* added variable to set number of particles if not all are required (saves ram) also fixed a nasty render bug

* added preliminary 1D fire function, unfinished

* added fractal FX test, fixed bugs in emit function

* tweaked 1D fire a little, still work in progress

* minor tuning on 1D fire to avoid 'oscillation' at start

* improved 1D particle fire, much more natural now.

* updated 2D fire, fixed init bug

- source init was wrong making fire init weirdly
- changed parameters on 2D fire making it look better and improving flame height for larger setups

* fixed 'nervours' fire

* slight improvements and some cleanup

* removed douplicate code for fire emit (tradeoff for some speed), removed unfinished fractal FX

- with the duplicate code removed, the fire particle emits are a bit slower but it saves on code. it is not really noticeable, its slower by about 1FPS

* Re-license from MIT to EUPL

* Started cleanup, speed improvement to rendering, renamed class

- removed 'smar' parameter in blur functions as smear is always used
- improved particle rendering (passing by reference, passing wrap parameters for faster access)
- renamed class to ParticleSystem2D
- removed some whitespaces
- some reformating, removed some comments
- minor tweaks
- removed non-working line-attractor function

* Optimization and bugfixes

- added out of bounds checking function
- fixed rendering at boundaries
- various small changes and cleanup
- bugfixes with comparing ints of different signeness
- fixed bounce radius

* Cleanup, bugfixes, speed improvements, refactoring

- lots of code refactoring / reformating
- fixed bug in fire particle update and improved speed a bit
- refactoring of pixel rendering
- removed 2D buffers, replaced with 1D buffer for faster access
- bugfix in blur2D
- many small improvements to 2D system

* Refactoring and cleanup of 1D PS, removed debug printouts

- code reformating for consistency and readability
- replaced "'?" operator with min / max (produces the same code, more readable)
- minor changes for speed (random16 used, can later be replaced with hardware random function)
- renamed PS Equalizer to PS 2D GEQ

* Cleanup and some refactoring of particle FX

- moved 2D / length check to PS initi
- code reformating
- removed some comments

* missed a spot

* minor tweaks to fast_color_add()

* Work in progress: update to fireworks, needs more testing & finetuning

also bugs fixed and some minor cleanup

* Work in Progress: added particle memory manager for transitions

- uses only one, persistant buffer to render all present particle systems
- Buffer for particles is shared for one segment (may allow interacitng systems in the future)
- updated some of the FX to handle the new transfer, 1D FX still not done
- updated parameters for particle impact FX

* work in progress: lots of changes & fixes, transitions now work correctly in 2D

- still fragile code with lots of cleanup to do

* added transitions for big-size rendering

- transitions now work with FX that use global large size rendering. this is done by handling the buffer correctly. to avoid creating a second buffer, it is transferred back and forth to the segment. this is a bit slow but a compromise solution.
- multiple segment handling is still untested

* speed improvement to  fast_color_add, added preliminary buffer transfer function

* merge fixes

* bugfix in setCurrentPalette, corrected order of 2D memory allocation, increased max particles/sources

- fixed timing for vortex

* fixed particle buffer handover, added 2D blur option, increased particle limits, various fixes

- fixed bug in memory watchdog, now works and also works when freezing segments
- fixed PS Box to work again with particle handover
- added smear blurring to waterfall
- added smear blurring to vortex, fixed color distribution, removed random color distribution option
- replaced all random() calls with hw_random()
- transitions now work but only if FX transitions are enabled and not when chaning segment size

* implemented correct 1D<->2D buffer handover+bugfixes

work in progress

* added smear to fuzzy noise, some cleanup

* added blurring option to PS 2D fireworks, work in progress in finding that nasty bug that crashes all

* BUGFIX: finally found and squased the memory bug, no more random crashes

also: removed debug outputs and minor cleanup

* minor cleanup and fixed a bug

1D system had a lot of crashes, some out of bounds memory issue. fixed it but I have no idea which change did that, maybe the order in 1D initialization

* BUGFIX: out of bounds checking was wrong, leading to crashes

* better handling of used particles in transitions

for FX that do not use all particles, transitions were constantly shifting the pointer, resulting in newly generated particles and weird particle flickering, this is not fixed by keeping the pointer constant once the number of used particles is reached.

* improved particle transition for low-count FX, updated 1D FX

now most 1D FX work again, still needs some fine-tuning

* Rework on Fireworks 1D, some minor fixes

- fireworks 1D now matches as closely as possible to the old FX
still not identical but as good as it gets.

* bugfix in PS Chase, increased brightness of 1D fireworks

* replaced sin16/cos16 with new versions

* bugfixes

* fixed hourglass init, rearranged PS FX init

* speed optimization

- moved out of bounds calculation to proper spot
- removed repeated allocation attempts if initial buffer alloc fails

* Added Sonic Stream FX, some cleanup, bugfix in emitter

* changed TTL to brightness calculation, added collision binning

- brightness is now doubled as some FX were really dim due to low TTL
- added binning in x-direction giving a huge speed advantage on larger matrix sizes

* collision binning bugfix, made particles less sticky, update to waterfall

- updated waterfall intensity and blurring

* WIP: fixed 1D system for over 1000 pixels, added collision binning for 1D

- making x coordinate 32bit allows for larger strips but uses a lot of ram due to struct memory alignment (12bytes instead of 8 bytes), this needs some more work to properly fix.
- adding collision binning significantly speeds things up, about a factor of 2 on most FX using collision
- there are still some bugs in FX or 1D memory handling (or both) on large setups

* moved particle flags to seperate array to save on RAM, refactoring

- moving the flags optimizes ram alignment, saving memory for each particle
- changed lots of parameters to `const`
- moved fire intensity to a variable instead of passing it to every render() call
- changed passing pointers to passing reference where possible
- saves a total of 340 bytes of flash

* removed todos after some checks, minor improvements

* inverted y axis in 2D render, 1D collision improvements, cleanup and fixes

- inverting the y-axis in the buffer instead of in buffer transfer fixes the FX flipping when transitiononing 1D<->2D
- improved particle binning for collisions
- added hard-pushing also when not using gravity so piles close to an edge dont collapse
- some improvments to "balance" FX
- renaming and cleanup

* FX fixes and minor tweaks

* increased min rockets

* fixed #ifdefs

* another fix

* revert unnecessary changes to base code

* merge fix

* minor tweak

* tweaked sparkler FX, some cleanup

* Fix in volcano FX, changed blurring of volcano and waterfall

* added ifdefs

* minor tweaks, increased 1D minsurfacehardness

* improved sparkler FX, made overlay possible (1D not yet), cleanup

* cleanup, now using new hsv2rgb/rgb2hsv, add overlay rendering to 1D

- new hsv2rgb is a tiny bit faster
- removed redundant code (using transferBuffer instead)
- tweked parameters in vortex, removed unneeded slider defaults

* fix for non or partially overlapping segments

- can not use overlay rendering if no segment clears the buffer, it will all add up to white eventually
- now additive transfer i.e. overlay mode is only activated if the segment is fully overlapping an underlying segment

* change got lost...

* increased sparkler intensity, some cleanup

* replaced #ifdefs, removed 1D replacements that have 2D version, removed notes

* cleanup, improvements to PS bouncing ball, replaced multicomet

- bouncing balls is now named pinball and has settings/parameters updated to be a replacement for multicomet

* cleanup, improvements, bugfixes

- large size rendering now works without framebuffer
- background adding is now done on buffer (if avilable) instead of segment
- fixed overflow bug in 2D large particle rendering (it worked only for powers of 2 size)

* potential bugfix, compiler warning fix

* removed colorwaves and pride option from chase (not worthy replacements)

* updated #defines, removed PS from 1M and 2M builds

* Adding Particle System and PS FX

Adding all 187 commits from particle system dev branch

* reverted some accidental changes

* reverted some accidental changes

* merge fixes

* changed replacement: multicomet instead of comet (lighthouse)

* changed replacement: multicomet instead of comet (lighthouse)

* disable 2D PS for ESP8266, some cleanup, improved pinball FX parameters, bugfixes

* Improved collision binning for large particles, improved pinball FX

* improved speed handling in pinball FX - rolling

* disable 2D PS for ESP8266, some cleanup, improved pinball FX parameters, bugfixes

* improved hourglass: millis instead of frame timing, better stacking. and cleanup.

* revert whitespaces

* simplified 1D collisions, improved binning for larger particles

- ran a lot of experiments with collisions in 1D, the new much simpler approach seems to be a good compromise with regards to stacking and normal collisions.

* Improved collision binning for large particles, improved pinball FX

* improved speed handling in pinball FX - rolling

* improved hourglass: millis instead of frame timing, better stacking. and cleanup.

* revert whitespaces

* prohibit use of 1D and 2D system simultaneously on ESP8266

* prohibit use of 1D and 2D system simultaneously on ESP8266

* update to handle blending styles

* fixed bugs, improved new transition handling

* updated 1D system to work with new transitions, replaced NULL with nullptr

* merge fixes

* added single pixel particle rendering for 2D system, adjusted FX to work with it

* improved collisions in 1D and 2D, some bugfixes in radius calculation, minor tweaks

- collisions are now also velocity based in 1D, there was a bug that prevented that from working well (wrong collision distance calculation)
- improvement and bugfix in 2D collision distance calculation
- added distance based pushing in 2D (instead of only using the dotproduct)
the combination of improved distance calculation and proper pushing make collisions a lot better in all tested FX

* minor fix

* fixed overlay detection, checking for partial overlay

if a PS FX is partially overlapping, it will render in overlay mode

* better blur range in PS Firworks

* minor code consolidation

* updated 1D collisions (yet again), improved 2D collision speed

- slight improvement to 2D collision code efficiency
- added faster "division" to C3/ESP8266 by using a right shift trick (biasing towards 0 also for negative numbers by applying proper rounding)

* minor tweak in PS balance
2025-02-17 18:32:12 +01:00
netmindz
756e27fb52
Disable notify - pending permissons fix 2025-02-16 14:02:06 +00:00
netmindz
1d6e5a2464
notify on nightly 2025-02-16 13:17:40 +00:00
netmindz
dc77428df4
Notify on daily 2025-02-16 13:17:03 +00:00
Will Tatam
b293356cec Revert "Disable changelog while fixing release update"
This reverts commit 1fd703aff9658ad3edeb548822f9fc4529d80137.
2025-02-16 10:53:19 +00:00
Will Tatam
1dc7647bb9 Merge branch 'main' into usermod-libs 2025-02-16 10:40:30 +00:00
netmindz
c3f6537a4d
Merge pull request #4558 from DedeHai/wifi_hardware_timing_fix
Bugfix for incorrect wifi-hardware timing
2025-02-16 10:33:52 +00:00
netmindz
70a3dc938a
Merge pull request #4560 from maxi4329/update-links
update links to point to the new repo
2025-02-16 10:29:05 +00:00
netmindz
1fd703aff9
Disable changelog while fixing release update 2025-02-16 10:21:38 +00:00
maxi4329
aa3fb7d165 update links to point to the new repo 2025-02-15 20:07:41 +01:00
netmindz
2b9ff3148c
Merge pull request #4556 from spiro-c/npm-check
Fix for: Build should stop if npm fails #4513
2025-02-15 15:09:46 +00:00
maxi4329
7f24269511
Fix for #4153 (#4253)
* fix for #4153

* only load touch/mouse events for touch/mouse devices

* undid formating changes

* undid more formating changes

* undid all formating changes

* use pointerover and pointerout eventlisteners
2025-02-15 15:14:52 +01:00
Damian Schneider
b34d65fce0 fix for incorrect hardware timing 2025-02-15 10:34:44 +01:00
SpiroC
778cecb512 Check if Node.js is installed and present in PATH 2025-02-15 14:43:08 +11:00
Brandon502
e7e0eb0f32 Pinwheel Rework
Optimized pinwheel algorithm. Math and memory optimizations by @DedeHai
2025-02-13 19:01:10 -05:00
Blaž Kristan
a0c55c6406
Merge pull request #4484 from blazoncek/parallel-I2S
WWA strip support & parallel I2S for S2/S3 (bumping outputs from 5/4 to 12)
2025-02-13 19:10:37 +01:00
Damian Schneider
aba736cb96 moved modulo 2025-02-10 20:26:34 +01:00
Damian Schneider
bdec873fed removed slider default 2025-02-10 08:42:22 +01:00
Damian Schneider
2cc73660bf bugfix (XY needs the modulo for zF/zD), updated amplitude for better range 2025-02-10 08:30:36 +01:00
Blaž Kristan
f3de45c6ad Remove reference to custom allocators 2025-02-09 21:43:35 +01:00
Blaž Kristan
386e2c6306
Merge pull request #4528 from blazoncek/ir-bugfix
Fix for "Send notifications on button press or IR" does not work when using "JSON remote" #4519
2025-02-09 20:36:44 +01:00
Blaž Kristan
2473065b98 Soap gap bugfix & aditional size tuning 2025-02-09 19:08:42 +01:00
Blaž Kristan
ed91c54654 Uninitialised _data bugfix 2025-02-09 18:24:10 +01:00
Damian Schneider
4d53e0adde
Fixes first pixel not being set in Stream FX (#4542)
* Fixes first pixel not being set
* added fix to Stream 2 as well
2025-02-08 16:45:33 +01:00
yangminglong
35f87365c9
Brightness follow sun (#4485)
* add usermod : Brightness Follow Sun
2025-02-08 10:11:14 +01:00
Damian Schneider
8e7d6d5dad cleanup and added Density slider
- moved local variables into function
- made coordinates an array
- amplitude can now be changed by user (default setting is a slight increase to original which cannot be avoided without complicated logic or default slider setting)
2025-02-08 10:06:29 +01:00
scourge411
95a10c692c
constexpr is invalid on is2D() (#4540)
* constexpr is invalid on is2D() (it does work on _V4 builds though)
2025-02-08 08:44:46 +01:00
Blaž Kristan
77d7082ffc Bugfix
- correct string length in strlcpy()
2025-02-07 16:56:16 +01:00
Blaž Kristan
c43d09c8b1 Move _data and allocation to derived class
- as suggested by @TripleWhy
- minimum length guard

Conflicts:
	wled00/bus_manager.cpp
	wled00/bus_manager.h
2025-02-07 16:18:53 +01:00
Damian Schneider
d92e60ee5f adding XY() lambda function back in
- slight increase in code size, speed is the same but better readability.
2025-02-07 15:23:44 +01:00
Damian Schneider
b9ceacb43d more optimizations and better readability 2025-02-07 11:14:13 +01:00
Damian Schneider
2fe809f15a consolidated double loops into function
- saves ~500 bytes of flash
- slight speed improvement
2025-02-07 09:46:06 +01:00
Will Miles
078a054dbd usermods/pixels_dice_tray: Fix BLE dependency 2025-02-07 04:12:07 +00:00
Will Miles
c57be77039 Fix sensor usermod globals
These can be static locals instead; allows these usermods to build and
link together.
2025-02-06 22:26:45 -05:00
Will Miles
e6910f732f Disable EleksTube_IPS usermod
For some reason, building it seems to consume 300kb of SRAM??
Probably there's still something wrong with the configuration.
2025-02-06 22:25:39 -05:00
Will Miles
d0b599781d Fix up BME280_v2 usermod
Minor compile correctness tweak
2025-02-06 22:24:53 -05:00
Will Miles
2431f2058b load_usermods: Split on any whitespace
This allows the common newline syntax in platformio
2025-02-06 22:23:12 -05:00
Blaž Kristan
8c717537c4 Lambda XY() 2025-02-06 15:12:04 +01:00
Damian Schneider
e088f4654a removed unnecessary changes 2025-02-06 11:32:33 +01:00
Damian Schneider
b363b6151c revert using color_fade() as it is slower
- ran a few more tests, it is 30% faster like it was originally so reverting. The conversion to 32bit color appears to be wasteful in resources.
2025-02-06 11:32:33 +01:00
Damian Schneider
3baa4f8223 improved speed and fixed issue
- fixed issue: blending was also done when color was on a key-index-color which is now skipped
- speed improvement: conversion is skipped if color is key-color
2025-02-06 11:32:33 +01:00
Damian Schneider
373f4cfefd removed unnecessary lambda function
performance is the same, the function just makes it a bit confusing.
2025-02-06 06:44:26 +01:00
Blaž Kristan
64a02b705a Blending style bugfix (wrong limit)
SoundSim bugfix (missing options)
2025-02-04 18:42:38 +01:00
Will Miles
f72b5d04e8 usermod/pixels_dice_try: Add missing dep
The "arduino-pixels-dice" library needs the ESP32 BLE subsystem, but
doesn't explicitly depend on it.
2025-02-03 19:35:12 +00:00
Will Miles
1688546519 Fix RTC usermod 2025-02-03 18:48:07 +00:00
Will Miles
2eff6b7a3a usermod/sensors_to_mqtt: Add explicit dep
This mod includes a header from the Adafruit Unified Sensor library
inherited by its target sensor libraries.  This isn't reliably
picked up by PlatformIO's dependency finder.  Add an explicit dep to
ensure build stability.
2025-02-03 17:57:09 +00:00
Woody
58962f8470
npm update 2025-02-01 22:56:06 +01:00
Woody
dfd7ff5b39
Merge branch 'cdata' of https://github.com/w00000dy/WLED into cdata 2025-02-01 22:54:20 +01:00
Woody
d56ded8c18
npm update 2025-02-01 22:52:31 +01:00
Woody
af3ebbb3c2
Merge branch 'main' into cdata 2025-02-01 22:51:02 +01:00
Blaž Kristan
1db3359b84 Replace unsigned with size_t 2025-02-01 12:07:31 +01:00
Will Miles
7a40ef74c6 Fix up PWM_fan
Use a custom setup script to check for the dependencies and pass along
the required compile flags to the module; also split the object
definitions for the target modules from their source so as to allow
#including them.
2025-01-31 23:59:37 +00:00
Damian Schneider
b64cd36468 fixes trail flickering randomly. thx @blazoncek for discovering 2025-01-31 14:14:23 +01:00
Will Miles
b3f9983f44 First half of usermod readme updates
Describe the new usermod enable process, and update sample
platformio_override.ini stubs.
2025-01-31 03:57:23 +00:00
Will Miles
070b08a9e6 Rename usermod EXAMPLE_v2 to EXAMPLE
It'd be better to not propagate the 'v2' suffix any further.  This is
the standard flavor of usermods now.
2025-01-31 03:54:17 +00:00
Will Miles
851e9ece03 Remove deprecated mqtt_switch_v2 usermod
...it's been 3 years, and it's easier than cleaning up the readme.
2025-01-31 03:52:59 +00:00
Will Miles
51db63dff7 load_usermods: Also search for mod_v2 2025-01-31 03:39:05 +00:00
Will Miles
a5b972d87e Merge remote-tracking branch 'upstream/main' into usermod-libs 2025-01-31 02:51:56 +00:00
Will Miles
4bc3408410 load_usermods: Don't cross usermod includes
Only include paths for the base system deps, not those of other
usermods.
2025-01-31 01:35:58 +00:00
Will Miles
5d392d89ce load_usermods: Improve include path assembly
Don't blast the path of any mentioned library - parse only the tree of
the actual build deps.
2025-01-31 01:33:34 +00:00
Will Miles
86f97614b0 platformio.ini: Fix esp32dev_V4 usermods 2025-01-31 01:32:34 +00:00
Blaž Kristan
5b7bab6752 Compile fixes 2025-01-30 20:46:26 +01:00
Blaž Kristan
70042db2de Allow "unlimited" virtual buses
- added config upload options
- number of buses it limited to 36 (0-9+A-Z identifiers)
- WRNING web server may not support that many variables
2025-01-30 19:41:44 +01:00
Blaž Kristan
bf69d37cbe Revert getBus() changes 2025-01-30 19:35:36 +01:00
Blaž Kristan
ee7ec20f29 Convert BusManager class to namespace
- use unique_ptr/make_unique for busses
2025-01-30 19:31:09 +01:00
Blaž Kristan
1e1ba9afa3 Fix for aircoookie/WLED#4519
- added JSON handling for irApplyToAllSelected
2025-01-30 19:19:27 +01:00
netmindz
32a75c1ff5
Merge pull request #4165 from willmmiles/esp8266-pwm-phase
Support PWM phase shifts on ESP8266
2025-01-27 19:05:46 +00:00
netmindz
61b99471a1
Merge pull request #4516 from willmmiles/aws-queue-0_16
Update AsyncWebServer and enable response queue
2025-01-26 16:15:24 +00:00
Will Tatam
e27fa882fa Move CONFIG_ASYNC_TCP_USE_WDT=0 to new esp32_all_variants 2025-01-26 16:12:08 +00:00
Will Tatam
7c05914e5a Merge branch 'main' into aws-queue-0_16 2025-01-26 16:07:15 +00:00
netmindz
daa438b349
Merge pull request #3835 from Aircoookie/gif
Image effect (GIF support)
2025-01-26 15:46:16 +00:00
Will Tatam
35624ab998 Merge branch 'main' into gif-fix 2025-01-26 15:19:56 +00:00
netmindz
2d6ad41ed4
Merge pull request #4430 from inverse/fix-devcontainers-config
Use proper devcontainers schema for vscode customisations
2025-01-25 08:20:38 +00:00
netmindz
8544bdd881
Merge pull request #4518 from zuckschwerdt/gh-add-gz-nightly
Nightly release - Add bin.gz artifacts
2025-01-25 07:48:21 +00:00
Christian W. Zuckschwerdt
a778ff01f6 Nightly release - Add bin.gz artifacts 2025-01-24 23:17:01 +01:00
Blaž Kristan
e7c0ce794b Merge conflict fix
- updated blending style constants
2025-01-24 10:10:14 +01:00
Will Miles
4c50119ac2 Merge remote-tracking branch 'upstream/main' into esp8266-pwm-phase 2025-01-23 19:39:01 -05:00
Will Miles
2181618357 stress_test: Add replicated index as a target
No locking contention, but a much larger target
2025-01-23 19:10:43 -05:00
Will Miles
bec7e54f7f Defer web requests if JSON lock contended
Use the web server's queuing mechanism to call us back later.
2025-01-23 19:10:43 -05:00
Will Miles
dc317220b3 Debug: Dump web server queue state
This can be helpful for debugging web handler related issues.
2025-01-23 19:10:43 -05:00
Will Miles
981750a48a Enable webserver queue and limits
Enable the new concurrent request and queue size limit features
of AsyncWebServer.  This should improve the handling of burst
traffic or many clients, and significantly reduce the likelihood
of OOM crashes due to HTTP requests.
2025-01-23 19:10:43 -05:00
Will Miles
1df717084b Update to AsyncWebServer v2.4.0
Includes update to use matching newer AsyncTCP on ESP32
2025-01-23 19:10:28 -05:00
Will Tatam
f2caf14d6a Fix missing hideDMXInput and hideNoDMXInput functions 2025-01-22 20:33:15 +00:00
Will Miles
c9672b35ce
Merge pull request #4511 from mlichvar/main
fix reproduction in game of life
2025-01-21 19:56:51 -05:00
Miroslav Lichvar
39512da74e fix reproduction in game of life
A typo caused broken counting of the most common color in neighbouring
cells and blocked reproduction in some directions.
2025-01-21 20:01:04 +01:00
Will Miles
0d44e7ec27 Usermods: Remove libArchive
This is now managed centrally.
2025-01-21 00:12:37 +00:00
Blaž Kristan
24082d169b
Merge branch 'main' into parallel-I2S 2025-01-20 22:19:49 +01:00
Blaž Kristan
3debaf0f41
Merge branch 'main' into use-bssid 2025-01-20 17:46:56 +01:00
netmindz
2448266d7c
Merge pull request #4158 from Aircoookie/blending-styles
Effect blending styles (recreated PR from #3877)
2025-01-20 11:30:57 +00:00
Blaž Kristan
3a426e258b
Merge branch 'main' into blending-styles 2025-01-20 11:19:43 +01:00
Blaž Kristan
b062d1ee3e
Merge branch 'main' into large-ledmap 2025-01-20 09:03:55 +01:00
Blaž Kristan
ebc171d405 Const update
- removed erroneous DEBUGFX
2025-01-20 08:59:35 +01:00
5chubrakete
4951be6999
Added some date and time formatting options to scrolling text effect. (#4195)
Updated to nonbreaking change and auto uppercasing according to review.
2025-01-20 06:24:10 +01:00
Ryan Ross
01a71132d5
connect the seven segment reloaded usermod to BH1750 usermod (#4503) 2025-01-20 06:12:12 +01:00
Damian Schneider
a421a90e0a
replacement for fastled sqrt16() (#4426)
* added bitwise operation based sqrt16

- replacement for fastled, it is about 10% slower for numbers smaller 128 but faster for larger numbers. speed difference is irrelevant to WLED but it saves some flash.

* updated to 32bit, improved for typical WLED use

- making it 32bits allows for larger numbers
- added another initial condition check for medium sized numbers
- increased the "small number" optimization to larger numbers: the function is currently only used to calculate sqrt(x^2+y^2) which even for small segments is larger than the initially used 64, so optimizing for 1024 makes more sense, although the value is arbitrarily chosen
2025-01-20 05:51:04 +01:00
Will Miles
1d558e8391 platformio.ini: Add extra flags for usermod test
Define a couple pins, leave a note where the usermod list comes from.
2025-01-19 22:25:34 +00:00
Will Miles
30a697e708 usermods/PWM_fan: Disable pending cross-mod check
A better solution for cross-module communication is required!
2025-01-19 22:19:30 +00:00
Will Miles
0233daeda2 usermods/sensors_to_mqtt: Fix char type 2025-01-19 22:19:30 +00:00
Will Miles
48372bcd91 platformio: Fix audioreactive usermod for ESP8266 2025-01-19 22:19:30 +00:00
Will Miles
44a1a1ebde usermods: Fix MQTT checks
- Check after including wled.h
- Use WLED_DISABLE_MQTT instead of WLED_ENABLE_MQTT
2025-01-19 22:19:30 +00:00
Will Miles
2b07be1d09 usermod mpu6050: Fix incorrect int type 2025-01-19 22:09:44 +00:00
Blaž Kristan
a98685d89e Remove numBusses, RMT idle bugfix
- experiment with std::unique_ptr
2025-01-19 21:37:34 +01:00
Blaž Kristan
1c4ba20646 Merge branch 'bus-improvements' into parallel-I2S 2025-01-19 12:41:17 +01:00
Blaž Kristan
d3954b94d3 Update NPB to 2.8.3
Remove logs form Git tracking
2025-01-19 12:19:06 +01:00
Blaž Kristan
7daea18907 Merge fixes & updates
- Segment::setName()
- S2 limits
- bus debug macros
- remove cctBlending from strip
2025-01-19 11:37:57 +01:00
Blaž Kristan
0c84235a95 Bus rework
- Implement vector in bus manager
- Memory calculation according to explanation from @Makuna
- Prefer 8 RMT before 8 I2S on ESP32 (fixes #4380)
- speed improvements in ABL
- verbose debugging
- get bus size from NPB (prototype)
- Parallel I2S output bugfix
- automatic selection of appropriate I2S bus (`X1xxxxxxMethod`)
- removed I2S0 on ESP32 (used by AudioReactive)
- renumbered internal bus numbers (iType)
- added buffer size reporting
2025-01-19 10:17:33 +01:00
Damian Schneider
aab29cb0ab consolidated colorwaves and pride into one base function
the two FX are almost identical in code with just a few lines difference.
2025-01-19 09:04:54 +01:00
Frank
566c5057f9 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-19 07:35:46 +01:00
Frank
cd52d7bcf6 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-19 07:35:46 +01:00
Frank
ed3ec66d33 fix compile error
"const" was missing in the function implementation
2025-01-19 07:35:46 +01:00
Blaž Kristan
01c463c8e8 More tuning
- replaced POD new/delete with malloc/free
- some more SEGLEN <= 1
- some gnu::pure
- more const attributes
- some static attributes
2025-01-19 07:35:46 +01:00
Frank
872465df40 typo in comments 2025-01-19 07:35:46 +01:00
Frank
b6f74287d0 implement recommendations from reviewers
* simplified transition bugfix
* removed cast same type
* isIp parameter changed to pass-by-reference, to avoid copy constructor
2025-01-19 07:35:46 +01:00
Frank
013684b5ca 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-19 07:35:46 +01:00
Frank
90c2955a71 avoid using keywords for variables: module, final
these are reserved names and future compilers may reject them.
2025-01-19 07:35:46 +01:00
Frank
7be868db12 bugfix: indexOf() returns -1 if string not found
... so we must use `int` instead of `unsigned`
2025-01-19 07:35:46 +01:00
Frank
703f84e5e1 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-19 07:35:46 +01:00
Malachi Soord
c92dbb10ac
Use proper devcontainers schema for vscode customisations 2025-01-18 01:03:39 +01:00
netmindz
48f5099646
Merge pull request #4495 from netmindz/DMX-Input-AC
Add Wired DMX Input support
2025-01-17 19:31:25 +00:00
Kilrah
b9aeb19834
RF433 json usermod (#4234)
* RF433 remote usermod

---------

Co-authored-by: Kilrah <kilrah@kilrah.xyz>
2025-01-17 08:01:17 +01:00
Will Miles
193926c795 usermods: Remove #pragma once from cpps 2025-01-17 00:50:02 +00:00
netmindz
a4c3491f0c
Merge pull request #4428 from blazoncek/waterfall-fix
FX: Waterfall, Matripix & Dissolve fix
2025-01-16 15:52:21 +00:00
netmindz
ad65856b3d
Merge pull request #4018 from Brandon502/main
Added Cube Mapping Tool
2025-01-16 13:03:22 +00:00
netmindz
b2aac9f991
Merge pull request #4386 from DedeHai/ESPNow_glitchfix
Fix for ESPNow remote causing output glitches
2025-01-16 13:01:00 +00:00
Will Tatam
a582786655 Port over remaining WLEDMM part of DMX Input and adapt for AC 2025-01-16 12:48:36 +00:00
Will Tatam
953e994c88 Add DMX Input support to builds 2025-01-16 12:24:42 +00:00
Will Tatam
9a6e91d3e5 DMX Input - reinstate loggers for connection state change 2025-01-16 12:22:51 +00:00
Will Tatam
fc4e7a2dee Swap DMX port to 1, persist user choice of port, validate port vs UART count 2025-01-16 12:22:32 +00:00
Will Tatam
a56014bb66 Hide DMX port as just confusing to users 2025-01-16 12:20:37 +00:00
Will Tatam
ebfc438bd4 Tweak DMX settings UI 2025-01-16 12:20:15 +00:00
Will Tatam
3996f02dea Revert "Rename WLED_ENABLE_DMX to WLED_ENABLE_DMX_OUTPUT"
This reverts commit 7f9cc6751875dd4882f91bf58adcb820d76cab8c.
2025-01-16 12:19:25 +00:00
Arne
d637524bfc chore: remove outdated comments 2025-01-16 12:16:50 +00:00
Arne
8570922dcc chore: adapt code style 2025-01-16 12:16:39 +00:00
Arne
6598265f9b make compile after rebase 2025-01-16 12:15:58 +00:00
Arne
8f398dfd08 Move dmx_input into its own task on core 0.
This was necessary because otherwise it is not able to respond to rdm in time.
2025-01-16 12:15:49 +00:00
Arne
68e9d701de Do no longer disable dmx_input when cache is disabled.
No longer needed because missing ISR_ATTR have been added to esp_dmx.
2025-01-16 12:15:37 +00:00
Arne
67e8a00b6d rename initDmx() -> initDmxOutput() 2025-01-16 12:11:21 +00:00
Arne
11b48bc374 rename handleDMX() handleDMXOutput() 2025-01-16 12:10:13 +00:00
Arne
fa80c62b28 rename dmx.cpp -> dmx_output.cpp 2025-01-16 12:06:10 +00:00
Arne
7f9cc67518 Rename WLED_ENABLE_DMX to WLED_ENABLE_DMX_OUTPUT 2025-01-16 12:05:40 +00:00
Arne
84eb6fd460 Add dmx input port to configuration 2025-01-16 11:47:48 +00:00
Arne
2cc5a29b86 keep dmx rdm identify on if dmx disconnects.
Some rdm testers disconnect after setting it.
2025-01-16 11:42:35 +00:00
Arne
b178c08271 Support dmx rdm personality change 2025-01-16 11:42:16 +00:00
Arne
9a3b208ac5 comments and cleanup 2025-01-16 11:37:14 +00:00
Arne
2989155f05 handle rdm dmx address changes 2025-01-16 11:37:05 +00:00
Arne
50b56c64f5 extract creation of dmx config into own method 2025-01-16 11:36:58 +00:00
Arne
be3e331afb Monitor dmx personality and dmx start address for change and update rdm 2025-01-16 11:36:50 +00:00
Arne
9d8fdd0b20 extract test for rdm identify into own method 2025-01-16 11:36:44 +00:00
Arne
033c7abe62 add enable/disable methods for dmxInput 2025-01-16 11:36:36 +00:00
Arne
5525a21696 rename settings 2025-01-16 11:36:24 +00:00
Arne
aed03cd03b hack: disable dmx receiver while wifi is being activated
This fixes a crash in the dmx receiver. The dmx receiver cannot work while cache is disabled. For some reason activating wifi disables the cache. In theory, the driver is placed in iram and should work, but it doesn't. This might be a bug in the driver.
2025-01-16 11:35:04 +00:00
Arne
5a5661f136 handle dmx rdm identify 2025-01-16 11:32:49 +00:00
Arne
a3bcf92ea5 Turn dmx_into into class with state.
This is much nicer to read and in the future more state will be added to support all the rdm stuff.
2025-01-16 11:29:39 +00:00
Will Tatam
0ad31c90f6 fix merge error 2025-01-16 11:26:42 +00:00
Arne
789d68e80d Move globals to top of file and change scope to compile unit only.
Some minor cleanup changes
2025-01-16 11:21:52 +00:00
Arne
f06a1e8b49 Extract dmx_input from dmx.cpp into dmx_input.cpp.
This greatly improves readability because it gets rid of most of the
ifdefs.
2025-01-16 11:21:41 +00:00
Arne
a0ca243955 Move dmx_input pin allocations from wled.cpp to dmx.cpp 2025-01-16 11:20:19 +00:00
Arne
9e2268bd74 Adapt to new api of esp_dmx v3.1 2025-01-16 11:17:58 +00:00
Arne
702d085117 rename global dmx... variables to dmxInput...
This is the first step in supporting both dmx input and dmx output on different pins.
2025-01-16 11:16:39 +00:00
Damian Schneider
356a0d72c3
proper fix for existing C3 override envs 2025-01-16 12:11:38 +01:00
Damian Schneider
7fcc4a5283
fix for existing C3 overrides 2025-01-16 12:07:52 +01:00
Will Miles
15edfcd088 Fix usermod platformio integration
Should now work for new *and* old versions of PlatformIO!
2025-01-16 01:05:12 +00:00
Damian Schneider
278d204d1c
merge fix for Deep-Sleep UM 2025-01-15 20:36:53 +01:00
Damian Schneider
39b3e7e507
BUGFIX in oscillate FX (#4494)
effect was changed from int to uint but it relied on negative numbers. fixed by checking overflow and a cast.
2025-01-15 15:17:56 +01:00
Will Tatam
8487dd7cfd Disable build of usermods that are broken at the moment 2025-01-15 12:49:40 +00:00
Will Tatam
5d05d7936c Add usermod dependencies 2025-01-15 12:46:48 +00:00
Will Tatam
0afd2fe720 Destructor must be public 2025-01-15 12:46:06 +00:00
Will Tatam
59a79a30da Add deps for usermods/BME280_v2 2025-01-15 11:34:51 +00:00
Will Tatam
5da380e1b0 Update dependencies for sensors_to_mqtt 2025-01-15 11:28:38 +00:00
Will Tatam
2adf745d06 Update env:usermods to use V4 2025-01-15 11:22:33 +00:00
Will Tatam
ef2eb0764c Merge branch 'main' into usermod-libs 2025-01-15 11:00:52 +00:00
netmindz
9e37d7051c
Merge pull request #4492 from Aircoookie/V4
V4
2025-01-15 10:57:24 +00:00
netmindz
05098c3382
Merge pull request #4487 from netmindz/V4-tasmota
Swap to tasmota/platform-espressif32
2025-01-15 10:39:50 +00:00
Will Miles
32607ee74c Revert incorrect testing platformio.ini 2025-01-15 02:26:34 +00:00
Will Miles
30559cd2d3 Fix dependency for EleksTube_IPS usermod 2025-01-14 22:21:41 +00:00
Will Miles
8fd905215f Integrate usermods environment
Move the "all usermods" logic in to the platformio script, so the
'usermods' environment can be built in any checkout without extra setup
commands.
2025-01-14 22:21:26 +00:00
Will Miles
270d75afe2 Update usermod deps earlier
When processing usermods, update their include path properties before
the LDF runs, so it can see through wled.h.
2025-01-14 22:16:55 +00:00
Blaž Kristan
a65f97ac75 Merge branch 'main' into blending-styles 2025-01-14 22:39:20 +01:00
Will Tatam
53c1856038 Enable GIF support for all esp32 builds 2025-01-14 18:47:06 +00:00
Will Tatam
56b8af86d7 Swap to WLED_ENABLE_GIF 2025-01-14 18:40:41 +00:00
Christian Schwinne
e852df3179 Proper debug statements 2025-01-14 18:30:34 +00:00
Christian Schwinne
7c03f716a8 Include gif library for all esp32 variants 2025-01-14 18:29:30 +00:00
Christian Schwinne
d4ba603cf7 Update pio version 2025-01-14 18:27:30 +00:00
Will Tatam
deb0306347 Merge branch 'main' into gif-fix 2025-01-14 18:26:41 +00:00
Will Tatam
881da25e8c Add local defintion of lolin_s3_mini as missing from Tasmota platform 2025-01-14 18:06:51 +00:00
Will Tatam
a37b953e72 Set flash_mode to qio for esp32c3dev to maintain current behaviour 2025-01-14 12:44:40 +00:00
Will Tatam
bba5188594 Add the safe option of flash_mode for esp32c3dev, qio also possible 2025-01-14 12:43:06 +00:00
Will Tatam
7dc633581d Merge branch 'V4-tasmota' of github.com:netmindz/WLED into V4-tasmota 2025-01-14 12:29:19 +00:00
Will Tatam
bd00d012e2 Remove esp8266_2m_tasmota as not a V4 change and no suitable tasmota build using the currently used Arduino Core version of 3.1.2 2025-01-14 12:29:03 +00:00
Will Tatam
4f4476b79f Set new codename 2025-01-14 11:53:10 +00:00
Will Miles
0b8721c25e Fix usermod libArchive setting
Monkey-patch PlatformIO to intercept the build process after library
dependencies are loaded, but before the build is fully analyzed.  This
lets us enforce libArchive=False for usermods without making that
setting global across all libraries.

The rest of the fixup code is integrated at the same call site for
simplicity.
2025-01-14 02:48:00 +00:00
Will Tatam
869e275e48 typo in usermods/sensors_to_mqtt/library.json 2025-01-14 00:43:59 +00:00
Will Tatam
e4714870a4 typo in usermods/sensors_to_mqtt/library.json 2025-01-14 00:39:04 +00:00
Will Tatam
1dbd7066de Revert LOROL_LITTLEFS hack 2025-01-14 00:27:54 +00:00
Will Tatam
022e4986ee Revert "Update to Tasmota Arduino Core 2.0.18" - Frank says to stay on
2.0.9

This reverts commit b421f7ae87aa0c76da34b12ba49dd6fc493e26b1.
2025-01-14 00:24:37 +00:00
Will Tatam
2c9c413e79 Merge branch 'usermod-libs' into usermod-libs-migration 2025-01-14 00:22:07 +00:00
Will Tatam
b380d5e2c7 reinstate libArchive:false 2025-01-14 00:10:55 +00:00
Will Tatam
650853c177 Use flash_mode = dio 2025-01-13 21:09:05 +00:00
Will Tatam
ae698f988a Merge branch 'V4' into V4-tasmota 2025-01-13 21:04:11 +00:00
Will Tatam
f920fdecfe Add esp32dev back to default_envs 2025-01-13 21:02:28 +00:00
Will Tatam
4e4f823141 Update comment 2025-01-13 20:57:49 +00:00
Will Tatam
b421f7ae87 Update to Tasmota Arduino Core 2.0.18 2025-01-13 20:56:48 +00:00
Will Tatam
ca80d0489b Add env:esp8266_2m_tasmota 2025-01-13 20:30:10 +00:00
Will Tatam
1ed82426a1 Add esp32dev back to default_envs 2025-01-13 19:30:35 +00:00
Will Tatam
7e9f7d4101 set board_build.flash_mode to fix missing sdkconfig.h 2025-01-13 18:39:21 +00:00
Will Tatam
f240a33935 Remove platform_package override 2025-01-13 18:33:30 +00:00
Will Tatam
5bd0a26126 Remove platform_package override 2025-01-13 16:39:58 +00:00
Blaž Kristan
cc011e39ce Bus creation bugfix
- speed improvements in ABL
- verbose debugging
2025-01-13 17:27:33 +01:00
Will Tatam
29ee551b06 Swap to tasmota/platform-espressif32 2025-01-13 15:38:25 +00:00
Will Tatam
5b5e4157e3 Add esp32dev_v4 env 2025-01-13 11:12:14 +00:00
Will Tatam
3c19692312 Cleanup copy-paste of platform and platform_packages - use the proper common esp32_idf_V4 2025-01-13 10:58:32 +00:00
Will Tatam
24accf96a8 Remove now redundant build section from library.json 2025-01-13 10:53:24 +00:00
Will Miles
f2626b0fc0 Remove now-obsolete AR_build_flags 2025-01-12 17:09:33 +00:00
Will Miles
cc9e9b109c Fix usermod library builds
Manage include folders via a second platformio script, fixing builds and
removing all the extra boilerplate from usermod library.json files.
2025-01-12 17:07:36 +00:00
Blaž Kristan
adead9b578 Bus wrapper modifications
- NeoPixelBus update 2.8.3
- automatic selection of appropriate I2S bus (`X1xxxxxxMethod`)
- removed I2S0 on ESP32 (used by AudioReactive)
- renumbered internal bus numbers (iType)
- added buffer size reporting

Bus modifications
- WWA strip support
- bus initialisation rewrite
- optional parallel I2S (ESP32, S2 & S3)
2025-01-12 15:17:22 +01:00
Will Miles
8527d231e1 audioreactive: Move flags to library
Use a PlatformIO script to move the last of AR_buildflags in to the
module itself.
2025-01-12 13:12:12 +00:00
Will Tatam
4c19341279 Merge branch 'usermod-libs-migration' of github.com:netmindz/WLED into usermod-libs-migration 2025-01-12 01:40:45 +00:00
Will Tatam
075fd4da2d Defining more usermod dependencies 2025-01-12 01:38:48 +00:00
Will Tatam
52bee88ad2 fix word_clock_matrix naming 2025-01-12 00:36:08 +00:00
Will Tatam
52b784e0e5 fix env:usermods 2025-01-12 00:22:54 +00:00
Will Tatam
3521732597 fix env:userods 2025-01-12 00:22:22 +00:00
Will Tatam
d3eec72e45 Defining more usermod dependencies 2025-01-12 00:09:31 +00:00
Will Tatam
79bac912aa use bigger partitions for usermods env 2025-01-11 23:25:05 +00:00
Will Tatam
2381e323c1 Define dependencies for ADS1115 usermod 2025-01-11 22:54:28 +00:00
Will Tatam
d64cedd3fc Build custom_usermods = audioreactive auto_save animartrix 2025-01-11 22:38:57 +00:00
Will Tatam
c16d83fab0 Build custom_usermods = audioreactive auto_save animartrix 2025-01-11 22:36:06 +00:00
Will Tatam
cbed841414 Include basic usermods in CI 2025-01-11 22:12:36 +00:00
Will Tatam
67022beca0 Build all usermods 2025-01-11 22:07:03 +00:00
Will Tatam
6e76a72d78 Convert usermods from header to library 2025-01-11 21:42:41 +00:00
Will Tatam
a5575bc3a0 Fix naming of usermod files to match library name 2025-01-11 21:41:21 +00:00
Will Tatam
90b18158fc Convert usermods from header to library 2025-01-11 21:14:20 +00:00
Will Miles
71b0e8e937 Convert AnimARTrix usermod to library
Borrowed library definition from @netmindz's work on #4476.
2025-01-11 13:32:28 -05:00
Will Miles
4d5e0ca7a3 load_usermods: Expand name search
Look for 'usermod_v2_x' as well.  This could be removed later if we
clean up the folder names.
2025-01-11 13:31:20 -05:00
Will Miles
b8685f2c39 Convert usermods to static libraries
Redesign the usermod system so that usermods are implemented as
PlatformIO libraries instead of headers.  This permits them to call for
dependencies, and eliminates the compiler flags for enabling each one,
allowing the build cache to behave better.

The usermod list is built using some linker magic to construct a static
list in ROM memory.  This eliminates the need for wasting SRAM on
something fixed at build time.
2025-01-11 12:08:29 -05:00
Will Tatam
c4e697d797 Revert "Reapply "Set build version during nightly build" - doesn't work as source"
This reverts commit 2aab617c2e2d3f49ba786532b0e44508659f1fae.
2025-01-10 17:09:25 +00:00
Will Tatam
3502a39181 Revert "Set build version during nightly build"
This reverts commit 4a56c92e7b87703166e0ef6dfa3b54f68ffeb237.
2025-01-10 17:09:11 +00:00
Will Tatam
4a56c92e7b Set build version during nightly build 2025-01-10 16:59:08 +00:00
Will Tatam
2aab617c2e Reapply "Set build version during nightly build" - doesn't work as source
This reverts commit 471bd83eb2dd9fa3636d89b884378cb6a65e62ad.
2025-01-10 16:56:07 +00:00
Will Tatam
471bd83eb2 Revert "Set build version during nightly build" - doesn't work as source
files not yet checked out

This reverts commit ec7a7f4c2522f9958636ceca802b9f6ed24ff64a.
2025-01-10 16:53:20 +00:00
Will Tatam
ec7a7f4c25 Set build version during nightly build 2025-01-10 16:49:15 +00:00
Damian Schneider
bb0c0af189
added a delay after switching relay (#4474)
- helps to stabilize power on the LEDs before sending data
2025-01-09 22:41:45 +01:00
netmindz
709aeff9ea
Merge pull request #4435 from TripleWhy/TripleWhy/issue4425
palette effect overflow fix
2025-01-09 11:03:44 +00:00
netmindz
34f18122f5
Merge pull request #4295 from WouterGritter/mqtt-use-topic-buffer-len
FIX: "magic numbers" for MQTT topic buffer length in mqtt.cpp and button.cpp (use already defined MQTT_MAX_TOPIC_LEN)
2025-01-09 11:01:23 +00:00
netmindz
7208282431
Merge pull request #4424 from inverse/consistent-node
Use consistent node version for local, CI, and devcontainer setup
2025-01-09 10:58:36 +00:00
Will Miles
204e72e9eb
Merge pull request #4213 from willmmiles/static-class-to-namespace
Complete transition of UsermodManager and PinManager away from classes
2025-01-08 21:38:10 -05:00
Will Tatam
f626dfb7b7 Nightly release - add changelog since last release 2025-01-08 10:00:39 +00:00
Will Tatam
08b263bf4e Nightly release - add changelog 2025-01-08 09:55:52 +00:00
Will Tatam
d0e99923fd Nightly release - add changelog 2025-01-08 09:55:41 +00:00
Will Tatam
1750512477 Nightly release - add changelog 2025-01-08 09:50:54 +00:00
Will Tatam
5e3b4c3a11 Nightly release - swap action 2025-01-08 09:32:12 +00:00
Will Tatam
0c431d9746 Nightly release - fix release 2025-01-08 09:22:00 +00:00
Will Tatam
438c5d9909 Nightly release - fix filename 2025-01-08 09:05:28 +00:00
Will Tatam
7d29edf6f4 Nightly release - fix filename 2025-01-08 09:01:15 +00:00
Will Tatam
50d505b896 Nightly release 2025-01-08 08:50:33 +00: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
Blaž Kristan
54264efb20 Fill SSID fix 2024-12-30 15:04:25 +01: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
TripleWhy
56e1d577fd palette effect overflow fix 2024-12-27 11:19:24 +01:00
Blaž Kristan
272129f66c Add ability to enter desired BSSID
- add event handling (debug)
- fixes #2151
2024-12-25 15:54:50 +01:00
Blaž Kristan
0441ede229 Fix for #4401 2024-12-25 15:18:34 +01:00
Blaž Kristan
f001846e00
Merge branch 'main' into waterfall-fix 2024-12-25 10:51:34 +01:00
Blaž Kristan
0ac627dfbb FX: Waterfall and Matripix fix
- for Arc expansion
- or gaps
- or ledmaps with missing pixels
2024-12-25 10:46:14 +01:00
Malachi Soord
1a82a3bf7b
Fix devcontainer 2024-12-24 20:30:54 +00:00
Malachi Soord
a2d84886c0
Update .nvmrc 2024-12-24 13:55:10 +01:00
Malachi Soord
97e8382a41
Use consistent node version 2024-12-24 11:05:35 +01: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
dcfebcb973 allow for 0 value button code 2024-12-19 17:46:39 +01:00
Damian Schneider
fd3b47908b renamed functions, changed timeout to 24ms 2024-12-19 17:41:44 +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
Frank
b72695f01a added example environment for pico-D4 boards
this one is actually for https://github.com/srg74/WLED-ESP32-pico

Its a simple example how to configure WLED for a custom board with build-in microphone and special purpose pins.
2024-12-15 21:22:19 +01:00
Frank
65f98c1f30 esp32: use "extends"
directly inherits default platform from esp32
2024-12-15 21:07:01 +01:00
Frank
c6fd4c51cf fix outdated build options
* DEFAULT_LED_PIN --> DATA_PINS
* DEFAULT_LED_COUNT --> PIXEL_COUNTS
* DEFAULT_LED_TYPE --> LED_TYPES
* USERMOD_AUDIOREACTIVE --> ${esp32.AR_build_flags}
2024-12-15 21:02:45 +01:00
Frank
3c11c8441f fix errors in pltformio_override.ini (solves #4395)
* WLED_tasmota_1M not existing
* always use ${esp32.default_partitions}
* fix build error in wemos_shield_esp32
2024-12-15 20:54:16 +01: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
Soeren Willrodt
c8625c70dd
Merge pull request #4397 from lost-hope/fix_internal_temp_usermod_main 2024-12-14 20:22:56 +01:00
Soeren Willrodt
396e9d0c39
Fix "preset not found issue"
this comit fixes the issue reported by user orbitinstasis
2024-12-14 19:58:30 +01:00
Damian Schneider
e16d3bf040 Fix: output-glitching on ESPNow remote command reception
Processing of received button command is no longer processed in the callback, instead the value is saved to a variable and processed in the main loop.
The actual fix is to not access the file system while data is being sent out: even just trying to open a non-existing file causes glitches on the C3. Waiting for the bus to finish fixes this BUT it causes a frame-delay which is the lesser evil than random color flashes.
2024-12-13 07:40:04 +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
netmindz
a426e93011
Merge pull request #4359 from blazoncek/reconnect
WiFi reconnect bugfix
2024-12-09 23:05:12 +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
a0f99393f5
Merge pull request #4341 from Aircoookie/hotfix_4335
Hotfix for #4335 - solves missed pixel problem in blends effect
2024-12-02 21:42:21 +01: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
netmindz
7a80a772c1
Merge pull request #4270 from DedeHai/palette_code_crunch
Replaced single palette cases with an array to consolidate code
2024-12-01 19:02:28 +00:00
Will Miles
8b1d712e1e settings_leds: Initialize current limiter field
When adding a new bus, the numeric current limit field was not being
initialized; this was causing it to save 0 when saved instead of the
default 55mA value.
2024-12-01 13:00:37 -05:00
Damian Schneider
0a05611e1d more improvements to setPixelColor
- code is a bit cleaner and faster as well
- chaning array access to pointer access in bus_manager makes it a few instructions faster
- changed getNumberOfPins and getNumberOfChannels to return 32bit values, saving the unnecessary 8bit conversion
2024-11-26 20:59:36 +01:00
Blaž Kristan
7236589037 Allow pre-compiled OTA password 2024-11-25 22:57:21 +01:00
Blaž Kristan
2c583c3071 Allow editing WiFi settings 2024-11-25 22:56:22 +01:00
Blaž Kristan
855e606163 Fix 1st use 2024-11-24 17:17:17 +01:00
Blaž Kristan
4f1965fbaa Add ability to configure settings PIN at compile time 2024-11-23 11:24:03 +01:00
Frank
6790f8af08
Same MIN_FRAME_DELAY=3 for -C3 and -S2 2024-11-21 22:16:03 +01:00
Wouter Gritter
8f8afd98a5 Replace comment with compile-time error and warning 2024-11-21 11:20:42 +01:00
Wouter Gritter
0db47a8586 Add comment warning about modification of MQTT_MAX_TOPIC_LEN 2024-11-21 09:51:13 +01:00
Wouter Gritter
cec8978886 Fix comment alignment 2024-11-20 12:45:39 +01:00
Wouter Gritter
0160e3fa87 Use MQTT_MAX_TOPIC_LEN in places where it was not used before to avoid buffer overflows when value is increased 2024-11-20 12:39:39 +01:00
maxi4329
7f69a0bc5e removed obsolete code as of #4267 2024-11-16 12:37:24 +01:00
maxi4329
5b829adedb Merge branch '0_15' of https://github.com/maxi4329/WLED into minor-webui-enhancements 2024-11-16 12:24:55 +01:00
Damian Schneider
d437027f26 Replaced single palette cases with an array to consolidate code
- all palettes are defined in palettes.h
- access to fastled palettes as an array to remove the switch cases
- palette createn in json.cpp in a loop instead of repeaded calls to save flash
2024-11-10 22:48:26 +01:00
Frank
9a564ee204
readme.md - link to multi-strip KB page 2024-11-10 14:45:55 +01:00
Will Miles
d37ee89e84 ESP8266PWM: Fix phase shift glitches
In some cases it was possible for the computed phase shift to skip
a cycle.  Update the shift calculation logic to prevent this.
2024-11-09 21:33:58 -05:00
Woody
4b6041302e
fix #4166 2024-11-09 21:59:52 +01:00
Blaž Kristan
ba5ec57e4d Enumeration support. 2024-11-09 11:33:10 +01:00
Blaž Kristan
9fa53ccf05 Large ledmap support
- add filtering support for readObjectFromFile()
2024-11-09 11:22:38 +01:00
Blaž Kristan
5c2bac4b9d Merge branch '0_15' into 0_15__speed_improvements 2024-11-09 10:53:27 +01:00
Blaž Kristan
ef1e24cec2 Bugfix & code reduction
- correctly clear segment spacing change
- renamed Segment::setUp() to Segment::setGeometry()
- removed WS2812FX::setSegment()
- removed obsolete/unfunctional word clock usermod .cpp file
2024-11-09 10:42:49 +01:00
Frank
001e2ad287 adjust audioreactive for the new FRAME_DELAY logic
minor
2024-11-08 19:35:42 +01:00
Frank
0404ec9881 changes in response to feedback from @willmmiles
* MIN_SHOW_DELAY -> MIN_FRAME_DELAY
* allow up to 250 for target FPS
* minor cleanup
* added specific MIN_FRAME_DELAY for -S2
2024-11-07 23:15:39 +01:00
netmindz
6ff5c88ebf
List ESP32 first 2024-11-07 08:17:08 +00:00
Frank
1e761c31bd simpler hight FPS warning
* removed "use 0 for unlimited"
* added "high FPS mode is experimental" warning
* added "backup first!" warning
* added anchor #backup to sec page
2024-11-06 22:09:33 +01:00
Frank
ab7b2d729e use class="warn" for unlimited mode message 2024-11-05 12:24:20 +01:00
Frank
029293a086 simplify sheduler logic
* _frametime ensures that effects are not serviced too often
*  MIN_SHOW_DELAY is the minimum allowed FRAMETIME that can be requested by effects
2024-11-04 20:11:10 +01:00
Frank
cf1630a94a 0 FPS = unlimited 2024-11-04 19:49:43 +01:00
Frank
50934e6840 adressing some review comments
* keep FRAMETIME_FIXED as a fixed value
* remove WLED_FPS_SLOW and FRAMETIME_FIXED_SLOW
* explicit test "(_targetFps != FPS_UNLIMITED)" for debug messages
* don't modify _lastServiceShow in show()
* test for "fps == FPS_UNLIMITED" explicitly, so we could pick a different
 magic number later
2024-11-02 18:16:51 +01:00
Frank
891ea48e11 Merge remote-tracking branch 'upstream/0_15' into framerate_ac015 2024-11-02 17:56:24 +01:00
Frank
451cd4c74a Improved framerate control in strip.show(), strip.service()
* separate fps calculation (strip.show) from framerate control (strio.service)
* improved condition for early exit in strip.show
* make MIN_SHOW_DELAY depend on target fps
* strip.show consideres complete time for effect calculation + show; old code wrongly used the time between completion of last show and start of next effect drawing, causing unexpected slowdown
* add "unlimited FPS mode" for testing
* increase warning limits for "slow strip" and "slow effects"
2024-11-01 23:19:38 +01:00
Will Miles
32eee3365a PinManager: Make in to namespace
Namespaces are the C++ language construct for grouping global functions.
2024-10-20 11:11:23 -04:00
Will Miles
95b4bde918 UsermodManager: Make into namespace
Namespaces are the C++ language construct for grouping global functions.
2024-10-20 11:11:20 -04:00
1Prototype1
4fa8a3898a Added Distribute for cpal
Added a button to distribute the color markers in palette equally
2024-10-19 00:30:24 +05:30
maxi4329
caa997fff1 removed onkeydown tried to find a replacement for the nbsp 2024-10-18 18:43:41 +02:00
maxi4329
bd68b977d5 minor webui enhancements 2024-10-17 18:07:01 +02:00
Blaž Kristan
210191b251 Fix for realtime drawing on main segment 2024-10-07 20:19:07 +02:00
Blaž Kristan
be64930ebb Indentation and shadowed variable. 2024-10-07 16:50:51 +02:00
Blaž Kristan
eb5ad232a0 Minor tweaks and whitespace 2024-10-05 23:31:31 +02:00
Damian Schneider
ca062140f3 removed todo. 2024-10-03 19:39:39 +00:00
Damian Schneider
a15c391e6c Improvement to setPixelColorXY and some flash optimisations
- changes to `setPixelColorXY` give an extra FPS, some checks and the loops are only done when needed, additional function call is still faster (force inlining it gives negligible speed boost but eats more flash)
- commented out the unused `boxBlur` function
- code size improvemnts (also faster) in `moveX()` and `moveY()` by only copying whats required and avoiding code duplications
- consolidated the `blur()` functions by enabling asymmetrical blur2D() to replace `blurRow` and `blurCol`
- compiler warning fixes (explicit unsigned casts)
2024-10-03 21:19:34 +02:00
Blaz Kristan
ba3a61f623 Reduced code size by:
- removing WS2812FX::setMode()
- removing WS2812FX::setColor()
- removing floating point in transition
- color handling modification in set.cpp
- replaced uint8_t with unsigned in function parameters
- inlined WS2812FX::isUpdating()
- (MAY BE BREAKING) alexa & smartnest update
2024-10-02 20:14:25 +02:00
Blaz Kristan
ee380c5377 Replace uint16_t with unsigned for segment data
swap if statements in color_fade
2024-09-30 16:35:40 +02:00
Will Miles
cb8dae1ddb PWM: Revert always apply dead time 2024-09-29 10:13:19 -04:00
Will Miles
59deebc961 Improve PWM on ESP8266
- Better phase updates without dropping samples
- Make second pin duty cycle always after first, even inverted
2024-09-29 10:00:27 -04:00
Blaz Kristan
0ae73296cf Update comment 2024-09-29 15:19:37 +02:00
Blaz Kristan
8e78fb4caa Merge branch '0_15' into 0_15__speed_improvements 2024-09-29 14:31:00 +02:00
Blaz Kristan
336da25463 Private global _colorScaled 2024-09-29 14:14:07 +02:00
Damian Schneider
ffbc8c5f70 Reverting addition of bool unScale, added new improvements and fixes
- Added pre-calculation for segment brightness: stored in _segBri. The impact on FPS is not huge but measurable (~1-2FPS in my test conditions)
- Removed `bool unScaled` from `setPixelColor()` function again (it has no/minimal impact on speed but huge impact on flash usage: +850 bytes)
- Removed negative checking in `setPixelColorXY()` and replaced it with a local typecast to unsigned, saves a few instructions (tested and working)
- Changed int8_t to int in `moveX()` and `moveY()`
- Removed a few functions from IRAM as they are now not called for every pixel but only once per segment update
- Removed a `virtualWidth()` call from `ripple_base()`
- Bugfix in `mode_colortwinkle()`
2024-09-29 13:55:00 +02:00
Will Miles
3c7f83407b Save a little RAM 2024-09-28 23:16:26 -04:00
Will Miles
fe4b668107 Slightly reduce PWM jankiness 2024-09-28 23:12:03 -04:00
Will Miles
cc87b32206 Support PWM phase shifts on ESP8266
Use the phase-locked soft PWM from the Arduino core to implement the
same PWM phase management as ESP32s are using.  The soft PWM code is
vendored in, as it was previously, to add the NMI workaround from #4035.

Completes #4034
2024-09-28 23:07:28 -04:00
Blaz Kristan
9114867578 Fix compiler error 2024-09-28 18:48:43 +02:00
Blaz Kristan
c842994df5 Pre-calculate virtual
- move SEGCOLOR() to Segment class
- add SEG_H, SEG_W macros
- try to speed up virtualXxxxx()
- compile warning fixes
2024-09-28 18:14:43 +02:00
Damian Schneider
202901b09f bugfix, ESP32 compiler requires the color order to be identical 2024-09-28 15:38:41 +02:00
Damian Schneider
7c0fe1285a updated setPixelColor() and getPixelColor() functions
uint16_t to unsigned to make it consisten throughout the hand-down.
colorFromPaletteWLED now returns uint32_t which saves the conversion to CRGB and back to uint32_t (in most uses at least).
also added (preliminary) CRGBW struct. I tried to use it in place of uint32_t colors but it adds a lot of overhead when passing the struct so reverted to uint32_t in most places.
updated a few FX to use the CRGBW struct and also cleaned some code to improve flash useage.
2024-09-28 15:26:14 +02:00
Damian Schneider
a76a895f1d bugfix 2024-09-27 06:17:26 +02:00
Damian Schneider
b404458369 fixed one forgotten replacement of rgb2hsv_approximate 2024-09-26 18:29:31 +02:00
Damian Schneider
c44b9f8659 Merge remote-tracking branch 'upstream/0_15' into 0_15__speed_improvements 2024-09-26 18:07:33 +02:00
Damian Schneider
bef1ac2668 Added HSV2RGB and RGB2HSV functions for higher accuracy conversions
- also added a struct to handle HSV with 16bit hue better (including some conversions, can be extended easily)
- the functions are optimized for speed and flash use. They are faster and more accurate than what fastled offers (and use much less flash).
- replaced colorHStoRGB() with a call to the new hsv2rgb() function, saving even more flash (new function is untested!)
- the 16bit hue calculations result in an almost perfect conversion from RGB to HSV and back, the maximum error was 1/255 in the cases I tested.
2024-09-26 18:06:41 +02:00
Blaz Kristan
906f8fc2e7 Fix C3 compiler issue. 2024-09-25 18:49:10 +02:00
Blaz Kristan
fafb2eba69 Merge branch '0_15' into blending-styles 2024-09-23 20:36:08 +02:00
Blaz Kristan
33cf82a982 Indentations and a few optimisations
Restore addPixelColor() behaviour.
2024-09-23 18:03:17 +02:00
Damian Schneider
0a5400263b removed IRAM_ATTR from inlined function
when the function is inlined into a IRAM_ATTR function, it will also reside in IRAM. Forced inlining is recommended by Espressif if I understand this correctly: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/hardware-abstraction.html
2024-09-22 13:52:56 +02:00
Damian Schneider
17d59d3337 adding initialization to vStrip, added comment on padding bytes 2024-09-22 09:02:42 +02:00
Damian Schneider
a88436c620 revert removal of adding with saturation, renamed 'fast' to 'saturate'
- blurring now uses desaturated adding: it is faster most of the times and blurring adds scaled colors so should rarely (ever?) saturate, I saw no visual difference in tests.
- formatting
2024-09-19 08:49:18 +02:00
Damian Schneider
696290527a cleanup and improved color_add()
- optimized color_add() again: now it is as fast with preserved ratio scaling than the "fast" variant was before (if no scaling is needed, it is even faster). plus it saves 250 bytes of flash
- bugfix in `color_fade()`
- removed a lot of whitespaces
2024-09-18 22:10:27 +02:00
Damian Schneider
686866c6f9 Merge remote-tracking branch 'upstream/0_15' into 0_15__speed_improvements 2024-09-18 08:10:45 +02:00
Blaz Kristan
ce5ee65d60 Merge branch '0_15' into blending-styles 2024-09-15 11:05:16 +02:00
Blaz Kristan
1ff667b7ef AWS library fix 2024-09-15 10:59:50 +02:00
Damian Schneider
f3137eb0a9 updated Segment::color_from_palette
- gamma correction only where needed
- paletteIndex should be uint8_t (it is only used as that)
note: integrating the new `ColorFromPaletteWLED()` into this would require  a whole lot of code rewrite and would result in more color conversions from 32bit to CRGB. It would be really useful only if CRGB is replaced with native 32bit colors.
2024-09-14 14:49:36 +02:00
Damian Schneider
0e5bd4ed74 remove test printout 2024-09-14 14:11:29 +02:00
Damian Schneider
6a37f25c5d memory improvement: dropped static gamma table
- there already is a method to calculate the table on the fly, there is no need to store it in flash, it can just be calculated at bootup (or cfg change)
2024-09-14 14:10:46 +02:00
Damian Schneider
2afff05014 minor tweak (break instead of continue in setPixelColorXY) 2024-09-14 11:45:27 +02:00
Damian Schneider
d45b4ad134 fixes and consistency 2024-09-13 19:01:54 +02:00
Damian Schneider
ec938f254c removed old code 2024-09-12 21:25:08 +02:00
Damian Schneider
09428dcade inlined getMappedPixelIndex, improved color_add, bugfix in colorFromPalette
inlining getMappedPixelIndex gets rid of function entry instructions (hopefully) so it should be faster.
also added the 'multi color math' trick to color_add function (it will not make much difference but code shrinks by a few bytes)
2024-09-12 16:34:55 +02:00
Damian Schneider
b07658b460 improved Segment::setPixelColorXY a tiny bit
uses less flash so it should be faster (did not notice any FPS difference though)
also cleaned code in ColorFromPaletteWLED (it is not faster, same amount of code)
2024-09-12 14:09:09 +02:00
Damian Schneider
992d11be10 Improvements in get/set PixelColor()
-calculations for virtual strips are done on each call, which is unnecessary. moved them into the if statement.
2024-09-12 08:28:30 +02:00
Damian Schneider
feac45fd0a improvement in color_add
its not faster but cleaner (and uses less flash)
2024-09-12 07:45:49 +02:00
Damian Schneider
934176818f more improvements to color_scale() now even faster.
tested and working, also tested video
2024-09-12 06:43:20 +02:00
Damian Schneider
c3f472fbcb some improvements to consider
no real difference in FPS but code is faster.
also 160bytes smaller, meaning it is actually faster
2024-09-11 21:41:42 +02:00
Blaz Kristan
1cee1c3562 Merge branch '0_15' into blending-styles 2024-09-11 17:28:48 +02:00
Frank
2cfd2e1410
Update CONTRIBUTING.md - typo 2024-09-10 20:36:18 +02:00
Frank
058e66c7fc
Update CONTRIBUTING.md - adding a hint to avoid force-pushing 2024-09-10 20:32:40 +02:00
Blaz Kristan
dc90a4ed42 Mirroring bugfix. 2024-09-04 23:43:13 +02:00
Frank
ef80abd885 8266 compatibility builds for older chips (another attempt t o solve #3690 and #3685)
some users have reported that releases after 0.14.0 are not working reliably. So we add a few "compat" for 8266 that try to reproduce the buildenv of 0.14.0 as much as possible.

* platform and platform_packages from 0.14.0
* not using PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48
* due to smaller IRAM, we had to move some functions back from IRAM to normal flash (may cause slowdown)
2024-09-04 23:42:58 +02:00
Blaz Kristan
ebd8a10cef Prevent styles on 1px segments 2024-09-03 17:20:16 +02:00
Blaz Kristan
0430dc5a1f Merge branch '0_15' into blending-styles 2024-08-17 20:55:56 +02:00
Blaz Kristan
011afd0910 Merge branch '0_15' into blending-styles 2024-08-17 15:24:20 +02:00
Blaz Kristan
77723b615f Fix compiler warning 2024-08-08 21:10:27 +02:00
Blaz Kristan
e1598a9966 Merge branch '0_15' into blending-styles 2024-08-05 16:47:25 +02:00
Blaž Kristan
365c1987ed Missing clipping fix
- small speed optimisations
2024-08-01 10:24:40 +02:00
Blaz Kristan
c03422ee37 Push variants 2024-07-30 17:26:50 +02:00
Blaz Kristan
1975c9c34a Merge branch '0_15' into blending-styles 2024-07-24 14:18:16 +02:00
Blaz Kristan
d88bb3c668 Merge branch '0_15' into blending-styles 2024-07-18 20:26:51 +02:00
Blaz Kristan
13ed78be96 Merge branch '0_15' into blending-styles 2024-07-11 21:30:10 +02:00
Blaz Kristan
0275bd1d45 On/Off blending respected 2024-07-05 21:23:59 +02:00
Blaz Kristan
f3891c305d Merge branch '0_15' into blending-styles 2024-07-05 21:22:29 +02:00
Blaz Kristan
593970ed6d Merge branch '0_15' into blending-styles 2024-06-30 10:45:54 +02:00
Blaz Kristan
bee75a4508 Hide 2D blending styles on non-2D set-up 2024-06-23 14:14:26 +02:00
Blaz Kristan
a4ac444bda Merge branch '0_15' into blending-styles 2024-06-23 14:10:43 +02:00
Blaz Kristan
296df2660a Merge branch '0_15' into blending-styles 2024-06-16 18:22:21 +02:00
Brandon502
b9849da66e Added Cube Mapping tool 2024-06-08 13:16:56 -04:00
Blaz Kristan
da484b07f5 Use transition style for palette and color change
- as requested by @willmmiles & @tkadauke
2024-06-02 21:30:44 +02:00
Blaz Kristan
20c0916adc Merge branch '0_15' into blending-styles 2024-06-02 21:25:24 +02:00
Blaz Kristan
de5632b1cf Merge branch '0_15' into blending-styles 2024-06-01 17:54:57 +02:00
Blaz Kristan
ccce0f2d3b Merge branch '0_15' into blending-styles 2024-05-15 20:59:41 +02:00
Blaž Kristan
f441ce9c17 Merge branch '0_15' into blending-styles 2024-05-12 08:12:58 +02:00
Blaz Kristan
8e8ffa30a6 Merge branch '0_15' into blending-styles 2024-04-26 20:45:26 +02:00
Blaz Kristan
9735d1c6f3 Merge branch '0_15' into blending-styles 2024-04-14 15:41:08 +02:00
Blaz Kristan
ef017fd343 Revert FX.cpp 2024-04-14 15:34:59 +02:00
Blaz Kristan
b3810a16cc Merge branch '0_15' into blending-styles 2024-04-09 16:39:29 +02:00
Blaz Kristan
a3a8fa1cef Remove conditional fade/blend
- transitions always enabled (use delay 0 to disable)
- optimisation in on/off fade
- fix for palette/color blend when blending style is not fade
- various tweaks and optimisations
2024-04-08 16:24:27 +02:00
Blaz Kristan
c6805271e9 Merge branch '0_15' into blending-styles 2024-04-08 15:28:57 +02:00
Blaz Kristan
f5199d2b73 Fix compile. 2024-04-03 20:55:59 +02:00
Blaz Kristan
0c8d9d5614 Mode blending styles
- alternative to #3669
2024-04-03 18:38:06 +02:00
Christian Schwinne
247de600af Fix missing GIF enable macros 2024-03-17 22:57:15 +01:00
Christian Schwinne
3e60d3d96e Working GIF support 2024-03-17 22:24:55 +01:00
Christian Schwinne
b2afac8914 GIFs work again in principle 2024-03-10 21:36:13 +01:00
Christian Schwinne
3ad56ea103 GIF testing 2024-03-10 14:34:15 +01:00
Christian Schwinne
1f25edc737
Merge pull request #3805 from Aircoookie/0_15
update gif with new changes
2024-03-09 19:44:42 +01:00
265 changed files with 15511 additions and 9853 deletions

View File

@ -2,12 +2,7 @@
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
FROM mcr.microsoft.com/devcontainers/python:0-${VARIANT}
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/

View File

@ -5,10 +5,7 @@
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3",
// Options
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*"
"VARIANT": "3"
}
},
@ -27,34 +24,35 @@
// risk to running the build directly on the host.
// "runArgs": ["--privileged", "-v", "/dev/bus/usb:/dev/bus/usb", "--group-add", "dialout"],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
"extensions": [
"ms-python.python",
"platformio.platformio-ide"
]
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"platformio.platformio-ide"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",
"postCreateCommand": "bash -i -c 'nvm install && npm ci'",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"

View File

@ -80,7 +80,7 @@ body:
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/Aircoookie/WLED/blob/master/CODE_OF_CONDUCT.md)
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/wled-dev/WLED/blob/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

View File

@ -26,7 +26,7 @@ jobs:
build:
name: Build Enviornments
name: Build Environments
runs-on: ubuntu-latest
needs: get_default_envs
strategy:
@ -38,6 +38,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- name: Cache PlatformIO
@ -56,6 +57,7 @@ jobs:
cache: 'pip'
- name: Install PlatformIO
run: pip install -r requirements.txt
- name: Build firmware
run: pio run -e ${{ matrix.environment }}
- uses: actions/upload-artifact@v4
@ -74,7 +76,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm test

47
.github/workflows/nightly.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Deploy Nightly
on:
# This can be used to automatically publish nightlies at UTC nighttime
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
# This can be used to allow manually triggering nightlies from the web interface
workflow_dispatch:
jobs:
wled_build:
uses: ./.github/workflows/build.yml
nightly:
name: Deploy nightly
runs-on: ubuntu-latest
needs: wled_build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Show Files
run: ls -la
- name: "✏️ Generate release changelog"
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v0.15.0
- name: Update Nightly Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Nightly Release $$'
prerelease: true
body: ${{ steps.changelog.outputs.changelog }}
files: |
*.bin
*.bin.gz
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
repository: wled/WLED-WebInstaller
event-type: release-nightly
token: ${{ secrets.PAT_PUBLIC }}

16
.github/workflows/pr-merge.yaml vendored Normal file
View File

@ -0,0 +1,16 @@
name: Notify Discord on PR Merge
on:
pull_request:
types: [closed]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Discord notification
shell: bash
env:
DISCORD_WEBHOOK_BETA_TESTERS: ${{ secrets.DISCORD_WEBHOOK_BETA_TESTERS }}
if: github.event.pull_request.merged == true
run: |
curl -H "Content-Type: application/json" -d '{"content": "Pull Request #{{ github.event.pull_request.number }} merged by {{ github.actor }}"}' $DISCORD_WEBHOOK_BETA_TESTERS

View File

@ -18,9 +18,16 @@ jobs:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: "✏️ Generate release changelog"
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: v0.15.0
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changelog.outputs.changelog }}
draft: True
files: |
*.bin

13
.github/workflows/test.yaml vendored Normal file
View File

@ -0,0 +1,13 @@
on:
workflow_dispatch:
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
repository: wled/WLED-WebInstaller
event-type: release-nightly
token: ${{ secrets.PAT_PUBLIC }}

1
.gitignore vendored
View File

@ -15,6 +15,7 @@ wled-update.sh
/build_output/
/node_modules/
/logs/
/wled00/extLibs
/wled00/LittleFS

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
20.18

View File

@ -173,7 +173,7 @@
- v0.15.0-b2
- WS2805 support (RGB + WW + CW, 600kbps)
- Unified PSRAM use
- NeoPixelBus v2.7.9
- NeoPixelBus v2.7.9 (for future WS2805 support)
- Ubiquitous PSRAM mode for all variants of ESP32
- SSD1309_64 I2C Support for FLD Usermod (#3836 by @THATDONFC)
- Palette cycling fix (add support for `{"seg":[{"pal":"X~Y~"}]}` or `{"seg":[{"pal":"X~Yr"}]}`)

View File

@ -14,7 +14,7 @@ A good description helps us to review and understand your proposed changes. For
### Target branch for pull requests
Please make all PRs against the `0_15` branch.
Please make all PRs against the `main` branch.
### Updating your code
While the PR is open - and under review by maintainers - you may be asked to modify your PR source code.
@ -27,7 +27,7 @@ Github will pick up the changes so your PR stays up-to-date.
> For example, we regularly lost review comments when the PR author force-pushes code changes. So, pretty please, do not force-push.
You can find a collection of very useful tips and tricks here: https://github.com/Aircoookie/WLED/wiki/How-to-properly-submit-a-PR
You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR
### Code style
@ -105,4 +105,4 @@ Good:
There is no hard character limit for a comment within a line,
though as a rule of thumb consider wrapping after 120 characters.
Inline comments are OK if they describe that line only and are not exceedingly wide.
Inline comments are OK if they describe that line only and are not exceedingly wide.

47
boards/lolin_s3_mini.json Normal file
View File

@ -0,0 +1,47 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_LOLIN_S3_MINI",
"-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x8167"
]
],
"mcu": "esp32s3",
"variant": "lolin_s3_mini"
},
"connectivity": [
"bluetooth",
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "WEMOS LOLIN S3 Mini",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.wemos.cc/en/latest/s3/index.html",
"vendor": "WEMOS"
}

View File

@ -0,0 +1,504 @@
/* esp8266_waveform imported from platform source code
Modified for WLED to work around a fault in the NMI handling,
which can result in the system locking up and hard WDT crashes.
Imported from https://github.com/esp8266/Arduino/blob/7e0d20e2b9034994f573a236364e0aef17fd66de/cores/esp8266/core_esp8266_waveform_phase.cpp
*/
/*
esp8266_waveform - General purpose waveform generation and control,
supporting outputs on all pins in parallel.
Copyright (c) 2018 Earle F. Philhower, III. All rights reserved.
Copyright (c) 2020 Dirk O. Kaar.
The core idea is to have a programmable waveform generator with a unique
high and low period (defined in microseconds or CPU clock cycles). TIMER1 is
set to 1-shot mode and is always loaded with the time until the next edge
of any live waveforms.
Up to one waveform generator per pin supported.
Each waveform generator is synchronized to the ESP clock cycle counter, not the
timer. This allows for removing interrupt jitter and delay as the counter
always increments once per 80MHz clock. Changes to a waveform are
contiguous and only take effect on the next waveform transition,
allowing for smooth transitions.
This replaces older tone(), analogWrite(), and the Servo classes.
Everywhere in the code where "ccy" or "ccys" is used, it means ESP.getCycleCount()
clock cycle time, or an interval measured in clock cycles, but not TIMER1
cycles (which may be 2 CPU clock cycles @ 160MHz).
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "core_esp8266_waveform.h"
#include <Arduino.h>
#include "debug.h"
#include "ets_sys.h"
#include <atomic>
// ----- @willmmiles begin patch -----
// Linker magic
extern "C" void usePWMFixedNMI(void) {};
// NMI crash workaround
// Sometimes the NMI fails to return, stalling the CPU. When this happens,
// the next NMI gets a return address /inside the NMI handler function/.
// We work around this by caching the last NMI return address, and restoring
// the epc3 and eps3 registers to the previous values if the observed epc3
// happens to be pointing to the _NMILevelVector function.
extern "C" void _NMILevelVector();
extern "C" void _UserExceptionVector_1(); // the next function after _NMILevelVector
static inline IRAM_ATTR void nmiCrashWorkaround() {
static uintptr_t epc3_backup, eps3_backup;
uintptr_t epc3, eps3;
__asm__ __volatile__("rsr %0,epc3; rsr %1,eps3":"=a"(epc3),"=a" (eps3));
if ((epc3 < (uintptr_t) &_NMILevelVector) || (epc3 >= (uintptr_t) &_UserExceptionVector_1)) {
// Address is good; save backup
epc3_backup = epc3;
eps3_backup = eps3;
} else {
// Address is inside the NMI handler -- restore from backup
__asm__ __volatile__("wsr %0,epc3; wsr %1,eps3"::"a"(epc3_backup),"a"(eps3_backup));
}
}
// ----- @willmmiles end patch -----
// No-op calls to override the PWM implementation
extern "C" void _setPWMFreq_weak(uint32_t freq) { (void) freq; }
extern "C" IRAM_ATTR bool _stopPWM_weak(int pin) { (void) pin; return false; }
extern "C" bool _setPWM_weak(int pin, uint32_t val, uint32_t range) { (void) pin; (void) val; (void) range; return false; }
// Timer is 80MHz fixed. 160MHz CPU frequency need scaling.
constexpr bool ISCPUFREQ160MHZ = clockCyclesPerMicrosecond() == 160;
// Maximum delay between IRQs, Timer1, <= 2^23 / 80MHz
constexpr int32_t MAXIRQTICKSCCYS = microsecondsToClockCycles(10000);
// Maximum servicing time for any single IRQ
constexpr uint32_t ISRTIMEOUTCCYS = microsecondsToClockCycles(18);
// The latency between in-ISR rearming of the timer and the earliest firing
constexpr int32_t IRQLATENCYCCYS = microsecondsToClockCycles(2);
// The SDK and hardware take some time to actually get to our NMI code
constexpr int32_t DELTAIRQCCYS = ISCPUFREQ160MHZ ?
microsecondsToClockCycles(2) >> 1 : microsecondsToClockCycles(2);
// for INFINITE, the NMI proceeds on the waveform without expiry deadline.
// for EXPIRES, the NMI expires the waveform automatically on the expiry ccy.
// for UPDATEEXPIRY, the NMI recomputes the exact expiry ccy and transitions to EXPIRES.
// for UPDATEPHASE, the NMI recomputes the target timings
// for INIT, the NMI initializes nextPeriodCcy, and if expiryCcy != 0 includes UPDATEEXPIRY.
enum class WaveformMode : uint8_t {INFINITE = 0, EXPIRES = 1, UPDATEEXPIRY = 2, UPDATEPHASE = 3, INIT = 4};
// Waveform generator can create tones, PWM, and servos
typedef struct {
uint32_t nextPeriodCcy; // ESP clock cycle when a period begins.
uint32_t endDutyCcy; // ESP clock cycle when going from duty to off
int32_t dutyCcys; // Set next off cycle at low->high to maintain phase
int32_t adjDutyCcys; // Temporary correction for next period
int32_t periodCcys; // Set next phase cycle at low->high to maintain phase
uint32_t expiryCcy; // For time-limited waveform, the CPU clock cycle when this waveform must stop. If WaveformMode::UPDATE, temporarily holds relative ccy count
WaveformMode mode;
bool autoPwm; // perform PWM duty to idle cycle ratio correction under high load at the expense of precise timings
} Waveform;
namespace {
static struct {
Waveform pins[17]; // State of all possible pins
uint32_t states = 0; // Is the pin high or low, updated in NMI so no access outside the NMI code
uint32_t enabled = 0; // Is it actively running, updated in NMI so no access outside the NMI code
// Enable lock-free by only allowing updates to waveform.states and waveform.enabled from IRQ service routine
int32_t toSetBits = 0; // Message to the NMI handler to start/modify exactly one waveform
int32_t toDisableBits = 0; // Message to the NMI handler to disable exactly one pin from waveform generation
// toSetBits temporaries
// cheaper than packing them in every Waveform, since we permit only one use at a time
uint32_t phaseCcy; // positive phase offset ccy count
int8_t alignPhase; // < 0 no phase alignment, otherwise starts waveform in relative phase offset to given pin
uint32_t(*timer1CB)() = nullptr;
bool timer1Running = false;
uint32_t nextEventCcy;
} waveform;
}
// Interrupt on/off control
static IRAM_ATTR void timer1Interrupt();
// Non-speed critical bits
#pragma GCC optimize ("Os")
static void initTimer() {
timer1_disable();
ETS_FRC_TIMER1_INTR_ATTACH(NULL, NULL);
ETS_FRC_TIMER1_NMI_INTR_ATTACH(timer1Interrupt);
timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE);
waveform.timer1Running = true;
timer1_write(IRQLATENCYCCYS); // Cause an interrupt post-haste
}
static void IRAM_ATTR deinitTimer() {
ETS_FRC_TIMER1_NMI_INTR_ATTACH(NULL);
timer1_disable();
timer1_isr_init();
waveform.timer1Running = false;
}
extern "C" {
// Set a callback. Pass in NULL to stop it
void setTimer1Callback_weak(uint32_t (*fn)()) {
waveform.timer1CB = fn;
std::atomic_thread_fence(std::memory_order_acq_rel);
if (!waveform.timer1Running && fn) {
initTimer();
} else if (waveform.timer1Running && !fn && !waveform.enabled) {
deinitTimer();
}
}
// Start up a waveform on a pin, or change the current one. Will change to the new
// waveform smoothly on next low->high transition. For immediate change, stopWaveform()
// first, then it will immediately begin.
int startWaveformClockCycles_weak(uint8_t pin, uint32_t highCcys, uint32_t lowCcys,
uint32_t runTimeCcys, int8_t alignPhase, uint32_t phaseOffsetCcys, bool autoPwm) {
uint32_t periodCcys = highCcys + lowCcys;
if (periodCcys < MAXIRQTICKSCCYS) {
if (!highCcys) {
periodCcys = (MAXIRQTICKSCCYS / periodCcys) * periodCcys;
}
else if (!lowCcys) {
highCcys = periodCcys = (MAXIRQTICKSCCYS / periodCcys) * periodCcys;
}
}
// sanity checks, including mixed signed/unsigned arithmetic safety
if ((pin > 16) || isFlashInterfacePin(pin) || (alignPhase > 16) ||
static_cast<int32_t>(periodCcys) <= 0 ||
static_cast<int32_t>(highCcys) < 0 || static_cast<int32_t>(lowCcys) < 0) {
return false;
}
Waveform& wave = waveform.pins[pin];
wave.dutyCcys = highCcys;
wave.adjDutyCcys = 0;
wave.periodCcys = periodCcys;
wave.autoPwm = autoPwm;
waveform.alignPhase = (alignPhase < 0) ? -1 : alignPhase;
waveform.phaseCcy = phaseOffsetCcys;
std::atomic_thread_fence(std::memory_order_acquire);
const uint32_t pinBit = 1UL << pin;
if (!(waveform.enabled & pinBit)) {
// wave.nextPeriodCcy and wave.endDutyCcy are initialized by the ISR
wave.expiryCcy = runTimeCcys; // in WaveformMode::INIT, temporarily hold relative cycle count
wave.mode = WaveformMode::INIT;
if (!wave.dutyCcys) {
// If initially at zero duty cycle, force GPIO off
if (pin == 16) {
GP16O = 0;
}
else {
GPOC = pinBit;
}
}
std::atomic_thread_fence(std::memory_order_release);
waveform.toSetBits = 1UL << pin;
std::atomic_thread_fence(std::memory_order_release);
if (!waveform.timer1Running) {
initTimer();
}
else if (T1V > IRQLATENCYCCYS) {
// Must not interfere if Timer is due shortly
timer1_write(IRQLATENCYCCYS);
}
}
else {
wave.mode = WaveformMode::INFINITE; // turn off possible expiry to make update atomic from NMI
std::atomic_thread_fence(std::memory_order_release);
if (runTimeCcys) {
wave.expiryCcy = runTimeCcys; // in WaveformMode::UPDATEEXPIRY, temporarily hold relative cycle count
wave.mode = WaveformMode::UPDATEEXPIRY;
std::atomic_thread_fence(std::memory_order_release);
waveform.toSetBits = 1UL << pin;
} else if (alignPhase >= 0) {
// @willmmiles new feature
wave.mode = WaveformMode::UPDATEPHASE; // recalculate start
std::atomic_thread_fence(std::memory_order_release);
waveform.toSetBits = 1UL << pin;
}
}
std::atomic_thread_fence(std::memory_order_acq_rel);
while (waveform.toSetBits) {
esp_yield(); // Wait for waveform to update
std::atomic_thread_fence(std::memory_order_acquire);
}
return true;
}
// Stops a waveform on a pin
IRAM_ATTR int stopWaveform_weak(uint8_t pin) {
// Can't possibly need to stop anything if there is no timer active
if (!waveform.timer1Running) {
return false;
}
// If user sends in a pin >16 but <32, this will always point to a 0 bit
// If they send >=32, then the shift will result in 0 and it will also return false
std::atomic_thread_fence(std::memory_order_acquire);
const uint32_t pinBit = 1UL << pin;
if (waveform.enabled & pinBit) {
waveform.toDisableBits = 1UL << pin;
std::atomic_thread_fence(std::memory_order_release);
// Must not interfere if Timer is due shortly
if (T1V > IRQLATENCYCCYS) {
timer1_write(IRQLATENCYCCYS);
}
while (waveform.toDisableBits) {
/* no-op */ // Can't delay() since stopWaveform may be called from an IRQ
std::atomic_thread_fence(std::memory_order_acquire);
}
}
if (!waveform.enabled && !waveform.timer1CB) {
deinitTimer();
}
return true;
}
};
// Speed critical bits
#pragma GCC optimize ("O2")
// For dynamic CPU clock frequency switch in loop the scaling logic would have to be adapted.
// Using constexpr makes sure that the CPU clock frequency is compile-time fixed.
static inline IRAM_ATTR int32_t scaleCcys(const int32_t ccys, const bool isCPU2X) {
if (ISCPUFREQ160MHZ) {
return isCPU2X ? ccys : (ccys >> 1);
}
else {
return isCPU2X ? (ccys << 1) : ccys;
}
}
static IRAM_ATTR void timer1Interrupt() {
const uint32_t isrStartCcy = ESP.getCycleCount();
//int32_t clockDrift = isrStartCcy - waveform.nextEventCcy;
// ----- @willmmiles begin patch -----
nmiCrashWorkaround();
// ----- @willmmiles end patch -----
const bool isCPU2X = CPU2X & 1;
if ((waveform.toSetBits && !(waveform.enabled & waveform.toSetBits)) || waveform.toDisableBits) {
// Handle enable/disable requests from main app.
waveform.enabled = (waveform.enabled & ~waveform.toDisableBits) | waveform.toSetBits; // Set the requested waveforms on/off
// Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t)
waveform.toDisableBits = 0;
}
if (waveform.toSetBits) {
const int toSetPin = __builtin_ffs(waveform.toSetBits) - 1;
Waveform& wave = waveform.pins[toSetPin];
switch (wave.mode) {
case WaveformMode::INIT:
waveform.states &= ~waveform.toSetBits; // Clear the state of any just started
if (waveform.alignPhase >= 0 && waveform.enabled & (1UL << waveform.alignPhase)) {
wave.nextPeriodCcy = waveform.pins[waveform.alignPhase].nextPeriodCcy + scaleCcys(waveform.phaseCcy, isCPU2X);
}
else {
wave.nextPeriodCcy = waveform.nextEventCcy;
}
if (!wave.expiryCcy) {
wave.mode = WaveformMode::INFINITE;
break;
}
// fall through
case WaveformMode::UPDATEEXPIRY:
// in WaveformMode::UPDATEEXPIRY, expiryCcy temporarily holds relative CPU cycle count
wave.expiryCcy = wave.nextPeriodCcy + scaleCcys(wave.expiryCcy, isCPU2X);
wave.mode = WaveformMode::EXPIRES;
break;
// @willmmiles new feature
case WaveformMode::UPDATEPHASE:
// in WaveformMode::UPDATEPHASE, we recalculate the targets
if ((waveform.alignPhase >= 0) && (waveform.enabled & (1UL << waveform.alignPhase))) {
// Compute phase shift to realign with target
auto const newPeriodCcy = waveform.pins[waveform.alignPhase].nextPeriodCcy + scaleCcys(waveform.phaseCcy, isCPU2X);
auto const period = scaleCcys(wave.periodCcys, isCPU2X);
auto shift = ((static_cast<int32_t> (newPeriodCcy - wave.nextPeriodCcy) + period/2) % period) - (period/2);
wave.nextPeriodCcy += static_cast<uint32_t>(shift);
if (static_cast<int32_t>(wave.endDutyCcy - wave.nextPeriodCcy) > 0) {
wave.endDutyCcy = wave.nextPeriodCcy;
}
}
default:
break;
}
waveform.toSetBits = 0;
}
// Exit the loop if the next event, if any, is sufficiently distant.
const uint32_t isrTimeoutCcy = isrStartCcy + ISRTIMEOUTCCYS;
uint32_t busyPins = waveform.enabled;
waveform.nextEventCcy = isrStartCcy + MAXIRQTICKSCCYS;
uint32_t now = ESP.getCycleCount();
uint32_t isrNextEventCcy = now;
while (busyPins) {
if (static_cast<int32_t>(isrNextEventCcy - now) > IRQLATENCYCCYS) {
waveform.nextEventCcy = isrNextEventCcy;
break;
}
isrNextEventCcy = waveform.nextEventCcy;
uint32_t loopPins = busyPins;
while (loopPins) {
const int pin = __builtin_ffsl(loopPins) - 1;
const uint32_t pinBit = 1UL << pin;
loopPins ^= pinBit;
Waveform& wave = waveform.pins[pin];
/* @willmmiles - wtf? We don't want to accumulate drift
if (clockDrift) {
wave.endDutyCcy += clockDrift;
wave.nextPeriodCcy += clockDrift;
wave.expiryCcy += clockDrift;
}
*/
uint32_t waveNextEventCcy = (waveform.states & pinBit) ? wave.endDutyCcy : wave.nextPeriodCcy;
if (WaveformMode::EXPIRES == wave.mode &&
static_cast<int32_t>(waveNextEventCcy - wave.expiryCcy) >= 0 &&
static_cast<int32_t>(now - wave.expiryCcy) >= 0) {
// Disable any waveforms that are done
waveform.enabled ^= pinBit;
busyPins ^= pinBit;
}
else {
const int32_t overshootCcys = now - waveNextEventCcy;
if (overshootCcys >= 0) {
const int32_t periodCcys = scaleCcys(wave.periodCcys, isCPU2X);
if (waveform.states & pinBit) {
// active configuration and forward are 100% duty
if (wave.periodCcys == wave.dutyCcys) {
wave.nextPeriodCcy += periodCcys;
wave.endDutyCcy = wave.nextPeriodCcy;
}
else {
if (wave.autoPwm) {
wave.adjDutyCcys += overshootCcys;
}
waveform.states ^= pinBit;
if (16 == pin) {
GP16O = 0;
}
else {
GPOC = pinBit;
}
}
waveNextEventCcy = wave.nextPeriodCcy;
}
else {
wave.nextPeriodCcy += periodCcys;
if (!wave.dutyCcys) {
wave.endDutyCcy = wave.nextPeriodCcy;
}
else {
int32_t dutyCcys = scaleCcys(wave.dutyCcys, isCPU2X);
if (dutyCcys <= wave.adjDutyCcys) {
dutyCcys >>= 1;
wave.adjDutyCcys -= dutyCcys;
}
else if (wave.adjDutyCcys) {
dutyCcys -= wave.adjDutyCcys;
wave.adjDutyCcys = 0;
}
wave.endDutyCcy = now + dutyCcys;
if (static_cast<int32_t>(wave.endDutyCcy - wave.nextPeriodCcy) > 0) {
wave.endDutyCcy = wave.nextPeriodCcy;
}
waveform.states |= pinBit;
if (16 == pin) {
GP16O = 1;
}
else {
GPOS = pinBit;
}
}
waveNextEventCcy = wave.endDutyCcy;
}
if (WaveformMode::EXPIRES == wave.mode && static_cast<int32_t>(waveNextEventCcy - wave.expiryCcy) > 0) {
waveNextEventCcy = wave.expiryCcy;
}
}
if (static_cast<int32_t>(waveNextEventCcy - isrTimeoutCcy) >= 0) {
busyPins ^= pinBit;
if (static_cast<int32_t>(waveform.nextEventCcy - waveNextEventCcy) > 0) {
waveform.nextEventCcy = waveNextEventCcy;
}
}
else if (static_cast<int32_t>(isrNextEventCcy - waveNextEventCcy) > 0) {
isrNextEventCcy = waveNextEventCcy;
}
}
now = ESP.getCycleCount();
}
//clockDrift = 0;
}
int32_t callbackCcys = 0;
if (waveform.timer1CB) {
callbackCcys = scaleCcys(waveform.timer1CB(), isCPU2X);
}
now = ESP.getCycleCount();
int32_t nextEventCcys = waveform.nextEventCcy - now;
// Account for unknown duration of timer1CB().
if (waveform.timer1CB && nextEventCcys > callbackCcys) {
waveform.nextEventCcy = now + callbackCcys;
nextEventCcys = callbackCcys;
}
// Timer is 80MHz fixed. 160MHz CPU frequency need scaling.
int32_t deltaIrqCcys = DELTAIRQCCYS;
int32_t irqLatencyCcys = IRQLATENCYCCYS;
if (isCPU2X) {
nextEventCcys >>= 1;
deltaIrqCcys >>= 1;
irqLatencyCcys >>= 1;
}
// Firing timer too soon, the NMI occurs before ISR has returned.
if (nextEventCcys < irqLatencyCcys + deltaIrqCcys) {
waveform.nextEventCcy = now + IRQLATENCYCCYS + DELTAIRQCCYS;
nextEventCcys = irqLatencyCcys;
}
else {
nextEventCcys -= deltaIrqCcys;
}
// Register access is fast and edge IRQ was configured before.
T1L = nextEventCcys;
}

View File

@ -1,717 +0,0 @@
/* esp8266_waveform imported from platform source code
Modified for WLED to work around a fault in the NMI handling,
which can result in the system locking up and hard WDT crashes.
Imported from https://github.com/esp8266/Arduino/blob/7e0d20e2b9034994f573a236364e0aef17fd66de/cores/esp8266/core_esp8266_waveform_pwm.cpp
*/
/*
esp8266_waveform - General purpose waveform generation and control,
supporting outputs on all pins in parallel.
Copyright (c) 2018 Earle F. Philhower, III. All rights reserved.
The core idea is to have a programmable waveform generator with a unique
high and low period (defined in microseconds or CPU clock cycles). TIMER1
is set to 1-shot mode and is always loaded with the time until the next
edge of any live waveforms.
Up to one waveform generator per pin supported.
Each waveform generator is synchronized to the ESP clock cycle counter, not
the timer. This allows for removing interrupt jitter and delay as the
counter always increments once per 80MHz clock. Changes to a waveform are
contiguous and only take effect on the next waveform transition,
allowing for smooth transitions.
This replaces older tone(), analogWrite(), and the Servo classes.
Everywhere in the code where "cycles" is used, it means ESP.getCycleCount()
clock cycle count, or an interval measured in CPU clock cycles, but not
TIMER1 cycles (which may be 2 CPU clock cycles @ 160MHz).
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <Arduino.h>
#include <coredecls.h>
#include "ets_sys.h"
#include "core_esp8266_waveform.h"
#include "user_interface.h"
extern "C" {
// Linker magic
void usePWMFixedNMI() {};
// Maximum delay between IRQs
#define MAXIRQUS (10000)
// Waveform generator can create tones, PWM, and servos
typedef struct {
uint32_t nextServiceCycle; // ESP cycle timer when a transition required
uint32_t expiryCycle; // For time-limited waveform, the cycle when this waveform must stop
uint32_t timeHighCycles; // Actual running waveform period (adjusted using desiredCycles)
uint32_t timeLowCycles; //
uint32_t desiredHighCycles; // Ideal waveform period to drive the error signal
uint32_t desiredLowCycles; //
uint32_t lastEdge; // Cycle when this generator last changed
} Waveform;
class WVFState {
public:
Waveform waveform[17]; // State of all possible pins
uint32_t waveformState = 0; // Is the pin high or low, updated in NMI so no access outside the NMI code
uint32_t waveformEnabled = 0; // Is it actively running, updated in NMI so no access outside the NMI code
// Enable lock-free by only allowing updates to waveformState and waveformEnabled from IRQ service routine
uint32_t waveformToEnable = 0; // Message to the NMI handler to start a waveform on a inactive pin
uint32_t waveformToDisable = 0; // Message to the NMI handler to disable a pin from waveform generation
uint32_t waveformToChange = 0; // Mask of pin to change. One bit set in main app, cleared when effected in the NMI
uint32_t waveformNewHigh = 0;
uint32_t waveformNewLow = 0;
uint32_t (*timer1CB)() = NULL;
// Optimize the NMI inner loop by keeping track of the min and max GPIO that we
// are generating. In the common case (1 PWM) these may be the same pin and
// we can avoid looking at the other pins.
uint16_t startPin = 0;
uint16_t endPin = 0;
};
static WVFState wvfState;
// Ensure everything is read/written to RAM
#define MEMBARRIER() { __asm__ volatile("" ::: "memory"); }
// Non-speed critical bits
#pragma GCC optimize ("Os")
// Interrupt on/off control
static IRAM_ATTR void timer1Interrupt();
static bool timerRunning = false;
static __attribute__((noinline)) void initTimer() {
if (!timerRunning) {
timer1_disable();
ETS_FRC_TIMER1_INTR_ATTACH(NULL, NULL);
ETS_FRC_TIMER1_NMI_INTR_ATTACH(timer1Interrupt);
timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE);
timerRunning = true;
timer1_write(microsecondsToClockCycles(10));
}
}
static IRAM_ATTR void forceTimerInterrupt() {
if (T1L > microsecondsToClockCycles(10)) {
T1L = microsecondsToClockCycles(10);
}
}
// PWM implementation using special purpose state machine
//
// Keep an ordered list of pins with the delta in cycles between each
// element, with a terminal entry making up the remainder of the PWM
// period. With this method sum(all deltas) == PWM period clock cycles.
//
// At t=0 set all pins high and set the timeout for the 1st edge.
// On interrupt, if we're at the last element reset to t=0 state
// Otherwise, clear that pin down and set delay for next element
// and so forth.
constexpr int maxPWMs = 8;
// PWM machine state
typedef struct PWMState {
uint32_t mask; // Bitmask of active pins
uint32_t cnt; // How many entries
uint32_t idx; // Where the state machine is along the list
uint8_t pin[maxPWMs + 1];
uint32_t delta[maxPWMs + 1];
uint32_t nextServiceCycle; // Clock cycle for next step
struct PWMState *pwmUpdate; // Set by main code, cleared by ISR
} PWMState;
static PWMState pwmState;
static uint32_t _pwmFreq = 1000;
static uint32_t _pwmPeriod = microsecondsToClockCycles(1000000UL) / _pwmFreq;
// If there are no more scheduled activities, shut down Timer 1.
// Otherwise, do nothing.
static IRAM_ATTR void disableIdleTimer() {
if (timerRunning && !wvfState.waveformEnabled && !pwmState.cnt && !wvfState.timer1CB) {
ETS_FRC_TIMER1_NMI_INTR_ATTACH(NULL);
timer1_disable();
timer1_isr_init();
timerRunning = false;
}
}
// Notify the NMI that a new PWM state is available through the mailbox.
// Wait for mailbox to be emptied (either busy or delay() as needed)
static IRAM_ATTR void _notifyPWM(PWMState *p, bool idle) {
p->pwmUpdate = nullptr;
pwmState.pwmUpdate = p;
MEMBARRIER();
forceTimerInterrupt();
while (pwmState.pwmUpdate) {
if (idle) {
esp_yield();
}
MEMBARRIER();
}
}
static void _addPWMtoList(PWMState &p, int pin, uint32_t val, uint32_t range);
// Called when analogWriteFreq() changed to update the PWM total period
//extern void _setPWMFreq_weak(uint32_t freq) __attribute__((weak));
void _setPWMFreq_weak(uint32_t freq) {
_pwmFreq = freq;
// Convert frequency into clock cycles
uint32_t cc = microsecondsToClockCycles(1000000UL) / freq;
// Simple static adjustment to bring period closer to requested due to overhead
// Empirically determined as a constant PWM delay and a function of the number of PWMs
#if F_CPU == 80000000
cc -= ((microsecondsToClockCycles(pwmState.cnt) * 13) >> 4) + 110;
#else
cc -= ((microsecondsToClockCycles(pwmState.cnt) * 10) >> 4) + 75;
#endif
if (cc == _pwmPeriod) {
return; // No change
}
_pwmPeriod = cc;
if (pwmState.cnt) {
PWMState p; // The working copy since we can't edit the one in use
p.mask = 0;
p.cnt = 0;
for (uint32_t i = 0; i < pwmState.cnt; i++) {
auto pin = pwmState.pin[i];
_addPWMtoList(p, pin, wvfState.waveform[pin].desiredHighCycles, wvfState.waveform[pin].desiredLowCycles);
}
// Update and wait for mailbox to be emptied
initTimer();
_notifyPWM(&p, true);
disableIdleTimer();
}
}
/*
static void _setPWMFreq_bound(uint32_t freq) __attribute__((weakref("_setPWMFreq_weak")));
void _setPWMFreq(uint32_t freq) {
_setPWMFreq_bound(freq);
}
*/
// Helper routine to remove an entry from the state machine
// and clean up any marked-off entries
static void _cleanAndRemovePWM(PWMState *p, int pin) {
uint32_t leftover = 0;
uint32_t in, out;
for (in = 0, out = 0; in < p->cnt; in++) {
if ((p->pin[in] != pin) && (p->mask & (1<<p->pin[in]))) {
p->pin[out] = p->pin[in];
p->delta[out] = p->delta[in] + leftover;
leftover = 0;
out++;
} else {
leftover += p->delta[in];
p->mask &= ~(1<<p->pin[in]);
}
}
p->cnt = out;
// Final pin is never used: p->pin[out] = 0xff;
p->delta[out] = p->delta[in] + leftover;
}
// Disable PWM on a specific pin (i.e. when a digitalWrite or analogWrite(0%/100%))
//extern bool _stopPWM_weak(uint8_t pin) __attribute__((weak));
IRAM_ATTR bool _stopPWM_weak(uint8_t pin) {
if (!((1<<pin) & pwmState.mask)) {
return false; // Pin not actually active
}
PWMState p; // The working copy since we can't edit the one in use
p = pwmState;
// In _stopPWM we just clear the mask but keep everything else
// untouched to save IRAM. The main startPWM will handle cleanup.
p.mask &= ~(1<<pin);
if (!p.mask) {
// If all have been stopped, then turn PWM off completely
p.cnt = 0;
}
// Update and wait for mailbox to be emptied, no delay (could be in ISR)
_notifyPWM(&p, false);
// Possibly shut down the timer completely if we're done
disableIdleTimer();
return true;
}
/*
static bool _stopPWM_bound(uint8_t pin) __attribute__((weakref("_stopPWM_weak")));
IRAM_ATTR bool _stopPWM(uint8_t pin) {
return _stopPWM_bound(pin);
}
*/
static void _addPWMtoList(PWMState &p, int pin, uint32_t val, uint32_t range) {
// Stash the val and range so we can re-evaluate the fraction
// should the user change PWM frequency. This allows us to
// give as great a precision as possible. We know by construction
// that the waveform for this pin will be inactive so we can borrow
// memory from that structure.
wvfState.waveform[pin].desiredHighCycles = val; // Numerator == high
wvfState.waveform[pin].desiredLowCycles = range; // Denominator == low
uint32_t cc = (_pwmPeriod * val) / range;
// Clip to sane values in the case we go from OK to not-OK when adjusting frequencies
if (cc == 0) {
cc = 1;
} else if (cc >= _pwmPeriod) {
cc = _pwmPeriod - 1;
}
if (p.cnt == 0) {
// Starting up from scratch, special case 1st element and PWM period
p.pin[0] = pin;
p.delta[0] = cc;
// Final pin is never used: p.pin[1] = 0xff;
p.delta[1] = _pwmPeriod - cc;
} else {
uint32_t ttl = 0;
uint32_t i;
// Skip along until we're at the spot to insert
for (i=0; (i <= p.cnt) && (ttl + p.delta[i] < cc); i++) {
ttl += p.delta[i];
}
// Shift everything out by one to make space for new edge
for (int32_t j = p.cnt; j >= (int)i; j--) {
p.pin[j + 1] = p.pin[j];
p.delta[j + 1] = p.delta[j];
}
int off = cc - ttl; // The delta from the last edge to the one we're inserting
p.pin[i] = pin;
p.delta[i] = off; // Add the delta to this new pin
p.delta[i + 1] -= off; // And subtract it from the follower to keep sum(deltas) constant
}
p.cnt++;
p.mask |= 1<<pin;
}
// Called by analogWrite(1...99%) to set the PWM duty in clock cycles
//extern bool _setPWM_weak(int pin, uint32_t val, uint32_t range) __attribute__((weak));
bool _setPWM_weak(int pin, uint32_t val, uint32_t range) {
stopWaveform(pin);
PWMState p; // Working copy
p = pwmState;
// Get rid of any entries for this pin
_cleanAndRemovePWM(&p, pin);
// And add it to the list, in order
if (p.cnt >= maxPWMs) {
return false; // No space left
}
// Sanity check for all-on/off
uint32_t cc = (_pwmPeriod * val) / range;
if ((cc == 0) || (cc >= _pwmPeriod)) {
digitalWrite(pin, cc ? HIGH : LOW);
return true;
}
_addPWMtoList(p, pin, val, range);
// Set mailbox and wait for ISR to copy it over
initTimer();
_notifyPWM(&p, true);
disableIdleTimer();
// Potentially recalculate the PWM period if we've added another pin
_setPWMFreq(_pwmFreq);
return true;
}
/*
static bool _setPWM_bound(int pin, uint32_t val, uint32_t range) __attribute__((weakref("_setPWM_weak")));
bool _setPWM(int pin, uint32_t val, uint32_t range) {
return _setPWM_bound(pin, val, range);
}
*/
// Start up a waveform on a pin, or change the current one. Will change to the new
// waveform smoothly on next low->high transition. For immediate change, stopWaveform()
// first, then it will immediately begin.
//extern int startWaveformClockCycles_weak(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) __attribute__((weak));
int startWaveformClockCycles_weak(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles,
int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) {
(void) alignPhase;
(void) phaseOffsetUS;
(void) autoPwm;
if ((pin > 16) || isFlashInterfacePin(pin) || (timeHighCycles == 0)) {
return false;
}
Waveform *wave = &wvfState.waveform[pin];
wave->expiryCycle = runTimeCycles ? ESP.getCycleCount() + runTimeCycles : 0;
if (runTimeCycles && !wave->expiryCycle) {
wave->expiryCycle = 1; // expiryCycle==0 means no timeout, so avoid setting it
}
_stopPWM(pin); // Make sure there's no PWM live here
uint32_t mask = 1<<pin;
MEMBARRIER();
if (wvfState.waveformEnabled & mask) {
// Make sure no waveform changes are waiting to be applied
while (wvfState.waveformToChange) {
esp_yield(); // Wait for waveform to update
MEMBARRIER();
}
wvfState.waveformNewHigh = timeHighCycles;
wvfState.waveformNewLow = timeLowCycles;
MEMBARRIER();
wvfState.waveformToChange = mask;
// The waveform will be updated some time in the future on the next period for the signal
} else { // if (!(wvfState.waveformEnabled & mask)) {
wave->timeHighCycles = timeHighCycles;
wave->desiredHighCycles = timeHighCycles;
wave->timeLowCycles = timeLowCycles;
wave->desiredLowCycles = timeLowCycles;
wave->lastEdge = 0;
wave->nextServiceCycle = ESP.getCycleCount() + microsecondsToClockCycles(1);
wvfState.waveformToEnable |= mask;
MEMBARRIER();
initTimer();
forceTimerInterrupt();
while (wvfState.waveformToEnable) {
esp_yield(); // Wait for waveform to update
MEMBARRIER();
}
}
return true;
}
/*
static int startWaveformClockCycles_bound(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) __attribute__((weakref("startWaveformClockCycles_weak")));
int startWaveformClockCycles(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) {
return startWaveformClockCycles_bound(pin, timeHighCycles, timeLowCycles, runTimeCycles, alignPhase, phaseOffsetUS, autoPwm);
}
// This version falls-thru to the proper startWaveformClockCycles call and is invariant across waveform generators
int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t runTimeUS,
int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) {
return startWaveformClockCycles_bound(pin,
microsecondsToClockCycles(timeHighUS), microsecondsToClockCycles(timeLowUS),
microsecondsToClockCycles(runTimeUS), alignPhase, microsecondsToClockCycles(phaseOffsetUS), autoPwm);
}
*/
// Set a callback. Pass in NULL to stop it
//extern void setTimer1Callback_weak(uint32_t (*fn)()) __attribute__((weak));
void setTimer1Callback_weak(uint32_t (*fn)()) {
wvfState.timer1CB = fn;
if (fn) {
initTimer();
forceTimerInterrupt();
}
disableIdleTimer();
}
/*
static void setTimer1Callback_bound(uint32_t (*fn)()) __attribute__((weakref("setTimer1Callback_weak")));
void setTimer1Callback(uint32_t (*fn)()) {
setTimer1Callback_bound(fn);
}
*/
// Stops a waveform on a pin
//extern int stopWaveform_weak(uint8_t pin) __attribute__((weak));
IRAM_ATTR int stopWaveform_weak(uint8_t pin) {
// Can't possibly need to stop anything if there is no timer active
if (!timerRunning) {
return false;
}
// If user sends in a pin >16 but <32, this will always point to a 0 bit
// If they send >=32, then the shift will result in 0 and it will also return false
uint32_t mask = 1<<pin;
if (wvfState.waveformEnabled & mask) {
wvfState.waveformToDisable = mask;
// Cancel any pending updates for this waveform, too.
if (wvfState.waveformToChange & mask) {
wvfState.waveformToChange = 0;
}
forceTimerInterrupt();
while (wvfState.waveformToDisable) {
MEMBARRIER(); // If it wasn't written yet, it has to be by now
/* no-op */ // Can't delay() since stopWaveform may be called from an IRQ
}
}
disableIdleTimer();
return true;
}
/*
static int stopWaveform_bound(uint8_t pin) __attribute__((weakref("stopWaveform_weak")));
IRAM_ATTR int stopWaveform(uint8_t pin) {
return stopWaveform_bound(pin);
}
*/
// Speed critical bits
#pragma GCC optimize ("O2")
// Normally would not want two copies like this, but due to different
// optimization levels the inline attribute gets lost if we try the
// other version.
static inline IRAM_ATTR uint32_t GetCycleCountIRQ() {
uint32_t ccount;
__asm__ __volatile__("rsr %0,ccount":"=a"(ccount));
return ccount;
}
// Find the earliest cycle as compared to right now
static inline IRAM_ATTR uint32_t earliest(uint32_t a, uint32_t b) {
uint32_t now = GetCycleCountIRQ();
int32_t da = a - now;
int32_t db = b - now;
return (da < db) ? a : b;
}
// ----- @willmmiles begin patch -----
// NMI crash workaround
// Sometimes the NMI fails to return, stalling the CPU. When this happens,
// the next NMI gets a return address /inside the NMI handler function/.
// We work around this by caching the last NMI return address, and restoring
// the epc3 and eps3 registers to the previous values if the observed epc3
// happens to be pointing to the _NMILevelVector function.
extern void _NMILevelVector();
extern void _UserExceptionVector_1(); // the next function after _NMILevelVector
static inline IRAM_ATTR void nmiCrashWorkaround() {
static uintptr_t epc3_backup, eps3_backup;
uintptr_t epc3, eps3;
__asm__ __volatile__("rsr %0,epc3; rsr %1,eps3":"=a"(epc3),"=a" (eps3));
if ((epc3 < (uintptr_t) &_NMILevelVector) || (epc3 >= (uintptr_t) &_UserExceptionVector_1)) {
// Address is good; save backup
epc3_backup = epc3;
eps3_backup = eps3;
} else {
// Address is inside the NMI handler -- restore from backup
__asm__ __volatile__("wsr %0,epc3; wsr %1,eps3"::"a"(epc3_backup),"a"(eps3_backup));
}
}
// ----- @willmmiles end patch -----
// The SDK and hardware take some time to actually get to our NMI code, so
// decrement the next IRQ's timer value by a bit so we can actually catch the
// real CPU cycle counter we want for the waveforms.
// The SDK also sometimes is running at a different speed the the Arduino core
// so the ESP cycle counter is actually running at a variable speed.
// adjust(x) takes care of adjusting a delta clock cycle amount accordingly.
#if F_CPU == 80000000
#define DELTAIRQ (microsecondsToClockCycles(9)/4)
#define adjust(x) ((x) << (turbo ? 1 : 0))
#else
#define DELTAIRQ (microsecondsToClockCycles(9)/8)
#define adjust(x) ((x) >> 0)
#endif
// When the time to the next edge is greater than this, RTI and set another IRQ to minimize CPU usage
#define MINIRQTIME microsecondsToClockCycles(6)
static IRAM_ATTR void timer1Interrupt() {
// ----- @willmmiles begin patch -----
nmiCrashWorkaround();
// ----- @willmmiles end patch -----
// Flag if the core is at 160 MHz, for use by adjust()
bool turbo = (*(uint32_t*)0x3FF00014) & 1 ? true : false;
uint32_t nextEventCycle = GetCycleCountIRQ() + microsecondsToClockCycles(MAXIRQUS);
uint32_t timeoutCycle = GetCycleCountIRQ() + microsecondsToClockCycles(14);
if (wvfState.waveformToEnable || wvfState.waveformToDisable) {
// Handle enable/disable requests from main app
wvfState.waveformEnabled = (wvfState.waveformEnabled & ~wvfState.waveformToDisable) | wvfState.waveformToEnable; // Set the requested waveforms on/off
wvfState.waveformState &= ~wvfState.waveformToEnable; // And clear the state of any just started
wvfState.waveformToEnable = 0;
wvfState.waveformToDisable = 0;
// No mem barrier. Globals must be written to RAM on ISR exit.
// Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t)
wvfState.startPin = __builtin_ffs(wvfState.waveformEnabled) - 1;
// Find the last bit by subtracting off GCC's count-leading-zeros (no offset in this one)
wvfState.endPin = 32 - __builtin_clz(wvfState.waveformEnabled);
} else if (!pwmState.cnt && pwmState.pwmUpdate) {
// Start up the PWM generator by copying from the mailbox
pwmState.cnt = 1;
pwmState.idx = 1; // Ensure copy this cycle, cause it to start at t=0
pwmState.nextServiceCycle = GetCycleCountIRQ(); // Do it this loop!
// No need for mem barrier here. Global must be written by IRQ exit
}
bool done = false;
if (wvfState.waveformEnabled || pwmState.cnt) {
do {
nextEventCycle = GetCycleCountIRQ() + microsecondsToClockCycles(MAXIRQUS);
// PWM state machine implementation
if (pwmState.cnt) {
int32_t cyclesToGo;
do {
cyclesToGo = pwmState.nextServiceCycle - GetCycleCountIRQ();
if (cyclesToGo < 0) {
if (pwmState.idx == pwmState.cnt) { // Start of pulses, possibly copy new
if (pwmState.pwmUpdate) {
// Do the memory copy from temp to global and clear mailbox
pwmState = *(PWMState*)pwmState.pwmUpdate;
}
GPOS = pwmState.mask; // Set all active pins high
if (pwmState.mask & (1<<16)) {
GP16O = 1;
}
pwmState.idx = 0;
} else {
do {
// Drop the pin at this edge
if (pwmState.mask & (1<<pwmState.pin[pwmState.idx])) {
GPOC = 1<<pwmState.pin[pwmState.idx];
if (pwmState.pin[pwmState.idx] == 16) {
GP16O = 0;
}
}
pwmState.idx++;
// Any other pins at this same PWM value will have delta==0, drop them too.
} while (pwmState.delta[pwmState.idx] == 0);
}
// Preserve duty cycle over PWM period by using now+xxx instead of += delta
cyclesToGo = adjust(pwmState.delta[pwmState.idx]);
pwmState.nextServiceCycle = GetCycleCountIRQ() + cyclesToGo;
}
nextEventCycle = earliest(nextEventCycle, pwmState.nextServiceCycle);
} while (pwmState.cnt && (cyclesToGo < 100));
}
for (auto i = wvfState.startPin; i <= wvfState.endPin; i++) {
uint32_t mask = 1<<i;
// If it's not on, ignore!
if (!(wvfState.waveformEnabled & mask)) {
continue;
}
Waveform *wave = &wvfState.waveform[i];
uint32_t now = GetCycleCountIRQ();
// Disable any waveforms that are done
if (wave->expiryCycle) {
int32_t expiryToGo = wave->expiryCycle - now;
if (expiryToGo < 0) {
// Done, remove!
if (i == 16) {
GP16O = 0;
}
GPOC = mask;
wvfState.waveformEnabled &= ~mask;
continue;
}
}
// Check for toggles
int32_t cyclesToGo = wave->nextServiceCycle - now;
if (cyclesToGo < 0) {
uint32_t nextEdgeCycles;
uint32_t desired = 0;
uint32_t *timeToUpdate;
wvfState.waveformState ^= mask;
if (wvfState.waveformState & mask) {
if (i == 16) {
GP16O = 1;
}
GPOS = mask;
if (wvfState.waveformToChange & mask) {
// Copy over next full-cycle timings
wave->timeHighCycles = wvfState.waveformNewHigh;
wave->desiredHighCycles = wvfState.waveformNewHigh;
wave->timeLowCycles = wvfState.waveformNewLow;
wave->desiredLowCycles = wvfState.waveformNewLow;
wave->lastEdge = 0;
wvfState.waveformToChange = 0;
}
if (wave->lastEdge) {
desired = wave->desiredLowCycles;
timeToUpdate = &wave->timeLowCycles;
}
nextEdgeCycles = wave->timeHighCycles;
} else {
if (i == 16) {
GP16O = 0;
}
GPOC = mask;
desired = wave->desiredHighCycles;
timeToUpdate = &wave->timeHighCycles;
nextEdgeCycles = wave->timeLowCycles;
}
if (desired) {
desired = adjust(desired);
int32_t err = desired - (now - wave->lastEdge);
if (abs(err) < desired) { // If we've lost > the entire phase, ignore this error signal
err /= 2;
*timeToUpdate += err;
}
}
nextEdgeCycles = adjust(nextEdgeCycles);
wave->nextServiceCycle = now + nextEdgeCycles;
wave->lastEdge = now;
}
nextEventCycle = earliest(nextEventCycle, wave->nextServiceCycle);
}
// Exit the loop if we've hit the fixed runtime limit or the next event is known to be after that timeout would occur
uint32_t now = GetCycleCountIRQ();
int32_t cycleDeltaNextEvent = nextEventCycle - now;
int32_t cyclesLeftTimeout = timeoutCycle - now;
done = (cycleDeltaNextEvent > MINIRQTIME) || (cyclesLeftTimeout < 0);
} while (!done);
} // if (wvfState.waveformEnabled)
if (wvfState.timer1CB) {
nextEventCycle = earliest(nextEventCycle, GetCycleCountIRQ() + wvfState.timer1CB());
}
int32_t nextEventCycles = nextEventCycle - GetCycleCountIRQ();
if (nextEventCycles < MINIRQTIME) {
nextEventCycles = MINIRQTIME;
}
nextEventCycles -= DELTAIRQ;
// Do it here instead of global function to save time and because we know it's edge-IRQ
T1L = nextEventCycles >> (turbo ? 1 : 0);
}
};

1902
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "wled",
"version": "0.15.0-b7",
"version": "0.16.0-alpha",
"description": "Tools for WLED project",
"main": "tools/cdata.js",
"directories": {
@ -14,21 +14,21 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Aircoookie/WLED.git"
"url": "git+https://github.com/wled-dev/WLED.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Aircoookie/WLED/issues"
"url": "https://github.com/wled-dev/WLED/issues"
},
"homepage": "https://github.com/Aircoookie/WLED#readme",
"homepage": "https://github.com/wled-dev/WLED#readme",
"dependencies": {
"clean-css": "^5.3.3",
"html-minifier-terser": "^7.2.0",
"inliner": "^1.13.1",
"nodemon": "^3.1.7"
"web-resource-inliner": "^7.0.0",
"nodemon": "^3.1.9"
},
"engines": {
"node": ">=20.0.0"
}
}
}

View File

@ -1,3 +1,21 @@
Import('env')
Import("env")
import shutil
env.Execute("npm run build")
node_ex = shutil.which("node")
# Check if Node.js is installed and present in PATH if it failed, abort the build
if node_ex is None:
print('\x1b[0;31;43m' + 'Node.js is not installed or missing from PATH html css js will not be processed check https://kno.wled.ge/advanced/compiling-wled/' + '\x1b[0m')
exitCode = env.Execute("null")
exit(exitCode)
else:
# Install the necessary node packages for the pre-build asset bundling script
print('\x1b[6;33;42m' + 'Installing node packages' + '\x1b[0m')
env.Execute("npm ci")
# Call the bundling script
exitCode = env.Execute("npm run build")
# If it failed, abort the build
if (exitCode):
print('\x1b[0;31;43m' + 'npm run build fails check https://kno.wled.ge/advanced/compiling-wled/' + '\x1b[0m')
exit(exitCode)

View File

@ -0,0 +1,115 @@
Import('env')
import os.path
from collections import deque
from pathlib import Path # For OS-agnostic path manipulation
from platformio.package.manager.library import LibraryPackageManager
usermod_dir = Path(env["PROJECT_DIR"]) / "usermods"
all_usermods = [f for f in usermod_dir.iterdir() if f.is_dir() and f.joinpath('library.json').exists()]
if env['PIOENV'] == "usermods":
# Add all usermods
env.GetProjectConfig().set(f"env:usermods", 'custom_usermods', " ".join([f.name for f in all_usermods]))
def find_usermod(mod: str):
"""Locate this library in the usermods folder.
We do this to avoid needing to rename a bunch of folders;
this could be removed later
"""
# Check name match
mp = usermod_dir / mod
if mp.exists():
return mp
mp = usermod_dir / f"{mod}_v2"
if mp.exists():
return mp
mp = usermod_dir / f"usermod_v2_{mod}"
if mp.exists():
return mp
raise RuntimeError(f"Couldn't locate module {mod} in usermods directory!")
usermods = env.GetProjectOption("custom_usermods","")
if usermods:
# Inject usermods in to project lib_deps
proj = env.GetProjectConfig()
deps = env.GetProjectOption('lib_deps')
src_dir = proj.get("platformio", "src_dir")
src_dir = src_dir.replace('\\','/')
mod_paths = {mod: find_usermod(mod) for mod in usermods.split()}
usermods = [f"{mod} = symlink://{path}" for mod, path in mod_paths.items()]
proj.set("env:" + env['PIOENV'], 'lib_deps', deps + usermods)
# Force usermods to be installed in to the environment build state before the LDF runs
# Otherwise we won't be able to see them until it's too late to change their paths for LDF
# Logic is largely borrowed from PlaformIO internals
not_found_specs = []
for spec in usermods:
found = False
for storage_dir in env.GetLibSourceDirs():
#print(f"Checking {storage_dir} for {spec}")
lm = LibraryPackageManager(storage_dir)
if lm.get_package(spec):
#print("Found!")
found = True
break
if not found:
#print("Missing!")
not_found_specs.append(spec)
if not_found_specs:
lm = LibraryPackageManager(
env.subst(os.path.join("$PROJECT_LIBDEPS_DIR", "$PIOENV"))
)
for spec in not_found_specs:
#print(f"LU: forcing install of {spec}")
lm.install(spec)
# Utility function for assembling usermod include paths
def cached_add_includes(dep, dep_cache: set, includes: deque):
""" Add dep's include paths to includes if it's not in the cache """
if dep not in dep_cache:
dep_cache.add(dep)
for include in dep.get_include_dirs():
if include not in includes:
includes.appendleft(include)
if usermod_dir not in Path(dep.src_dir).parents:
# Recurse, but only for NON-usermods
for subdep in dep.depbuilders:
cached_add_includes(subdep, dep_cache, includes)
# Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies
# Save the old value
old_ConfigureProjectLibBuilder = env.ConfigureProjectLibBuilder
# Our new wrapper
def wrapped_ConfigureProjectLibBuilder(xenv):
# Update usermod properties
# Set libArchive before build actions are added
for um in (um for um in xenv.GetLibBuilders() if usermod_dir in Path(um.src_dir).parents):
build = um._manifest.get("build", {})
build["libArchive"] = False
um._manifest["build"] = build
# Call the wrapped function
result = old_ConfigureProjectLibBuilder.clone(xenv)()
# Fix up include paths
# In PlatformIO >=6.1.17, this could be done prior to ConfigureProjectLibBuilder
wled_dir = xenv["PROJECT_SRC_DIR"]
# Build a list of dependency include dirs
# TODO: Find out if this is the order that PlatformIO/SCons puts them in??
processed_deps = set()
extra_include_dirs = deque() # Deque used for fast prepend
for dep in result.depbuilders:
cached_add_includes(dep, processed_deps, extra_include_dirs)
for um in [dep for dep in result.depbuilders if usermod_dir in Path(dep.src_dir).parents]:
# Add the wled folder to the include path
um.env.PrependUnique(CPPPATH=wled_dir)
# Add WLED's own dependencies
for dir in extra_include_dirs:
um.env.PrependUnique(CPPPATH=dir)
return result
# Apply the wrapper
env.AddMethod(wrapped_ConfigureProjectLibBuilder, "ConfigureProjectLibBuilder")

View File

@ -10,7 +10,7 @@
# ------------------------------------------------------------------------------
# CI/release binaries
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover
default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, nodemcuv2_160, esp8266_2m_160, esp01_1m_full_160, nodemcuv2_compat, esp8266_2m_compat, esp01_1m_full_compat, esp32dev, esp32dev_V4, esp32_eth, lolin_s2_mini, esp32c3dev, esp32s3dev_16MB_opi, esp32s3dev_8MB_opi, esp32s3_4M_qspi, esp32_wrover, usermods
src_dir = ./wled00
data_dir = ./wled00/data
@ -114,6 +114,7 @@ extra_scripts =
post:pio-scripts/output_bins.py
post:pio-scripts/strip-floats.py
pre:pio-scripts/user_config_copy.py
pre:pio-scripts/load_usermods.py
pre:pio-scripts/build_ui.py
; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging)
@ -138,9 +139,9 @@ lib_compat_mode = strict
lib_deps =
fastled/FastLED @ 3.6.0
IRremoteESP8266 @ 2.8.2
makuna/NeoPixelBus @ 2.8.0
makuna/NeoPixelBus @ 2.8.3
#https://github.com/makuna/NeoPixelBus.git#CoreShaderBeta
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.2.1
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.0
# for I2C interface
;Wire
# ESP-NOW library
@ -157,25 +158,18 @@ lib_deps =
;adafruit/Adafruit BMP280 Library @ 2.1.0
;adafruit/Adafruit CCS811 Library @ 1.0.4
;adafruit/Adafruit Si7021 Library @ 1.4.0
#For ADS1115 sensor uncomment following
;adafruit/Adafruit BusIO @ 1.13.2
;adafruit/Adafruit ADS1X15 @ 2.4.0
#For MAX1704x Lipo Monitor / Fuel Gauge uncomment following
; https://github.com/adafruit/Adafruit_BusIO @ 1.14.5
; https://github.com/adafruit/Adafruit_MAX1704X @ 1.0.2
#For MPU6050 IMU uncomment follwoing
;electroniccats/MPU6050 @1.0.1
# For -D USERMOD_ANIMARTRIX
# CC BY-NC 3.0 licensed effects by Stefan Petrick, include this usermod only if you accept the terms!
;https://github.com/netmindz/animartrix.git#18bf17389e57c69f11bc8d04ebe1d215422c7fb7
# SHT85
;robtillaart/SHT85@~0.3.3
# Audioreactive usermod
;kosme/arduinoFFT @ 2.0.1
extra_scripts = ${scripts_defaults.extra_scripts}
[esp8266]
build_unflags = ${common.build_unflags}
build_flags =
-DESP8266
-DFP_IN_IROM
@ -235,20 +229,30 @@ lib_deps_compat =
IRremoteESP8266 @ 2.8.2
makuna/NeoPixelBus @ 2.7.9
https://github.com/blazoncek/QuickESPNow.git#optional-debug
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.2.1
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.0
[esp32_all_variants]
lib_deps =
willmmiles/AsyncTCP @ 1.3.1
bitbank2/AnimatedGIF@^1.4.7
https://github.com/Aircoookie/GifDecoder#bc3af18
build_flags =
-D CONFIG_ASYNC_TCP_USE_WDT=0
-D WLED_ENABLE_GIF
[esp32]
#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip
platform = espressif32@3.5.0
platform_packages = framework-arduinoespressif32 @ https://github.com/Aircoookie/arduino-esp32.git#1.0.6.4
build_unflags = ${common.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
#-DCONFIG_LITTLEFS_FOR_IDF_3_2
-D CONFIG_ASYNC_TCP_USE_WDT=0
#use LITTLEFS library by lorol in ESP32 core 1.x.x instead of built-in in 2.x.x
-D LOROL_LITTLEFS
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
${esp32_all_variants.build_flags}
tiny_partitions = tools/WLED_ESP32_2MB_noOTA.csv
default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
extended_partitions = tools/WLED_ESP32_4MB_700k_FS.csv
@ -257,12 +261,13 @@ large_partitions = tools/WLED_ESP32_8MB.csv
extreme_partitions = tools/WLED_ESP32_16MB_9MB_FS.csv
lib_deps =
https://github.com/lorol/LITTLEFS.git
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
${esp32_all_variants.lib_deps}
${env.lib_deps}
# additional build flags for audioreactive
AR_build_flags = -D USERMOD_AUDIOREACTIVE
-D sqrt_internal=sqrtf ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster)
AR_lib_deps = kosme/arduinoFFT @ 2.0.1
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
# additional build flags for audioreactive - must be applied globally
AR_build_flags = ;; -fsingle-precision-constant ;; forces ArduinoFFT to use float math (2x faster)
AR_lib_deps = ;; for pre-usermod-library platformio_override compatibility
[esp32_idf_V4]
;; experimental build environment for ESP32 using ESP-IDF 4.4.x / arduino-esp32 v2.0.5
@ -270,69 +275,78 @@ AR_lib_deps = kosme/arduinoFFT @ 2.0.1
;;
;; please note that you can NOT update existing ESP32 installs with a "V4" build. Also updating by OTA will not work properly.
;; You need to completely erase your device (esptool erase_flash) first, then install the "V4" build from VSCode+platformio.
platform = espressif32@ ~6.3.2
platform_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.06.02/platform-espressif32.zip ;; Tasmota Arduino Core 2.0.9 with IPv6 support, based on IDF 4.4.4
build_unflags = ${common.build_unflags}
build_flags = -g
-Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one
-DARDUINO_ARCH_ESP32 -DESP32
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DARDUINO_USB_CDC_ON_BOOT=0 ;; this flag is mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
${esp32_all_variants.build_flags}
-D WLED_ENABLE_DMX_INPUT
lib_deps =
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
${esp32_all_variants.lib_deps}
https://github.com/someweisguy/esp_dmx.git#47db25d
${env.lib_deps}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
[esp32s2]
;; generic definitions for all ESP32-S2 boards
platform = espressif32@ ~6.3.2
platform_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
platform = ${esp32_idf_V4.platform}
build_unflags = ${common.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32S2
-DCONFIG_IDF_TARGET_ESP32S2=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0
-DCO
-DARDUINO_USB_MODE=0 ;; this flag is mandatory for ESP32-S2 !
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_all_variants.build_flags}
lib_deps =
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
${esp32_all_variants.lib_deps}
${env.lib_deps}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
[esp32c3]
;; generic definitions for all ESP32-C3 boards
platform = espressif32@ ~6.3.2
platform_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
platform = ${esp32_idf_V4.platform}
build_unflags = ${common.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32C3
-DCONFIG_IDF_TARGET_ESP32C3=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DCO
-DARDUINO_USB_MODE=1 ;; this flag is mandatory for ESP32-C3
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_all_variants.build_flags}
lib_deps =
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
${esp32_all_variants.lib_deps}
${env.lib_deps}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
board_build.flash_mode = qio
[esp32s3]
;; generic definitions for all ESP32-S3 boards
platform = espressif32@ ~6.3.2
platform_packages = platformio/framework-arduinoespressif32 @ 3.20009.0 ;; select arduino-esp32 v2.0.9 (arduino-esp32 2.0.10 thru 2.0.14 are buggy so avoid them)
platform = ${esp32_idf_V4.platform}
build_unflags = ${common.build_unflags}
build_flags = -g
-DESP32
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32S3
-DCONFIG_IDF_TARGET_ESP32S3=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_DFU_ON_BOOT=0
-DCO
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_MODE, ARDUINO_USB_CDC_ON_BOOT
${esp32_all_variants.build_flags}
lib_deps =
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
${esp32_all_variants.lib_deps}
${env.lib_deps}
board_build.partitions = ${esp32.large_partitions} ;; default partioning for 8MB flash - can be overridden in build envs
# ------------------------------------------------------------------------------
@ -346,6 +360,7 @@ platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP8266\" #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM2D
lib_deps = ${esp8266.lib_deps}
monitor_filters = esp8266_exception_decoder
@ -355,13 +370,15 @@ extends = env:nodemcuv2
platform = ${esp8266.platform_compat}
platform_packages = ${esp8266.platform_packages_compat}
build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEASE_NAME=\"ESP8266_compat\" #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM2D
;; lib_deps = ${esp8266.lib_deps_compat} ;; experimental - use older NeoPixelBus 2.7.9
[env:nodemcuv2_160]
extends = env:nodemcuv2
board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP8266_160\" #-DWLED_DISABLE_2D
-D USERMOD_AUDIOREACTIVE
-D WLED_DISABLE_PARTICLESYSTEM2D
custom_usermods = audioreactive
[env:esp8266_2m]
board = esp_wroom_02
@ -370,6 +387,8 @@ platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m512k}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP02\"
-D WLED_DISABLE_PARTICLESYSTEM2D
-D WLED_DISABLE_PARTICLESYSTEM1D
lib_deps = ${esp8266.lib_deps}
[env:esp8266_2m_compat]
@ -378,12 +397,16 @@ extends = env:esp8266_2m
platform = ${esp8266.platform_compat}
platform_packages = ${esp8266.platform_packages_compat}
build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEASE_NAME=\"ESP02_compat\" #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
[env:esp8266_2m_160]
extends = env:esp8266_2m
board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP02_160\"
-D USERMOD_AUDIOREACTIVE
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
custom_usermods = audioreactive
[env:esp01_1m_full]
board = esp01_1m
@ -393,6 +416,8 @@ board_build.ldscript = ${common.ldscript_1m128k}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP01\" -D WLED_DISABLE_OTA
; -D WLED_USE_REAL_MATH ;; may fix wrong sunset/sunrise times, at the cost of 7064 bytes FLASH and 975 bytes RAM
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
lib_deps = ${esp8266.lib_deps}
[env:esp01_1m_full_compat]
@ -401,35 +426,47 @@ extends = env:esp01_1m_full
platform = ${esp8266.platform_compat}
platform_packages = ${esp8266.platform_packages_compat}
build_flags = ${common.build_flags} ${esp8266.build_flags_compat} -D WLED_RELEASE_NAME=\"ESP01_compat\" -D WLED_DISABLE_OTA #-DWLED_DISABLE_2D
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
[env:esp01_1m_full_160]
extends = env:esp01_1m_full
board_build.f_cpu = 160000000L
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_RELEASE_NAME=\"ESP01_160\" -D WLED_DISABLE_OTA
-D USERMOD_AUDIOREACTIVE
; -D WLED_USE_REAL_MATH ;; may fix wrong sunset/sunrise times, at the cost of 7064 bytes FLASH and 975 bytes RAM
-D WLED_DISABLE_PARTICLESYSTEM1D
-D WLED_DISABLE_PARTICLESYSTEM2D
custom_usermods = audioreactive
[env:esp32dev]
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32\" #-D WLED_DISABLE_BROWNOUT_DET
${esp32.AR_build_flags}
lib_deps = ${esp32.lib_deps}
${esp32.AR_lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
[env:esp32dev_V4]
board = esp32dev
platform = ${esp32_idf_V4.platform}
build_unflags = ${common.build_unflags}
custom_usermods = audioreactive
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_V4\" #-D WLED_DISABLE_BROWNOUT_DET
lib_deps = ${esp32_idf_V4.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = dio
[env:esp32dev_8M]
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_8M\" #-D WLED_DISABLE_BROWNOUT_DET
${esp32.AR_build_flags}
lib_deps = ${esp32_idf_V4.lib_deps}
${esp32.AR_lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.large_partitions}
board_upload.flash_size = 8MB
@ -440,12 +477,10 @@ board_upload.maximum_size = 8388608
[env:esp32dev_16M]
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_16M\" #-D WLED_DISABLE_BROWNOUT_DET
${esp32.AR_build_flags}
lib_deps = ${esp32_idf_V4.lib_deps}
${esp32.AR_lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
@ -457,11 +492,10 @@ board_build.flash_mode = dio
;board = esp32dev
;platform = ${esp32.platform}
;platform_packages = ${esp32.platform_packages}
;custom_usermods = audioreactive
;build_unflags = ${common.build_unflags}
;build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_audioreactive\" #-D WLED_DISABLE_BROWNOUT_DET
; ${esp32.AR_build_flags}
;lib_deps = ${esp32.lib_deps}
; ${esp32.AR_lib_deps}
;monitor_filters = esp32_exception_decoder
;board_build.partitions = ${esp32.default_partitions}
;; board_build.f_flash = 80000000L
@ -472,34 +506,30 @@ board = esp32-poe
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_Ethernet\" -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
; -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only
${esp32.AR_build_flags}
lib_deps = ${esp32.lib_deps}
${esp32.AR_lib_deps}
board_build.partitions = ${esp32.default_partitions}
[env:esp32_wrover]
extends = esp32_idf_V4
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
board = ttgo-t7-v14-mini32
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.partitions = ${esp32.extended_partitions}
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_WROVER\"
-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ;; Older ESP32 (rev.<3) need a PSRAM fix (increases static RAM used) https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/external-ram.html
-D DATA_PINS=25
${esp32.AR_build_flags}
lib_deps = ${esp32_idf_V4.lib_deps}
${esp32.AR_lib_deps}
[env:esp32c3dev]
extends = esp32c3
platform = ${esp32c3.platform}
platform_packages = ${esp32c3.platform_packages}
framework = arduino
board = esp32-c3-devkitm-1
board_build.partitions = ${esp32.default_partitions}
@ -517,17 +547,15 @@ lib_deps = ${esp32c3.lib_deps}
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_16MB_opi\"
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
${esp32.AR_build_flags}
lib_deps = ${esp32s3.lib_deps}
${esp32.AR_lib_deps}
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
@ -540,17 +568,15 @@ monitor_filters = esp32_exception_decoder
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
board_build.arduino.memory_type = qio_opi ;; use with PSRAM: 8MB or 16MB
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_8MB_opi\"
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
;-D ARDUINO_USB_CDC_ON_BOOT=0 ;; -D ARDUINO_USB_MODE=1 ;; for boards with serial-to-USB chip
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
${esp32.AR_build_flags}
lib_deps = ${esp32s3.lib_deps}
${esp32.AR_lib_deps}
board_build.partitions = ${esp32.large_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
@ -560,10 +586,10 @@ monitor_filters = esp32_exception_decoder
;; For ESP32-S3 WROOM-2, a.k.a. ESP32-S3 DevKitC-1 v1.1
;; with >= 16MB FLASH and >= 8MB PSRAM (memory_type: opi_opi)
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
board = esp32s3camlcd ;; this is the only standard board with "opi_opi"
board_build.arduino.memory_type = opi_opi
upload_speed = 921600
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_WROOM-2\"
-D CONFIG_LITTLEFS_FOR_IDF_3_2 -D WLED_WATCHDOG_TIMEOUT=0
@ -573,10 +599,8 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=
-D LEDPIN=38 -D DATA_PINS=38 ;; buildin WS2812b LED
-D BTNPIN=0 -D RLYPIN=16 -D IRPIN=17 -D AUDIOPIN=-1
-D WLED_DEBUG
${esp32.AR_build_flags}
-D SR_DMTYPE=1 -D I2S_SDPIN=13 -D I2S_CKPIN=14 -D I2S_WSPIN=15 -D MCLK_PIN=4 ;; I2S mic
lib_deps = ${esp32s3.lib_deps}
${esp32.AR_lib_deps}
board_build.partitions = ${esp32.extreme_partitions}
board_upload.flash_size = 16MB
@ -587,17 +611,15 @@ monitor_filters = esp32_exception_decoder
;; ESP32-S3, with 4MB FLASH and <= 4MB PSRAM (memory_type: qio_qspi)
board = lolin_s3_mini ;; -S3 mini, 4MB flash 2MB PSRAM
platform = ${esp32s3.platform}
platform_packages = ${esp32s3.platform_packages}
upload_speed = 921600
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S3_4M_qspi\"
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB")
-DBOARD_HAS_PSRAM
-DLOLIN_WIFI_FIX ; seems to work much better with this
-D WLED_WATCHDOG_TIMEOUT=0
${esp32.AR_build_flags}
lib_deps = ${esp32s3.lib_deps}
${esp32.AR_lib_deps}
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
@ -605,11 +627,11 @@ monitor_filters = esp32_exception_decoder
[env:lolin_s2_mini]
platform = ${esp32s2.platform}
platform_packages = ${esp32s2.platform_packages}
board = lolin_s2_mini
board_build.partitions = ${esp32.default_partitions}
board_build.flash_mode = qio
board_build.f_flash = 80000000L
custom_usermods = audioreactive
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=\"ESP32-S2\"
-DARDUINO_USB_CDC_ON_BOOT=1
@ -618,7 +640,6 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=
-DBOARD_HAS_PSRAM
-DLOLIN_WIFI_FIX ; seems to work much better with this
-D WLED_WATCHDOG_TIMEOUT=0
-D CONFIG_ASYNC_TCP_USE_WDT=0
-D DATA_PINS=16
-D HW_PIN_SCL=35
-D HW_PIN_SDA=33
@ -626,6 +647,17 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=
-D HW_PIN_DATASPI=11
-D HW_PIN_MISOSPI=9
; -D STATUSLED=15
${esp32.AR_build_flags}
lib_deps = ${esp32s2.lib_deps}
${esp32.AR_lib_deps}
[env:usermods]
board = esp32dev
platform = ${esp32_idf_V4.platform}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\"
-DTOUCH_CS=9
lib_deps = ${esp32_idf_V4.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.flash_mode = dio
; custom_usermods = *every folder with library.json* -- injected by pio-scripts/load_usermods.py
board_build.partitions = ${esp32.extreme_partitions} ; We're gonna need a bigger boat

View File

@ -5,7 +5,7 @@
# Please visit documentation: https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs = WLED_tasmota_1M # define as many as you need
default_envs = WLED_generic8266_1M, esp32dev_V4_dio80 # put the name(s) of your own build environment here. You can define as many as you need
#----------
# SAMPLE
@ -28,13 +28,13 @@ lib_deps = ${esp8266.lib_deps}
; robtillaart/SHT85@~0.3.3
; ;gmag11/QuickESPNow @ ~0.7.0 # will also load QuickDebug
; https://github.com/blazoncek/QuickESPNow.git#optional-debug ;; exludes debug library
; ${esp32.AR_lib_deps} ;; used for USERMOD_AUDIOREACTIVE
; bitbank2/PNGdec@^1.0.1 ;; used for POV display uncomment following
; ${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags}
;
; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above.
; *** To use the below defines/overrides, copy and paste each onto its own line just below build_flags in the section above.
;
; Set a release name that may be used to distinguish required binary for flashing
; -D WLED_RELEASE_NAME=\"ESP32_MULTI_USREMODS\"
@ -141,7 +141,8 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
; -D PIR_SENSOR_MAX_SENSORS=2 # max allowable sensors (uses OR logic for triggering)
;
; Use Audioreactive usermod and configure I2S microphone
; -D USERMOD_AUDIOREACTIVE
; ${esp32.AR_build_flags} ;; default flags required to properly configure ArduinoFFT
; ;; don't forget to add ArduinoFFT to your libs_deps: ${esp32.AR_lib_deps}
; -D AUDIOPIN=-1
; -D DMTYPE=1 # 0-analog/disabled, 1-I2S generic, 2-ES7243, 3-SPH0645, 4-I2S+mclk, 5-I2S PDM
; -D I2S_SDPIN=36
@ -157,17 +158,22 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
; -D USERMOD_POV_DISPLAY
; Use built-in or custom LED as a status indicator (assumes LED is connected to GPIO16)
; -D STATUSLED=16
;
;
; set the name of the module - make sure there is a quote-backslash-quote before the name and a backslash-quote-quote after the name
; -D SERVERNAME="\"WLED\""
;
;
; set the number of LEDs
; -D DEFAULT_LED_COUNT=30
; -D PIXEL_COUNTS=30
; or this for multiple outputs
; -D PIXEL_COUNTS=30,30
;
; set the default LED type
; -D DEFAULT_LED_TYPE=22 # see const.h (TYPE_xxxx)
; -D LED_TYPES=22 # see const.h (TYPE_xxxx)
; or this for multiple outputs
; -D LED_TYPES=TYPE_SK6812_RGBW,TYPE_WS2812_RGB
;
; set default color order of your led strip
; -D DEFAULT_LED_COLOR_ORDER=COL_ORDER_GRB
;
; set milliampere limit when using ESP power pin (or inadequate PSU) to power LEDs
; -D ABL_MILLIAMPS_DEFAULT=850
@ -176,9 +182,6 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
; enable IR by setting remote type
; -D IRTYPE=0 # 0 Remote disabled | 1 24-key RGB | 2 24-key with CT | 3 40-key blue | 4 40-key RGB | 5 21-key RGB | 6 6-key black | 7 9-key red | 8 JSON remote
;
; set default color order of your led strip
; -D DEFAULT_LED_COLOR_ORDER=COL_ORDER_GRB
;
; use PSRAM on classic ESP32 rev.1 (rev.3 or above has no issues)
; -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue # needed only for classic ESP32 rev.1
;
@ -236,14 +239,13 @@ build_flags = ${common.build_flags} ${esp8266.build_flags} -D DATA_PINS=1 -D WLE
lib_deps = ${esp8266.lib_deps}
[env:esp32dev_qio80]
extends = env:esp32dev # we want to extend the existing esp32dev environment (and define only updated options)
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} #-D WLED_DISABLE_BROWNOUT_DET
${esp32.AR_build_flags} ;; optional - includes USERMOD_AUDIOREACTIVE
lib_deps = ${esp32.lib_deps}
${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
@ -251,26 +253,25 @@ board_build.flash_mode = qio
;; experimental ESP32 env using ESP-IDF V4.4.x
;; Warning: this build environment is not stable!!
;; please erase your device before installing.
extends = esp32_idf_V4 # based on newer "esp-idf V4" platform environment
board = esp32dev
platform = ${esp32_idf_V4.platform}
platform_packages = ${esp32_idf_V4.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} #-D WLED_DISABLE_BROWNOUT_DET
${esp32.AR_build_flags} ;; includes USERMOD_AUDIOREACTIVE
lib_deps = ${esp32_idf_V4.lib_deps}
${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32_idf_V4.default_partitions}
board_build.partitions = ${esp32.default_partitions} ;; if you get errors about "out of program space", change this to ${esp32.extended_partitions} or even ${esp32.big_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dio
[env:esp32s2_saola]
extends = esp32s2
board = esp32-s2-saola-1
platform = ${esp32s2.platform}
platform_packages = ${esp32s2.platform_packages}
framework = arduino
board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv
board_build.flash_mode = qio
upload_speed = 460800
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32s2.build_flags}
;-DLOLIN_WIFI_FIX ;; try this in case Wifi does not work
-DARDUINO_USB_CDC_ON_BOOT=1
@ -279,7 +280,7 @@ lib_deps = ${esp32s2.lib_deps}
[env:esp32s3dev_8MB_PSRAM_qspi]
;; ESP32-TinyS3 development board, with 8MB FLASH and PSRAM (memory_type: qio_qspi)
extends = env:esp32s3dev_8MB_PSRAM_opi
;board = um_tinys3 ; -> needs workaround from https://github.com/Aircoookie/WLED/pull/2905#issuecomment-1328049860
;board = um_tinys3 ; -> needs workaround from https://github.com/wled-dev/WLED/pull/2905#issuecomment-1328049860
board = esp32-s3-devkitc-1 ;; generic dev board; the next line adds PSRAM support
board_build.arduino.memory_type = qio_qspi ;; use with PSRAM: 2MB or 4MB
@ -307,7 +308,7 @@ platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_USE_SHOJO_PCB
build_flags = ${common.build_flags} ${esp8266.build_flags} -D WLED_USE_SHOJO_PCB ;; NB: WLED_USE_SHOJO_PCB is not used anywhere in the source code. Not sure why its needed.
lib_deps = ${esp8266.lib_deps}
[env:d1_mini_debug]
@ -362,35 +363,48 @@ board_upload.flash_size = 2MB
board_upload.maximum_size = 2097152
[env:wemos_shield_esp32]
extends = esp32 ;; use default esp32 platform
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 460800
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags}
-D WLED_RELEASE_NAME=\"ESP32_wemos_shield\"
-D DATA_PINS=16
-D RLYPIN=19
-D BTNPIN=17
-D IRPIN=18
-D UWLED_USE_MY_CONFIG
-UWLED_USE_MY_CONFIG
-D USERMOD_DALLASTEMPERATURE
-D USERMOD_FOUR_LINE_DISPLAY
-D TEMPERATURE_PIN=23
-D USERMOD_AUDIOREACTIVE
${esp32.AR_build_flags} ;; includes USERMOD_AUDIOREACTIVE
lib_deps = ${esp32.lib_deps}
OneWire@~2.3.5
olikraus/U8g2 @ ^2.28.8
https://github.com/blazoncek/arduinoFFT.git
OneWire@~2.3.5 ;; needed for USERMOD_DALLASTEMPERATURE
olikraus/U8g2 @ ^2.28.8 ;; needed for USERMOD_FOUR_LINE_DISPLAY
${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE
board_build.partitions = ${esp32.default_partitions}
[env:m5atom]
board = esp32dev
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D DATA_PINS=27 -D BTNPIN=39
[env:esp32_pico-D4]
extends = esp32 ;; use default esp32 platform
board = pico32 ;; pico32-D4 is different from the standard esp32dev
;; hardware details from https://github.com/srg74/WLED-ESP32-pico
build_flags = ${common.build_flags} ${esp32.build_flags}
-D WLED_RELEASE_NAME=\"pico32-D4\" -D SERVERNAME='"WLED-pico32"'
-D WLED_DISABLE_ADALIGHT ;; no serial-to-USB chip on this board - better to disable serial protocols
-D DATA_PINS=2,18 ;; LED pins
-D RLYPIN=19 -D BTNPIN=0 -D IRPIN=-1 ;; no default pin for IR
${esp32.AR_build_flags} ;; include USERMOD_AUDIOREACTIVE
-D UM_AUDIOREACTIVE_ENABLE ;; enable AR by default
;; Audioreactive settings for on-board microphone (ICS-43432)
-D SR_DMTYPE=1 -D I2S_SDPIN=25 -D I2S_WSPIN=15 -D I2S_CKPIN=14
-D SR_SQUELCH=5 -D SR_GAIN=30
lib_deps = ${esp32.lib_deps}
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
${esp32.AR_lib_deps} ;; needed for USERMOD_AUDIOREACTIVE
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
[env:m5atom]
extends = env:esp32dev # we want to extend the existing esp32dev environment (and define only updated options)
build_flags = ${common.build_flags} ${esp32.build_flags} -D DATA_PINS=27 -D BTNPIN=39
[env:sp501e]
board = esp_wroom_02
@ -413,7 +427,7 @@ platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m512k}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags} -D BTNPIN=-1 -D RLYPIN=-1 -D DATA_PINS=4,12,14,13,5
-D DEFAULT_LED_TYPE=TYPE_ANALOG_5CH -D WLED_DISABLE_INFRARED -D WLED_MAX_CCT_BLEND=0
-D LED_TYPES=TYPE_ANALOG_5CH -D WLED_DISABLE_INFRARED -D WLED_MAX_CCT_BLEND=0
lib_deps = ${esp8266.lib_deps}
[env:Athom_15w_RGBCW] ;15w bulb
@ -423,7 +437,7 @@ platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m512k}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp8266.build_flags} -D BTNPIN=-1 -D RLYPIN=-1 -D DATA_PINS=4,12,14,5,13
-D DEFAULT_LED_TYPE=TYPE_ANALOG_5CH -D WLED_DISABLE_INFRARED -D WLED_MAX_CCT_BLEND=0 -D WLED_USE_IC_CCT
-D LED_TYPES=TYPE_ANALOG_5CH -D WLED_DISABLE_INFRARED -D WLED_MAX_CCT_BLEND=0 -D WLED_USE_IC_CCT
lib_deps = ${esp8266.lib_deps}
[env:Athom_3Pin_Controller] ;small controller with only data
@ -489,17 +503,15 @@ lib_deps = ${esp8266.lib_deps}
# EleksTube-IPS
# ------------------------------------------------------------------------------
[env:elekstube_ips]
extends = esp32 ;; use default esp32 platform
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 921600
custom_usermods = ${env:esp32dev.custom_usermods} RTC EleksTube_IPS
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOUT_DET -D WLED_DISABLE_INFRARED
-D USERMOD_RTC
-D USERMOD_ELEKSTUBE_IPS
-D DATA_PINS=12
-D RLYPIN=27
-D BTNPIN=34
-D DEFAULT_LED_COUNT=6
-D PIXEL_COUNTS=6
# Display config
-D ST7789_DRIVER
-D TFT_WIDTH=135
@ -513,7 +525,14 @@ build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOU
-D SPI_FREQUENCY=40000000
-D USER_SETUP_LOADED
monitor_filters = esp32_exception_decoder
lib_deps =
${esp32.lib_deps}
TFT_eSPI @ ^2.3.70
board_build.partitions = ${esp32.default_partitions}
# ------------------------------------------------------------------------------
# Usermod examples
# ------------------------------------------------------------------------------
# 433MHz RF remote example for esp32dev
[env:esp32dev_usermod_RF433]
extends = env:esp32dev
build_flags = ${env:esp32dev.build_flags} -D USERMOD_RF433
lib_deps = ${env:esp32dev.lib_deps}
sui77/rc-switch @ 2.6.4

View File

@ -1,18 +1,18 @@
<p align="center">
<img src="/images/wled_logo_akemi.png">
<a href="https://github.com/Aircoookie/WLED/releases"><img src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square"></a>
<a href="https://raw.githubusercontent.com/Aircoookie/WLED/master/LICENSE"><img src="https://img.shields.io/github/license/Aircoookie/wled?color=blue&style=flat-square"></a>
<a href="https://github.com/wled-dev/WLED/releases"><img src="https://img.shields.io/github/release/wled-dev/WLED.svg?style=flat-square"></a>
<a href="https://raw.githubusercontent.com/wled-dev/WLED/main/LICENSE"><img src="https://img.shields.io/github/license/wled-dev/wled?color=blue&style=flat-square"></a>
<a href="https://wled.discourse.group"><img src="https://img.shields.io/discourse/topics?colorB=blue&label=forum&server=https%3A%2F%2Fwled.discourse.group%2F&style=flat-square"></a>
<a href="https://discord.gg/QAh7wJHrRM"><img src="https://img.shields.io/discord/473448917040758787.svg?colorB=blue&label=discord&style=flat-square"></a>
<a href="https://kno.wled.ge"><img src="https://img.shields.io/badge/quick_start-wiki-blue.svg?style=flat-square"></a>
<a href="https://github.com/Aircoookie/WLED-App"><img src="https://img.shields.io/badge/app-wled-blue.svg?style=flat-square"></a>
<a href="https://gitpod.io/#https://github.com/Aircoookie/WLED"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?style=flat-square&logo=gitpod"></a>
<a href="https://gitpod.io/#https://github.com/wled-dev/WLED"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?style=flat-square&logo=gitpod"></a>
</p>
# Welcome to my project WLED! ✨
A fast and feature-rich implementation of an ESP8266/ESP32 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!
A fast and feature-rich implementation of an ESP32 and ESP8266 webserver to control NeoPixel (WS2812B, WS2811, SK6812) LEDs or also SPI based chipsets like the WS2801 and APA102!
## ⚙️ Features
- WS2812FX library with more than 100 special effects
@ -21,7 +21,7 @@ A fast and feature-rich implementation of an ESP8266/ESP32 webserver to control
- Segments to set different effects and colors to user defined parts of the LED string
- Settings page - configuration via the network
- Access Point and station mode - automatic failsafe AP
- Up to 10 LED outputs per instance
- [Up to 10 LED outputs](https://kno.wled.ge/features/multi-strip/#esp32) per instance
- Support for RGBW strips
- Up to 250 user presets to save and load colors/effects easily, supports cycling through them.
- Presets can be used to automatically execute API calls

View File

@ -1 +1 @@
platformio
platformio>=6.1.17

View File

@ -1,27 +1,25 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile
# pip-compile requirements.in
#
ajsonrpc==1.2.0
# via platformio
anyio==4.6.0
anyio==4.8.0
# via starlette
bottle==0.13.1
bottle==0.13.2
# via platformio
certifi==2024.8.30
certifi==2025.1.31
# via requests
charset-normalizer==3.3.2
charset-normalizer==3.4.1
# via requests
click==8.1.7
click==8.1.8
# via
# platformio
# uvicorn
colorama==0.4.6
# via
# click
# platformio
# via platformio
h11==0.14.0
# via
# uvicorn
@ -30,13 +28,13 @@ idna==3.10
# via
# anyio
# requests
marshmallow==3.22.0
marshmallow==3.26.1
# via platformio
packaging==24.1
packaging==24.2
# via marshmallow
platformio==6.1.16
platformio==6.1.17
# via -r requirements.in
pyelftools==0.31
pyelftools==0.32
# via platformio
pyserial==3.5
# via platformio
@ -46,13 +44,15 @@ semantic-version==2.10.0
# via platformio
sniffio==1.3.1
# via anyio
starlette==0.39.1
starlette==0.45.3
# via platformio
tabulate==0.9.0
# via platformio
urllib3==2.2.3
typing-extensions==4.12.2
# via anyio
urllib3==2.3.0
# via requests
uvicorn==0.30.6
uvicorn==0.34.0
# via platformio
wsproto==1.2.0
# via platformio

BIN
tools/AutoCubeMap.xlsx Normal file

Binary file not shown.

View File

@ -17,7 +17,7 @@
const fs = require("node:fs");
const path = require("path");
const inliner = require("inliner");
const inline = require("web-resource-inliner");
const zlib = require("node:zlib");
const CleanCSS = require("clean-css");
const minifyHtml = require("html-minifier-terser").minify;
@ -89,7 +89,7 @@ function adoptVersionAndRepo(html) {
repoUrl = repoUrl.replace(/^git\+/, "");
repoUrl = repoUrl.replace(/\.git$/, "");
html = html.replaceAll("https://github.com/atuline/WLED", repoUrl);
html = html.replaceAll("https://github.com/Aircoookie/WLED", repoUrl);
html = html.replaceAll("https://github.com/wled-dev/WLED", repoUrl);
}
let version = packageJson.version;
if (version) {
@ -128,21 +128,26 @@ async function minify(str, type = "plain") {
async function writeHtmlGzipped(sourceFile, resultFile, page) {
console.info("Reading " + sourceFile);
new inliner(sourceFile, async function (error, html) {
if (error) throw error;
inline.html({
fileContent: fs.readFileSync(sourceFile, "utf8"),
relativeTo: path.dirname(sourceFile),
strict: true,
},
async function (error, html) {
if (error) throw error;
html = adoptVersionAndRepo(html);
const originalLength = html.length;
html = await minify(html, "html-minify");
const result = zlib.gzipSync(html, { level: zlib.constants.Z_BEST_COMPRESSION });
console.info("Minified and compressed " + sourceFile + " from " + originalLength + " to " + result.length + " bytes");
const array = hexdump(result);
let src = singleHeader;
src += `const uint16_t PAGE_${page}_L = ${result.length};\n`;
src += `const uint8_t PAGE_${page}[] PROGMEM = {\n${array}\n};\n\n`;
console.info("Writing " + resultFile);
fs.writeFileSync(resultFile, src);
});
html = adoptVersionAndRepo(html);
const originalLength = html.length;
html = await minify(html, "html-minify");
const result = zlib.gzipSync(html, { level: zlib.constants.Z_BEST_COMPRESSION });
console.info("Minified and compressed " + sourceFile + " from " + originalLength + " to " + result.length + " bytes");
const array = hexdump(result);
let src = singleHeader;
src += `const uint16_t PAGE_${page}_L = ${result.length};\n`;
src += `const uint8_t PAGE_${page}[] PROGMEM = {\n${array}\n};\n\n`;
console.info("Writing " + resultFile);
fs.writeFileSync(resultFile, src);
});
}
async function specToChunk(srcDir, s) {

View File

@ -27,6 +27,7 @@ read -a JSON_TINY_TARGETS <<< $(replicate "json/nodes")
read -a JSON_SMALL_TARGETS <<< $(replicate "json/info")
read -a JSON_LARGE_TARGETS <<< $(replicate "json/si")
read -a JSON_LARGER_TARGETS <<< $(replicate "json/fxdata")
read -a INDEX_TARGETS <<< $(replicate "")
# Expand target URLS to full arguments for curl
TARGETS=(${TARGET_STR[@]})

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
#include <Adafruit_ADS1X15.h>
#include <math.h>
@ -252,4 +250,7 @@ class ADS1115Usermod : public Usermod {
int16_t results = ads.getLastConversionResults();
readings[activeChannel] = ads.computeVolts(results);
}
};
};
static ADS1115Usermod ads1115_v2;
REGISTER_USERMOD(ads1115_v2);

View File

@ -0,0 +1,7 @@
{
"name:": "ADS1115_v2",
"dependencies": {
"Adafruit BusIO": "https://github.com/adafruit/Adafruit_BusIO#1.13.2",
"Adafruit ADS1X15": "https://github.com/adafruit/Adafruit_ADS1X15#2.4.0"
}
}

View File

@ -6,5 +6,5 @@ Configuration is performed via the Usermod menu. There are no parameters to set
## Installation
Add the build flag `-D USERMOD_ADS1115` to your platformio environment.
Uncomment libraries with comment `#For ADS1115 sensor uncomment following`
Add 'ADS1115' to `custom_usermods` in your platformio environment.

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
#include <AHT10.h>
@ -54,12 +52,6 @@ private:
_lastTemperature = 0;
}
~UsermodAHT10()
{
delete _aht;
_aht = nullptr;
}
#ifndef WLED_DISABLE_MQTT
void mqttInitialize()
{
@ -322,6 +314,15 @@ public:
_initDone = true;
return configComplete;
}
~UsermodAHT10()
{
delete _aht;
_aht = nullptr;
}
};
const char UsermodAHT10::_name[] PROGMEM = "AHTxx";
const char UsermodAHT10::_name[] PROGMEM = "AHTxx";
static UsermodAHT10 aht10_v2;
REGISTER_USERMOD(aht10_v2);

View File

@ -22,15 +22,9 @@ Dependencies, These must be added under `lib_deps` in your `platform.ini` (or `p
# Compiling
To enable, compile with `USERMOD_AHT10` defined (e.g. in `platformio_override.ini`)
To enable, add 'AHT10' to `custom_usermods` in your platformio encrionment (e.g. in `platformio_override.ini`)
```ini
[env:aht10_example]
extends = env:esp32dev
build_flags =
${common.build_flags} ${esp32.build_flags}
-D USERMOD_AHT10
; -D USERMOD_AHT10_DEBUG ; -- add a debug status to the info modal
lib_deps =
${esp32.lib_deps}
enjoyneering/AHT10@~1.1.0
custom_usermods = ${env:esp32dev.custom_usermods} AHT10
```

View File

@ -0,0 +1,6 @@
{
"name:": "AHT10_v2",
"dependencies": {
"enjoyneering/AHT10":"~1.1.0"
}
}

View File

@ -2,8 +2,4 @@
extends = env:esp32dev
build_flags =
${common.build_flags} ${esp32.build_flags}
-D USERMOD_AHT10
; -D USERMOD_AHT10_DEBUG ; -- add a debug status to the info modal
lib_deps =
${esp32.lib_deps}
enjoyneering/AHT10@~1.1.0

View File

@ -1,4 +1,3 @@
#pragma once
#include "wled.h"
/*
@ -254,3 +253,7 @@ public:
return USERMOD_ID_ANALOG_CLOCK;
}
};
static AnalogClockUsermod analog_clock;
REGISTER_USERMOD(analog_clock);

View File

@ -0,0 +1,3 @@
{
"name:": "Analog_Clock"
}

View File

@ -7,7 +7,6 @@
*
* See the accompanying README.md file for more info.
*/
#pragma once
#include "wled.h"
class Animated_Staircase : public Usermod {
@ -562,3 +561,7 @@ const char Animated_Staircase::_bottomEcho_pin[] PROGMEM = "bottomEch
const char Animated_Staircase::_topEchoCm[] PROGMEM = "top-dist-cm";
const char Animated_Staircase::_bottomEchoCm[] PROGMEM = "bottom-dist-cm";
const char Animated_Staircase::_togglePower[] PROGMEM = "toggle-on-off";
static Animated_Staircase animated_staircase;
REGISTER_USERMOD(animated_staircase);

View File

@ -15,10 +15,9 @@ To include this usermod in your WLED setup, you have to be able to [compile WLED
Before compiling, you have to make the following modifications:
Edit `usermods_list.cpp`:
1. Open `wled00/usermods_list.cpp`
2. add `#include "../usermods/Animated_Staircase/Animated_Staircase.h"` to the top of the file
3. add `UsermodManager::add(new Animated_Staircase());` to the end of the `void registerUsermods()` function.
Edit your environment in `platformio_override.ini`
1. Open `platformio_override.ini`
2. add `Animated_Staircase` to the `custom_usermods` line for your environment
You can configure usermod using the Usermods settings page.
Please enter GPIO pins for PIR or ultrasonic sensors (trigger and echo).

View File

@ -0,0 +1,3 @@
{
"name:": "Animated_Staircase"
}

View File

@ -1,15 +1,13 @@
// force the compiler to show a warning to confirm that this file is included
#warning **** Included USERMOD_BH1750 ****
#ifndef WLED_ENABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
#pragma once
#include "wled.h"
#include <BH1750.h>
#ifdef WLED_DISABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
// the max frequency to check photoresistor, 10 seconds
#ifndef USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL
#define USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL 10000
@ -250,3 +248,7 @@ const char Usermod_BH1750::_maxReadInterval[] PROGMEM = "max-read-interval-ms";
const char Usermod_BH1750::_minReadInterval[] PROGMEM = "min-read-interval-ms";
const char Usermod_BH1750::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscoveryLux";
const char Usermod_BH1750::_offset[] PROGMEM = "offset-lx";
static Usermod_BH1750 bh1750_v2;
REGISTER_USERMOD(bh1750_v2);

View File

@ -0,0 +1,6 @@
{
"name:": "BH1750_v2",
"dependencies": {
"claws/BH1750":"^1.2.0"
}
}

View File

@ -6,22 +6,11 @@ The luminance is displayed in both the Info section of the web UI, as well as pu
## Dependencies
- Libraries
- `claws/BH1750 @^1.2.0`
- This must be added under `lib_deps` in your `platformio.ini` (or `platformio_override.ini`).
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
## Compilation
To enable, compile with `USERMOD_BH1750` defined (e.g. in `platformio_override.ini`)
```ini
[env:usermod_BH1750_d1_mini]
extends = env:d1_mini
build_flags =
${common.build_flags_esp8266}
-D USERMOD_BH1750
lib_deps =
${esp8266.lib_deps}
claws/BH1750 @ ^1.2.0
```
To enable, compile with `BH1750` in `custom_usermods` (e.g. in `platformio_override.ini`)
### Configuration Options
The following settings can be set at compile-time but are configurable on the usermod menu (except First Measurement time):

View File

@ -1,17 +1,15 @@
// force the compiler to show a warning to confirm that this file is included
#warning **** Included USERMOD_BME280 version 2.0 ****
#ifndef WLED_ENABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
#pragma once
#include "wled.h"
#include <Arduino.h>
#include <BME280I2C.h> // BME280 sensor
#include <EnvironmentCalculations.h> // BME280 extended measurements
#ifdef WLED_DISABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
class UsermodBME280 : public Usermod
{
private:
@ -241,7 +239,7 @@ public:
// from the UI and values read from sensor, then publish to broker
if (temperature != lastTemperature || PublishAlways)
{
publishMqtt("temperature", String(temperature, TemperatureDecimals).c_str());
publishMqtt("temperature", String(temperature, (unsigned) TemperatureDecimals).c_str());
}
lastTemperature = temperature; // Update last sensor temperature for next loop
@ -254,17 +252,17 @@ public:
if (humidity != lastHumidity || PublishAlways)
{
publishMqtt("humidity", String(humidity, HumidityDecimals).c_str());
publishMqtt("humidity", String(humidity, (unsigned) HumidityDecimals).c_str());
}
if (heatIndex != lastHeatIndex || PublishAlways)
{
publishMqtt("heat_index", String(heatIndex, TemperatureDecimals).c_str());
publishMqtt("heat_index", String(heatIndex, (unsigned) TemperatureDecimals).c_str());
}
if (dewPoint != lastDewPoint || PublishAlways)
{
publishMqtt("dew_point", String(dewPoint, TemperatureDecimals).c_str());
publishMqtt("dew_point", String(dewPoint, (unsigned) TemperatureDecimals).c_str());
}
lastHumidity = humidity;
@ -281,7 +279,7 @@ public:
if (pressure != lastPressure || PublishAlways)
{
publishMqtt("pressure", String(pressure, PressureDecimals).c_str());
publishMqtt("pressure", String(pressure, (unsigned) PressureDecimals).c_str());
}
lastPressure = pressure;
@ -479,3 +477,7 @@ public:
const char UsermodBME280::_name[] PROGMEM = "BME280/BMP280";
const char UsermodBME280::_enabled[] PROGMEM = "enabled";
static UsermodBME280 bme280_v2;
REGISTER_USERMOD(bme280_v2);

View File

@ -22,7 +22,6 @@ Dependencies
- Libraries
- `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280))
- `Wire`
- These must be added under `lib_deps` in your `platform.ini` (or `platform_override.ini`).
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
- This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else is listening to the serial TX pin or your board will get confused by log messages!
@ -40,17 +39,11 @@ Methods also exist to read the read/calculated values from other WLED modules th
# Compiling
To enable, compile with `USERMOD_BME280` defined (e.g. in `platformio_override.ini`)
To enable, add `BME280_v2` to your `custom_usermods` (e.g. in `platformio_override.ini`)
```ini
[env:usermod_bme280_d1_mini]
extends = env:d1_mini
build_flags =
${common.build_flags_esp8266}
-D USERMOD_BME280
lib_deps =
${esp8266.lib_deps}
BME280@~3.0.0
Wire
custom_usermods = ${env:d1_mini.custom_usermods} BME280_v2
```

View File

@ -0,0 +1,6 @@
{
"name:": "BME280_v2",
"dependencies": {
"finitespace/BME280":"~3.0.0"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +1,70 @@
# Usermod BME68X
This usermod was developed for a BME680/BME68X sensor. The BME68X is not compatible with the BME280/BMP280 chip. It has its own library. The original 'BSEC Software Library' from Bosch was used to develop the code. The measured values are displayed on the WLED info page.
This usermod was developed for a BME680/BME68X sensor. The BME68X is not compatible with the BME280/BMP280 chip. It has its own library. The original 'BSEC Software Library' from Bosch was used to develop the code. The measured values are displayed on the WLED info page.
<p align="center"><img src="pics/pic1.png" style="width:60%;"></p>
In addition, the values are published on MQTT if this is active. The topic used for this is: 'wled/[MQTT Client ID]'. The Client ID is set in the WLED MQTT settings.
<p align="center"><img src="pics/pic2.png"></p>
If you use HomeAssistance discovery, the device tree for HomeAssistance is created. This is published under the topic 'homeassistant/sensor/[MQTT Client ID]' via MQTT.
<p align="center"><img src="pics/pic3.png"></p>
A device with the following sensors appears in HomeAssistant. Please note that MQTT must be activated in HomeAssistant.
<p align="center"><img src="pics/pic4.png" style="width:60%;"></p>
## Features
Raw sensor types
Sensor Accuracy Scale Range
--------------------------------------------------------------------------------------------------
Temperature +/- 1.0 °C/°F -40 to 85 °C
Humidity +/- 3 % 0 to 100 %
Pressure +/- 1 hPa 300 to 1100 hPa
Gas Resistance Ohm
Sensor Accuracy Scale Range
-----------------------------
Temperature +/- 1.0 °C/°F -40 to 85 °C
Humidity +/- 3 % 0 to 100 %
Pressure +/- 1 hPa 300 to 1100 hPa
Gas Resistance Ohm
The BSEC Library calculates the following values via the gas resistance
Sensor Accuracy Scale Range
--------------------------------------------------------------------------------------------------
IAQ value between 0 and 500
Static IAQ same as IAQ but for permanently installed devices
CO2 PPM
VOC PPM
Gas-Percentage %
Sensor Accuracy Scale Range
-----------------------------
IAQ value between 0 and 500
Static IAQ same as IAQ but for permanently installed devices
CO2 PPM
VOC PPM
Gas-Percentage %
In addition the usermod calculates
Sensor Accuracy Scale Range
--------------------------------------------------------------------------------------------------
Absolute humidity g/m³
Dew point °C/°F
Sensor Accuracy Scale Range
-----------------------------
Absolute humidity g/m³
Dew point °C/°F
### IAQ (Indoor Air Quality)
The IAQ is divided into the following value groups.
The IAQ is divided into the following value groups.
<p align="center"><img src="pics/pic5.png"></p>
For more detailed information, please consult the enclosed Bosch product description (BME680.pdf).
## Calibration of the device
The gas sensor of the BME68X must be calibrated. This differs from the BME280, which does not require any calibration.
The gas sensor of the BME68X must be calibrated. This differs from the BME280, which does not require any calibration.
There is a range of additional information for this, which the driver also provides. These values can be found in HomeAssistant under Diagnostics.
- **STABILIZATION_STATUS**: Gas sensor stabilization status [boolean] Indicates initial stabilization status of the gas sensor element: stabilization is ongoing (0) or stabilization is finished (1).
- **RUN_IN_STATUS**: Gas sensor run-in status [boolean] Indicates power-on stabilization status of the gas sensor element: stabilization is ongoing (0) or stabilization is finished (1)
Furthermore, all GAS based values have their own accuracy value. These have the following meaning:
Furthermore, all GAS based values have their own accuracy value. These have the following meaning:
- **Accuracy = 0** means the sensor is being stabilized (this can take a while on the first run)
- **Accuracy = 1** means that the previous measured values show too few differences and cannot be used for calibration. If the sensor is at accuracy 1 for too long, you must ensure that the ambient air is chaning. Opening the windows is fine. Or sometimes it is sufficient to breathe on the sensor for approx. 5 minutes.
- **Accuracy = 0** means the sensor is being stabilized (this can take a while on the first run)
- **Accuracy = 1** means that the previous measured values show too few differences and cannot be used for calibration. If the sensor is at accuracy 1 for too long, you must ensure that the ambient air is chaning. Opening the windows is fine. Or sometimes it is sufficient to breathe on the sensor for approx. 5 minutes.
- **Accuracy = 2** means the sensor is currently calibrating.
- **Accuracy = 3** means that the sensor has been successfully calibrated. Once accuracy 3 is reached, the calibration data is automatically written to the file system. This calibration data will be used again at the next start and will speed up the calibration.
@ -67,28 +72,29 @@ The IAQ index is therefore only meaningful if IAQ Accuracy = 3. In addition to t
Reasonably reliable values are therefore only achieved when accuracy displays the value 3.
## Settings
The settings of the usermods are set in the usermod section of wled.
The settings of the usermods are set in the usermod section of wled.
<p align="center"><img src="pics/pic6.png"></p>
The possible settings are
- **Enable:** Enables / disables the usermod
- **I2C address:** I2C address of the sensor. You can choose between 0X77 & 0X76. The default is 0x77.
- **Interval:** Specifies the interval of seconds at which the usermod should be executed. The default is every second.
- **Pub Chages Only:** If this item is active, the values are only published if they have changed since the last publication.
- **Pub Accuracy:** The Accuracy values associated with the gas values are also published.
- **Pub Calib State:** If this item is active, STABILIZATION_STATUS& RUN_IN_STATUS are also published.
- **Interval:** Specifies the interval of seconds at which the usermod should be executed. The default is every second.
- **Pub Chages Only:** If this item is active, the values are only published if they have changed since the last publication.
- **Pub Accuracy:** The Accuracy values associated with the gas values are also published.
- **Pub Calib State:** If this item is active, STABILIZATION_STATUS& RUN_IN_STATUS are also published.
- **Temp Scale:** Here you can choose between °C and °F.
- **Temp Offset:** The temperature offset is always set in °C. It must be converted for Fahrenheit.
- **HA Discovery:** If this item is active, the HomeAssistant sensor tree is created.
- **Temp Offset:** The temperature offset is always set in °C. It must be converted for Fahrenheit.
- **HA Discovery:** If this item is active, the HomeAssistant sensor tree is created.
- **Pause While WLED Active:** If WLED has many LEDs to calculate, the computing power may no longer be sufficient to calculate the LEDs and read the sensor data. The LEDs then hang for a few microseconds, which can be seen. If this point is active, no sensor data is fetched as long as WLED is running.
- **Del Calibration Hist:** If a check mark is set here, the calibration file saved in the file system is deleted when the settings are saved.
- **Del Calibration Hist:** If a check mark is set here, the calibration file saved in the file system is deleted when the settings are saved.
### Sensors
Applies to all sensors. The number of decimal places is set here. If the sensor is set to -1, it will no longer be published. In addition, the IAQ values can be activated here in verbal form.
Applies to all sensors. The number of decimal places is set here. If the sensor is set to -1, it will no longer be published. In addition, the IAQ values can be activated here in verbal form.
It is recommended to use the Static IAQ for the IAQ values. This is recommended by Bosch for statically placed devices.
@ -99,8 +105,9 @@ Data is published over MQTT - make sure you've enabled the MQTT sync interface.
In addition to outputting via MQTT, you can read the values from the Info Screen on the dashboard page of the device's web interface.
Methods also exist to read the read/calculated values from other WLED modules through code.
- getTemperature(); The scale °C/°F is depended to the settings
- getHumidity();
- getHumidity();
- getPressure();
- getGasResistance();
- getAbsoluteHumidity();
@ -118,32 +125,36 @@ Methods also exist to read the read/calculated values from other WLED modules th
- getStabStatus();
- getRunInStatus();
## Compilation
## Compiling
To enable, compile with `BME68X` in `custom_usermods` (e.g. in `platformio_override.ini`)
To enable, compile with `USERMOD_BME68X` defined (e.g. in `platformio_override.ini`) and add the `BSEC Software Library` to the lib_deps.
Example:
```
[env:esp32-BME680]
board = esp32dev
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
lib_deps = ${esp32.lib_deps}
boschsensortec/BSEC Software Library @ ^1.8.1492 ; USERMOD: BME680
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32}
-D USERMOD_BME68X ; USERMOD: BME680
```[env:esp32_mySpecial]
extends = env:esp32dev
custom_usermods = ${env:esp32dev.custom_usermods} BME68X
```
## Revision History
### Version 1.0.0
- First version of the BME68X_v user module
### Version 1.0.1
- Rebased to WELD Version 0.15
- Reworked some default settings
- A problem with the default settings has been fixed
### Version 1.0.2
* Rebased to WELD Version 0.16
* Fixed: Solved compilation problems related to some macro naming interferences.
## Known problems
- MQTT goes online at device start. Shortly afterwards it goes offline and takes quite a while until it goes online again. The problem does not come from this user module, but from the WLED core.
- If you save the settings often, WLED can get stuck.
- If many LEDS are connected to WLED, reading the sensor can cause a small but noticeable hang. The "Pause While WLED Active" option was introduced as a workaround.

View File

@ -0,0 +1,6 @@
{
"name:": "BME68X",
"dependencies": {
"boschsensortec/BSEC Software Library":"^1.8.1492"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
#include "battery_defaults.h"
#include "UMBattery.h"
@ -857,3 +855,7 @@ const char UsermodBattery::_preset[] PROGMEM = "preset";
const char UsermodBattery::_duration[] PROGMEM = "duration";
const char UsermodBattery::_init[] PROGMEM = "init";
const char UsermodBattery::_haDiscovery[] PROGMEM = "HA-discovery";
static UsermodBattery battery;
REGISTER_USERMOD(battery);

View File

@ -0,0 +1,3 @@
{
"name:": "Battery"
}

View File

@ -23,9 +23,7 @@ Enables battery level monitoring of your project.
## 🎈 Installation
| **Option 1** | **Option 2** |
|--------------|--------------|
| In `wled00/my_config.h`<br>Add the line: `#define USERMOD_BATTERY`<br><br>[Example: my_config.h](assets/installation_my_config_h.png) | In `platformio_override.ini` (or `platformio.ini`)<br>Under: `build_flags =`, add the line: `-D USERMOD_BATTERY`<br><br>[Example: platformio_override.ini](assets/installation_platformio_override_ini.png) |
In `platformio_override.ini` (or `platformio.ini`)<br>Under: `custom_usermods =`, add the line: `Battery`<br><br>[Example: platformio_override.ini](assets/installation_platformio_override_ini.png) |
<br><br>

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
class UsermodCronixie : public Usermod {
@ -299,4 +297,7 @@ class UsermodCronixie : public Usermod {
{
return USERMOD_ID_CRONIXIE;
}
};
};
static UsermodCronixie cronixie;
REGISTER_USERMOD(cronixie);

View File

@ -0,0 +1,3 @@
{
"name:": "Cronixie"
}

View File

@ -4,5 +4,5 @@ This usermod supports driving the Cronixie M and L clock kits by Diamex.
## Installation
Compile and upload after adding `-D USERMOD_CRONIXIE` to `build_flags` of your PlatformIO environment.
Compile and upload after adding `Cronixie` to `custom_usermods` of your PlatformIO environment.
Make sure the Auto Brightness Limiter is enabled at 420mA (!) and configure 60 WS281x LEDs.

View File

@ -1,7 +1,5 @@
#pragma once
#include "wled.h"
#ifndef WLED_ENABLE_MQTT
#ifdef WLED_DISABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
@ -245,3 +243,7 @@ class UsermodDHT : public Usermod {
}
};
static UsermodDHT dht;
REGISTER_USERMOD(dht);

View File

@ -0,0 +1,7 @@
{
"name:": "DHT",
"build": { "libArchive": false},
"dependencies": {
"DHT_nonblocking":"https://github.com/alwynallan/DHT_nonblocking"
}
}

View File

@ -1,6 +1,5 @@
; Options
; -------
; USERMOD_DHT - define this to have this user mod included wled00\usermods_list.cpp
; USERMOD_DHT_DHTTYPE - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22
; USERMOD_DHT_PIN - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board
; USERMOD_DHT_CELSIUS - define this to report temperatures in degrees celsious, otherwise fahrenheit will be reported
@ -11,13 +10,11 @@
[env:d1_mini_usermod_dht_C]
extends = env:d1_mini
build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS
lib_deps = ${env:d1_mini.lib_deps}
https://github.com/alwynallan/DHT_nonblocking
custom_usermods = ${env:d1_mini.custom_usermods} DHT
build_flags = ${env:d1_mini.build_flags} -D USERMOD_DHT_CELSIUS
[env:custom32_LEDPIN_16_usermod_dht_C]
extends = env:custom32_LEDPIN_16
build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS
lib_deps = ${env.lib_deps}
https://github.com/alwynallan/DHT_nonblocking
custom_usermods = ${env:custom32_LEDPIN_16.custom_usermods} DHT
build_flags = ${env:custom32_LEDPIN_16.build_flags} -D USERMOD_DHT_CELSIUS -D USERMOD_DHT_STATS

View File

@ -15,7 +15,6 @@ Copy the example `platformio_override.ini` to the root directory. This file sho
### Define Your Options
* `USERMOD_DHT` - define this to include this user mod wled00\usermods_list.cpp
* `USERMOD_DHT_DHTTYPE` - DHT model: 11, 21, 22 for DHT11, DHT21, or DHT22, defaults to 22/DHT22
* `USERMOD_DHT_PIN` - pin to which DTH is connected, defaults to Q2 pin on QuinLed Dig-Uno's board
* `USERMOD_DHT_CELSIUS` - define this to report temperatures in degrees Celsius, otherwise Fahrenheit will be reported

View File

@ -0,0 +1,4 @@
{
"name:": "EXAMPLE",
"dependencies": {}
}

View File

@ -4,7 +4,6 @@ In this usermod file you can find the documentation on how to take advantage of
## Installation
Copy `usermod_v2_example.h` to the wled00 directory.
Uncomment the corresponding lines in `usermods_list.cpp` and compile!
Add `EXAMPLE` to `custom_usermods` in your PlatformIO environment and compile!
_(You shouldn't need to actually install this, it does nothing useful)_

View File

@ -1,10 +1,8 @@
#pragma once
#include "wled.h"
/*
* Usermods allow you to add own functionality to WLED more easily
* See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality
* See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
*
* This is an example for a v2 usermod.
* v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
@ -404,3 +402,6 @@ void MyExampleUsermod::publishMqtt(const char* state, bool retain)
}
#endif
}
static MyExampleUsermod example_usermod;
REGISTER_USERMOD(example_usermod);

View File

@ -1,4 +1,3 @@
#pragma once
#include "TFTs.h"
#include "wled.h"
@ -156,3 +155,7 @@ class ElekstubeIPSUsermod : public Usermod {
const char ElekstubeIPSUsermod::_name[] PROGMEM = "EleksTubeIPS";
const char ElekstubeIPSUsermod::_tubeSeg[] PROGMEM = "tubeSegment";
const char ElekstubeIPSUsermod::_digitOffset[] PROGMEM = "digitOffset";
static ElekstubeIPSUsermod elekstube_ips;
REGISTER_USERMOD(elekstube_ips);

View File

@ -0,0 +1,7 @@
{
"name:": "EleksTube_IPS",
"dependencies": {
"TFT_eSPI" : "2.5.33"
}
}
# Seems to add 300kb to the RAM requirement???

View File

@ -1,11 +1,12 @@
#ifndef WLED_ENABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
#include "wled.h"
#include <Arduino.h>
#include <U8x8lib.h> // from https://github.com/olikraus/u8g2/
#include <DallasTemperature.h> //Dallastemperature sensor
#ifdef WLED_DISABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
//The SCL and SDA pins are defined here.
//Lolin32 boards use SCL=5 SDA=4
#define U8X8_PIN_SCL 5

View File

@ -1,13 +1,13 @@
#ifndef WLED_ENABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
#include "wled.h"
#include <Arduino.h>
#include <U8x8lib.h> // from https://github.com/olikraus/u8g2/
#include <Wire.h>
#include <BME280I2C.h> //BME280 sensor
#ifdef WLED_DISABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
void UpdateBME280Data();
#define Celsius // Show temperature measurement in Celsius otherwise is in Fahrenheit

View File

@ -0,0 +1,4 @@
{
"name:": "Fix_unreachable_netservices_v2",
"platforms": ["espressif8266"]
}

View File

@ -30,41 +30,6 @@ The usermod supports the following state changes:
## Installation
1. Copy the file `usermod_Fix_unreachable_netservices.h` to the `wled00` directory.
2. Register the usermod by adding `#include "usermod_Fix_unreachable_netservices.h"` in the top and `registerUsermod(new FixUnreachableNetServices());` in the bottom of `usermods_list.cpp`.
Example **usermods_list.cpp**:
```cpp
#include "wled.h"
/*
* Register your v2 usermods here!
* (for v1 usermods using just usermod.cpp, you can ignore this file)
*/
/*
* Add/uncomment your usermod filename here (and once more below)
* || || ||
* \/ \/ \/
*/
//#include "usermod_v2_example.h"
//#include "usermod_temperature.h"
//#include "usermod_v2_empty.h"
#include "usermod_Fix_unreachable_netservices.h"
void registerUsermods()
{
/*
* Add your usermod class name here
* || || ||
* \/ \/ \/
*/
//UsermodManager::add(new MyExampleUsermod());
//UsermodManager::add(new UsermodTemperature());
//UsermodManager::add(new UsermodRenameMe());
UsermodManager::add(new FixUnreachableNetServices());
}
```
1. Add `Fix_unreachable_netservices` to `custom_usermods` in your PlatformIO environment.
Hopefully I can help someone with that - @gegu

View File

@ -1,12 +1,4 @@
#pragma once
#include "wled.h"
#if defined(ESP32)
#warning "Usermod FixUnreachableNetServices works only with ESP8266 builds"
class FixUnreachableNetServices : public Usermod
{
};
#endif
#if defined(ESP8266)
#include <ping.h>
@ -16,7 +8,7 @@ class FixUnreachableNetServices : public Usermod
* By this procedure the net services of WLED remains accessible in some problematic WLAN environments.
*
* Usermods allow you to add own functionality to WLED more easily
* See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality
* See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
*
* v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
* Multiple v2 usermods can be added to one compilation easily.
@ -168,4 +160,11 @@ Delay <input type=\"number\" min=\"5\" max=\"300\" value=\"";
return USERMOD_ID_FIXNETSERVICES;
}
};
static FixUnreachableNetServices fix_unreachable_net_services;
REGISTER_USERMOD(fix_unreachable_net_services);
#else /* !ESP8266 */
#warning "Usermod FixUnreachableNetServices works only with ESP8266 builds"
#endif

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
#include <INA226_WE.h>
@ -210,12 +208,6 @@ private:
}
}
~UsermodINA226()
{
delete _ina226;
_ina226 = nullptr;
}
#ifndef WLED_DISABLE_MQTT
void mqttInitialize()
{
@ -551,6 +543,17 @@ public:
_initDone = true;
return configComplete;
}
~UsermodINA226()
{
delete _ina226;
_ina226 = nullptr;
}
};
const char UsermodINA226::_name[] PROGMEM = "INA226";
static UsermodINA226 ina226_v2;
REGISTER_USERMOD(ina226_v2);

View File

@ -22,13 +22,6 @@ The following settings can be configured in the Usermod Menu:
- **MqttPublishAlways**: Publish always, regardless if there is a change.
- **MqttHomeAssistantDiscovery**: Enable Home Assistant discovery.
## Dependencies
These must be added under `lib_deps` in your `platform.ini` (or `platform_override.ini`).
- Libraries
- `wollewald/INA226_WE@~1.2.9` (by [wollewald](https://registry.platformio.org/libraries/wollewald/INA226_WE))
- `Wire`
## Understanding Samples and Conversion Times
@ -62,16 +55,12 @@ For detailed programming information and register configurations, refer to the [
## Compiling
To enable, compile with `USERMOD_INA226` defined (e.g. in `platformio_override.ini`).
To enable, compile with `INA226` in `custom_usermods` (e.g. in `platformio_override.ini`).
```ini
[env:ina226_example]
extends = env:esp32dev
build_flags =
${common.build_flags} ${esp32.build_flags}
-D USERMOD_INA226
custom_usermods = ${env:esp32dev.custom_usermods} INA226
build_flags = ${env:esp32dev.build_flags}
; -D USERMOD_INA226_DEBUG ; -- add a debug status to the info modal
lib_deps =
${esp32.lib_deps}
wollewald/INA226_WE@~1.2.9
```

View File

@ -0,0 +1,6 @@
{
"name:": "INA226_v2",
"dependencies": {
"wollewald/INA226_WE":"~1.2.9"
}
}

View File

@ -1,9 +1,6 @@
[env:ina226_example]
extends = env:esp32dev
custom_usermods = ${env:esp32dev.custom_usermods} INA226_v2
build_flags =
${common.build_flags} ${esp32.build_flags}
-D USERMOD_INA226
${env:esp32dev.build_flags}
; -D USERMOD_INA226_DEBUG ; -- add a debug status to the info modal
lib_deps =
${esp32.lib_deps}
wollewald/INA226_WE@~1.2.9

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
class InternalTemperatureUsermod : public Usermod
@ -50,7 +48,7 @@ public:
#else // ESP32 ESP32S3 and ESP32C3
temperature = roundf(temperatureRead() * 10) / 10;
#endif
if(presetToActivate != 0){
// Check if temperature has exceeded the activation threshold
if (temperature >= activationThreshold) {
// Update the state flag if not already set
@ -58,7 +56,7 @@ public:
isAboveThreshold = true;
}
// Check if a 'high temperature' preset is configured and it's not already active
if (presetToActivate != 0 && currentPreset != presetToActivate) {
if (currentPreset != presetToActivate) {
// If a playlist is active, store it for reactivation later
if (currentPlaylist > 0) {
previousPlaylist = currentPlaylist;
@ -101,6 +99,7 @@ public:
}
}
}
}
#ifndef WLED_DISABLE_MQTT
if (WLED_MQTT_CONNECTED)
@ -192,4 +191,7 @@ void InternalTemperatureUsermod::publishMqtt(const char *state, bool retain)
mqtt->publish(subuf, 0, retain, state);
}
#endif
}
}
static InternalTemperatureUsermod internal_temperature_v2;
REGISTER_USERMOD(internal_temperature_v2);

View File

@ -0,0 +1,3 @@
{
"name:": "Internal_Temperature_v2"
}

View File

@ -23,8 +23,7 @@
## Installation
- Add a build flag `-D USERMOD_INTERNAL_TEMPERATURE` to your `platformio.ini` (or `platformio_override.ini`).
- Add `Internal_Temperature` to `custom_usermods` in your `platformio.ini` (or `platformio_override.ini`).
## 📝 Change Log

View File

@ -1,14 +1,10 @@
#warning **** Included USERMOD_LD2410 ****
#ifndef WLED_ENABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
#pragma once
#include "wled.h"
#include <ld2410.h>
#ifdef WLED_DISABLE_MQTT
#error "This user mod requires MQTT to be enabled."
#endif
class LD2410Usermod : public Usermod {
private:
@ -235,3 +231,7 @@ void LD2410Usermod::publishMqtt(const char* topic, const char* state, bool retai
}
#endif
}
static LD2410Usermod ld2410_v2;
REGISTER_USERMOD(ld2410_v2);

View File

@ -0,0 +1,6 @@
{
"name:": "LD2410_v2",
"dependencies": {
"ncmreynolds/ld2410":"^0.1.3"
}
}

View File

@ -10,21 +10,15 @@ The movement and presence state are displayed in both the Info section of the we
## Dependencies
- Libraries
- `ncmreynolds/ld2410@^0.1.3`
- This must be added under `lib_deps` in your `platformio.ini` (or `platformio_override.ini`).
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
## Compilation
To enable, compile with `USERMOD_LD2410` defined (e.g. in `platformio_override.ini`)
To enable, compile with `LD2140` in `custom_usermods` (e.g. in `platformio_override.ini`)
```ini
[env:usermod_USERMOD_LD2410_esp32dev]
extends = env:esp32dev
build_flags =
${common.build_flags_esp32}
-D USERMOD_LD2410
lib_deps =
${esp32.lib_deps}
ncmreynolds/ld2410@^0.1.3
custom_usermods = ${env:esp32dev.custom_usermods} LD2140
```
### Configuration Options

View File

@ -1,4 +1,3 @@
#pragma once
#include "wled.h"
#ifndef ARDUINO_ARCH_ESP32
@ -151,3 +150,7 @@ class LDR_Dusk_Dawn_v2 : public Usermod {
};
const char LDR_Dusk_Dawn_v2::_name[] PROGMEM = "LDR_Dusk_Dawn_v2";
static LDR_Dusk_Dawn_v2 ldr_dusk_dawn_v2;
REGISTER_USERMOD(ldr_dusk_dawn_v2);

View File

@ -2,13 +2,14 @@
This usermod will obtain readings from a Light Dependent Resistor (LDR) and will turn on/off specific presets based on those readings. This is useful for exterior lighting situations where you want the lights to only be on when it is dark out.
# Installation
Add "-D USERMOD_LDR_DUSK_DAWN" to your platformio.ini [common] build_flags and build.
Add "LDR_Dusk_Dawn" to your platformio.ini environment's custom_usermods and build.
Example:
```
[common]
build_flags =
-D USERMOD_LDR_DUSK_DAWN # Enable LDR Dusk Dawn Usermod
[env:usermod_LDR_Dusk_Dawn_esp32dev]
extends = env:esp32dev
custom_usermods = ${env:esp32dev.custom_usermods}
LDR_Dusk_Dawn # Enable LDR Dusk Dawn Usermod
```
# Usermod Settings

View File

@ -0,0 +1,3 @@
{
"name:": "LDR_Dusk_Dawn_v2"
}

View File

@ -1,8 +1,6 @@
// force the compiler to show a warning to confirm that this file is included
#warning **** Included USERMOD_MAX17048 V2.0 ****
#pragma once
#include "wled.h"
#include "Adafruit_MAX1704X.h"
@ -279,3 +277,7 @@ const char Usermod_MAX17048::_enabled[] PROGMEM = "enabled";
const char Usermod_MAX17048::_maxReadInterval[] PROGMEM = "max-read-interval-ms";
const char Usermod_MAX17048::_minReadInterval[] PROGMEM = "min-read-interval-ms";
const char Usermod_MAX17048::_HomeAssistantDiscovery[] PROGMEM = "HomeAssistantDiscovery";
static Usermod_MAX17048 max17048_v2;
REGISTER_USERMOD(max17048_v2);

View File

@ -0,0 +1,7 @@
{
"name:": "MAX17048_v2",
"build": { "libArchive": false},
"dependencies": {
"Adafruit_MAX1704X":"https://github.com/adafruit/Adafruit_MAX1704X#1.0.2"
}
}

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
#include "MY92xx.h"
@ -42,4 +40,7 @@ class MY9291Usermod : public Usermod {
uint16_t getId() {
return USERMOD_ID_MY9291;
}
};
};
static MY9291Usermod my9291;
REGISTER_USERMOD(my9291);

View File

@ -0,0 +1,4 @@
{
"name:": "MY9291",
"platforms": ["espressif8266"]
}

View File

@ -42,7 +42,7 @@
*
*
* Usermods allow you to add own functionality to WLED more easily
* See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality
* See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
*
* v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
* Multiple v2 usermods can be added to one compilation easily.

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
#ifndef PIR_SENSOR_PIN
@ -26,7 +24,7 @@
* Maintained by: @blazoncek
*
* Usermods allow you to add own functionality to WLED more easily
* See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality
* See: https://github.com/wled-dev/WLED/wiki/Add-own-functionality
*
* v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
* Multiple v2 usermods can be added to one compilation easily.
@ -571,3 +569,7 @@ bool PIRsensorSwitch::readFromConfig(JsonObject &root)
// use "return !top["newestParameter"].isNull();" when updating Usermod with new features
return !(pins.isNull() || pins.size() != PIR_SENSOR_MAX_SENSORS);
}
static PIRsensorSwitch pir_sensor_switch;
REGISTER_USERMOD(pir_sensor_switch);

View File

@ -0,0 +1,3 @@
{
"name:": "PIR_sensor_switch"
}

View File

@ -5,7 +5,7 @@ This usermod-v2 modification allows the connection of a PIR sensor to switch on
_Story:_
I use the PIR Sensor to automatically turn on the WLED analog clock in my home office room when I am there.
The LED strip is switched [using a relay](https://github.com/Aircoookie/WLED/wiki/Control-a-relay-with-WLED) to keep the power consumption low when it is switched off.
The LED strip is switched [using a relay](https://kno.wled.ge/features/relay-control/) to keep the power consumption low when it is switched off.
## Web interface

View File

@ -1,10 +1,14 @@
#pragma once
#include "wled.h"
#if !defined(USERMOD_DALLASTEMPERATURE) && !defined(USERMOD_SHT)
#if defined(USERMOD_DALLASTEMPERATURE)
#include "UsermodTemperature.h"
#elif defined(USERMOD_SHT)
#include "ShtUsermod.h"
#else
#error The "PWM fan" usermod requires "Dallas Temeprature" or "SHT" usermod to function properly.
#endif
#include "wled.h"
// PWM & tacho code curtesy of @KlausMu
// https://github.com/KlausMu/esp32-fan-controller/tree/main/src
@ -397,3 +401,7 @@ const char PWMFanUsermod::_maxPWMValuePct[] PROGMEM = "max-PWM-percent";
const char PWMFanUsermod::_IRQperRotation[] PROGMEM = "IRQs-per-rotation";
const char PWMFanUsermod::_speed[] PROGMEM = "speed";
const char PWMFanUsermod::_lock[] PROGMEM = "lock";
static PWMFanUsermod pwm_fan;
REGISTER_USERMOD(pwm_fan);

View File

@ -0,0 +1,6 @@
{
"name:": "PWM_fan",
"build": {
"extraScript": "setup_deps.py"
}
}

View File

@ -11,8 +11,8 @@ If the _tachometer_ is supported, the current speed (in RPM) will be displayed o
## Installation
Add the compile-time option `-D USERMOD_PWM_FAN` to your `platformio.ini` (or `platformio_override.ini`) or use `#define USERMOD_PWM_FAN` in `myconfig.h`.
You will also need `-D USERMOD_DALLASTEMPERATURE`.
Add the `PWM_fan` to `custom_usermods` in your `platformio.ini` (or `platformio_override.ini`)
You will also need `Temperature` or `sht`.
### Define Your Options

View File

@ -0,0 +1,12 @@
Import('env')
usermods = env.GetProjectOption("custom_usermods","").split()
# Check for dependencies
if "Temperature" in usermods:
env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")])
elif "sht" in usermods:
env.Append(CPPDEFINES=[("USERMOD_SHT")])
else:
raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled")

View File

@ -1,5 +1,3 @@
#pragma once
#include "src/dependencies/time/DS1307RTC.h"
#include "wled.h"
@ -48,4 +46,7 @@ class RTCUsermod : public Usermod {
{
return USERMOD_ID_RTC;
}
};
};
static RTCUsermod rtc;
REGISTER_USERMOD(rtc);

View File

@ -0,0 +1,3 @@
{
"name:": "RTC"
}

View File

@ -1,5 +1,3 @@
#pragma once
#include "wled.h"
//Pin defaults for QuinLed Dig-Uno (A0)
@ -210,3 +208,7 @@ const char Usermod_SN_Photoresistor::_referenceVoltage[] PROGMEM = "supplied-vol
const char Usermod_SN_Photoresistor::_resistorValue[] PROGMEM = "resistor-value";
const char Usermod_SN_Photoresistor::_adcPrecision[] PROGMEM = "adc-precision";
const char Usermod_SN_Photoresistor::_offset[] PROGMEM = "offset";
static Usermod_SN_Photoresistor sn_photoresistor;
REGISTER_USERMOD(sn_photoresistor);

View File

@ -0,0 +1,3 @@
{
"name:": "SN_Photoresistor"
}

View File

@ -27,19 +27,6 @@ This usermod enables display of the following:
### Platformio.ini changes
In the `platformio.ini` file, uncomment the `TFT_eSPI` line within the [common] section, under `lib_deps`:
```ini
# platformio.ini
...
[common]
...
lib_deps =
...
#For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line
#TFT_eSPI
...
```
In the `platformio.ini` file, you must change the environment setup to build for just the esp32dev platform as follows:

View File

@ -1,8 +1,6 @@
// Credits to @mrVanboy, @gwaland and my dearest friend @westward
// Also for @spiff72 for usermod TTGO-T-Display
// 210217
#pragma once
#include "wled.h"
#include <TFT_eSPI.h>
#include <SPI.h>
@ -410,4 +408,7 @@ class St7789DisplayUsermod : public Usermod {
//More methods can be added in the future, this example will then be extended.
//Your usermod will remain compatible as it does not need to implement all methods from the Usermod base class!
};
};
static name. st7789_display;
REGISTER_USERMOD(st7789_display);

Some files were not shown because too many files have changed in this diff Show More