Skip to content

Commit

Permalink
buildenv updates
Browse files Browse the repository at this point in the history
* suppress NeoPixelBus warning: 'maybe_unused' attribute directive ignored
* add -D USERMOD_CUSTOMEFFECTS to all Soudreactive environments
* Add default squelch for boards with SPM1423 (PDM mic)
* fixed some broken SoundReactive build envs
* updated default_envs : major SR builds
* added debug binaries
  • Loading branch information
softhack007 committed Mar 27, 2023
1 parent 2a9a545 commit c3aa31a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
47 changes: 37 additions & 10 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# Release binaries
; default_envs = nodemcuv2, esp8266_2m, esp01_1m_full, esp32dev, esp32_eth, esp32s2_saola, esp32c3

# WLEDSR Relase binaries
default_envs = soundReactive_esp32dev, soundReactive_esp32_eth, esp32_4MB_max, esp32_4MB_min_debug, esp32_4MB_min_micdebug, esp32_pico_4MB_min, wemos_shield_esp32_4MB_max, wemos_shield_esp32_16MB_max

# WLED sound-reactive binaries
; default_envs = soundReactive_lolin_d32
; default_envs = soundReactive_esp32dev
Expand All @@ -26,7 +29,7 @@

; default_envs = esp32_4MB_min, esp32_4MB_max, esp32_16MB_max, wemos_shield_esp32_4MB_max, wemos_shield_esp32_16MB_max, esp32_pico_4MB_min
; default_envs = esp32_4MB_min
default_envs = esp32_4MB_max ; recommended default
; default_envs = esp32_4MB_max ; recommended default
; default_envs = esp32_16MB_max
; default_envs = wemos_shield_esp32_4MB_max
; default_envs = wemos_shield_esp32_16MB_max
Expand Down Expand Up @@ -228,7 +231,8 @@ platform = [email protected]

platform_packages = framework-arduinoespressif32 @ https://github.com/Aircoookie/arduino-esp32.git#1.0.6.4

build_flags = -g
build_flags = -g
-Wno-attributes -Wno-unused-variable -Wno-unused-function ;; WLEDSR disables some stupid warnings, like NeoPixelBus warning: 'maybe_unused' attribute directive ignored
-DARDUINO_ARCH_ESP32
#-DCONFIG_LITTLEFS_FOR_IDF_3_2
-D CONFIG_ASYNC_TCP_USE_WDT=0
Expand Down Expand Up @@ -439,6 +443,7 @@ platform_packages = ${esp32.platform_packages}
upload_speed = 460800 ; 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=soundReactive_esp32dev -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
Expand All @@ -452,6 +457,7 @@ platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=soundReactive_esp32_eth -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
board_build.partitions = ${esp32.default_partitions}
; board_build.f_flash = 80000000L
Expand All @@ -464,6 +470,7 @@ platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
Expand All @@ -477,17 +484,18 @@ platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.f_cpu = 240000000L
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = tools/SoundReactive_ESP32_16MB.csv
board_build.partitions = tools/WLED_ESP32_16MB.csv ; for esp32_16MB with 16MB flash
board_build.f_flash = 80000000L
board_build.flash_mode = qio

[env:soundReactive_m5atom]
board = esp32dev
board = m5stack-atom
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 1500000
Expand All @@ -499,18 +507,19 @@ build_flags = ${common.build_flags_esp32}
-D WLED_DISABLE_LOXONE
-D LEDPIN=27
-D BTNPIN=39
-D DMENABLED=5
-D DMENABLED=5 -D SR_SQUELCH=5 -D SR_GAIN=75 ;; SPM1423 specific
-D I2S_SDPIN=26
-D I2S_WSPIN=32
-D I2S_CKPIN=-1
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dio

[env:soundReactive_m5stamp-pico]
board = esp32dev
board = pico32
platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 1500000
Expand All @@ -522,15 +531,16 @@ build_flags = ${common.build_flags_esp32}
-D WLED_DISABLE_LOXONE
-D LEDPIN=27
-D BTNPIN=39
-D DMENABLED=5
-D DMENABLED=5 -D SR_SQUELCH=5 -D SR_GAIN=75 ;; SPM1423 specific
-D I2S_SDPIN=32
-D I2S_WSPIN=33
-D I2S_CKPIN=-1
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dio
board_build.flash_mode = dout

# ------------------------------------------------------------------------------
# custom board configurations
Expand All @@ -549,6 +559,7 @@ build_flags = ${common.build_flags_esp32}
-D UWLED_USE_MY_CONFIG
-D USERMOD_DALLASTEMPERATURE
-D USERMOD_FOUR_LINE_DISPLAY
-D USERMOD_CUSTOMEFFECTS ; WLEDMM usermod
-D TEMPERATURE_PIN=23
lib_deps = ${esp32.lib_deps}
OneWire@~2.3.5
Expand Down Expand Up @@ -627,6 +638,21 @@ build_flags = ${esp32_4MB_min_base.build_flags}
; RAM: [== ] 24.1% (used 78900 bytes from 327680 bytes)
; Flash: [======== ] 83.7% (used 1315729 bytes from 1572864 bytes)

; esp32_4MB_min_debug: bin entry, uses esp32_4MB_min_base + WLED_DEBUG
[env:esp32_4MB_min_debug]
extends = esp32_4MB_min_base
build_flags = ${esp32_4MB_min_base.build_flags}
-D WLED_RELEASE_NAME=esp32_4MB_min_debug ; This will be included in the firmware.bin filename
-D WLED_DEBUG ; lots of generic debug messages
-D SR_DEBUG -D NO_MIC_LOGGER ; some extra debug messages from audioreactive

; esp32_4MB_min_micdebug: bin entry, uses esp32_4MB_min_base + MIC_LOGGER
[env:esp32_4MB_min_micdebug]
extends = esp32_4MB_min_base
build_flags = ${esp32_4MB_min_base.build_flags}
-D WLED_RELEASE_NAME=esp32_4MB_min_micdebug ; This will be included in the firmware.bin filename
; -D MIC_LOGGER ; mic signal plotting with arduino serial plotter

; esp32_4MB_max: bin entry, uses esp32_4MB_max_base
[env:esp32_4MB_max]
extends = esp32_4MB_max_base
Expand Down Expand Up @@ -735,8 +761,9 @@ build_flags = ${esp32_4MB_min_base.build_flags}
; -D SR_DEBUG -D NO_MIC_LOGGER ; some extra debug messages from audioreactive
; -D MIC_LOGGER ; mic signal plotting with arduino serial plotter
; -D WLED_USE_MY_CONFIG
; RAM: [=== ] 32.4% (used 106284 bytes from 327680 bytes)
; Flash: [======== ] 80.6% (used 1267505 bytes from 1572864 bytes);
; -D WLED_USE_CIE_BRIGHTNESS_TABLE
; RAM: [=== ] 32.5% (used 106356 bytes from 327680 bytes)
; Flash: [======== ] 81.3% (used 1278269 bytes from 1572864 bytes)
monitor_filters = esp32_exception_decoder
lib_ignore = IRremoteESP8266 ;; for faster compilation

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion wled00/wled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void WLED::setup()
#ifdef WLED_ENABLE_ADALIGHT
//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(3) && !pinManager.isPinAllocated(1)) {
if (!pinManager.isPinAllocated(3) && (!pinManager.isPinAllocated(1) || (pinManager.getPinOwner(1) == PinOwner::DebugOut))) { // WLEDSR allow TX = debugOut
Serial.println(F("Ada"));
}
#endif
Expand Down
7 changes: 5 additions & 2 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,16 @@ WLED_GLOBAL byte briS _INIT(128); // default brightness
WLED_GLOBAL byte inputLevelS _INIT(128); // WLEDSR default inputLevel
#if !defined(SR_SQUELCH)
WLED_GLOBAL byte soundSquelch _INIT(10); // default squelch value for volume reactive routines
WLED_GLOBAL byte sampleGain _INIT(40); // default sample gain
WLED_GLOBAL byte soundAgc _INIT(0); // default Automagic gain control
#else
WLED_GLOBAL byte soundSquelch _INIT(SR_SQUELCH); // default squelch value
WLED_GLOBAL byte sampleGain _INIT(30); // default sample gain
WLED_GLOBAL byte soundAgc _INIT(2); // squelch was provided - we can enable AGC by default
#endif
#if !defined(SR_GAIN)
WLED_GLOBAL byte sampleGain _INIT(40); // default sample gain
#else
WLED_GLOBAL byte sampleGain _INIT(SR_GAIN); // default sample gain
#endif

WLED_GLOBAL byte nightlightTargetBri _INIT(0); // brightness after nightlight is over
WLED_GLOBAL byte nightlightDelayMins _INIT(60);
Expand Down

0 comments on commit c3aa31a

Please sign in to comment.