diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 8d698ae3..ae853c4d 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -9,6 +9,8 @@ #include "bus_wrapper.h" #include "bus_manager.h" +//WLEDMM: #define DEBUGOUT(x) netDebugEnabled?NetDebug.print(x):Serial.print(x) not supported in this file as netDebugEnabled not in scope +#if 0 //colors.cpp uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb); uint16_t approximateKelvinFromRGB(uint32_t rgb); @@ -18,7 +20,6 @@ void colorRGBtoRGBW(byte* rgb); uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, byte *buffer, uint8_t bri=255, bool isRGBW=false); // enable additional debug output -//WLEDMM: #define DEBUGOUT(x) netDebugEnabled?NetDebug.print(x):Serial.print(x) not supported in this file as netDebugEnabled not in scope #if defined(WLED_DEBUG_HOST) #include "net_debug.h" #define DEBUGOUT NetDebug @@ -38,6 +39,10 @@ uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, byte #define DEBUG_PRINTLN(x) #define DEBUG_PRINTF(x...) #endif +#else + // WLEDMM use wled.h +#include "wled.h" +#endif //color mangling macros #define RGBW32(r,g,b,w) (uint32_t((byte(w) << 24) | (byte(r) << 16) | (byte(g) << 8) | (byte(b)))) @@ -114,7 +119,11 @@ BusDigital::BusDigital(BusConfig &bc, uint8_t nr, const ColorOrderMap &com) : Bu _busPtr = PolyBus::create(_iType, _pins, lenToCreate, nr); _valid = (_busPtr != nullptr); _colorOrder = bc.colorOrder; - DEBUG_PRINTF("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u)\n", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_pins[1],_iType); + if (_pins[1] != 255) { // WLEDMM USER_PRINTF + USER_PRINTF("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u)\n", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_pins[1],_iType); + } else { + USER_PRINTF("%successfully inited strip %u (len %u) with type %u and pin %u (itype %u)\n", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_iType); + } } void BusDigital::show() { diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index f2b364f6..14b663b9 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -928,9 +928,15 @@ class PolyBus { if (num > 3) return I_NONE; //if (num > 3) offset = num -4; // I2S not supported yet #else + #ifndef WLEDMM_FASTPATH // standard ESP32 has 8 RMT and 2 I2S channels if (num > 9) return I_NONE; if (num > 7) offset = num -7; + #else + // ESP32 "audio_fastpath" - 8 RMT and 1 I2S channels. RMT 5-8 have sending delays, so use I2S#1 as 5th bus, before going for RMT 5-8 + if (num > 8) return I_NONE; + if (num == 4) offset = 2; // use I2S channel 2 as 5th bus. Ladies and Gentlemen, _this_ is a dirty hack. + #endif #endif switch (busType) { case TYPE_WS2812_1CH_X3: diff --git a/wled00/const.h b/wled00/const.h index 7d6264d9..449eeba0 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -43,8 +43,13 @@ #define WLED_MIN_VIRTUAL_BUSSES 4 #else #if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33 + #ifndef WLEDMM_FASTPATH #define WLED_MAX_BUSSES 8 #define WLED_MIN_VIRTUAL_BUSSES 2 + #else + #define WLED_MAX_BUSSES 9 // WLEDMM I2S#1 is availeable for LEDs + #define WLED_MIN_VIRTUAL_BUSSES 1 + #endif #else #define WLED_MAX_BUSSES 10 #define WLED_MIN_VIRTUAL_BUSSES 0