Commit Graph

413 Commits

Author SHA1 Message Date
Blaz Kristan
7b28387bb4 Comments from Aircoookie addressed 2023-08-09 17:23:21 +02:00
Blaz Kristan
9832fbe042 Segment reset 2023-08-08 20:40:19 +02:00
Blaz Kristan
084070475d Chasing memory corruption/leaks. 2023-08-07 16:50:18 +02:00
Blaz Kristan
93a1616933 Blend tweaking. 2023-08-05 21:01:06 +02:00
Blaz Kristan
9a87a2ff0d Blending 2023-08-05 17:35:14 +02:00
Blaz Kristan
937e3d0b94 FX blending POC 2023-08-05 13:50:08 +02:00
Blaz Kristan
8503aba583 Better random palette handling.
Remove unnecessary debug timing.
2023-08-03 22:28:53 +02:00
cschwinne
8ccf349458 Always repaint NPB buffer on brightness change
Fix bus re-init causing full brightness (every show() now attempts to set the brightness, bus will ignore this if it stays the same)
2023-07-19 17:25:25 +02:00
cschwinne
2fce15db94 Restore brightness immediately after show() 2023-07-19 16:22:34 +02:00
cschwinne
5b9630cf46 Repaint NPB buffer on brightness updates 2023-07-19 13:50:09 +02:00
Blaz Kristan
7dcbb409a9 Trying to solve ABL bug.
(no more pulsing)
2023-07-18 23:33:28 +02:00
Frank
5ef7cd7bdd blur bugfix
turns out that fastLED 3.6.0 has an explicit uint32_t operator that returns RGBA, however  3.5.0 does not have this and the conversion returned only the "red" component".
2023-07-18 13:12:52 +02:00
Blaz Kristan
abfb8bbc34 Fix (almost good) for unbuffered ABL calculations. 2023-07-17 17:06:04 +02:00
Blaz Kristan
82e01f7b17 Fixed ABL calculation. 2023-07-17 16:15:17 +02:00
cschwinne
5e20abd7f1 Move segment bounds queuing to WS2812FX 2023-07-13 13:08:36 +02:00
Frank
72a72dbc88
proper rounding of FPS 2023-07-13 12:49:19 +02:00
cschwinne
4766666913 Static queued segment bounds
(saves 180 bytes of RAM)
Fixed segment index not increasing on inactive segments
2023-07-13 03:09:42 +02:00
Blaz Kristan
fa6070c680 Multiple updates:
- additional debug timings
- removed local leds[] buffer
- async segment bounds change (crashes seen otherwise)
- added isActive() check to Segment drawing methods
- ABL simplification
- palette option for Black hole (FX)
- (possible) crash mitigation is Segment handling (rapid preset changes)
2023-07-12 20:52:34 +02:00
cschwinne
6267d11e51 Fix compilation and ABL scaling 2023-07-09 12:32:28 +02:00
Christian Schwinne
822298ab66
Merge branch 'main' into alt-buffer 2023-07-09 11:31:02 +02:00
Blaz Kristan
f437fd6cd6 Code readability.
Fix for peek.
Loop timing.
2023-07-06 21:16:29 +02:00
Frank
42b247756a blur speedup
it seems that SEGMENT.blur() is the main bottleneck for many 2D effects.

This change optimizes performance of the function:
* avoid to re-write unchanged pixels
* early exit when blur_amount == 0 (=nothing to do)
* use _fast_ types where possible

I've seen up to 20% speedup with this change.
2023-07-06 19:51:37 +02:00
Frank
788a276616 fix power calculation for NeoPixelBusLg
power estimation results from estimateCurrentAndLimitBri() were too low (example: estimated 1.3Amp, measured 1.6Amp). This change corrects the power calculation. Due to the changed behavior of getPixelColor, powerSum must be used as-is, not scaled down again by brightness.
2023-07-06 19:06:31 +02:00
Blaz Kristan
59a144baed Disable global buffer on ESP8266 by default
Remove global dependency from Bus class and subclasses
Remove timings
2023-07-05 23:57:46 +02:00
Blaz Kristan
66616e1cab Some timings added. 2023-07-03 21:13:01 +02:00
Frank
fa281a0df0 ABL optimization
this optimization avoids to apply brightness two times .

NeoPixelBusLg has already applied global brightness at sPC. Due to internal working of the Lg bus, its sufficient to only post-apply scaling, and set the new (scaled) brightness for the next frame.
2023-07-03 19:23:57 +02:00
Frank
d48a96599f prevent races on leds buffer (looptask vs. async_tcp)
I still see strange crashes in setPixelColor/GetpixelColor, which ssem to come from race conditions between async_tcp (change presets) and looptask (strip.service).
To make the situation better, its important that any global pointers are reset to NULL immediately after free().
2023-07-03 19:15:50 +02:00
Frank
7de7ef8e8c fix some crashes when changing presets
This fixes some of the crashes I had when changing presets.

still not a full solution ...
2023-07-03 17:00:43 +02:00
Frank
406a254523 inactive segments robustness improvement
* Avoid uint16 underflow in width() and height(): stop > start is possible, and means "inactive segment".

Without these checks, it was possible that width() and height() produce VERY large values due to underflow.
2023-07-03 15:43:47 +02:00
Frank
65e073e6b8 de-optimization
first version still cased some flickering.
This de-optimization makes LEDs more stable.
2023-07-03 14:01:45 +02:00
Blaz Kristan
858b57d77a Return of local leds[] 2023-07-01 21:48:30 +02:00
Frank
9b87892036 optimization for ABL hotfix
* adding an optional parameter to setBrightness(). ApplyPostAdjustments() will only be called if `immediate=true`. Only ABL will use immediate=true, to ensure electrical safety of equipment.

This allows some optimizations of performance, as ApplyPostAdjustments() is time consuming.

* busses.setBrightness(bri) --> applied to all future pixels (fast, lossless)
* busses.setBrightness(bri, true) --> applied directly to all previously set pixels (slower, lossy)
2023-07-01 20:09:52 +02:00
Blaz Kristan
272f96b405 Double buffering at bus level. 2023-06-30 21:12:59 +02:00
Christian Schwinne
fa9b151c36 Slightly more efficient buffer copy to busses 2023-06-27 01:57:05 +02:00
Christian Schwinne
61ba16b779 Global buffer and ABL fixes 2023-06-27 00:38:30 +02:00
Christian Schwinne
f6e86bfcf8 First global buffer iteration 2023-06-26 22:12:32 +02:00
Christian Schwinne
498dd76730 Decouple segment led buffer from global led buffer 2023-06-26 18:16:38 +02:00
Blaz Kristan
ef3c72a24f Fix for #3265 2023-06-23 23:49:54 +02:00
Blaz Kristan
189d145393 Merge branch 'main' into beta-3 2023-06-04 18:43:28 +02:00
Blaz Kristan
1e7071bff3 Transition bugfix. 2023-06-04 18:36:46 +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
Blaž Kristan
69ab2ce402
Merge branch 'main' into feature 2023-05-30 16:20:20 +02:00
Blaz Kristan
0a5aac724a Merge branch 'main' into seg-groups 2023-05-29 21:35:52 +02:00
Blaz Kristan
5a8a8dc292 Feature implementation
- #2236
  - #1984
Better PSRAM handling
platformio.ini update
On/Off bus handling
2023-05-28 22:50:19 +02:00
Blaz Kristan
bffeec1615 Remove PSRAM use from global LED buffer. 2023-05-21 18:37:18 +02:00
Frank
e4a9f115cb fx functions: avoid memory corruption
* PSRAM_Allocator was missing the "reallocate" method, which lead to undefined behaviour when dynamic JSON doc needed to grow/shrink
* Segment::setUpLeds() quickfix for length() == 0 (should not happen, but it did happen for me once)
* leds in PSRAM causes major slowdown on wrover boards - disabled.
2023-05-21 14:33:25 +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
Blaz Kristan
217004c70c Bugfix.
- disbled transitions/crossfade prevented segment off
2023-05-14 18:18:09 +02:00
Blaz Kristan
3d9160f2fa Merge branch 'main' into seg-groups 2023-05-05 23:01:17 +02:00