Commit Graph

412 Commits

Author SHA1 Message Date
Frank
01c187f8aa bugfix for #104
this avoids heap corruption, by double-checking that "use global leds" is not configured, before trying to free ledsrgb[].

It is still a mystery why Segment::_globalLeds == nullptr.
2024-01-02 15:52:00 +01:00
Frank
f699a56220 tiny correction 2023-12-31 12:03:08 +01:00
Frank
4b89016c2d audio-enhanced standard effects
backported from WLED-SR
2023-12-31 00:01:29 +01:00
Frank
ced03f1f08 code spell checking - part1 (core)
I've found a code spellchecker, so this is what can be corrected easily. Changes are only affecting comments, readme and a few user-visible strings. So no functional impact expected.
2023-12-14 22:05:55 +01:00
Frank
d2c9c9ee71 fix small typo 2023-12-10 16:50:49 +01:00
Frank
e4cb0929c3 PartyJerk: minor code style improvements
* fix some too-long tabs
*author info added
* shrunk number of blank lines
* removed unused audio variables
* colorIndex : better accuracy by first doing multiply, then divide
2023-12-10 16:49:13 +01:00
tonyxforce
21f925eab2 Merge branch 'MoonModules:mdev' into mdev 2023-11-14 23:07:39 +01:00
Frank
fd15047220 Squashed commit of the following:
commit 84148ad07a7ac94993dc9dfd0bdc6d7a8d9e47ac
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Sun Sep 3 12:34:17 2023 +0200

    Implement palette colors

commit af3c8f66f7e77dd6306ceadf2cea26a41336e439
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Tue Aug 1 18:18:41 2023 +0200

    revert wled00.ino

commit 3097a1b17efa06b78d52611b3a9d3c519a15ed17
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Tue Aug 1 18:13:37 2023 +0200

    minor aesthetic fixes

commit 54b80f74b2dc8766951d55438c6bc560b33e505b
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Tue Aug 1 18:09:32 2023 +0200

    remove unused variable

commit 9a78d28cd71da998cdd76ba826946f54ee2044bd
Merge: 56a74bc5 1ed81793
Author: Blaz Kristan <blaz@kristan-sp.si>
Date:   Tue Aug 1 18:08:29 2023 +0200

    Merge branch 'main' into PJH_ADD_Linearbounce

commit 56a74bc54c5bbf189b1f98c6cd216956b4f6bd6c
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Sat Aug 15 12:34:13 2020 -0500

    Update FX.cpp

    Added the improvements suggested by Gregor Hartmann

commit a20358b61bf0c38356438c87e5c59663524e038e
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Sun Jul 12 08:33:48 2020 -0500

    Adding 2 ball track modes

    With and without collisions

commit 341d9d1697e9af4fdf2fbd5b4c1de935d0b5a229
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Sun Jul 5 14:55:14 2020 -0500

    Update FX.cpp

    Still 1 bug to fix - this was a test.

commit 9cee4243837f35431302814cc7ace13a72ab5fed
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Sun Jul 5 14:53:14 2020 -0500

    Update FX.cpp

commit 37cb51cfd6991f6041d663de72debfdcf349c1da
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Thu Jul 2 14:16:25 2020 -0500

    Adding Collision

    A couple of bugs still need sorting

commit 84b7bfb989e662e37a47d78e381105b3951311a6
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Sun Jun 28 19:59:46 2020 -0500

    update for lost balls

    Added some protection - so that when intensity is lowered and raised some time later balls that have moved way off the track are recovered.

commit 04d17e483956b74754002da4cb4dfcddaf932f7b
Author: pjhatch <66844564+pjhatch@users.noreply.github.com>
Date:   Sun Jun 28 19:43:56 2020 -0500

    Added Ball Track V1

    In this version the balls bounce of the edges and do not interact with one another.
2023-09-17 19:19:37 +02:00
tonyxforce
c07a8ae263 Fixed possible naming legal issues 2023-08-25 20:26:16 +02:00
tonyxforce
6a37f81465 Renamed the effect, biased the sliders, so it
looks best with all sliders in the middle,
added option to change the effect speed multiplier
2023-08-25 01:03:40 +02:00
tonyxforce
7fe0123c63 modified: wled00/FX.cpp
modified:   wled00/FX.h
2023-08-23 18:13:15 +02:00
Frank
9a3a97eff1 pre-merge
cleanup:
- version increase
- clean up debug messages
- minor fixes in platformio.ini
- fix compilation with -D WLED_DISABLE_2D

helping the compiler to optimize:
- a few more __attribute__((pure))
- fx.cpp marked a few local functions as "static"
2023-07-13 19:58:48 +02:00
Frank
0fb5edc4a2 robustness improvements from upstream
(from upstream alt-buffer branch)
* prevent drawing into inactive segments
* robustness improvements for transitions
2023-07-13 18:34:46 +02:00
Frank
c64f74a611 fix for random crashes on changing presets (UI)
Segments are created/deleted on-the-fly; it seems that "local leds" buffers did not follow properly.
* revise segment copy/move constructors
* de-optimize use of local leds (as they need to be re-allocated when segment size changes)
* minor stability improvements
2023-07-08 22:40:43 +02:00
Frank
601499b69b XY: minor bugfix
properly handle width=0 OR height=0
2023-07-06 10:02:01 +02:00
Frank
582b96f846 robustness improvements
* handling of stop = 0 when calculating sizes (avoid unsigned underflow)
* make sure groupLength() is never zero (to avoid div/0)
* gapmaps: check for "(gapSize > 0)" added.

not sure if all the checks are 100% needed, but they will improve robustness in corner cases.
2023-06-21 13:30:40 +02:00
Frank
310daa61a8 improve segment code robustness
* Avoid uint16 underflow in width() and height(): stop > start is possible, and means "inactive segment".

* use size_t for ledsrgbSize, _dataLen and _usedSegmentData -  uint16_t could overflow in some situations.

* try to catch attempts to allocate zero bytes (inactive segment => size 0)
2023-06-21 01:43:26 +02:00
Frank
3127c60b41 Merge branch 'mdev' into audio_fastpath 2023-06-15 20:54:57 +02:00
Ewoud
b95ff2d74f Merge remote-tracking branch 'upstream/main' into mdev 2023-06-07 20:54:04 +02:00
Frank
63b03a4139 Merge branch 'mdev' into audio_fastpath 2023-06-01 21:58:34 +02:00
Frank
333f5ac2a1 waitUntilIdle() improvements
* protect deserializeMap()
* better handling of recursion in deserializeSegment() and deserializeState
* don't use yield() on esp32
2023-06-01 21:28:46 +02:00
Frank
52fe8e28a3 Merge branch 'mdev' into audio_fastpath 2023-06-01 17:44:36 +02:00
Frank
0a5bfb656d avoid updating strip / segments while draving effects (ESP32 only)
💫 this is the way🌟
A new locking mechanism that allows to wait until strip.service() has completed.
2023-06-01 17:41:36 +02:00
Sebastian
9d22a06969 Changes for allowing Alexa to change light color to White when auto-calculating from RGB (#3211)
* Changes for allowing Alexa to change light color to White when auto-calculating from RGB

* Update alexa.cpp

Indention

* Do not rely on global auto white override

(gets white mode from segment light capabilities)

* alexa.cpp: Removed unnecessary whitespaces

---------

Co-authored-by: Aircoookie <21045690+Aircoookie@users.noreply.github.com>
2023-05-31 20:12:17 +02:00
Frank
1daeecc7dd Merge branch 'mdev' into audio_fastpath 2023-05-30 20:44:10 +02:00
Frank
9cb6189611 minor speedup for 2D
* robustness: Segment::height() should never return 0
* Segment::XY(), Segment::virtualWidth() and Segment::virtualHeight() declared inline in fx.h. The compiler will always inline these functions now, avoiding overhead of call/return. "Knowing" the function body might also enable other optimizations.
--> up to 10% speedup in 2D effects.
2023-05-26 23:12:49 +02:00
Ewoud
305a5b19c4 leds(rgb): also adjusted if new ledmap + grow not shrink (unless...)
FX.h: add ledsrgbSize and allocLeds()
FX_fcn.cpp: 
- copy constructor: allocLeds()
- move constructor: no change
- copy assignment: reuse! + allocLeds()
- move asignment: no change
- resetIfRequired: no free
- setUpLeds/resetSegments: allocLeds()

unless...: copy constructor aften called. That is the bad boy causing re-allocs at every effect change!
2023-05-24 14:59:39 +02:00
Ewoud
992eb2e2de small 2023-05-19 15:30:55 +02:00
Ewoud
22decaa0d6 segment.leds refactor (wip)
rename leds to ledsrgb
2023-05-19 15:25:26 +02:00
Ewoud
ef12aaa60b Temp fix for leds array crashes: size fixed to 10000pixels/30000bytes 2023-05-17 15:07:42 +02:00
Ewoud
40d120146f Merge branch 'mdev' into audio_fastpath 2023-05-17 11:58:43 +02:00
Ewoud
c0d5cad198 Merge remote-tracking branch 'upstream/main' into mdev 2023-05-17 11:15:50 +02:00
Ewoud
175375e30d Merge branch 'mdev' into audio_fastpath 2023-05-16 16:02:47 +02:00
Ewoud
21c7347296 Minimal (de)allocs on customMappingTable (only grow, not shrink) 2023-05-16 15:13:30 +02:00
Ewoud
d6bc9967d0 Support for large ledmaps
optimize jMapC, enumerateLedmaps and deserializeMap
2023-05-16 13:12:30 +02:00
Frank
6d23eb6874 improve robustness when heap is low
* customMappingTable: allocate using calloc instead of new (new will throw exception if nor enough heap)
* fixing a few minor memory leaks
* ws.cpp: catch out-of-memory in sendLiveLedsWs
* ws.cpp: change interval to 80ms (120 ws very slow...)
2023-05-15 21:15:24 +02:00
Blaz Kristan
4a567ab97c Merge branch 'main' into seg-groups 2023-05-15 17:06:38 +02:00
Blaz Kristan
90431b662b Rename "group" to "set" 2023-05-15 17:06:29 +02:00
Ewoud
fede3dd54c Merge remote-tracking branch 'upstream/main' into mdev 2023-05-11 17:39:12 +02:00
Blaz Kristan
3d9160f2fa Merge branch 'main' into seg-groups 2023-05-05 23:01:17 +02:00
Frank
7d0e627e14 some effect optimizations
* getpixelcolor: attribute pure - it reads memory, but does not write
* some optimizations for SEGMENT.blur() and SEGMENT.fadeToBlackBy()

* FX.c:pp remove double calls to blur() and fade_out()
* FX.cpp: SEGMENT.setUpLeds() added to effects, to enable LED buffering (safe some time because getPixelColor does not need to access NeopixelBus)

* a few other optimizations to safe time and avoid "expensive" operations
* set I2C bus speed to 400kHz (default is 100Khz)

* a few other small optimizations and tweaks
* pio: esp32 V4 builds use "patch5" toolchain version, which contains a few bugfixes especially for memory management.
2023-05-03 20:33:23 +02:00
Frank
f69142d5be optimization for AA setPixelColorXY() 2023-04-30 19:09:38 +02:00
Frank
fb03a37b08 fps help in LED settings
led settings: added hint on max leds per pin
fx.h: faster FRAMERATE_FIXED
2023-04-30 18:37:14 +02:00
Blaz Kristan
61eb7b0a6a Waving Cell FX 2023-04-29 17:04:16 +02:00
Blaz Kristan
2119d08543 Octopus 2D effect
- by Stepko
2023-04-28 22:00:35 +02:00
Blaz Kristan
65c584aeda 2D enhancement (internal)
- move() wrapping
- dual addPixelColorXY()
2023-04-27 17:31:55 +02:00
Blaž Kristan
2540a2dfd9 Soap, new 2D effect (#3184)
* Soap, new 2D effect

* Fix Soap FX on matrices with edges < 8 LEDs

* Add palette support to Soap FX

---------

Co-authored-by: cschwinne <dev.aircoookie@gmail.com>
2023-04-27 01:22:33 +02:00
Frank
8e9db0adde more accurate FPS forESP32
the standard millis() code is very inaccurate in the "high FPS" ranges. This replaces it with the esp32 high resolution timer.
2023-04-21 17:34:01 +02:00
Frank
9130e4be54 minor optimization of core LED functions
* use _fast_ integer types in loops - in contrast to "uint16_t" etc, the compiler can leave out range/overflow corrections, so it might run faster.
* fcn_declare.h: revive "WLED_USE_REAL_MATH" option, which can be a bit faster on ESP32.
2023-04-21 16:44:58 +02:00
Frank
00661de7fc accept up to 250 fps target in LED preferences
warning included.
2023-04-21 15:26:35 +02:00