From 66d3802f0fe14db19dfb2b03e3875d47fd51a570 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 2 Sep 2022 19:15:03 +0200 Subject: [PATCH] updates for mdev PIO config - updated mdev config, to use latest arduinoFFT, plus threadsafe LittleFS, plus default to 80Mhz flash speed. - re-introducing the preset saving fix from SR WLED. Still I don't believe that upstream got that corrected properly. --- platformio.ini | 12 ++++++++++-- wled00/presets.cpp | 12 ++++++++++++ wled00/wled.h | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 6f2ab535..696426a8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -224,7 +224,9 @@ default_partitions = tools/WLED_ESP32_4MB_1MB_FS.csv lib_deps = ${env.lib_deps} - https://github.com/lorol/LITTLEFS.git + ; https://github.com/lorol/LITTLEFS.git + ; WLEDSR specific: use patched version of lorol LittleFS + https://github.com/softhack007/LITTLEFS-threadsafe.git#master makuna/NeoPixelBus @ 2.6.9 https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 @@ -449,14 +451,20 @@ platform = ${esp32.platform} upload_speed = 460800 ; or 921600 platform_packages = ${esp32.platform_packages} build_unflags = ${common.build_unflags} + build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32 #-D WLED_DISABLE_BLYNK #-D WLED_DISABLE_BROWNOUT_DET -D USERMOD_AUDIOREACTIVE + -D UM_AUDIOREACTIVE_USE_NEW_FFT -D USERMOD_CUSTOMEFFECTS + lib_deps = ${esp32.lib_deps} - https://github.com/blazoncek/arduinoFFT.git ; arduinoFFT @ 1.5.6 + ; https://github.com/blazoncek/arduinoFFT.git ; arduinoFFT @ 1.5.6 + https://github.com/kosme/arduinoFFT#develop @ 1.9.2 monitor_filters = esp32_exception_decoder board_build.partitions = ${esp32.default_partitions} +board_build.f_flash = 80000000L +board_build.flash_mode = dio [env:esp8266mdev] extends = env:d1_mini diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 4bcccea5..1ccf0659 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -38,6 +38,18 @@ void handlePresets(bool force) uint8_t core = 1; #ifdef ARDUINO_ARCH_ESP32 core = xPortGetCoreID(); + // begin WLEDSR specific + // loopTask (arduino main loop) sometimes runs on core #1 + if ((core == 1) && (strncmp(pcTaskGetTaskName(NULL), "loopTask", 8) == 0)) { + DEBUG_PRINTF("[applyPreset] called from loopTask on core %d; forcing core = 0\n", (int)core); + core = 0; + } + // async_tcp (network requests) sometimes runs on core #0 + if ((core == 0) && (strncmp(pcTaskGetTaskName(NULL), "async_tcp", 9) == 0)) { + DEBUG_PRINTF("[applyPreset] called from async_tcp on core %d; forcing core = 1\n", (int)core); + core = 1; + } + // end WLEDSR specific #endif //only allow use of fileDoc from the core responsible for network requests (AKA HTTP JSON API) //do not use active network request doc from preset called by main loop (playlist, schedule, ...) diff --git a/wled00/wled.h b/wled00/wled.h index 80eb4809..e629f331 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2208311 +#define VERSION 2209021 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG