Commit Graph

157 Commits

Author SHA1 Message Date
Frank
6c93250cd8 small improvement
addPixelColorXY() is actually the same code as color_add()
2024-04-20 23:24:27 +02:00
Frank
d0f018586e bugfix
comparing uint32_t to fastled CRGB does not work.
2024-04-20 22:42:26 +02:00
Frank
e886ece189 Segment::setPixelColorXY optimization
use a shortcut when the segment is "simple" and just a single pixel needs to be set on HW level.
2024-04-20 22:02:15 +02:00
Frank
93b8c63e2b post PR3904 fixes and improvements
* fix compiler warnings (uninitialized vars, ambiguous  functions calls)
* restore some lost function prototypes
* avoid negative pixel indices
* only use "fast" color_add when there is no risk of  "overshooting" results
* minor optimizations
2024-04-18 21:09:14 +02:00
Blaž Kristan
48c64aecff Merge pull request #3904 from DedeHai/FX_fcn_improvements
added improvements to color scaling and blurring
2024-04-18 19:26:57 +02:00
netmindz
0f79e9b7ff Merge pull request #124 from netmindz/auto-playlist
New Usermod - Auto Playlist
2024-04-16 22:38:56 +01:00
Frank
019cafc5e0 report out-of-memory situations to the user 2024-04-16 19:10:46 +02:00
Troy
6e23b09a93 Update FX_2Dfcn.cpp
removed temp debugging
2024-04-04 21:46:35 -04:00
Troy
22be977df8 IfDefs to quiet some other debug lines during debugging. 2024-03-25 12:19:13 -04:00
Troy
5ff44755d8 calculations based on normalized FFT results 2024-03-25 08:19:05 -04:00
Frank
8905992a89 code spell checking - part4 (MM specific) 2023-12-15 00:14:57 +01:00
Ewoud
0092e49eb3 GFX/Preview done right if > 4096 pixels + unlimited virtual pixels in 2d 2023-10-24 16:58:35 +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
3295579e05 jsonToPixels robustness
avoid string overflow when constructing filename
2023-07-13 18:36:11 +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
a45306b141 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-08 20:06:52 +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
117dd52ce4 Ledmap 1D / no width/height 2023-06-15 11:29:41 +02:00
Ewoud
5c7937507b Bug fix segment view, use ledmapMaxSize (TroyHack) 2023-06-08 19:24:37 +02:00
Ewoud
8d43af6acc Bug fix segment view, use ledmapMaxSize (TroyHack) 2023-06-08 18:34:10 +02:00
TroyHacks
143f84238f WLED_DEBUG_MAPS flag added 2023-06-06 19:44:02 -04:00
Frank
dc77c172b2 Merge branch 'mdev' into audio_fastpath 2023-06-01 22:59:20 +02:00
Frank
f300ffdbe9 debug out: flush serial buffer after dumping out ledmap. 2023-06-01 22:57:15 +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
Frank
fc193408d8 (experimental) use malloc/realloc for customMappingTable
if this works better, we should cherry-pick it into mdev.
2023-05-21 19:38:04 +02:00
Ewoud
22decaa0d6 segment.leds refactor (wip)
rename leds to ledsrgb
2023-05-19 15:25:26 +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
Ewoud
fede3dd54c Merge remote-tracking branch 'upstream/main' into mdev 2023-05-11 17:39:12 +02:00
Frank
f69142d5be optimization for AA setPixelColorXY() 2023-04-30 19:09:38 +02:00
Frank
40c96c14f5 a bunch of smaller speedups to core functions
*  make local functions "static"
* use fast_ int types where possible
* use native min/max instead of MIN/MAX macros. Macros evaluate each parameter TWICE!!
* adding __attribute__((pure)) and __attribute((const)) to help the compiler optimize
* ws.cpp: reduce max "live leds" in fastpath mode
2023-04-30 18:41:30 +02:00
Blaz Kristan
65c584aeda 2D enhancement (internal)
- move() wrapping
- dual addPixelColorXY()
2023-04-27 17:31:55 +02:00
Ewoud
4aea3970a3 ARTI-FX support 8266 (experimental!!) add soundpressure
Add ARTI-FX to esp8266_4MB_M (experimental!)

Arti.h
- FREE_SIZE ESP.getFreeHeap() for 8266
- define asChar(x) to print to Serial/File depending on ESP32/8266
- artiPrintf: print to USER_PRINTF (experimental)

Arti_wled.h
- add ARDUINO_ARCH_ESP8266 to ARTI_ARDUINO
- add soundPressure

usermod_v2_artifx.h: use FREE_SIZE
2023-04-07 12:43:38 +02:00
Ewoud
753f5621d1 ws sendLiveLedsWs: no skiplines to show large matrices uncompressed 2023-04-06 11:49:16 +02:00
Ewoud
cae1c00467 ARTIFX add support for pixelart + small changes
arti_wled.h:
- add jsonToPixels and frameTime
- change printf to print

usermod_v2_artifx
- return MAX(frameTime,FRAMETIME); 

FX.h and FX_2Dfcn.cpp
- add jsonToPixels

audioreactive.h
- ES8388 allow for default and add moon
2023-04-05 13:22:50 +02:00
Ewoud
2f024568de Fix for smaller number of pixeld than matrix size.
Borrowed from upstream / onepx-segment
2023-03-11 21:18:21 +01:00
Blaz Kristan
7c186e4fcc Fix for smaller number of pixeld than matrix size. 2023-03-11 15:03:28 +01:00
Ewoud
10c5d8f20f Refactor setUpMatrix, deserializeMap for ledmaps 2023-03-07 13:56:18 +01:00
Blaz Kristan
ddd32bd600 Multiple fixes.
- compiler warning fixes (gcc17)
- revert min heap size to 8k
- fix form submitting in 2D settings
- remove IRAM_ATTR for ESP8266 core 4.1.0
2023-03-05 22:56:14 +01:00
Ewoud
86af341c6a setUpMatrix bug fix 2023-02-23 15:58:02 +01:00
Ewoud
4a5cbc9879 Merge remote-tracking branch 'upstream/main' into mdev
Some additions:

pio.ini: add debug entries
cfg.cpp, set.cpp, xml/cpp: keep storing basic 2D setup

index.js: use ledmapFileNames

settings_2D.htm: keep using basic and advanced

FX_2Dfcn.cpp: use gaptable and also MM ledmaps

FX_fcn.cpp: extend enumerateledmaps with AC ledmapNames (but not used in UI)
2023-02-22 16:09:27 +01:00
Ewoud
def3cde8b8 Bugfix 2D without ledmap
index.js: remove showToast when ledmap not found

FX_2DFCN: Check on ledmapsize >0 for doing logical and physical mapping
2023-02-14 21:47:25 +01:00
Ewoud
d8f625beea show only ledmap pixels, show bus lengths in segment visualization
index.js: segment visualization:
- max width if no pc
- don't show nr if only one segment
- Ledmap nr color depending on bus output

FX_2Dfcn.cpp / FX_fcn.cpp
- don't show ledmap -1 pixels

json.cpp: add busses.length to outputs

ws.cpp: peek back to strip.gPC only
2023-02-14 17:22:58 +01:00
Blaz Kristan
92d2be3f5e Add ledmap names
Bugfix
- reset segments upon 2D ledmap allocation error
- fix invlid 2D segments
2023-02-14 17:11:58 +01:00
Ewoud
9ba9a61af5 Add support for default ledmap.json + peek with ledmap if default panel
Thx to @Troy#2642
2023-02-13 19:09:02 +01:00