fastpath: use i2s#1 for 5th LED pin
use 4 RMT channels, then I2S#1, then RMT 5-8. This allows to have up to 5 "fast" LED pins. "Even though the ESP32 has 8 channels of RMT hardware, using beyond 4 has shown to cause sending delays." (https://github.com/Makuna/NeoPixelBus/wiki/ESP32-NeoMethods#rmt)
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
#include "bus_wrapper.h"
|
#include "bus_wrapper.h"
|
||||||
#include "bus_manager.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
|
//colors.cpp
|
||||||
uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb);
|
uint32_t colorBalanceFromKelvin(uint16_t kelvin, uint32_t rgb);
|
||||||
uint16_t approximateKelvinFromRGB(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);
|
uint8_t realtimeBroadcast(uint8_t type, IPAddress client, uint16_t length, byte *buffer, uint8_t bri=255, bool isRGBW=false);
|
||||||
|
|
||||||
// enable additional debug output
|
// 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)
|
#if defined(WLED_DEBUG_HOST)
|
||||||
#include "net_debug.h"
|
#include "net_debug.h"
|
||||||
#define DEBUGOUT NetDebug
|
#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_PRINTLN(x)
|
||||||
#define DEBUG_PRINTF(x...)
|
#define DEBUG_PRINTF(x...)
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
// WLEDMM use wled.h
|
||||||
|
#include "wled.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//color mangling macros
|
//color mangling macros
|
||||||
#define RGBW32(r,g,b,w) (uint32_t((byte(w) << 24) | (byte(r) << 16) | (byte(g) << 8) | (byte(b))))
|
#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);
|
_busPtr = PolyBus::create(_iType, _pins, lenToCreate, nr);
|
||||||
_valid = (_busPtr != nullptr);
|
_valid = (_busPtr != nullptr);
|
||||||
_colorOrder = bc.colorOrder;
|
_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() {
|
void BusDigital::show() {
|
||||||
|
|||||||
@@ -928,9 +928,15 @@ class PolyBus {
|
|||||||
if (num > 3) return I_NONE;
|
if (num > 3) return I_NONE;
|
||||||
//if (num > 3) offset = num -4; // I2S not supported yet
|
//if (num > 3) offset = num -4; // I2S not supported yet
|
||||||
#else
|
#else
|
||||||
|
#ifndef WLEDMM_FASTPATH
|
||||||
// standard ESP32 has 8 RMT and 2 I2S channels
|
// standard ESP32 has 8 RMT and 2 I2S channels
|
||||||
if (num > 9) return I_NONE;
|
if (num > 9) return I_NONE;
|
||||||
if (num > 7) offset = num -7;
|
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
|
#endif
|
||||||
switch (busType) {
|
switch (busType) {
|
||||||
case TYPE_WS2812_1CH_X3:
|
case TYPE_WS2812_1CH_X3:
|
||||||
|
|||||||
@@ -43,8 +43,13 @@
|
|||||||
#define WLED_MIN_VIRTUAL_BUSSES 4
|
#define WLED_MIN_VIRTUAL_BUSSES 4
|
||||||
#else
|
#else
|
||||||
#if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
|
#if defined(USERMOD_AUDIOREACTIVE) // requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
|
||||||
|
#ifndef WLEDMM_FASTPATH
|
||||||
#define WLED_MAX_BUSSES 8
|
#define WLED_MAX_BUSSES 8
|
||||||
#define WLED_MIN_VIRTUAL_BUSSES 2
|
#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
|
#else
|
||||||
#define WLED_MAX_BUSSES 10
|
#define WLED_MAX_BUSSES 10
|
||||||
#define WLED_MIN_VIRTUAL_BUSSES 0
|
#define WLED_MIN_VIRTUAL_BUSSES 0
|
||||||
|
|||||||
Reference in New Issue
Block a user