From 37a4a4dcdf577634604b3c649af29d95ca171aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Tue, 11 Oct 2022 09:46:48 +0200 Subject: [PATCH] Fix max bus limits for C3, S2 & S3 --- wled00/const.h | 18 +++++++++++++----- wled00/xml.cpp | 5 ----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/wled00/const.h b/wled00/const.h index 1ad4bd29..f0be7fbf 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -25,14 +25,22 @@ #ifdef ESP8266 #define WLED_MAX_BUSSES 3 #else - #if defined(CONFIG_IDF_TARGET_ESP32C3) + #if defined(CONFIG_IDF_TARGET_ESP32C3) // 2 RMT, only has 1 I2S but NPB does not support it ATM #define WLED_MAX_BUSSES 2 - #elif defined(CONFIG_IDF_TARGET_ESP32S2) - #define WLED_MAX_BUSSES 5 - #elif defined(CONFIG_IDF_TARGET_ESP32S3) + #elif defined(CONFIG_IDF_TARGET_ESP32S2) // 4 RMT, only has 1 I2S bus, supported in NPB + #if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33 + #define WLED_MAX_BUSSES 4 + #else + #define WLED_MAX_BUSSES 5 + #endif + #elif defined(CONFIG_IDF_TARGET_ESP32S3) // 4 RMT, has 2 I2S but NPB does not support them ATM #define WLED_MAX_BUSSES 4 #else - #define WLED_MAX_BUSSES 10 + #if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33 + #define WLED_MAX_BUSSES 8 + #else + #define WLED_MAX_BUSSES 10 + #endif #endif #endif #endif diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 13fafcdd..e5cf95e5 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -367,12 +367,7 @@ void getSettingsJS(byte subPage, char* dest) // set limits oappend(SET_F("bLimits(")); - #if defined(ESP32) && defined(USERMOD_AUDIOREACTIVE) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C3) - // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33 - oappend(itoa(WLED_MAX_BUSSES-2,nS,10)); oappend(","); // prevent use of I2S buses if audio installed. ESP32-S3 currently does not support these busses. - #else oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(","); - #endif oappend(itoa(MAX_LEDS_PER_BUS,nS,10)); oappend(","); oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(","); oappend(itoa(MAX_LEDS,nS,10));