Skip to content

Commit 8cb5028

Browse files
authored
Merge branch 'MoonModules:mdev' into Strip_Level_Color_Adjust
2 parents 5dfa6d6 + 06f9474 commit 8cb5028

39 files changed

+641
-194
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ body:
4848
attributes:
4949
label: What version/release of MM WLED?
5050
description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message"
51-
placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b30.37_esp32_4MB_M.bin"
51+
placeholder: "e.g. build 2401290, WLEDMM_0.14.1-b31.38_esp32_4MB_M.bin"
5252
validations:
5353
required: true
5454
- type: dropdown

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wled",
3-
"version": "0.14.1-b30.37",
3+
"version": "0.14.1-b31.38",
44
"description": "Tools for WLED project",
55
"main": "tools/cdata.js",
66
"directories": {

pio-scripts/obj-dump.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
# Little convenience script to get an object dump
2+
# You may add "-S" to the objdump commandline (i.e. replace "-D -C " with "-d -S -C ")
3+
# to get source code intermixed with disassembly (SLOW !)
24

35
Import('env')
46

57
def obj_dump_after_elf(source, target, env):
8+
platform = env.PioPlatform()
9+
board = env.BoardConfig()
10+
mcu = board.get("build.mcu", "esp32")
11+
612
print("Create firmware.asm")
7-
env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm")
8-
13+
if mcu == "esp8266":
14+
env.Execute("xtensa-lx106-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
15+
if mcu == "esp32":
16+
env.Execute("xtensa-esp32-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
17+
if mcu == "esp32s2":
18+
env.Execute("xtensa-esp32s2-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
19+
if mcu == "esp32s3":
20+
env.Execute("xtensa-esp32s3-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
21+
if mcu == "esp32c3":
22+
env.Execute("riscv32-esp-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
23+
924
env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf])

pio-scripts/output_bins.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def _create_dirs(dirs=["firmware", "map"]):
2525
def bin_rename_copy(source, target, env):
2626
_create_dirs()
2727
variant = env["PIOENV"]
28+
builddir = os.path.join(env["PROJECT_BUILD_DIR"], variant)
29+
source_map = os.path.join(builddir, env["PROGNAME"] + ".map")
2830

2931
# create string with location and file names based on variant
3032
map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant)
@@ -48,7 +50,11 @@ def bin_rename_copy(source, target, env):
4850

4951
# copy firmware.map to map/<variant>.map
5052
if os.path.isfile("firmware.map"):
51-
shutil.move("firmware.map", map_file)
53+
print("Found linker mapfile firmware.map")
54+
shutil.copy("firmware.map", map_file)
55+
if os.path.isfile(source_map):
56+
print(f"Found linker mapfile {source_map}")
57+
shutil.copy(source_map, map_file)
5258

5359
def bin_gzip(source, target, env):
5460
_create_dirs()

platformio.ini

Lines changed: 289 additions & 120 deletions
Large diffs are not rendered by default.

tools/WLED_ESP32_4MB_512KB_FS.csv

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x1B0000,
5+
app1, app, ota_1, 0x1C0000,0x1B0000,
6+
spiffs, data, spiffs, 0x370000,0x80000,
7+
coredump, data, coredump,,64K

tools/WLED_ESP32_4MB_700k_FS.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x1A0000,
5+
app1, app, ota_1, 0x1B0000,0x1A0000,
6+
spiffs, data, spiffs, 0x350000,0xB0000,

usermods/audioreactive/audio_reactive.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,9 @@ void FFTcode(void * parameter)
617617
FFT.ComplexToMagnitude(); // Compute magnitudes
618618
#endif
619619

620+
float last_majorpeak = FFT_MajorPeak;
621+
float last_magnitude = FFT_Magnitude;
622+
620623
#ifdef FFT_MAJORPEAK_HUMAN_EAR
621624
// scale FFT results
622625
for(uint_fast16_t binInd = 0; binInd < samplesFFT; binInd++)
@@ -629,6 +632,9 @@ void FFTcode(void * parameter)
629632
FFT.MajorPeak(&FFT_MajorPeak, &FFT_Magnitude); // let the effects know which freq was most dominant
630633
#endif
631634

635+
if (FFT_MajorPeak < (SAMPLE_RATE / samplesFFT)) {FFT_MajorPeak = 1.0f; FFT_Magnitude = 0;} // too low - use zero
636+
if (FFT_MajorPeak > (0.42f * SAMPLE_RATE)) {FFT_MajorPeak = last_majorpeak; FFT_Magnitude = last_magnitude;} // too high - keep last peak
637+
632638
#ifdef FFT_MAJORPEAK_HUMAN_EAR
633639
// undo scaling - we want unmodified values for FFTResult[] computations
634640
for(uint_fast16_t binInd = 0; binInd < samplesFFT; binInd++)
@@ -1794,6 +1800,11 @@ class AudioReactive : public Usermod {
17941800
#endif
17951801
delay(100); // Give that poor microphone some time to setup.
17961802

1803+
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
1804+
if ((i2sckPin == I2S_PIN_NO_CHANGE) && (i2ssdPin >= 0) && (i2swsPin >= 0)
1805+
&& ((dmType == 1) || (dmType == 4)) ) dmType = 51; // dummy user support: SCK == -1 --means--> PDM microphone
1806+
#endif
1807+
17971808
useInputFilter = 2; // default: DC blocker
17981809
switch (dmType) {
17991810
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)

usermods/audioreactive/audio_source.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,12 @@ class I2SSource : public AudioSource {
186186
.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_STAND_I2S),
187187
//.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
188188
#ifdef WLEDMM_FASTPATH
189+
#if CONFIG_IDF_TARGET_ESP32 && !defined(BOARD_HAS_PSRAM) // still need to test on boards with PSRAM
190+
.intr_alloc_flags = ESP_INTR_FLAG_IRAM|ESP_INTR_FLAG_LEVEL2|ESP_INTR_FLAG_LEVEL3, // IRAM flag reduces missed samples
191+
#else
189192
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2|ESP_INTR_FLAG_LEVEL3, // seems to reduce noise
190-
.dma_buf_count = 28, // 160ms buffer (128 * dma_buf_count / sampleRate)
193+
#endif
194+
.dma_buf_count = 24, // 140ms buffer (128 * dma_buf_count / sampleRate)
191195
#else
192196
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2,
193197
.dma_buf_count = 8,

0 commit comments

Comments
 (0)