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"
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.
* 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.
* 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)
* 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.
* 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...)
* 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
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
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)
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
index.js:
- add global ledmap variable
- updateLen conditional draw parameter
- draw black out not mapped
json.cpp:
- add "ledmap" in (de)serializeState (not info)
- use loadedLedmap
wled.cpp/h:
- loadLedMap is boolean, use loadedLedmap for ledmap
- show * password
liveviewws2D: colorAmp
settings2D: add id and name, change max to 255