diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 9f6250cb..2cb69644 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -48,7 +48,7 @@ body: attributes: label: What version/release of MM WLED? description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message" - placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b30.37_esp32_4MB_M.bin" + placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b31.38_esp32_4MB_M.bin" validations: required: true - type: dropdown diff --git a/package-lock.json b/package-lock.json index eead5461..b4bcd63e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wled", - "version": "0.14.1-b30.37", + "version": "0.14.1-b31.38", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wled", - "version": "0.14.1-b30.37", + "version": "0.14.1-b31.38", "license": "GPL-3.0-or-later", "dependencies": { "clean-css": "^4.2.3", diff --git a/package.json b/package.json index 920024ce..347fec25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.14.1-b30.37", + "version": "0.14.1-b31.38", "description": "Tools for WLED project", "main": "tools/cdata.js", "directories": { diff --git a/pio-scripts/obj-dump.py b/pio-scripts/obj-dump.py index 91bc3de5..174df509 100644 --- a/pio-scripts/obj-dump.py +++ b/pio-scripts/obj-dump.py @@ -1,9 +1,24 @@ # Little convenience script to get an object dump +# You may add "-S" to the objdump commandline (i.e. replace "-D -C " with "-d -S -C ") +# to get source code intermixed with disassembly (SLOW !) Import('env') def obj_dump_after_elf(source, target, env): + platform = env.PioPlatform() + board = env.BoardConfig() + mcu = board.get("build.mcu", "esp32") + print("Create firmware.asm") - env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm") - + if mcu == "esp8266": + env.Execute("xtensa-lx106-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm") + if mcu == "esp32": + env.Execute("xtensa-esp32-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm") + if mcu == "esp32s2": + env.Execute("xtensa-esp32s2-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm") + if mcu == "esp32s3": + env.Execute("xtensa-esp32s3-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm") + if mcu == "esp32c3": + env.Execute("riscv32-esp-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm") + env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf]) diff --git a/pio-scripts/output_bins.py b/pio-scripts/output_bins.py index 2b047780..4df40ed4 100644 --- a/pio-scripts/output_bins.py +++ b/pio-scripts/output_bins.py @@ -25,6 +25,8 @@ def _create_dirs(dirs=["firmware", "map"]): def bin_rename_copy(source, target, env): _create_dirs() variant = env["PIOENV"] + builddir = os.path.join(env["PROJECT_BUILD_DIR"], variant) + source_map = os.path.join(builddir, env["PROGNAME"] + ".map") # create string with location and file names based on variant map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant) @@ -48,7 +50,11 @@ def bin_rename_copy(source, target, env): # copy firmware.map to map/.map if os.path.isfile("firmware.map"): - shutil.move("firmware.map", map_file) + print("Found linker mapfile firmware.map") + shutil.copy("firmware.map", map_file) + if os.path.isfile(source_map): + print(f"Found linker mapfile {source_map}") + shutil.copy(source_map, map_file) def bin_gzip(source, target, env): _create_dirs() diff --git a/platformio.ini b/platformio.ini index 2da68bd7..9471b484 100644 --- a/platformio.ini +++ b/platformio.ini @@ -74,7 +74,9 @@ default_envs = ; esp32_4MB_PSRAM_REV3_S ;; experimental, optimized for WROVER-E with "revision3" chip esp32S3_8MB_S ;; experimental, optimized for speed esp32S3_8MB_M - ;; esp32S3_8MB_PSRAM_M ;; experiemental + esp32S3_4MB_PSRAM_S ;; for lolin s3 mini, S3 zero, S3 super mini - optimized for speed + esp32S3_4MB_PSRAM_M ;; for lolin s3 mini, S3 zero, S3 super mini + esp32S3_8MB_PSRAM_M ;; experiemental ;; esp32s2_tinyUF2_PSRAM_S ;; experimental - only for adafruit -S2 boards with tinyUF2 bootloader !!! esp32s2_PSRAM_M ;; experimental esp32c3dev_4MB_M ;; experimental @@ -213,6 +215,7 @@ extra_scripts = post:pio-scripts/output_bins.py post:pio-scripts/strip-floats.py pre:pio-scripts/user_config_copy.py + ; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging) # ------------------------------------------------------------------------------ # COMMON SETTINGS: @@ -239,8 +242,8 @@ lib_deps = IRremoteESP8266 @ 2.8.2 ;;makuna/NeoPixelBus @ 2.7.5 ;; WLEDMM will be added in board specific sections ;;https://github.com/Aircoookie/ESPAsyncWebServer.git @ ~2.0.7 - https://github.com/lost-hope/ESPAsyncWebServer.git#master ;; WLEDMM to display .log and .wled files in /edit - ;; https://github.com/Aircoookie/ESPAsyncWebServer.git @ ^2.2.1 + ;; https://github.com/lost-hope/ESPAsyncWebServer.git#master ;; WLEDMM to display .log and .wled files in /edit + https://github.com/Aircoookie/ESPAsyncWebServer.git @ 2.2.1 ;; newer with bugfixes and stability improvements #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line #TFT_eSPI #For compatible OLED display uncomment following @@ -307,6 +310,12 @@ build_flags = -g default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv ;; WLED standard for 4MB flash: 1.4MB firmware, 1MB filesystem ;default_partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; WLEDMM alternative for 4MB flash: 1.8MB firmware, 256KB filesystem (esptool erase_flash needed before changing) +tiny_partitions = tools/WLED_ESP32_2MB_noOTA.csv +extended_partitions = tools/WLED_ESP32_4MB_700k_FS.csv +big_partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem, coredump support +large_partitions = tools/WLED_ESP32_8MB.csv +extreme_partitions = tools/WLED_ESP32_16MB_9MB_FS.csv + lib_deps = https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ;; WLEDMM this must be first in the list, otherwise Aircoookie/ESPAsyncWebServer pulls in an older version of AsyncTCP !! ; https://github.com/lorol/LITTLEFS.git @@ -315,6 +324,10 @@ lib_deps = makuna/NeoPixelBus @ 2.7.5 ${env.lib_deps} +;; Compatibility with upstream --> you should prefer using ${common_mm.build_flags_S} and ${common_mm.lib_deps_S} +AR_build_flags = ${common_mm.AR_build_flags} +AR_lib_deps = ${common_mm.AR_lib_deps} ;; optimized version, 10% faster on -S2/-C3 + ;; WLEDMM begin ;; ** For compiling with latest Frameworks (IDF4.4.x and arduino-esp32 v2.0.x) ** @@ -323,13 +336,12 @@ platformV4_pre = espressif32@5.2.0 platformV4_packages_pre = toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 ; required for platform version < 5.3.0, remove this line when upgrading to platform >=5.3.0 ;;; standard V4 platform -platformV4 = espressif32@5.3.0 -platformV4_packages = +platformV4 = espressif32@ ~6.3.2 +platformV4_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) -;;; experimental: latest V4 platform with latest arduino-esp32 2.0.9 + ESP-IDF 4.4.4 (may or may not work) -platformV4_xp = espressif32@ ~6.4.0 -platformV4_packages_xp = platformio/framework-arduinoespressif32 @ ~3.20009.0 ;; arduino-esp32 v2.0.9+ -;; platformV4_packages_xp = platformio/framework-arduinoespressif32 @ ~3.20011.0 ;; arduino-esp32 v2.0.11 (latest one supported in platformio) +;;; experimental: latest V4 platform with latest arduino-esp32 2.0.14 + ESP-IDF 4.4.6 (may or may not work) +platformV4_xp = espressif32@ ~6.5.0 +platformV4_packages_xp = platformio/framework-arduinoespressif32 @ 3.20014.231204 ;; arduino-esp32 2.0.14 build_flagsV4 = -g -DARDUINO_ARCH_ESP32 -DESP32 @@ -343,8 +355,8 @@ build_flagsV4 = -g lib_depsV4 = https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ;; WLEDMM this must be first in the list, otherwise Aircoookie/ESPAsyncWebServer pulls in an older version of AsyncTCP !! makuna/NeoPixelBus @ 2.7.5 + ${common_mm.HUB75_lib_deps} ${env.lib_deps} - https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git @ 3.0.10 ;; WLEDMM end @@ -355,8 +367,8 @@ lib_depsV4 = ;; ;; 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@5.3.0 -platform_packages = +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) build_flags = -g -Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one -DARDUINO_ARCH_ESP32 -DESP32 @@ -372,10 +384,13 @@ lib_deps = [esp32s2] ;; generic definitions for all ESP32-S2 boards -platform = espressif32@5.2.0 -platform_packages = - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 - toolchain-xtensa-esp32s2 @ 8.4.0+2021r2-patch5 +;; platform = espressif32@5.2.0 +;; platform_packages = +;; toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 +;; toolchain-xtensa-esp32s2 @ 8.4.0+2021r2-patch5 +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) + build_flags = -g -DARDUINO_ARCH_ESP32 -DESP32 ;; WLEDMM -DARDUINO_ARCH_ESP32S2 @@ -396,8 +411,8 @@ lib_deps = [esp32c3] ;; generic definitions for all ESP32-C3 boards -platform = espressif32@5.3.0 -platform_packages = +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) build_flags = -g -DARDUINO_ARCH_ESP32 -DESP32 ;; WLEDMM -DARDUINO_ARCH_ESP32C3 @@ -417,8 +432,8 @@ lib_deps = [esp32s3] ;; generic definitions for all ESP32-S3 boards -platform = espressif32@5.3.0 -platform_packages = +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) build_flags = -g -DESP32 -DARDUINO_ARCH_ESP32 @@ -431,7 +446,6 @@ build_flags = -g -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 - lib_deps = https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 makuna/NeoPixelBus @ 2.7.5 @@ -602,13 +616,30 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} #-D WLED_RELEASE_NAME -DARDUINO_USB_CDC_ON_BOOT=1 lib_deps = ${esp32s2.lib_deps} +;; WLEDMM: use WLEDMM build environments +;; [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} +;; build_unflags = ${common.build_unflags} +;; build_flags = ${common.build_flags_esp32_V4} -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 LEDPIN=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 = tools/WLED_ESP32_4MB_1MB_FS.csv +board_build.partitions = ${esp32.default_partitions} build_flags = ${common.build_flags} ${esp32c3.build_flags} -D WLED_RELEASE_NAME=ESP32-C3 -D WLED_WATCHDOG_TIMEOUT=0 -DLOLIN_WIFI_FIX ; seems to work much better with this @@ -631,7 +662,8 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -D WLED_RELEASE_NAME= ;-D ARDUINO_USB_CDC_ON_BOOT=1 ;; -D ARDUINO_USB_MODE=1 ;; for boards with USB-OTG connector only (USBCDC or "TinyUSB") ;-D WLED_DEBUG lib_deps = ${esp32s3.lib_deps} -board_build.partitions = tools/WLED_ESP32_8MB.csv + ${esp32.AR_lib_deps} +board_build.partitions = ${esp32.large_partitions} board_build.f_flash = 80000000L board_build.flash_mode = qio ; board_build.flash_mode = dio ;; try this if you have problems at startup @@ -652,7 +684,8 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} ; -D WLED_RELEASE_NAME=ESP32-S3_PSRAM -D WLED_USE_PSRAM -DBOARD_HAS_PSRAM ; tells WLED that PSRAM shall be used lib_deps = ${esp32s3.lib_deps} -board_build.partitions = tools/WLED_ESP32_8MB.csv + ${esp32.AR_lib_deps} +board_build.partitions = ${esp32.large_partitions} board_build.f_flash = 80000000L board_build.flash_mode = qio monitor_filters = esp32_exception_decoder @@ -735,8 +768,10 @@ lib_deps = ${esp8266.lib_deps} platform = ${esp32s2.platform} platform_packages = ${esp32s2.platform_packages} board = lolin_s2_mini -board_build.partitions = tools/WLED_ESP32_4MB_1MB_FS.csv +board_build.partitions = ${esp32.default_partitions} build_unflags = ${common.build_unflags} #-DARDUINO_USB_CDC_ON_BOOT=1 +;; board_build.flash_mode = qio +;; board_build.f_flash = 80000000L build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=ESP32-S2 -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT=1 # try disabling and enabling unflag above in case of board-specific issues, will disable Serial @@ -970,6 +1005,29 @@ build_disable_sync_interfaces = -D WLED_DISABLE_ADALIGHT ;; WLEDMM this board does not have a serial-to-USB chip. Better to disable serial protocols, to avoid crashes (see upstream #3128) -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only +AR_build_flags = -D USERMOD_AUDIOREACTIVE -D UM_AUDIOREACTIVE_USE_NEW_FFT ;; WLEDMM audioreactive usermod, licensed under GPLv3 +AR_lib_deps = https://github.com/softhack007/arduinoFFT.git#develop @ 1.9.2 ;; used for USERMOD_AUDIOREACTIVE - optimized version, 10% faster on -S2/-C3 + +animartrix_build_flags = -D USERMOD_ANIMARTRIX ;; WLEDMM usermod: CC BY-NC 3.0 licensed effects by Stefan Petrick +animartrix_lib_deps = https://github.com/netmindz/animartrix.git#18bf17389e57c69f11bc8d04ebe1d215422c7fb7 +animartrix_lib_ignore = animartrix ;; to remove the animartrix lib dependancy (saves a few bytes) + +DMXin_build_flags = -D WLED_ENABLE_DMX_INPUT ;; WLEDMM DMX physical input - requires ESP-IDF v4.4.x +DMXin_lib_deps = https://github.com/someweisguy/esp_dmx.git#47db25d ;; for DMX_INPUT +DMXin_lib_ignore = esp_dmx ;; to remove the esp-dmx lib dependancy (saves a few bytes) + +HUB75_build_flags = + -D WLED_ENABLE_HUB75MATRIX ;-D SPIRAM_FRAMEBUFFER ;; WLEDMM HUB75 support - requires ESP-IDF v4.4.x + -D NO_GFX ; Disable the use of Adafruit_GFX by the HUB75 driver +HUB75_lib_deps = https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git @ 3.0.10 +HUB75_lib_ignore = ESP32 HUB75 LED MATRIX PANEL DMA Display ;; to remove the HUB75 lib dependancy (saves a few bytes) + +NetDebug_build_flags = + ;; WLEDMM: only setting WLED_DEBUG_HOST is enough, ip and port can be defined in sync settings as well + -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible + -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + + build_flags_S = -Wall -Wformat -Woverflow -Wuninitialized -Winit-self -Warray-bounds ; enables more warnings -Wno-attributes -Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations ;disables some stupid warnings @@ -977,21 +1035,15 @@ build_flags_S = -D WLED_USE_MY_CONFIG ; -D WLED_DISABLE_2D ;; un-comment to build a firmware without 2D matrix support ; -D WLED_USE_CIE_BRIGHTNESS_TABLE ;; experimental: use different color / brightness lookup table - -D USERMOD_AUDIOREACTIVE + ${common_mm.AR_build_flags} ; use latest (upstream) FFTLib, instead of older library modified by blazoncek. Slightly faster, more accurate, needs 2KB RAM extra -D USERMOD_AUTO_PLAYLIST - -D UM_AUDIOREACTIVE_USE_NEW_FFT ; use latest (upstream) FFTLib, instead of older library modified by blazoncek. Slightly faster, more accurate, needs 2KB RAM extra ; -D USERMOD_ARTIFX ;; WLEDMM usermod - temporarily moved into "_M", due to problems in "_S" when compiling with -O2 -D WLEDMM_FASTPATH ;; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions. ; -D WLED_DEBUG_HEAP ;; WLEDMM enable heap debugging - ${common_mm.build_disable_sync_interfaces} lib_deps_S = ;; https://github.com/kosme/arduinoFFT#develop @ 1.9.2+sha.419d7b0 ;; used for USERMOD_AUDIOREACTIVE - using "known working" hash - https://github.com/softhack007/arduinoFFT.git#develop @ 1.9.2 ;; used for USERMOD_AUDIOREACTIVE - optimized version, 10% faster on -S2/-C3 - - -animartrix_build_flags = -D USERMOD_ANIMARTRIX ;; WLEDMM usermod: CC BY-NC 3.0 licensed effects by Stefan Petrick -animartrix_lib_deps = https://github.com/netmindz/animartrix.git#18bf17389e57c69f11bc8d04ebe1d215422c7fb7 + ${common_mm.AR_lib_deps} ;; used for USERMOD_AUDIOREACTIVE - optimized version, 10% faster on -S2/-C3 build_flags_M = -D USERMOD_ARTIFX ; WLEDMM usermod - temporarily moved into "_M", due to problems in "_S" when compiling with -O2 @@ -1004,9 +1056,7 @@ build_flags_M = -D USERMOD_ROTARY_ENCODER_UI -D USERMOD_AUTO_SAVE ${common_mm.animartrix_build_flags} - ;WLEDMM: only setting WLED_DEBUG_HOST is enough, ip and port can be defined in sync settings as well - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + ${common_mm.NetDebug_build_flags} lib_deps_M = ;https://github.com/blazoncek/OneWire.git ; includes bugfixes for inconsistent readings @@ -1021,6 +1071,7 @@ lib_deps_V4_M = ${common_mm.animartrix_lib_deps} build_flags_XL = + -D WLEDMM_SAVE_FLASH -D USERMOD_WEATHER ; WLEDMM usermod -D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG) -D USERMOD_GAMES ; WLEDMM usermod @@ -1066,7 +1117,7 @@ platform = ${esp32.platform} upload_speed = 460800 ; or 921600 platform_packages = ${esp32.platform_packages} build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags_esp32} ${common_mm.build_flags_S} +build_flags = ${common.build_flags_esp32} ${common_mm.build_flags_S} ${common_mm.build_disable_sync_interfaces} lib_deps = ${esp32.lib_deps} ${common_mm.lib_deps_S} board_build.partitions = ${esp32.default_partitions} board_build.f_flash = 80000000L ; use full 80MHz speed for flash (default = 40Mhz) @@ -1076,17 +1127,15 @@ monitor_filters = esp32_exception_decoder ;common default for all max environments [esp32_4MB_M_base] extends = esp32_4MB_S_base -build_flags = ${esp32_4MB_S_base.build_flags} ${common_mm.build_flags_M} -build_unflags = ${esp32_4MB_S_base.build_unflags} ${common_mm.build_disable_sync_interfaces} +build_flags = ${common.build_flags_esp32} ${common_mm.build_flags_S} ${common_mm.build_flags_M} ;; we don't want common_mm.build_disable_sync_interfaces, so we cannot inherit from esp32_4MB_S_base +build_unflags = ${esp32_4MB_S_base.build_unflags} lib_deps = ${esp32_4MB_S_base.lib_deps} ${common_mm.lib_deps_M} -; board_build.partitions = tools/WLED_ESP32-wrover_4MB.csv [esp32_4MB_XL_base] extends = esp32_4MB_M_base build_flags = ${esp32_4MB_M_base.build_flags} ${common_mm.build_flags_XL} -build_unflags = ${esp32_4MB_M_base.build_unflags} ${common_mm.build_disable_sync_interfaces} +build_unflags = ${esp32_4MB_M_base.build_unflags} lib_deps = ${esp32_4MB_M_base.lib_deps} ${common_mm.lib_deps_XL} -; board_build.partitions = tools/WLED_ESP32-wrover_4MB.csv ;common default for all V4 min environments, including -S3, -S2, -C3 [esp32_4MB_V4_S_base] @@ -1095,14 +1144,14 @@ upload_speed = 460800 ; or 921600 platform = ${esp32.platformV4} platform_packages = ${esp32.platformV4_packages} build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags} ${common_mm.build_flags_S} ;; do not include ${esp32.build_flagsV4} here !!!! +build_flags = ${common.build_flags} ${common_mm.build_flags_S} ${common_mm.build_disable_sync_interfaces} ;; do not include ${esp32.build_flagsV4} here !!!! -Wno-misleading-indentation -Wno-format-truncation -Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one ;-Wstack-usage=2732 ;; warn if a function needs more that 30% of availeable stack ("stack usage might be unbounded", "stack usage is 2824 bytes") ;-Wsuggest-attribute=const -Wsuggest-attribute=pure ;; ask compiler for hints on attributes - -D WLED_ENABLE_DMX_INPUT + ${common_mm.DMXin_build_flags} lib_deps = ${common_mm.lib_deps_S} ;; do not include ${esp32.lib_depsV4} here !!!! - https://github.com/someweisguy/esp_dmx.git#47db25d ;; for DMX_INPUT + ${common_mm.DMXin_lib_deps} esp32_build_flags = ${esp32.build_flagsV4} ${esp32_4MB_V4_S_base.build_flags} ;; this is for esp32 only, including specific "V4" flags esp32_lib_deps = ${esp32.lib_depsV4} ${esp32_4MB_V4_S_base.lib_deps} ;; this is for esp32 only, including specific "V4" flags board_build.partitions = ${esp32.default_partitions} @@ -1113,7 +1162,14 @@ board_build.flash_mode = dio ; (dio = dual i/o; more compatible than qio = quad [esp32_4MB_V4_M_base] extends = esp32_4MB_V4_S_base -build_flags = ${esp32_4MB_V4_S_base.build_flags} ${common_mm.build_flags_M} ;; generic, for all variants +build_flags = + ${common.build_flags} ${common_mm.build_flags_S} ;; do not include ${esp32.build_flagsV4} here !!!! + -Wno-misleading-indentation -Wno-format-truncation + -Wshadow=compatible-local ;; emit warning in case a local variable "shadows" another local one + ;-Wstack-usage=2732 ;; warn if a function needs more that 30% of availeable stack ("stack usage might be unbounded", "stack usage is 2824 bytes") + ;-Wsuggest-attribute=const -Wsuggest-attribute=pure ;; ask compiler for hints on attributes + -D WLED_ENABLE_DMX_INPUT + ${common_mm.build_flags_M} ;; generic, for all variants lib_deps = ${esp32_4MB_V4_S_base.lib_deps} ${common_mm.lib_deps_V4_M} esp32_build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} ${common_mm.build_flags_M} ;; for esp32 only, including specific "V4" flags esp32_lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} ${common_mm.lib_deps_V4_M} @@ -1185,22 +1241,22 @@ build_flags = ${esp32_4MB_S_base.build_flags} -D WLED_DISABLE_LOXONE ;-D WLED_DISABLE_MQTT ;-D WLED_DISABLE_INFRARED - ;WLEDMM: disable the next two lines if you don't need "net Debug". It will free ~2% of flash - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + -D WLEDMM_SAVE_FLASH + ;WLEDMM: disable the next line if you don't need "net Debug". It will free ~2% of flash + ${common_mm.NetDebug_build_flags} ;; normal build ; RAM: [=== ] 25.0% (used 81988 bytes from 327680 bytes) ; Flash: [========= ] 87.4% (used 1374677 bytes from 1572864 bytes) WLEDMM: Earlier 85.7 ;; optimized-for-speed build -; RAM: [=== ] 25.8% (used 84628 bytes from 327680 bytes) -; Flash: [==========] 99.4% (used 1562869 bytes from 1572864 bytes) +; RAM: [=== ] 25.4% (used 83244 bytes from 327680 bytes) +; Flash: [========= ] 93.3% (used 1466821 bytes from 1572864 bytes) [env:esp32_4MB_M] extends = esp32_4MB_M_base build_flags = ${esp32_4MB_M_base.build_flags} -D WLED_RELEASE_NAME=esp32_4MB_M -; RAM: [=== ] 25.2% (used 82628 bytes from 327680 bytes) -; Flash: [========= ] 94.3% (used 1483793 bytes from 1572864 bytes) WLEDMM: earlier 91.1 +; RAM: [=== ] 26.0% (used 85244 bytes from 327680 bytes) +; Flash: [==========] 97.4% (used 1532125 bytes from 1572864 bytes) [env:esp32_4MB_M_eth] extends = esp32_4MB_M_base @@ -1223,8 +1279,8 @@ build_flags = ${esp32_4MB_XL_base.build_flags} -D WLEDMM_SAVE_FLASH ;; a humble attempt to save a few extra bytes build_unflags = ${esp32_4MB_XL_base.build_unflags} board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv -; RAM: [=== ] 26.3% (used 86172 bytes from 327680 bytes) -; Flash: [========= ] 85.0% (used 1615569 bytes from 1900544 bytes) +; RAM: [=== ] 26.3% (used 86188 bytes from 327680 bytes) +; Flash: [========= ] 85.2% (used 1619513 bytes from 1900544 bytes) ;; standard framework build for 16MB flash, optimized for speed [env:esp32_16MB_S] @@ -1257,8 +1313,8 @@ build_flags = ${esp32_4MB_M_base.build_flags} board = esp32_16MB board_build.partitions = tools/WLED_ESP32_16MB.csv ;; WLED standard for 16MB flash: 2MB firmware, 12 MB filesystem ;board_build.partitions = tools/WLED_ESP32_16MB_9MB_FS.csv ;; WLED extended for 16MB flash: 3.2MB firmware, 9 MB filesystem - ; RAM: [== ] 24.4% (used 79916 bytes from 327680 bytes) - ; Flash: [======= ] 67.0% (used 1405701 bytes from 2097152 bytes) + ; RAM: [=== ] 26.0% (used 85244 bytes from 327680 bytes) + ; Flash: [======= ] 73.1% (used 1532125 bytes from 2097152 bytes) ;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation [env:esp32_4MB_M_debug] @@ -1311,8 +1367,8 @@ build_flags = ${esp32_4MB_M_base.build_flags} -D WLED_RELEASE_NAME=esp32_16MB_M_eth ; This will be included in the firmware.bin filename -D WLED_USE_ETHERNET -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only -; RAM: [== ] 24.5% (used 80348 bytes from 327680 bytes) -; Flash: [======= ] 69.4% (used 1455233 bytes from 2097152 bytes) +; RAM: [=== ] 26.1% (used 85452 bytes from 327680 bytes) +; Flash: [======= ] 73.3% (used 1537945 bytes from 2097152 bytes) [env:esp8266_2MB_S] @@ -1329,8 +1385,7 @@ build_flags = ${common.build_flags_esp8266} ;; -D WLED_DISABLE_INFRARED ;RAM 136 bytes; FLASH 24492 bytes ; -D WLED_DISABLE_2D ; -UWLED_USE_MY_CONFIG - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + ${common_mm.NetDebug_build_flags} ; -D WLED_DEBUG ; monitor_filters = esp8266_exception_decoder ;; lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation @@ -1351,8 +1406,7 @@ build_flags = ${common.build_flags_esp8266} ;; -D WLED_DISABLE_INFRARED ;RAM 136 bytes; FLASH 24492 bytes ; -D WLED_DISABLE_2D ; -UWLED_USE_MY_CONFIG - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + ${common_mm.NetDebug_build_flags} ; -D WLED_DEBUG ; monitor_filters = esp8266_exception_decoder ;; lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation @@ -1380,8 +1434,7 @@ build_flags = ${common.build_flags_esp8266} ; -D USERMOD_ARTIFX ; this is compiling but not working due to low memory on 8266 -D USERMOD_BATTERY ;; enable Battery usermod -D USERMOD_BATTERY_USE_LIPO ;; use new "discharging curve" for LiPo cells - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + ${common_mm.NetDebug_build_flags} ; -D WLED_DEBUG monitor_filters = esp8266_exception_decoder lib_deps = ${esp8266.lib_deps} @@ -1436,8 +1489,7 @@ build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_ALEXA -D WLED_DISABLE_HUESYNC ; -D WLED_DEBUG ${common.debug_flags} ;; un-comment for debug messages - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + ${common_mm.NetDebug_build_flags} ;; -D WLED_DISABLE_ESPNOW ;; might help in case of WiFi connectivity problems ; -D WLED_DISABLE_LOXONE ; FLASH 1272 bytes ; -D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes @@ -1477,8 +1529,7 @@ build_flags = ${common.build_flags_esp8266} -D USERMOD_FOUR_LINE_DISPLAY -D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG) -D USERMOD_GAMES ; WLEDMM usermod - -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible - -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 + ${common_mm.NetDebug_build_flags} ; -D WLED_DEBUG monitor_filters = esp8266_exception_decoder lib_deps = ${esp8266.lib_deps} @@ -1529,8 +1580,8 @@ build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation - ; RAM: [=== ] 27.7% (used 90664 bytes from 327680 bytes) - ; Flash: [==========] 95.1% (used 1495497 bytes from 1572864 bytes) + ; RAM: [=== ] 28.1% (used 91960 bytes from 327680 bytes) + ; Flash: [==========] 97.8% (used 1537777 bytes from 1572864 bytes) ; compiled with ESP-IDF 4.4.1 [env:esp32_4MB_V4_M] extends = esp32_4MB_V4_M_base @@ -1541,16 +1592,21 @@ build_flags = ${esp32_4MB_V4_M_base.esp32_build_flags} -D WLED_DISABLE_LOXONE ; FLASH 1272 bytes -D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes -D WLED_DISABLE_HUESYNC ;RAM 122 bytes; FLASH 6308 bytes - ;-D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes + -D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes ;; softhack007 disabled to stay below 100% flash size -D WLED_DISABLE_INFRARED ;RAM 136 bytes; FLASH 24492 bytes ;; softhack007 disabled to stay below 100% flash size + -D WLEDMM_SAVE_FLASH lib_deps = ${esp32_4MB_V4_M_base.esp32_lib_deps} lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation + ${common_mm.HUB75_lib_ignore} ;; over the flash size limit + ${common_mm.animartrix_lib_ignore} build_unflags = ${esp32_4MB_V4_M_base.build_unflags} -D USERMOD_ANIMARTRIX ;; Tips our memory usage over the limit + -D USERMOD_ARTIFX + -D USERMOD_AUTO_SAVE -D WLED_ENABLE_HUB75MATRIX -;; RAM: [=== ] 25.9% (used 84708 bytes from 327680 bytes) -;; Flash: [==========] 98.5% (used 1549033 bytes from 1572864 bytes) +;; RAM: [=== ] 28.0% (used 91664 bytes from 327680 bytes) +;; Flash: [==========] 99.5% (used 1564945 bytes from 1572864 bytes) ;; V4 build for 16MB flash, optimized for speed [env:esp32_16MB_V4_S] @@ -1621,13 +1677,14 @@ monitor_filters = esp32_exception_decoder extends = esp32_4MB_V4_S_base board = lolin_d32_pro ;board = esp32cam +build_unflags = ${esp32_4MB_V4_S_base.build_unflags} + -D WLED_ENABLE_HUB75MATRIX ;; uses too much flash build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} -D WLED_RELEASE_NAME=esp32_4MB_PSRAM_S -D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET -D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup -D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions. -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM ;; WLED_USE_PSRAM causes major slow-down (slow LEDs) on some ESP32 boards - ;; -DALL_JSON_TO_PSRAM ;; WLEDMM experimental --> try to force all JSON stuff into PSRAM; gives more free heap. -D WLED_DISABLE_LOXONE ; FLASH 1272 bytes -D WLED_DISABLE_HUESYNC ; RAM 122 bytes; FLASH 6308 bytes -D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes @@ -1639,8 +1696,8 @@ build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} ; -D MIC_LOGGER lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation -;; RAM: [== ] 24.3% (used 79524 bytes from 327680 bytes) -;; Flash: [========= ] 93.2% (used 1466389 bytes from 1572864 bytes) +;; RAM: [== ] 20.4% (used 66960 bytes from 327680 bytes) +;; Flash: [==========] 98.7% (used 1553129 bytes from 1572864 bytes) ;; similar to 4MB_PSRAM_S, but optimized for WROVER-E (chip revision >= 3) that doesn't need any workarounds for PSRAM any more ;; tl;dr: its faster on PSRAM. But it will not work on all boards. @@ -1654,6 +1711,7 @@ build_unflags = ${esp32_4MB_V4_S_base.build_unflags} -DARDUINO_EVENT_RUNNING_CORE=1 ;; we want to run wifi on core0, so remove the standard flag -mfix-esp32-psram-cache-issue ;; this fix is not needed any more for revision 3 -mfix-esp32-psram-cache-strategy=memw ;; same as above + -D WLED_ENABLE_HUB75MATRIX ;; uses too much flash build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} -DARDUINO_EVENT_RUNNING_CORE=0 ;; assign Wifi to core0, to have more CPU on core#1 (arduino loop) @@ -1662,7 +1720,6 @@ build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} ;;${Speed_Flags.build_flags} ;; optimize for speed instead of size --> over 100% flash, but works with 256KB filesystem (alternative partitions file) -D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions. -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM ;; WLED_USE_PSRAM causes major slow-down (slow LEDs) on some ESP32 boards - ;; -DALL_JSON_TO_PSRAM ;; WLEDMM experimental --> try to force all JSON stuff into PSRAM; gives more free heap. ;;-D CONFIG_ESP32_REV_MIN=3 ;; disables PSRAM bug workarounds in the core, reducing the code size and improving overall performance. -D WLED_RELEASE_NAME=esp32_4MB_PSRAM_REV3_S -D WLED_WATCHDOG_TIMEOUT=0 #-D WLED_DISABLE_BROWNOUT_DET @@ -1679,8 +1736,8 @@ build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} ; -D MIC_LOGGER lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation -;; RAM: [==== ] 35.9% (used 117688 bytes from 327680 bytes) -;; Flash: [========= ] 94.5% (used 1487097 bytes from 1572864 bytes) +;; RAM: [== ] 20.4% (used 66976 bytes from 327680 bytes) +;; Flash: [==========] 97.0% (used 1525833 bytes from 1572864 bytes) ;; PSRAM build env that only leaves 300Kb for filesystem (instead of 1MB), but adds 300kB for program space [env:esp32_4MB_PSRAM_M] @@ -1704,8 +1761,13 @@ build_flags = ${esp32_4MB_V4_M_base.esp32_build_flags} ; -D MIC_LOGGER lib_deps = ${esp32_4MB_V4_M_base.esp32_lib_deps} ;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation -;; RAM: [== ] 24.9% (used 81484 bytes from 327680 bytes) -;; Flash: [======== ] 84.6% (used 1607857 bytes from 1900544 bytes) +;; RAM: [== ] 20.7% (used 67672 bytes from 327680 bytes) +;; Flash: [========= ] 90.4% (used 1718421 bytes from 1900544 bytes) + + +# ------------------------------------------------------------------------------ +# esp32-S3 environments +# ------------------------------------------------------------------------------ [env:esp32S3_8MB_M] @@ -1840,6 +1902,82 @@ board_build.partitions = tools/WLED_ESP32_8MB.csv ; RAM: [=== ] 25.8% (used 84544 bytes from 327680 bytes) ; Flash: [======== ] 78.1% (used 1638737 bytes from 2097152 bytes) +;; MM for esp32-s3 zero/supermini and lolin S3 mini boards - fastpath, optimize for speed +[env:esp32S3_4MB_PSRAM_S] +extends = env:esp32S3_8MB_S +board = lolin_s3_mini ;; -S3 mini: 4MB flash 2MB PSRAM +board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv ;; 1.8MB firmware, 256KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions) +;; board_build.partitions = tools/WLED_ESP32_4MB_512KB_FS.csv ;; 1.7MB firmware, 500KB filesystem (esptool erase_flash needed when changing from "standard WLED" partitions) +build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation + ${common_mm.build_flags_S} + -D WLED_RELEASE_NAME=esp32S3_4MB_S + -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM + -DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1 ;; optional - allows some buffers to use PSRAM + -DLOLIN_WIFI_FIX -DWLEDMM_WIFI_POWERON_HACK ;; seems to work much better with this + -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Serial-to-USB chip + ;;-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Hardware-CDC USB mode + -D WLED_DISABLE_ADALIGHT ;; disables serial protocols - recommended for Hardware-CDC USB (Serial RX will receive junk commands when RX pin is unconnected, unless its pulled down by resistor) + ${Speed_Flags.build_flags} ;; optimize for speed instead of size + -D WLEDMM_FASTPATH ;; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions. + ${common_mm.animartrix_build_flags} + -D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0 + -D WLED_DISABLE_LOXONE ; FLASH 1272 bytes + -D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes + -D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes + -D WLED_DISABLE_HUESYNC ;RAM 122 bytes; FLASH 6308 bytes + -D WLED_DISABLE_INFRARED ;RAM 136 bytes; FLASH 24492 bytes + -D LEDPIN=21 + -D BTNPIN=-1 -D RLYPIN=-1 -D IRPIN=-1 + -D HW_PIN_SDA=12 -D HW_PIN_SCL=13 + -D AUDIOPIN=-1 + -D SR_DMTYPE=1 -D I2S_SDPIN=5 -D I2S_WSPIN=6 -D I2S_CKPIN=4 -D MCLK_PIN=7 + ; -D WLED_DEBUG + ; -D SR_DEBUG + ; -D MIC_LOGGER +lib_ignore = + IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation +; RAM: [== ] 20.4% (used 66908 bytes from 327680 bytes) +; Flash: [========= ] 87.1% (used 1655529 bytes from 1900544 bytes) + +;; MM for esp32-s3 zero/supermini and lolin S3 mini boards - standard +[env:esp32S3_4MB_PSRAM_M] +extends = env:esp32S3_8MB_M +board = lolin_s3_mini ;; -S3 mini: 4MB flash 2MB PSRAM +board_build.partitions = ${esp32.default_partitions} +build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation + ${common_mm.build_flags_S} ${common_mm.build_flags_M} + -D WLED_RELEASE_NAME=esp32S3_4MB_M + -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM + -DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1 ;; optional - allows some buffers to use PSRAM + -DLOLIN_WIFI_FIX -DWLEDMM_WIFI_POWERON_HACK ;; seems to work much better with this + -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Serial-to-USB chip + ;;-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 ;; for Hardware-CDC USB mode + -D WLED_DISABLE_ADALIGHT ;; disables serial protocols - recommended for Hardware-CDC USB (Serial RX will receive junk commands when RX pin is unconnected, unless its pulled down by resistor) + ${common_mm.animartrix_build_flags} + -D LEDPIN=21 + -D BTNPIN=-1 -D RLYPIN=-1 -D IRPIN=-1 -D AUDIOPIN=-1 + -D HW_PIN_SDA=12 -D HW_PIN_SCL=13 + -D SR_DMTYPE=1 -D I2S_SDPIN=5 -D I2S_WSPIN=6 -D I2S_CKPIN=4 -D MCLK_PIN=7 + -D WLED_DISABLE_LOXONE ; FLASH 1272 bytes - disabled to stay below 100% + -D WLED_DISABLE_HUESYNC ; RAM 122 bytes; FLASH 6308 bytes - disabled to stay below 100% + -D WLED_DISABLE_INFRARED ; RAM 136 bytes; FLASH 24492 bytes - disabled to stay below 100% + ;; -D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes + ;; -D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes + -D WLEDMM_SAVE_FLASH + ; -D WLED_DEBUG + ; -D SR_DEBUG + ; -D MIC_LOGGER +lib_deps = ${esp32s3.lib_deps} ${common_mm.lib_deps_S} ${common_mm.lib_deps_V4_M} +lib_ignore = + IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation +; RAM: [== ] 20.6% (used 67532 bytes from 327680 bytes) +; Flash: [==========] 98.4% (used 1547445 bytes from 1572864 bytes) + + +# ------------------------------------------------------------------------------ +# esp32-S2 environments +# ------------------------------------------------------------------------------ + ;; MM for Adafruit QT Py ESP32-S2 -> 4MB flash, PSRAM, and tinyUF2 bootloader ;; to ewowi - i'll optimize this entry later, as a few things can be inherited for sure. To softhack: sure ;-) @@ -1858,6 +1996,8 @@ build_unflags = ${common.build_unflags} -D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX) -D WLED_ENABLE_DMX_INPUT ;; needs more testing -DWLEDMM_FASTPATH ;; needs more testing on -S2 + -DUSERMOD_RTC + -D WLED_ENABLE_HUB75MATRIX build_flags = ${common.build_flags} ${esp32s2.build_flags} ; ${Debug_Flags.build_flags} ;ewowi: enabling debug causes Error: The program size (1463330 bytes) is greater than maximum allowed (1441792 bytes) @@ -1871,12 +2011,12 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 -D SERVERNAME='"WLED-S2"' -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM - -DALL_JSON_TO_PSRAM ;; WLEDMM experimental --> try to force all JSON stuff into PSRAM; gives more free heap. -D WLED_DISABLE_LOXONE ;; FLASH 1272 bytes -D WLED_DISABLE_HUESYNC ;; RAM 122 bytes; FLASH 6308 bytes -D WLED_DISABLE_ALEXA ;; RAM 116 bytes; FLASH 13524 bytes ; -D WLED_DISABLE_MQTT ;; RAM 216 bytes; FLASH 16496 bytes -D WLED_DISABLE_INFRARED ;; RAM 136 bytes; FLASH 24492 bytes + -D WLEDMM_SAVE_FLASH -D LEDPIN=39 ;; onboard neopixel LED. Attach your own LEDs to GPIO 7 or GPIO 6 -D BTNPIN=0 ;-D RLYPIN=6 @@ -1894,8 +2034,8 @@ lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE monitor_filters = esp32_exception_decoder -; RAM: [=== ] 33.0% (used 108276 bytes from 327680 bytes) -; Flash: [==========] 97.9% (used 1411114 bytes from 1441792 bytes) !!! 98% +; RAM: [== ] 21.5% (used 70448 bytes from 327680 bytes) +; Flash: [==========] 99.4% (used 1432846 bytes from 1441792 bytes) ;; MM environment for generic ESP32-S2, with PSRAM, 4MB flash (300kB filesystem to have more program space) ;; PINs assignments optimized for use with serg74 "mini shield" @@ -1915,6 +2055,7 @@ build_unflags = ${common.build_unflags} -D WLED_ENABLE_DMX ;; disabled because it does not work with ESP-IDF 4.4.x (buggy driver in SparkFunDMX) -D WLED_ENABLE_DMX_INPUT ;; needs more testing -DWLEDMM_FASTPATH ;; needs more testing on -S2 + -D WLED_ENABLE_HUB75MATRIX build_flags = ${common.build_flags} ${esp32s2.build_flags} ;; ${Debug_Flags.build_flags} -D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0 @@ -1922,7 +2063,6 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -Wno-misleading-indentation -Wno-format-truncation -D WLED_RELEASE_NAME=esp32s2_4MB_M -DBOARD_HAS_PSRAM -D WLED_USE_PSRAM_JSON ;; -D WLED_USE_PSRAM - ;; -DALL_JSON_TO_PSRAM ;; WLEDMM experimental --> try to force all JSON stuff into PSRAM; gives more free heap. -DLOLIN_WIFI_FIX -DWLEDMM_WIFI_POWERON_HACK ;; seems to work much better with this -DARDUINO_USB_CDC_ON_BOOT=0 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=1 -D WLED_DISABLE_ADALIGHT ;; disables serial protocols, as the board only has CDC USB @@ -1930,6 +2070,7 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_DISABLE_ALEXA ;; save flash space -D WLED_DISABLE_HUESYNC ;; save flash space -D WLED_DISABLE_LOXONE ;; save flash space + -D WLEDMM_SAVE_FLASH -D AUDIOPIN=-1 -D BTNPIN=-1 -D IRPIN=-1 -D LEDPIN=16 ;; second led pin = 18 @@ -1945,8 +2086,13 @@ lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE monitor_filters = esp32_exception_decoder -; RAM: [=== ] 29.7% (used 97376 bytes from 327680 bytes) -; Flash: [======== ] 81.4% (used 1547834 bytes from 1900544 bytes) +; RAM: [== ] 21.8% (used 71304 bytes from 327680 bytes) +; Flash: [======== ] 84.0% (used 1596970 bytes from 1900544 bytes) + + +# ------------------------------------------------------------------------------ +# esp32-C3 environments +# ------------------------------------------------------------------------------ ;; MM environment for generic ESP32-C3 -> 4MB flash, no PSRAM @@ -1986,6 +2132,7 @@ build_flags = ${common.build_flags} ${esp32c3.build_flags} -D WLEDMM_WIFI_POWERON_HACK -DLOLIN_WIFI_FIX ;; use this _only_ if your device is not able to make a WiFI connection! ;-D WLED_DISABLE_INFRARED ;; save flash space ;-D WLED_DISABLE_ALEXA ;; save flash space + -D WLEDMM_SAVE_FLASH -D LEDPIN=8 ;; onboard neopixel 5x5 Matrix. Attach your own LEDs to GPIO 20 -D BTNPIN=9 ; -D STATUSLED=10 ;; onboard LED @@ -1999,8 +2146,8 @@ lib_ignore = ;IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE U8g2 ; not needed as we don't include USERMOD_FOUR_LINE_DISPLAY -; RAM: [== ] 23.7% (used 77780 bytes from 327680 bytes) -; Flash: [========= ] 93.9% (used 1477456 bytes from 1572864 bytes) +; RAM: [=== ] 25.9% (used 84884 bytes from 327680 bytes) +; Flash: [==========] 98.9% (used 1555608 bytes from 1572864 bytes) ;; MM environment for ESP32-C3 "mini" and "super mini" -> flash mode "dio" instead of "qio" (see #101) [env:esp32c3mini_dio_4MB_M] @@ -2018,6 +2165,8 @@ build_flags = ${env:esp32c3dev_4MB_M.build_flags} -D WLED_DISABLE_BROWNOUT_DET ;; the board only has a 500mA LDO, better to disable brownout detection -D WLED_DISABLE_ADALIGHT ;; to disable serial protocols for boards with CDC USB (Serial RX will receive junk commands, unless its pulled down by resistor) -D HW_PIN_SDA=0 -D HW_PIN_SCL=1 ;; avoid pin conflicts +; RAM: [=== ] 25.8% (used 84700 bytes from 327680 bytes) +; Flash: [==========] 98.7% (used 1552582 bytes from 1572864 bytes) ;; MM environment for "seeed xiao -C3" boards [env:seeed_esp32c3_4MB_S] @@ -2029,6 +2178,7 @@ board_build.flash_mode = qio upload_speed = 460800 build_unflags = ${env:esp32c3dev_4MB_M.build_unflags} -DWLEDMM_FASTPATH ;; needs more testing on -C3 + -D WLED_ENABLE_HUB75MATRIX ;; not enough pins build_flags = ${common.build_flags} ${esp32c3.build_flags} -D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0 ${common_mm.build_flags_S} -Wno-misleading-indentation -Wno-format-truncation @@ -2048,21 +2198,24 @@ build_flags = ${common.build_flags} ${esp32c3.build_flags} -D WLED_USE_MY_CONFIG ;-D WLED_DEBUG -D SR_DEBUG lib_deps = ${esp32c3.lib_deps} ${common_mm.lib_deps_S} -;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation +lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation monitor_filters = esp32_exception_decoder -; RAM: [== ] 23.8% (used 77908 bytes from 327680 bytes) -; Flash: [========= ] 90.9% (used 1429302 bytes from 1572864 bytes) - +; RAM: [== ] 23.6% (used 77460 bytes from 327680 bytes) +; Flash: [========= ] 91.7% (used 1442092 bytes from 1572864 bytes) # ------------------------------------------------------------------------------ # custom board environments # ------------------------------------------------------------------------------ + +# ------------------------------------------------------------------------------ +# wemos shields +# ------------------------------------------------------------------------------ ;https://www.tindie.com/products/serg74/wled-shield-board-for-addressable-leds/ ;https://www.tindie.com/products/moonmodules/shield-board-for-esp32-for-wled-addressable-leds/ [wemos_shield_esp32_4MB_S_base] extends = esp32_4MB_S_base -build_flags = ${esp32_4MB_S_base.build_flags} +pinout_build_flags = -D ABL_MILLIAMPS_DEFAULT=9500 ; Wemos max 10A -D LEDPIN=16 -D RLYPIN=19 @@ -2077,10 +2230,11 @@ build_flags = ${esp32_4MB_S_base.build_flags} -D PIR_SENSOR_PIN=-1 -D PWM_PIN=-1 ; -D WLED_USE_MY_CONFIG +build_flags = ${esp32_4MB_S_base.build_flags} ${common_mm.build_disable_sync_interfaces} ${wemos_shield_esp32_4MB_S_base.pinout_build_flags} [wemos_shield_esp32_4MB_M_base] extends = wemos_shield_esp32_4MB_S_base -build_flags = ${wemos_shield_esp32_4MB_S_base.build_flags} ${common_mm.build_flags_M} +build_flags = ${esp32_4MB_M_base.build_flags} ${wemos_shield_esp32_4MB_S_base.pinout_build_flags} lib_deps = ${wemos_shield_esp32_4MB_S_base.lib_deps} ${common_mm.lib_deps_M} [wemos_shield_esp32_4MB_XL_base] @@ -2092,13 +2246,15 @@ lib_deps = ${wemos_shield_esp32_4MB_M_base.lib_deps} ${common_mm.lib_deps_XL} extends = wemos_shield_esp32_4MB_S_base build_flags = ${wemos_shield_esp32_4MB_S_base.build_flags} -D WLED_RELEASE_NAME=wemos_shield_esp32_4MB_S +; RAM: [=== ] 25.4% (used 83124 bytes from 327680 bytes) +; Flash: [======== ] 83.4% (used 1311629 bytes from 1572864 bytes) [env:wemos_shield_esp32_4MB_M] extends = wemos_shield_esp32_4MB_M_base build_flags = ${wemos_shield_esp32_4MB_M_base.build_flags} -D WLED_RELEASE_NAME=wemos_shield_esp32_4MB_M -; RAM: [== ] 24.4% (used 79820 bytes from 327680 bytes) -; Flash: [========= ] 88.6% (used 1393421 bytes from 1572864 bytes) +; RAM: [=== ] 26.0% (used 85252 bytes from 327680 bytes) +; Flash: [==========] 97.4% (used 1531865 bytes from 1572864 bytes) [env:wemos_shield_esp32_4MB_ICS4343x_M] extends = wemos_shield_esp32_4MB_M_base @@ -2186,16 +2342,22 @@ board = esp32_16MB board_build.partitions = tools/WLED_ESP32_16MB.csv ;; WLED standard for 16MB flash: 2MB firmware, 12 MB filesystem ;board_build.partitions = tools/WLED_ESP32_16MB_9MB_FS.csv ;; WLED extended for 16MB flash: 3.2MB firmware, 9 MB filesystem + +# ------------------------------------------------------------------------------ +# special boards and controlers +# ------------------------------------------------------------------------------ + ;https://www.athom.tech/blank-1/wled-esp32-music-addressable-led-strip-controller [env:athom_music_esp32_4MB_M] extends = esp32_4MB_M_base -build_flags = ${esp32_4MB_M_base.build_flags} ${Athom_PDMmic.build_flags} +build_flags = ${esp32_4MB_M_base.build_flags} + ${Athom_PDMmic.build_flags} -D WLED_AP_SSID_UNIQUE -D WLED_RELEASE_NAME=athom_music_esp32_4MB_M -D ABL_MILLIAMPS_DEFAULT=14500 ; max 15A -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE -D WLED_DISABLE_ADALIGHT ;to get 4ld working - -D BTNPIN=0 -D RLYPIN=2 -D IRPIN=25 -D IRTYPE=9 -D LEDPIN=18 -D + -D BTNPIN=0 -D RLYPIN=2 -D IRPIN=25 -D IRTYPE=9 -D LEDPIN=18 -D AUDIOPIN=-1 ; -D TEMPERATURE_PIN=23 -D FLD_PIN_SCL=-1 -D FLD_PIN_SDA=-1 ; use global! @@ -2205,6 +2367,8 @@ build_flags = ${esp32_4MB_M_base.build_flags} ${Athom_PDMmic.build_flags} ; -D PIR_SENSOR_PIN=-1 ; -D PWM_PIN=-1 ; -D WLED_USE_MY_CONFIG +; RAM: [=== ] 25.9% (used 84948 bytes from 327680 bytes) +; Flash: [==========] 95.9% (used 1509113 bytes from 1572864 bytes) ;https://shop.myhome-control.de/Elektronik/ [env:abc_wled_controller_v43_S] @@ -2224,6 +2388,8 @@ build_flags = ${esp32_4MB_S_base.build_flags} -D SR_DMTYPE=4 -D I2S_SDPIN=32 -D I2S_WSPIN=15 -D I2S_CKPIN=14 -D MCLK_PIN=0 ; generic i2s with mclk 0 -D SR_SQUELCH=1 -D SR_GAIN=60 ; increrase squelch if noise, in test 0 is okay, but only slightly -D SR_FREQ_PROF=1 ; Generic line in +; RAM: [=== ] 25.9% (used 84884 bytes from 327680 bytes) +; Flash: [========= ] 88.7% (used 1395249 bytes from 1572864 bytes) ; ESP32 WLED pico board with builtin ICS-43432 microphpone [env:esp32_pico_4MB_M] @@ -2257,19 +2423,18 @@ build_flags = ${esp32_4MB_M_base.build_flags} ; -D WLED_DISABLE_MQTT ; -D WLED_DISABLE_INFRARED ; -D WLED_ENABLE_DMX -; RAM: [== ] 24.4% (used 79812 bytes from 327680 bytes) -; Flash: [========= ] 90.4% (used 1422581 bytes from 1572864 bytes) - +; RAM: [=== ] 26.0% (used 85236 bytes from 327680 bytes) +; Flash: [==========] 97.1% (used 1527049 bytes from 1572864 bytes) ;; experimental -;; PICO environment with ESP-IDF v4.4.1 / arduino-esp32 v2.0.4 +;; PICO environment with ESP-IDF v4.4.4 / arduino-esp32 v2.0.9 [env:esp32_pico_4MB_V4_S] extends = esp32_4MB_V4_S_base board = pico32 -;platform = espressif32@~5.2.0 ;; alternative platform, might help in case you experience bootloops due to corrupted flash filesystem -;platform_packages = upload_speed = 256000 ;; or 115200 ;; or 460800 ; or 921600 (slower speeds are better when flashing without a soldered connection) +build_unflags = ${esp32_4MB_V4_S_base.build_unflags} + -D WLED_ENABLE_HUB75MATRIX ;; not enough pins build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} -D ARDUINO_USB_CDC_ON_BOOT=0 ; needed for arduino-esp32 >=2.0.4; avoids errors on startup -D WLED_RELEASE_NAME=esp32_pico_4MB_V4_S @@ -2277,13 +2442,8 @@ build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} -D SERVERNAME='"WLED-pico32-V4"' -D WLED_WATCHDOG_TIMEOUT=0 ; -D WLED_WATCHDOG_TIMEOUT=60 - ; -D WLEDMM_FASTPATH ; WLEDMM experimental option. Reduces audio lag (latency), and allows for faster LED framerates. May break compatibility with previous versions. -D WLED_DISABLE_ADALIGHT ;; WLEDMM this board does not have a serial-to-USB chip. Better to disable serial protocols, to avoid crashes (see upstream #3128) - ; -D WLED_DISABLE_LOXONE - ; -D WLED_DISABLE_ALEXA - ; -D WLED_DISABLE_HUESYNC - ; -D WLED_DISABLE_MQTT - ; -D WLED_DISABLE_INFRARED + ${common_mm.NetDebug_build_flags} ;; net debug is not included in normal _S builds ; -D WLED_DEBUG ; -D SR_DEBUG -D LEDPIN=2 @@ -2295,16 +2455,20 @@ build_flags = ${esp32_4MB_V4_S_base.esp32_build_flags} -D SR_ENABLE_DEFAULT ;; enable audioreactive at first start - no need to manually set "enable", then reboot ; -D WLED_USE_MY_CONFIG lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} -;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation -; RAM: [=== ] 25.4% (used 83144 bytes from 327680 bytes) -; Flash: [==========] 96.4% (used 1516029 bytes from 1572864 bytes) +lib_ignore = + IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation + ${common_mm.HUB75_lib_ignore} +; RAM: [=== ] 27.9% (used 91528 bytes from 327680 bytes) +; Flash: [==========] 96.7% (used 1521457 bytes from 1572864 bytes) ; [env:adafruit_matrixportal_esp32s3] -platform = espressif32 ; latest +extends = esp32_4MB_V4_M_base +platform = ${esp32.platformV4_xp} ;; 6.5.0 = first platform release supporting matrixportal +platform_packages = ${esp32.platformV4_packages_xp} ;; arduino-esp32 2.0.14 needed - previous versions were missing files for matrixportal board = adafruit_matrixportal_esp32s3 -extends = esp32_4MB_V4_S_base + build_unflags = ${env:esp32S3_8MB_M.build_unflags} ;; use the same as "normal" S3 buildenv build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-indentation -Wno-format-truncation ${common_mm.build_flags_S} @@ -2316,9 +2480,14 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-inden -D LOLIN_WIFI_FIX ;; try this in case Wifi does not work -D WLED_WATCHDOG_TIMEOUT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0 -D WLED_USE_PSRAM -DBOARD_HAS_PSRAM ; tells WLED that PSRAM shall be used - -D WLED_ENABLE_HUB75MATRIX -D NO_GFX ;-D SPIRAM_FRAMEBUFFER + ${common_mm.HUB75_build_flags} -D DEFAULT_LED_TYPE=101 -lib_deps = ${esp32_4MB_V4_S_base.esp32_lib_deps} - ${common_mm.animartrix_lib_deps} +lib_deps = ${esp32s3.lib_deps} ${common_mm.lib_deps_S} ;; ;; do not include ${esp32.lib_depsV4} !!!! + ${common_mm.animartrix_lib_deps} + ${common_mm.HUB75_lib_deps} + lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation monitor_filters = esp32_exception_decoder +; +; RAM: [== ] 20.4% (used 66984 bytes from 327680 bytes) +; Flash: [========= ] 94.8% (used 1491489 bytes from 1572864 bytes) diff --git a/tools/WLED_ESP32_4MB_512KB_FS.csv b/tools/WLED_ESP32_4MB_512KB_FS.csv new file mode 100644 index 00000000..5281a612 --- /dev/null +++ b/tools/WLED_ESP32_4MB_512KB_FS.csv @@ -0,0 +1,7 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x1B0000, +app1, app, ota_1, 0x1C0000,0x1B0000, +spiffs, data, spiffs, 0x370000,0x80000, +coredump, data, coredump,,64K \ No newline at end of file diff --git a/tools/WLED_ESP32_4MB_700k_FS.csv b/tools/WLED_ESP32_4MB_700k_FS.csv new file mode 100644 index 00000000..39c88e54 --- /dev/null +++ b/tools/WLED_ESP32_4MB_700k_FS.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x1A0000, +app1, app, ota_1, 0x1B0000,0x1A0000, +spiffs, data, spiffs, 0x350000,0xB0000, diff --git a/usermods/audioreactive/audio_reactive.h b/usermods/audioreactive/audio_reactive.h index 41aff83c..1af0d22f 100644 --- a/usermods/audioreactive/audio_reactive.h +++ b/usermods/audioreactive/audio_reactive.h @@ -617,6 +617,9 @@ void FFTcode(void * parameter) FFT.ComplexToMagnitude(); // Compute magnitudes #endif + float last_majorpeak = FFT_MajorPeak; + float last_magnitude = FFT_Magnitude; + #ifdef FFT_MAJORPEAK_HUMAN_EAR // scale FFT results for(uint_fast16_t binInd = 0; binInd < samplesFFT; binInd++) @@ -629,6 +632,9 @@ void FFTcode(void * parameter) FFT.MajorPeak(&FFT_MajorPeak, &FFT_Magnitude); // let the effects know which freq was most dominant #endif + if (FFT_MajorPeak < (SAMPLE_RATE / samplesFFT)) {FFT_MajorPeak = 1.0f; FFT_Magnitude = 0;} // too low - use zero + if (FFT_MajorPeak > (0.42f * SAMPLE_RATE)) {FFT_MajorPeak = last_majorpeak; FFT_Magnitude = last_magnitude;} // too high - keep last peak + #ifdef FFT_MAJORPEAK_HUMAN_EAR // undo scaling - we want unmodified values for FFTResult[] computations for(uint_fast16_t binInd = 0; binInd < samplesFFT; binInd++) @@ -1794,6 +1800,11 @@ class AudioReactive : public Usermod { #endif delay(100); // Give that poor microphone some time to setup. + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) + if ((i2sckPin == I2S_PIN_NO_CHANGE) && (i2ssdPin >= 0) && (i2swsPin >= 0) + && ((dmType == 1) || (dmType == 4)) ) dmType = 51; // dummy user support: SCK == -1 --means--> PDM microphone + #endif + useInputFilter = 2; // default: DC blocker switch (dmType) { #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3) diff --git a/usermods/audioreactive/audio_source.h b/usermods/audioreactive/audio_source.h index 8f552bbc..38a2ef72 100644 --- a/usermods/audioreactive/audio_source.h +++ b/usermods/audioreactive/audio_source.h @@ -186,8 +186,12 @@ class I2SSource : public AudioSource { .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_STAND_I2S), //.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, #ifdef WLEDMM_FASTPATH + #if CONFIG_IDF_TARGET_ESP32 && !defined(BOARD_HAS_PSRAM) // still need to test on boards with PSRAM + .intr_alloc_flags = ESP_INTR_FLAG_IRAM|ESP_INTR_FLAG_LEVEL2|ESP_INTR_FLAG_LEVEL3, // IRAM flag reduces missed samples + #else .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2|ESP_INTR_FLAG_LEVEL3, // seems to reduce noise - .dma_buf_count = 28, // 160ms buffer (128 * dma_buf_count / sampleRate) + #endif + .dma_buf_count = 24, // 140ms buffer (128 * dma_buf_count / sampleRate) #else .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2, .dma_buf_count = 8, diff --git a/usermods/usermod_v2_auto_playlist/usermod_v2_auto_playlist.h b/usermods/usermod_v2_auto_playlist/usermod_v2_auto_playlist.h index c15f116e..d08f295f 100644 --- a/usermods/usermod_v2_auto_playlist/usermod_v2_auto_playlist.h +++ b/usermods/usermod_v2_auto_playlist/usermod_v2_auto_playlist.h @@ -85,7 +85,8 @@ class AutoPlaylistUsermod : public Usermod { // gets called once at boot. Do all initialization that doesn't depend on // network here void setup() { - USER_PRINTLN("AutoPlaylistUsermod"); + USER_PRINT(F("AutoPlaylistUsermod startup; enabled = ")); + USER_PRINT(enabled ? F("true"):F("false")); USER_PRINTLN(F(".")); initDone = true; } diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h index cc6d7b29..89854571 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h @@ -488,7 +488,7 @@ void FourLineDisplayUsermod::draw2x2String(uint8_t col, uint8_t row, const char if (!typeOK || !enabled) return; if (u8x8 == nullptr) return; if (FLD_SemaphoreTake(drawMux, maxWait) != pdTRUE) return; // WLEDMM acquire draw mutex -#if defined(ARDUINO_ARCH_ESP32) && !defined(OLD_4LD_FONTS) // WLEDMM use nicer 2x2 font on ESP32 +#if defined(ARDUINO_ARCH_ESP32) && !defined(OLD_4LD_FONTS) && !defined(WLEDMM_SAVE_FLASH) // WLEDMM use nicer 2x2 font on ESP32 if (lineHeight>1) { // WLEDMM use 2x3 on 128x64 displays //u8x8->setFont(u8x8_font_profont29_2x3_r); // sans serif 2x3 u8x8->setFont(u8x8_font_courB18_2x3_r); // courier bold 2x3 diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 36a40afd..0565c0b2 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -1126,7 +1126,7 @@ static const char _data_FX_MODE_RUNNING_RANDOM[] PROGMEM = "Stream ☾@!,Zone si uint16_t larson_scanner(bool dual) { uint16_t counter = strip.now * ((SEGMENT.speed >> 2) +8); uint16_t index = counter * SEGLEN >> 16; - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() SEGMENT.fade_out(SEGMENT.intensity); @@ -1738,7 +1738,7 @@ uint16_t mode_multi_comet(void) { if (SEGENV.step == it) return FRAMETIME; if (!SEGENV.allocateData(sizeof(uint16_t) * 8)) return mode_static(); //allocation failed - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() SEGMENT.fade_out(SEGMENT.intensity); uint16_t* comets = reinterpret_cast(SEGENV.data); @@ -2096,7 +2096,7 @@ uint16_t mode_fire_2012() { const uint16_t strips = SEGMENT.nrOfVStrips(); if (!SEGENV.allocateData(strips * SEGLEN)) return mode_static(); //allocation failed byte* heat = SEGENV.data; - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() const uint32_t it = strip.now >> 5; //div 32 @@ -2529,7 +2529,7 @@ uint16_t ripple_base() uint16_t dataSize = sizeof(ripple) * maxRipples; if (!SEGENV.allocateData(dataSize)) return mode_static(); //allocation failed - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() Ripple* ripples = reinterpret_cast(SEGENV.data); @@ -3552,7 +3552,10 @@ uint16_t mode_exploding_fireworks(void) if (SEGLEN == 1) return mode_static(); const uint16_t cols = strip.isMatrix ? SEGMENT.virtualWidth() : 1; const uint16_t rows = strip.isMatrix ? SEGMENT.virtualHeight() : SEGMENT.virtualLength(); - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) { + SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + SEGMENT.fill(BLACK); + } //allocate segment data uint16_t maxData = FAIR_DATA_PER_SEG; //ESP8266: 256 ESP32: 640 @@ -4306,7 +4309,7 @@ static const char _data_FX_MODE_FLOW[] PROGMEM = "Flow@!,Zones;;!;;m12=1"; //ver uint16_t mode_chunchun(void) { if (SEGLEN == 1) return mode_static(); - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() SEGMENT.fade_out(254); // add a bit of trail uint16_t counter = strip.now * (6 + (SEGMENT.speed >> 4)); uint16_t numBirds = 2 + (SEGLEN >> 3); // 2 + 1/8 of a segment @@ -4822,7 +4825,7 @@ static const char _data_FX_MODE_AURORA[] PROGMEM = "Aurora@!,!;1,2,3;!;;sx=24,pa // Controls are speed, # of pixels, faderate. uint16_t mode_perlinmove(void) { if (SEGLEN == 1) return mode_static(); - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() SEGMENT.fade_out(255-SEGMENT.custom1); for (int i = 0; i < SEGMENT.intensity/16 + 1; i++) { uint16_t locn = inoise16(strip.now*128/(260-SEGMENT.speed)+i*15000, strip.now*128/(260-SEGMENT.speed)); // Get a new pixel location from moving noise. @@ -6055,7 +6058,7 @@ uint16_t mode_2Dghostrider(void) { const size_t maxLighters = min(cols + rows, LIGHTERS_AM); - if (SEGENV.call == 0) SEGMENT.setUpLeds(); + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} if (SEGENV.aux0 != cols || SEGENV.aux1 != rows) { SEGENV.aux0 = cols; SEGENV.aux1 = rows; @@ -6140,7 +6143,7 @@ uint16_t mode_2Dfloatingblobs(void) { if (!SEGENV.allocateData(sizeof(blob_t))) return mode_static(); //allocation failed blob_t *blob = reinterpret_cast(SEGENV.data); - if (SEGENV.call == 0) SEGMENT.setUpLeds(); + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} if (SEGENV.aux0 != cols || SEGENV.aux1 != rows) { SEGENV.aux0 = cols; // re-initialise if virtual size changes SEGENV.aux1 = rows; @@ -6408,6 +6411,7 @@ uint16_t mode_ripplepeak(void) { // * Ripple peak. By Andrew Tuli if (SEGENV.call == 0) { SEGMENT.setUpLeds(); + SEGMENT.fill(BLACK); SEGENV.aux0 = 255; SEGMENT.custom1 = *binNum; SEGMENT.custom2 = *maxVol * 2; @@ -6766,18 +6770,19 @@ uint16_t mode_juggles(void) { // Juggles. By Andrew Tuline. um_data = simulateSound(SEGMENT.soundSim); } float volumeSmth = *(float*) um_data->u_data[0]; - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() SEGMENT.fade_out(224); // 6.25% uint16_t my_sampleAgc = fmax(fmin(volumeSmth, 255.0), 0); for (size_t i=0; iu_data[0]; int16_t volumeRaw = *(int16_t*)um_data->u_data[1]; - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() //uint8_t fadeRate = map(SEGMENT.speed,0,255,224,255); uint8_t fadeRate = map(SEGMENT.speed,0,255,200,254); @@ -6977,7 +6982,7 @@ uint16_t mode_pixelwave(void) { // Pixelwave. By Andrew Tuline. return FRAMETIME; } // mode_pixelwave() -static const char _data_FX_MODE_PIXELWAVE[] PROGMEM = "Pixelwave@!,Sensitivity;!,!;!;1v;ix=64,m12=2,si=0"; // Arc, Beatsin +static const char _data_FX_MODE_PIXELWAVE[] PROGMEM = "Pixelwave@!,Sensitivity;!,!;!;01v;ix=64,m12=2,si=0"; // Arc, Beatsin ////////////////////// @@ -7023,7 +7028,7 @@ uint16_t mode_plasmoid(void) { // Plasmoid. By Andrew Tuline. return FRAMETIME; } // mode_plasmoid() -static const char _data_FX_MODE_PLASMOID[] PROGMEM = "Plasmoid@Phase,# of pixels;!,!;!;1v;sx=128,ix=80,pal=8,m12=0,si=0"; // Pixels, Beatsin, Lava Palette +static const char _data_FX_MODE_PLASMOID[] PROGMEM = "Plasmoid@Phase,# of pixels;!,!;!;01v;sx=128,ix=80,pal=8,m12=0,si=0"; // Pixels, Beatsin, Lava Palette /////////////////////// @@ -7122,7 +7127,7 @@ uint16_t mode_pixels(void) { // Pixels. By Andrew Tuline. um_data = simulateSound(SEGMENT.soundSim); } float volumeSmth = *(float*) um_data->u_data[0]; - if (SEGENV.call == 0) SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + if (SEGENV.call == 0) {SEGENV.setUpLeds(); SEGMENT.fill(BLACK);} // WLEDMM use lossless getPixelColor() myVals[strip.now%32] = volumeSmth; // filling values semi randomly @@ -7178,7 +7183,7 @@ uint16_t mode_blurz(void) { // Blurz. By Andrew Tuline. return FRAMETIME; } // mode_blurz() -static const char _data_FX_MODE_BLURZ[] PROGMEM = "Blurz@Fade rate,Blur;!,Color mix;!;1f;m12=0,si=0"; // Pixels, Beatsin +static const char _data_FX_MODE_BLURZ[] PROGMEM = "Blurz@Fade rate,Blur;!,Color mix;!;01f;m12=0,si=0"; // Pixels, Beatsin #else // original version from SR 0.13, with some enhancements by @softhack007 uint16_t mode_blurz(void) { // Blurz. By Andrew Tuline. @@ -7209,6 +7214,7 @@ uint16_t mode_blurz(void) { // Blurz. By Andrew Tuline. if ((SEGENV.aux1 < SEGLEN) && (volumeSmth > 1.0f)) SEGMENT.setPixelColor(SEGENV.aux1,SEGENV.step); // "repaint" last pixel after blur uint16_t segLoc = random16(SEGLEN); + if (SEGLEN < 2) segLoc = 0; // WLEDMM just to be sure unsigned pixColor = (2*fftResult[SEGENV.aux0%16]*240)/max(1, SEGLEN-1); // WLEDMM avoid uint8 overflow, and preserve pixel parameters for redraw unsigned pixIntensity = min((unsigned)(2.0f*fftResult[SEGENV.aux0%16]), 255U); @@ -7225,13 +7231,14 @@ uint16_t mode_blurz(void) { // Blurz. By Andrew Tuline. return FRAMETIME_FIXED; } // mode_blurz() -static const char _data_FX_MODE_BLURZ[] PROGMEM = "Blurz ☾@Fade rate,Blur;!,Color mix;!;1f;sx=48,ix=127,m12=0,si=0"; // Pixels, Beatsin +static const char _data_FX_MODE_BLURZ[] PROGMEM = "Blurz ☾@Fade rate,Blur;!,Color mix;!;01f;sx=48,ix=127,m12=0,si=0"; // Pixels, Beatsin #endif ///////////////////////// // ** DJLight // ///////////////////////// uint16_t mode_DJLight(void) { // Written by Stefan Petrick, Adapted by Will Tatam. + // No need to prevent from executing on single led strips, only mid will be set (mid = 0) const int mid = SEGLEN / 2; um_data_t *um_data; @@ -7287,13 +7294,14 @@ uint16_t mode_DJLight(void) { // Written by Stefan Petrick, Ad if (SEGENV.check1) fadeVal = constrain(fadeVal, 0, 176); // "candy factory" mode - avoid complete fade-out SEGMENT.setPixelColor(mid, color.fadeToBlackBy(fadeVal)); + // if SEGLEN equals 1 these loops won't execute for (int i = SEGLEN - 1; i > mid; i--) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i-1)); // move to the left for (int i = 0; i < mid; i++) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i+1)); // move to the right } return FRAMETIME; } // mode_DJLight() -static const char _data_FX_MODE_DJLIGHT[] PROGMEM = "DJ Light@Speed,,,,,Candy Factory;;;1f;m12=2,si=0"; // Arc, Beatsin +static const char _data_FX_MODE_DJLIGHT[] PROGMEM = "DJ Light@Speed,,,,,Candy Factory;;;01f;m12=2,si=0"; // Arc, Beatsin //////////////////// @@ -7347,6 +7355,7 @@ static const char _data_FX_MODE_FREQMAP[] PROGMEM = "Freqmap@Fade rate,Starting // ** Freqmatrix // /////////////////////// uint16_t mode_freqmatrix(void) { // Freqmatrix. By Andreas Pleschung. + // No need to prevent from executing on single led strips, we simply change pixel 0 each time and avoid the shift um_data_t *um_data; if (!usermods.getUMData(&um_data, USERMOD_ID_AUDIOREACTIVE)) { // add support for no audio @@ -7389,12 +7398,13 @@ uint16_t mode_freqmatrix(void) { // Freqmatrix. By Andreas Plesch // shift the pixels one pixel up SEGMENT.setPixelColor(0, color); + // if SEGLEN equals 1 this loop won't execute for (int i = SEGLEN - 1; i > 0; i--) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i-1)); //move to the left } return FRAMETIME; } // mode_freqmatrix() -static const char _data_FX_MODE_FREQMATRIX[] PROGMEM = "Freqmatrix@Speed,Sound effect,Low bin,High bin,Sensitivity;;;1f;c1=18,c2=48,c3=6,m12=3,si=0"; // Corner, Beatsin; notes range C3 to C7 +static const char _data_FX_MODE_FREQMATRIX[] PROGMEM = "Freqmatrix@Speed,Sound effect,Low bin,High bin,Sensitivity;;;01f;c1=18,c2=48,c3=6,m12=3,si=0"; // Corner, Beatsin; notes range C3 to C7 ////////////////////// @@ -7451,6 +7461,7 @@ static const char _data_FX_MODE_FREQPIXELS[] PROGMEM = "Freqpixels@Fade rate,Sta // As a compromise between speed and accuracy we are currently sampling with 10240Hz, from which we can then determine with a 512bin FFT our max frequency is 5120Hz. // Depending on the music stream you have you might find it useful to change the frequency mapping. uint16_t mode_freqwave(void) { // Freqwave. By Andreas Pleschung. With some enhancements by @softhack007 + // As before, this effect can also work on single pixels, we just lose the shifting effect um_data_t *um_data; if (!usermods.getUMData(&um_data, USERMOD_ID_AUDIOREACTIVE)) { // add support for no audio @@ -7506,13 +7517,14 @@ uint16_t mode_freqwave(void) { // Freqwave. By Andreas Pleschun SEGMENT.setPixelColor(SEGLEN/2, color); // shift the pixels one pixel outwards + // if SEGLEN equals 1 these loops won't execute for (int i = SEGLEN - 1; i > SEGLEN/2; i--) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i-1)); //move to the left for (int i = 0; i < SEGLEN/2; i++) SEGMENT.setPixelColor(i, SEGMENT.getPixelColor(i+1)); // move to the right } return FRAMETIME; } // mode_freqwave() -static const char _data_FX_MODE_FREQWAVE[] PROGMEM = "Freqwave@Speed,Sound effect,Low bin,High bin,Pre-amp,Musical Scale ☾;;;1f;c1=18,c2=48,m12=2,si=0"; // notes range C3 to C7, Arc, Beatsin +static const char _data_FX_MODE_FREQWAVE[] PROGMEM = "Freqwave@Speed,Sound effect,Low bin,High bin,Pre-amp,Musical Scale ☾;;;01f;c1=18,c2=48,m12=2,si=0"; // notes range C3 to C7, Arc, Beatsin /////////////////////// @@ -7585,8 +7597,8 @@ uint16_t mode_noisemove(void) { // Noisemove. By: Andrew Tuli uint8_t *fftResult = (uint8_t*)um_data->u_data[2]; if (SEGENV.call == 0) { - SEGMENT.fill(BLACK); SEGENV.setUpLeds(); // WLEDMM use lossless getPixelColor() + SEGMENT.fill(BLACK); } //SEGMENT.fade_out(224); // Just in case something doesn't get faded. int fadeoutDelay = (256 - SEGMENT.speed) / 96; @@ -7595,13 +7607,14 @@ uint16_t mode_noisemove(void) { // Noisemove. By: Andrew Tuli uint8_t numBins = map(SEGMENT.intensity,0,255,0,16); // Map slider to fftResult bins. for (int i=0; i> 2) +2)) & 0xFFFF; counter = counter >> 8; @@ -8049,7 +8065,8 @@ uint16_t mode_2Dsoap() { random16_set_seed(535); USER_PRINTF("SuperSync\n"); } - SEGMENT.setUpLeds(); + SEGENV.setUpLeds(); + SEGMENT.fill(BLACK); *noise32_x = random16(); *noise32_y = random16(); *noise32_z = random16(); diff --git a/wled00/alexa.cpp b/wled00/alexa.cpp index 179a522c..b02c10e5 100644 --- a/wled00/alexa.cpp +++ b/wled00/alexa.cpp @@ -139,4 +139,5 @@ void onAlexaChange(EspalexaDevice* dev) #else void alexaInit(){} void handleAlexa(){} + #pragma message "Alexa interface disabled" #endif diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 0fa3f1bd..76a5c9e1 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -313,7 +313,27 @@ void BusPwm::setPixelColor(uint16_t pix, uint32_t c) { //does no index check uint32_t BusPwm::getPixelColor(uint16_t pix) { if (!_valid) return 0; +#if 1 + // WLEDMM stick with the old code - we don't have cctICused return RGBW32(_data[0], _data[1], _data[2], _data[3]); +#else + // TODO getting the reverse from CCT is involved (a quick approximation when CCT blending is ste to 0 implemented) + switch (_type) { + case TYPE_ANALOG_1CH: //one channel (white), relies on auto white calculation + return RGBW32(0, 0, 0, _data[0]); + case TYPE_ANALOG_2CH: //warm white + cold white + if (cctICused) return RGBW32(0, 0, 0, _data[0]); + else return RGBW32(0, 0, 0, _data[0] + _data[1]); + case TYPE_ANALOG_5CH: //RGB + warm white + cold white + if (cctICused) return RGBW32(_data[0], _data[1], _data[2], _data[3]); + else return RGBW32(_data[0], _data[1], _data[2], _data[3] + _data[4]); + case TYPE_ANALOG_4CH: //RGBW + return RGBW32(_data[0], _data[1], _data[2], _data[3]); + case TYPE_ANALOG_3CH: //standard dumb RGB + return RGBW32(_data[0], _data[1], _data[2], 0); + } + return RGBW32(_data[0], _data[0], _data[0], _data[0]); +#endif } void BusPwm::show() { @@ -465,6 +485,7 @@ void BusNetwork::cleanup() { // *************************************************************************** #ifdef WLED_ENABLE_HUB75MATRIX +#warning "HUB75 driver enabled (experimental)" BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { @@ -713,12 +734,12 @@ uint32_t BusManager::memUsage(BusConfig &bc) { int BusManager::add(BusConfig &bc) { if (getNumBusses() - getNumVirtualBusses() >= WLED_MAX_BUSSES) return -1; - USER_PRINTF("BusManager::add(bc.type=%u)\n", bc.type); + DEBUG_PRINTF("BusManager::add(bc.type=%u)\n", bc.type); if (bc.type >= TYPE_NET_DDP_RGB && bc.type < 96) { busses[numBusses] = new BusNetwork(bc); #ifdef WLED_ENABLE_HUB75MATRIX } else if (bc.type >= TYPE_HUB75MATRIX && bc.type <= (TYPE_HUB75MATRIX + 10)) { - USER_PRINTLN("BusManager::add - Adding BusHub75Matrix"); + DEBUG_PRINTLN("BusManager::add - Adding BusHub75Matrix"); busses[numBusses] = new BusHub75Matrix(bc); #endif } else if (IS_DIGITAL(bc.type)) { diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index ada486d5..327da0ad 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -389,6 +389,13 @@ class PolyBus { } }; static void* create(uint8_t busType, uint8_t* pins, uint16_t len, uint8_t channel, uint16_t clock_kHz = 0U) { + #if defined(ARDUINO_ARCH_ESP32) && !(defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)) + #if defined(WLEDMM_FASTPATH) && !defined(WLEDMM_SLOWPATH) // WLEDMM only for fastpath builds + // NOTE: "channel" is only used on ESP32 (and its variants) for RMT channel allocation + // since 0.15.0-b3 I2S1 is favoured for classic ESP32 and moved to position 0 (channel 0) so we need to subtract 1 for correct RMT allocation + if (channel > 0) channel--; // accommodate I2S1 which is used as 1st bus on classic ESP32 + #endif + #endif void* busPtr = nullptr; switch (busType) { case I_NONE: break; @@ -1192,8 +1199,8 @@ class PolyBus { if (num > 7) return I_NONE; #else if (num > 8) return I_NONE; - if (num == 1) offset = 2; // use I2S#1 as 2nd bus - seems to be a good compromise for performance, and reduces flickering for some users - // if (num == 0) offset = 2; // un-comment to use I2S#1 as 1st bus - sometimes helps, if you experience flickering during Wifi or filesystem activity. + //if (num == 1) offset = 2; // use I2S#1 as 2nd bus - seems to be a good compromise for performance, and reduces flickering for some users + if (num == 0) offset = 2; // un-comment to use I2S#1 as 1st bus - sometimes helps, if you experience flickering during Wifi or filesystem activity. #endif #endif #endif diff --git a/wled00/const.h b/wled00/const.h index 14f419c2..8f690ac9 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -351,6 +351,7 @@ #define ERR_LOW_MEM 33 // WLEDMM: low memory (RAM) #define ERR_LOW_SEG_MEM 34 // WLEDMM: low memory (segment data RAM) #define ERR_LOW_WS_MEM 35 // WLEDMM: low memory (ws) +#define ERR_LOW_AJAX_MEM 36 // WLEDMM: low memory (oappend) // Timer mode types #define NL_MODE_SET 0 //After nightlight time elapsed, set to target brightness diff --git a/wled00/data/index.js b/wled00/data/index.js index 2a4b51ba..4744fb38 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -680,6 +680,7 @@ function populateInfo(i) if (i.ver.includes("0.14.0-b2")) vcn = "This is the way"; // recently watched The Mandalorian? I have spoken ;-) if (i.ver.includes("0.14.0-b15.22")) vcn = "Lupo"; if (i.ver.includes("0.14.1-b3")) vcn = "Fried Chicken"; // final line of "One Vision" by Queen + if (i.ver.includes("0.14.3-b")) vcn = "Fried Chicken"; cn += `v${i.ver}  "${vcn}"

(WLEDMM_${i.ver} ${i.rel}.bin)

build ${i.vid}

${urows} ${urows===""?'':''} @@ -690,24 +691,22 @@ ${inforow("Build",i.vid)} ${inforow("Estimated current",pwru)} ${inforow("Average FPS",i.leds.fps)} ${inforow("Signal strength",i.wifi.signal +"% ("+ i.wifi.rssi, " dBm)")} +${inforow("MAC address",i.mac)} ${inforow("Uptime",getRuntimeStr(i.uptime))} + +${inforow("Filesystem",i.fs.u + "/" + i.fs.t + " kB, " +Math.round(i.fs.u*100/i.fs.t) + "%")} +${theap>0?inforow("Heap ☾",((i.totalheap-i.freeheap)/1000).toFixed(0)+"/"+theap.toFixed(0)+" kB",", "+Math.round((i.totalheap-i.freeheap)/(10*theap))+"%"):inforow("Free heap",heap," kB")} +${i.minfreeheap?inforow("Max used heap ☾",((i.totalheap-i.minfreeheap)/1000).toFixed(0)+" kB",", "+Math.round((i.totalheap-i.minfreeheap)/(10*theap))+"%"):""} +${i.psram?inforow("PSRAM ☾",((i.tpram-i.psram)/1024).toFixed(0)+"/"+(i.tpram/1024).toFixed(0)+" kB",", "+((i.tpram-i.psram)*100.0/i.tpram).toFixed(1)+"%"):""} +${i.psusedram?inforow("Max used PSRAM ☾",((i.tpram-i.psusedram)/1024).toFixed(0)+" kB",", "+((i.tpram-i.psusedram)*100.0/i.tpram).toFixed(1)+"%"):""} +${i.freestack?inforow("Free stack ☾",(i.freestack/1000).toFixed(3)," kB"):""} -${inforow("Filesystem",i.fs.u + "/" + i.fs.t + " kB (" +Math.round(i.fs.u*100/i.fs.t) + "%)")} -${theap>0?inforow("Heap ☾",((i.totalheap-i.freeheap)/1000).toFixed(0)+"/"+theap.toFixed(0)+" kB"," ("+Math.round((i.totalheap-i.freeheap)/(10*theap))+"%)"):""} -${i.minfreeheap?inforow("Max used heap ☾",((i.totalheap-i.minfreeheap)/1000).toFixed(1)+" kB"," ("+Math.round((i.totalheap-i.minfreeheap)/(10*theap))+"%)"):""} -${inforow("Free heap",heap," kB")} -${i.freestack?inforow("Free stack ☾",(i.freestack/1024).toFixed(3)," kB"):""} -${inforow("Flash Size ☾",flashsize," kB")} -${i.tpram?inforow("PSRAM ☾",(i.tpram/1024).toFixed(1)," kB"):""} -${i.psram?((i.tpram-i.psram)>16383?inforow("Used PSRAM ☾",((i.tpram-i.psram)/1024).toFixed(1)," kB"):inforow("Used PSRAM ☾",(i.tpram-i.psram)," B")):""} -${i.psusedram?((i.tpram-i.psusedram)>16383?inforow("Max used PSRAM ☾",((i.tpram-i.psusedram)/1024).toFixed(1)," kB"):inforow("Max used PSRAM ☾",(i.tpram-i.psusedram)," B")):""} -${i.psram?inforow("Free PSRAM",(i.psram/1024).toFixed(1)," kB"):""} -${inforow("MAC address",i.mac)} +${i.tpram?inforow("PSRAM " + (i.psrmode?"("+i.psrmode+" mode) ":"") + " ☾",(i.tpram/1024/1024).toFixed(0)," MB"):""} +${i.e32flash?inforow("Flash mode "+i.e32flashmode+i.e32flashtext + " ☾",i.e32flash+" MB, "+i.e32flashspeed," Mhz"):""} +${i.e32model?inforow(i.e32model + " ☾",i.e32cores +" core(s),"," "+i.e32speed+" Mhz"):""} ${inforow("Environment",i.arch + " " + i.core + " (" + i.lwip + ")")} -${i.e32model?inforow(i.e32model + " ☾",i.e32cores +" core(s)"," "+i.e32speed+" Mhz"):""} -${i.e32flash?inforow("Flash "+i.e32flash+"MB"+" mode "+i.e32flashmode+i.e32flashtext + " ☾",i.e32flashspeed," Mhz"):""} ${i.e32code?inforow("Last ESP Restart ☾",i.e32code+" "+i.e32text):""} ${i.e32core0code?inforow("Core0 rst reason ☾",i.e32core0code, " "+i.e32core0text):""} ${i.e32core1code?inforow("Core1 rst reason ☾",i.e32core1code, " "+i.e32core1text):""} @@ -1976,6 +1975,9 @@ function readState(s,command=false) case 35: errstr = "Low Memory (WS data)."; break; + case 36: + errstr = "Low Memory (oappend buffer)."; + break; } showToast('Error ' + s.error + ": " + errstr, true); } diff --git a/wled00/dmx_input.cpp b/wled00/dmx_input.cpp index af0bb679..77ebc859 100644 --- a/wled00/dmx_input.cpp +++ b/wled00/dmx_input.cpp @@ -1,6 +1,7 @@ #include "wled.h" #ifdef WLED_ENABLE_DMX_INPUT +#pragma message "DMX physical input driver enabled" #ifdef ESP8266 #error DMX input is only supported on ESP32 diff --git a/wled00/dmx_output.cpp b/wled00/dmx_output.cpp index aa01c8a3..b3f2eadd 100644 --- a/wled00/dmx_output.cpp +++ b/wled00/dmx_output.cpp @@ -11,6 +11,7 @@ */ #ifdef WLED_ENABLE_DMX +#pragma message "DMX network output enabled" // WLEDMM: seems that DMX output triggers watchdog resets when compiling for IDF 4.4.x #ifdef ARDUINO_ARCH_ESP32 diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index ff44bbd9..38a18b09 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -93,6 +93,7 @@ bool readObjectFromFileUsingId(const char* file, uint16_t id, JsonDocument* dest bool readObjectFromFile(const char* file, const char* key, JsonDocument* dest); void updateFSInfo(); void closeFile(); +void invalidateFileNameCache(); // WLEDMM call when new files were uploaded //hue.cpp void handleHue(); diff --git a/wled00/file.cpp b/wled00/file.cpp index bf7c1a7a..4e23d5ca 100644 --- a/wled00/file.cpp +++ b/wled00/file.cpp @@ -35,6 +35,14 @@ static File f; // don't export to other cpp files //wrapper to find out how long closing takes void closeFile() { + #ifdef ARDUINO_ARCH_ESP32 + // WLEDMM: file.close() triggers flash writing. While flash is writing, the NPB RMT driver cannot fill its buffer which may create glitches. + unsigned long t_wait = millis(); + while(strip.isUpdating() && (millis() - t_wait < 72)) delay(1); // WLEDMM try to catch a moment when strip is idle + while(strip.isUpdating() && (millis() - t_wait < 96)) delay(0); // try harder + //if (strip.isUpdating()) USER_PRINTLN("closeFile: strip still updating."); + delay(2); // might help + #endif #ifdef WLED_DEBUG_FS DEBUGFS_PRINT(F("Close -> ")); uint32_t s = millis(); @@ -399,19 +407,122 @@ static String getContentType(AsyncWebServerRequest* request, String filename){ return "text/plain"; } +#if defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON)) +// caching presets in PSRAM may prevent occasional flashes seen when HomeAssistant polls WLED +// original idea by @akaricchi (https://github.com/Akaricchi) +// returns a pointer to the PSRAM buffer, updates size parameter +static const uint8_t *getPresetCache(size_t &size) { + static unsigned long presetsCachedTime = 0; + static uint8_t *presetsCached = nullptr; + static size_t presetsCachedSize = 0; + static byte presetsCachedValidate = 0; + + if (!psramFound()) { + size = 0; + return nullptr; + } + + //if (presetsModifiedTime != presetsCachedTime) DEBUG_PRINTLN(F("getPresetCache(): presetsModifiedTime changed.")); + //if (presetsCachedValidate != cacheInvalidate) DEBUG_PRINTLN(F("getPresetCache(): cacheInvalidate changed.")); + + if ((presetsModifiedTime != presetsCachedTime) || (presetsCachedValidate != cacheInvalidate)) { + if (presetsCached) { + free(presetsCached); + presetsCached = nullptr; + } + } + + if (!presetsCached) { + File file = WLED_FS.open("/presets.json", "r"); + if (file) { + presetsCachedTime = presetsModifiedTime; + presetsCachedValidate = cacheInvalidate; + presetsCachedSize = 0; + presetsCached = (uint8_t*)ps_malloc(file.size() + 1); + if (presetsCached) { + presetsCachedSize = file.size(); + file.read(presetsCached, presetsCachedSize); + presetsCached[presetsCachedSize] = 0; + file.close(); + //USER_PRINTLN(F("getPresetCache(): /presets.json cached in PSRAM.")); + } + } + } else { + //USER_PRINTLN(F("getPresetCache(): /presets.json served from PSRAM.")); + } + + size = presetsCachedSize; + return presetsCached; +} +#endif + +// WLEDMM +static bool haveLedmapFile = true; +static bool haveIndexFile = true; +static bool haveSkinFile = true; +static bool haveICOFile = true; +static bool haveCpalFile = true; +void invalidateFileNameCache() { // reset "file not found" cache + haveLedmapFile = true; + haveIndexFile = true; + haveSkinFile = true; + haveICOFile = true; + haveCpalFile = true; + + #if defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON)) + // WLEDMM hack to clear presets.json cache + size_t dummy; + unsigned long realpresetsTime = presetsModifiedTime; + presetsModifiedTime = toki.second(); // pretend we have changes + (void) getPresetCache(dummy); // clear presets.json cache + presetsModifiedTime = realpresetsTime; // restore correct value +#endif + //USER_PRINTLN("WS FileRead cache cleared"); +} + bool handleFileRead(AsyncWebServerRequest* request, String path){ DEBUG_PRINTLN("WS FileRead: " + path); if(path.endsWith("/")) path += "index.htm"; if(path.indexOf("sec") > -1) return false; + + // WLEDMM shortcuts + if ((haveLedmapFile == false) && path.equals("/ledmap.json")) return false; + if ((haveIndexFile == false) && path.equals("/index.htm")) return false; + if ((haveSkinFile == false) && path.equals("/skin.css")) return false; + if ((haveICOFile == false) && path.equals("/favicon.ico")) return false; + if ((haveCpalFile == false) && path.equals("/cpal.htm")) return false; + // WLEDMM toDO: add file caching (PSRAM) for /presets.json an /cfg.json + String contentType = getContentType(request, path); /*String pathWithGz = path + ".gz"; if(WLED_FS.exists(pathWithGz)){ request->send(WLED_FS, pathWithGz, contentType); return true; }*/ - if(WLED_FS.exists(path)) { - request->send(WLED_FS, path, contentType); + + #if defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON)) + if (path.endsWith("/presets.json")) { + size_t psize; + const uint8_t *presets = getPresetCache(psize); + if (presets) { + AsyncWebServerResponse *response = request->beginResponse_P(200, contentType, presets, psize); + request->send(response); + return true; + } + } + #endif + + if(WLED_FS.exists(path) || WLED_FS.exists(path + ".gz")) { + request->send(WLED_FS, path, String(), request->hasArg(F("download"))); return true; } + //USER_PRINTLN("WS FileRead failed: " + path + " (" + contentType + ")"); + + // WLEDMM cache "file not found" results (reduces LED flickering during UI activities) + if (path.equals("/ledmap.json")) haveLedmapFile = false; + if (path.equals("/index.htm")) haveIndexFile = false; + if (path.equals("/skin.css")) haveSkinFile = false; + if (path.equals("/favicon.ico")) haveICOFile = false; + if (path.equals("/cpal.htm")) haveCpalFile = false; return false; } diff --git a/wled00/hue.cpp b/wled00/hue.cpp index 950c5489..54cddd33 100644 --- a/wled00/hue.cpp +++ b/wled00/hue.cpp @@ -205,4 +205,5 @@ void onHueData(void* arg, AsyncClient* client, void *data, size_t len) #else void handleHue(){} void reconnectHue(){} +#pragma message "Philips HUE bridge interface disabled" #endif diff --git a/wled00/improv.cpp b/wled00/improv.cpp index af30065d..646201d3 100644 --- a/wled00/improv.cpp +++ b/wled00/improv.cpp @@ -210,7 +210,7 @@ void sendImprovInfoResponse() { //Use serverDescription if it has been changed from the default "WLED", else mDNS name bool useMdnsName = (strcmp(serverDescription, "WLED") == 0 && strlen(cmDNS) > 0); char vString[32]; - snprintf_P(vString, sizeof(vString)-1, PSTR("0.14.1-b30.37/%i"),VERSION); + snprintf_P(vString, sizeof(vString)-1, PSTR("0.14.1-b31.38/%i"),VERSION); const char *str[4] = {"WLED", vString, bString, useMdnsName ? cmDNS : serverDescription}; sendImprovRPCResult(ImprovRPCType::Request_Info, 4, str); diff --git a/wled00/ir.cpp b/wled00/ir.cpp index c3e12544..bfb79264 100644 --- a/wled00/ir.cpp +++ b/wled00/ir.cpp @@ -7,6 +7,7 @@ */ #if defined(WLED_DISABLE_INFRARED) +#pragma message "IR remote support disabled" void handleIR(){} #else diff --git a/wled00/json.cpp b/wled00/json.cpp index 8bd9cd2d..c03a61f0 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -597,6 +597,8 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId) } } + doAdvancePlaylist = root[F("np")] | doAdvancePlaylist; //advances to next preset in playlist when true + stateUpdated(callMode); if (presetToRestore) currentPreset = presetToRestore; @@ -1032,6 +1034,14 @@ void serializeInfo(JsonObject root) if(ESP.getChipCores() > 1) // WLEDMM root[F("resetReason1")] = (int)rtc_get_reset_reason(1); #endif + + #if defined(ARDUINO_ARCH_ESP32) + unsigned long t_wait = millis(); + while(strip.isUpdating() && (millis() - t_wait < 125)) delay(1); // WLEDMM try to catch a moment when strip is idle + while(strip.isUpdating() && (millis() - t_wait < 160)) yield(); // try harder + //if (strip.isUpdating()) USER_PRINTLN("serializeInfo: strip still updating."); + #endif + root[F("lwip")] = 0; //deprecated root[F("totalheap")] = ESP.getHeapSize(); //WLEDMM #else @@ -1056,6 +1066,13 @@ void serializeInfo(JsonObject root) root[F("tpram")] = ESP.getPsramSize(); //WLEDMM root[F("psram")] = ESP.getFreePsram(); root[F("psusedram")] = ESP.getMinFreePsram(); + #if CONFIG_ESP32S3_SPIRAM_SUPPORT // WLEDMM -S3 has "qspi" or "opi" PSRAM mode + #if CONFIG_SPIRAM_MODE_OCT + root[F("psrmode")] = F("🚀 OPI"); + #elif CONFIG_SPIRAM_MODE_QUAD + root[F("psrmode")] = F("qspi 🛻"); + #endif + #endif } #else // for testing @@ -1521,6 +1538,8 @@ void serveJson(AsyncWebServerRequest* request) #ifdef WLED_ENABLE_JSONLIVE #define MAX_LIVE_LEDS 180 +#warning "JSON Live enabled" + bool serveLiveLeds(AsyncWebServerRequest* request, uint32_t wsClient) { #ifdef WLED_ENABLE_WEBSOCKETS diff --git a/wled00/lx_parser.cpp b/wled00/lx_parser.cpp index e717f941..5fe7c18c 100644 --- a/wled00/lx_parser.cpp +++ b/wled00/lx_parser.cpp @@ -68,4 +68,6 @@ void parseLxJson(int lxValue, byte segId, bool secondary) } } +#else +#pragma message "Loxone support disabled" #endif diff --git a/wled00/mqtt.cpp b/wled00/mqtt.cpp index a5caaf47..31162148 100644 --- a/wled00/mqtt.cpp +++ b/wled00/mqtt.cpp @@ -195,4 +195,6 @@ bool initMqtt() mqtt->connect(); return true; } +#else +#pragma message "MQTT disabled" #endif diff --git a/wled00/net_debug.cpp b/wled00/net_debug.cpp index a345dd30..43c47ac1 100644 --- a/wled00/net_debug.cpp +++ b/wled00/net_debug.cpp @@ -26,4 +26,6 @@ size_t NetworkDebugPrinter::write(const uint8_t *buf, size_t size) { NetworkDebugPrinter NetDebug; +#else +#pragma message "Net debug disabled" #endif diff --git a/wled00/network.cpp b/wled00/network.cpp index 6c94c447..1e414d81 100644 --- a/wled00/network.cpp +++ b/wled00/network.cpp @@ -4,6 +4,8 @@ #ifdef WLED_USE_ETHERNET +#pragma message "Ethernet support enabled" + // The following six pins are neither configurable nor // can they be re-assigned through IOMUX / GPIO matrix. // See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit-v1.1.html#ip101gri-phy-interface diff --git a/wled00/playlist.cpp b/wled00/playlist.cpp index 236cc324..1d6f7a99 100644 --- a/wled00/playlist.cpp +++ b/wled00/playlist.cpp @@ -137,7 +137,7 @@ void handlePlaylist() { return; // but don't progress to next extry, and don't shuffle } - if (millis() - presetCycledTime > (100*playlistEntryDur)) { +if (millis() - presetCycledTime > (100 * playlistEntryDur) || doAdvancePlaylist) { presetCycledTime = millis(); if (bri == 0 || nightlightActive) return; @@ -159,6 +159,7 @@ void handlePlaylist() { transitionDelayTemp = playlistEntries[playlistIndex].tr * 100; playlistEntryDur = playlistEntries[playlistIndex].dur; applyPreset(playlistEntries[playlistIndex].preset); + doAdvancePlaylist = false; } } diff --git a/wled00/remote.cpp b/wled00/remote.cpp index 5a993c29..64c668c5 100644 --- a/wled00/remote.cpp +++ b/wled00/remote.cpp @@ -17,9 +17,15 @@ #define WIZMOTE_BUTTON_BRIGHT_UP 9 #define WIZMOTE_BUTTON_BRIGHT_DOWN 8 +#define WIZ_SMART_BUTTON_ON 100 +#define WIZ_SMART_BUTTON_OFF 101 +#define WIZ_SMART_BUTTON_BRIGHT_UP 102 +#define WIZ_SMART_BUTTON_BRIGHT_DOWN 103 + #ifdef WLED_DISABLE_ESPNOW void handleRemote(){} #else +#pragma message "ESP-NOW remote driver enabled" #if !defined(ARDUINO_ARCH_ESP32) && !defined(ESP_OK) #define ESP_OK 0 // add missing constant for stupid esp8266 @@ -148,7 +154,6 @@ void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) { return; } - USER_PRINT(F("\nIncoming ESP Now Packet[")); USER_PRINT(cur_seq); USER_PRINT(F("] from sender[")); @@ -165,8 +170,11 @@ void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) { case WIZMOTE_BUTTON_NIGHT : activateNightMode(); stateUpdated(CALL_MODE_BUTTON); break; case WIZMOTE_BUTTON_BRIGHT_UP : brightnessUp(); stateUpdated(CALL_MODE_BUTTON); break; case WIZMOTE_BUTTON_BRIGHT_DOWN : brightnessDown(); stateUpdated(CALL_MODE_BUTTON); break; + case WIZ_SMART_BUTTON_ON : setOn(); break; + case WIZ_SMART_BUTTON_OFF : setOff(); break; + case WIZ_SMART_BUTTON_BRIGHT_UP : brightnessUp(); break; + case WIZ_SMART_BUTTON_BRIGHT_DOWN : brightnessDown(); break; default: break; - } last_seq = cur_seq; diff --git a/wled00/set.cpp b/wled00/set.cpp index 3b7c8a9c..31fbb784 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -922,6 +922,9 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply) applyPreset(presetCycCurr); } + pos = req.indexOf(F("NP")); //advances to next preset in a playlist + if (pos > 0) doAdvancePlaylist = true; + //set brightness updateVal(req.c_str(), "&A=", &bri); diff --git a/wled00/util.cpp b/wled00/util.cpp index ceefcc2f..896b57e3 100644 --- a/wled00/util.cpp +++ b/wled00/util.cpp @@ -155,6 +155,7 @@ bool oappend(const char* txt) USER_PRINTF("%2u bytes \t\"", len /*1 + olen + len - SETTINGS_STACK_BUF_SIZE*/); USER_PRINT(txt); USER_PRINTLN(F("\"")); + errorFlag = ERR_LOW_AJAX_MEM; } return false; // buffer full } @@ -433,6 +434,7 @@ um_data_t* simulateSound(uint8_t simulationId) static float volumeSmth; static uint16_t volumeRaw; static float my_magnitude; + static uint16_t zeroCrossingCount = 0; // number of zero crossings in the current batch of 512 samples //arrays uint8_t *fftResult; @@ -447,7 +449,7 @@ um_data_t* simulateSound(uint8_t simulationId) // NOTE!!! // This may change as AudioReactive usermod may change um_data = new um_data_t; - um_data->u_size = 11; + um_data->u_size = 12; um_data->u_type = new um_types_t[um_data->u_size]; um_data->u_data = new void*[um_data->u_size]; um_data->u_data[0] = &volumeSmth; @@ -461,6 +463,7 @@ um_data_t* simulateSound(uint8_t simulationId) um_data->u_data[8] = &FFT_MajorPeak; // dummy (FFT Peak smoothed) um_data->u_data[9] = &volumeSmth; // dummy (soundPressure) um_data->u_data[10] = &volumeSmth; // dummy (agcSensitivity) + um_data->u_data[11] = &zeroCrossingCount; } else { // get arrays from um_data fftResult = (uint8_t*)um_data->u_data[2]; @@ -527,6 +530,7 @@ um_data_t* simulateSound(uint8_t simulationId) volumeRaw = volumeSmth; my_magnitude = 10000.0f / 8.0f; //no idea if 10000 is a good value for FFT_Magnitude ??? if (volumeSmth < 1 ) my_magnitude = 0.001f; // noise gate closed - mute + zeroCrossingCount = floorf(FFT_MajorPeak / 36.0f); // 9Khz max frequency => 255 zero crossings return um_data; } diff --git a/wled00/wled.cpp b/wled00/wled.cpp index e8e9eecc..11ebcf72 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -611,10 +611,12 @@ void WLED::setup() DEBUG_PRINTLN(F("PSRAM not used.")); #endif #endif -#if defined(ARDUINO_ESP32_PICO) -// special handling for PICO-D4: gpio16+17 are in use for onboard SPI FLASH (not PSRAM) -managed_pin_type pins[] = { {16, true}, {17, true} }; -pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), PinOwner::SPI_RAM); +#if defined(ARDUINO_ARCH_ESP32) + if (strncmp("ESP32-PICO", ESP.getChipModel(), 10) == 0) { // WLEDMM detect pico board at runtime + // special handling for PICO-D4: gpio16+17 are in use for onboard SPI FLASH (not PSRAM) + managed_pin_type pins[] = { {16, true}, {17, true} }; + pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), PinOwner::SPI_RAM); + } #endif //DEBUG_PRINT(F("LEDs inited. heap usage ~")); @@ -681,7 +683,7 @@ pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), Pin updateFSInfo(); USER_PRINT(F("done Mounting FS; ")); - USER_PRINT(((fsBytesTotal-fsBytesUsed)/1024)); USER_PRINTLN(F(" kB free.")); + USER_PRINT(((fsBytesTotal-fsBytesUsed)/1024)); USER_PRINTLN(F(" kB free.\n")); // generate module IDs must be done before AP setup escapedMac = WiFi.macAddress(); @@ -705,7 +707,7 @@ pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), Pin beginStrip(); DEBUG_PRINT(F("heap ")); DEBUG_PRINTLN(ESP.getFreeHeap()); - USER_PRINTLN(F("Usermods setup ...")); + USER_PRINTLN(F("\nUsermods setup ...")); userSetup(); usermods.setup(); DEBUG_PRINT(F("heap ")); DEBUG_PRINTLN(ESP.getFreeHeap()); @@ -721,7 +723,7 @@ pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), Pin //Serial RX (Adalight, Improv, Serial JSON) only possible if GPIO3 unused //Serial TX (Debug, Improv, Serial JSON) only possible if GPIO1 unused if (!pinManager.isPinAllocated(hardwareRX) && !pinManager.isPinAllocated(hardwareTX)) { - if (Serial) Serial.println(F("Ada")); + if (Serial) Serial.println(F("\nAda")); } #endif @@ -852,7 +854,7 @@ pinManager.allocateMultiplePins(pins, sizeof(pins)/sizeof(managed_pin_type), Pin // repeat Ada prompt #ifdef WLED_ENABLE_ADALIGHT if (!pinManager.isPinAllocated(hardwareRX) && !pinManager.isPinAllocated(hardwareTX)) { - if (Serial) Serial.println(F("Ada")); + if (Serial) Serial.println(F("\nAda")); } #endif @@ -1031,6 +1033,12 @@ bool WLED::initEthernet() void WLED::initConnection() { +#ifdef ARDUINO_ARCH_ESP32 + unsigned long t_wait = millis(); + while(strip.isUpdating() && (millis() - t_wait < 86)) delay(1); // WLEDMM try to catch a moment when strip is idle + //if (strip.isUpdating()) USER_PRINTLN("WLED::initConnection: strip still updating."); +#endif + #ifdef WLED_ENABLE_WEBSOCKETS ws.onEvent(wsEvent); #endif @@ -1208,7 +1216,7 @@ void WLED::handleConnection() static unsigned retryCount = 0; // WLEDMM #ifdef ARDUINO_ARCH_ESP32 // reconnect WiFi to clear stale allocations if heap gets too low - if (now - heapTime > 5000) { // WLEDMM: updated with better logic for small heap available by block, not total. + if ((!strip.isUpdating()) && (now - heapTime > 5000)) { // WLEDMM: updated with better logic for small heap available by block, not total. // WLEDMM trying to use a moment when the strip is idle #if defined(ARDUINO_ARCH_ESP32S2) uint32_t heap = ESP.getFreeHeap(); // WLEDMM works better on -S2 #else diff --git a/wled00/wled.h b/wled00/wled.h index 92b121f0..a0e4283e 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2404201 +#define VERSION 2405040 // WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED. #define _MoonModules_WLED_ @@ -184,6 +184,12 @@ // There is a code that will still not use PSRAM though: // AsyncJsonResponse is a derived class that implements DynamicJsonDocument (AsyncJson-v6.h) #if defined(ARDUINO_ARCH_ESP32) && defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON)) // WLEDMM +// WLEDMM the JSON_TO_PSRAM feature works, so use it by default +#undef WLED_USE_PSRAM_JSON +#define WLED_USE_PSRAM_JSON +#undef ALL_JSON_TO_PSRAM +#define ALL_JSON_TO_PSRAM + struct PSRAM_Allocator { void* allocate(size_t size) { if (psramFound()) return ps_malloc(size); // use PSRAM if it exists @@ -533,7 +539,8 @@ WLED_GLOBAL byte macroDoublePress[WLED_MAX_BUTTONS] _INIT({0}); WLED_GLOBAL bool otaLock _INIT(false); // prevents OTA firmware updates without password. ALWAYS enable if system exposed to any public networks WLED_GLOBAL bool wifiLock _INIT(false); // prevents access to WiFi settings when OTA lock is enabled #ifdef ARDUINO_ARCH_ESP32 -WLED_GLOBAL bool aOtaEnabled _INIT(true); // ArduinoOTA allows easy updates directly from the IDE. Careful, it does not auto-disable when OTA lock is on +// WLEDMM disabled as default - arduinoOTA is a relic, only useful when using ArduinoIDE +WLED_GLOBAL bool aOtaEnabled _INIT(false); // ArduinoOTA allows easy updates directly from the IDE. Careful, it does not auto-disable when OTA lock is on #else WLED_GLOBAL bool aOtaEnabled _INIT(false); // WLEDMM: start with OTA disabled, as it seems to be unstable on 8266 #endif @@ -646,6 +653,7 @@ WLED_GLOBAL byte timerWeekday[] _INIT_N(({ 255, 255, 255, 255, 255, 255, 255, WLED_GLOBAL byte timerMonth[] _INIT_N(({28,28,28,28,28,28,28,28})); WLED_GLOBAL byte timerDay[] _INIT_N(({1,1,1,1,1,1,1,1})); WLED_GLOBAL byte timerDayEnd[] _INIT_N(({31,31,31,31,31,31,31,31})); +WLED_GLOBAL bool doAdvancePlaylist _INIT(false); //improv WLED_GLOBAL byte improvActive _INIT(0); //0: no improv packet received, 1: improv active, 2: provisioning @@ -802,7 +810,7 @@ WLED_GLOBAL int8_t spi_sclk _INIT(HW_PIN_CLOCKSPI); WLED_GLOBAL PSRAMDynamicJsonDocument doc; #else WLED_GLOBAL PSRAMDynamicJsonDocument doc(JSON_BUFFER_SIZE); - #warning experimental - trying to always use dynamic JSON + //#warning trying to always use dynamic JSON in PSRAM #endif #else WLED_GLOBAL StaticJsonDocument doc; diff --git a/wled00/wled_serial.cpp b/wled00/wled_serial.cpp index 596b5791..221f21ad 100644 --- a/wled00/wled_serial.cpp +++ b/wled00/wled_serial.cpp @@ -229,6 +229,8 @@ void handleSerial() //#ifdef WLED_DEBUG if ((millis() - startTime) > SERIAL_MAXTIME_MILLIS) { USER_PRINTLN(F("handleSerial(): need a break after >100ms of activity.")); } //#endif + #else + #pragma message "Serial protocols (AdaLight, Serial JSON, Serial LED driver, improv) disabled" #endif // If Continuous Serial Streaming is enabled, send new LED data as bytes diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index a08e9ea6..f3fe1c08 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -58,6 +58,7 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t request->_tempFile.close(); USER_PRINT(F("File uploaded: ")); // WLEDMM USER_PRINTLN(filename); // WLEDMM + invalidateFileNameCache(); // WLEDMM if (filename.equalsIgnoreCase("/cfg.json") || filename.equalsIgnoreCase("cfg.json")) { // WLEDMM request->send(200, "text/plain", F("Configuration restore successful.\nRebooting...")); doReboot = true; diff --git a/wled00/ws.cpp b/wled00/ws.cpp index 351caad4..08624b1e 100644 --- a/wled00/ws.cpp +++ b/wled00/ws.cpp @@ -313,4 +313,5 @@ void handleWs() #else void handleWs() {} void sendDataWs(AsyncWebSocketClient * client) {} +#pragma message "WebSockets disabled - no live preview." #endif