ESP32-S3: different number of RMT and PWM channels

ESP32-S3: 8 RMT channels (not sure if all 8 are usable by NeopixelBus), 8 LED-PWM channels
This commit is contained in:
Frank
2022-09-02 22:30:56 +02:00
parent 4162d8fdfa
commit a67f9d86f7
4 changed files with 21 additions and 8 deletions

View File

@@ -319,7 +319,7 @@ public:
};
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// ADC over I2S is only availeable in "claasic" ESP32
// ADC over I2S is only availeable in "classic" ESP32
/* ADC over I2S Microphone
This microphone is an ADC pin sampled via the I2S interval

View File

@@ -25,10 +25,14 @@
#ifdef ESP8266
#define WLED_MAX_BUSSES 3
#else
#ifdef CONFIG_IDF_TARGET_ESP32S2
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
#define WLED_MAX_BUSSES 5
#else
#define WLED_MAX_BUSSES 10
#if defined(CONFIG_IDF_TARGET_ESP32S3)
#define WLED_MAX_BUSSES 8
#else
#define WLED_MAX_BUSSES 10
#endif
#endif
#endif
#endif

View File

@@ -219,11 +219,20 @@ PinOwner PinManagerClass::getPinOwner(byte gpio) {
}
#ifdef ARDUINO_ARCH_ESP32
#if defined(CONFIG_IDF_TARGET_ESP32C3)
#define MAX_LED_CHANNELS 6
#else
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
#define MAX_LED_CHANNELS 8
#else
#define MAX_LED_CHANNELS 16
#endif
#endif
byte PinManagerClass::allocateLedc(byte channels)
{
if (channels > 16 || channels == 0) return 255;
if (channels > MAX_LED_CHANNELS || channels == 0) return 255;
byte ca = 0;
for (byte i = 0; i < 16; i++) {
for (byte i = 0; i < MAX_LED_CHANNELS; i++) {
byte by = i >> 3;
byte bi = i - 8*by;
if (bitRead(ledcAlloc[by], bi)) { //found occupied pin
@@ -248,7 +257,7 @@ byte PinManagerClass::allocateLedc(byte channels)
void PinManagerClass::deallocateLedc(byte pos, byte channels)
{
for (byte j = pos; j < pos + channels; j++) {
if (j > 16) return;
if (j > MAX_LED_CHANNELS) return;
byte by = j >> 3;
byte bi = j - 8*by;
bitWrite(ledcAlloc[by], bi, false);

View File

@@ -317,9 +317,9 @@ void getSettingsJS(byte subPage, char* dest)
// set limits
oappend(SET_F("bLimits("));
#if defined(ESP32) && defined(USERMOD_AUDIOREACTIVE)
#if defined(ESP32) && defined(USERMOD_AUDIOREACTIVE) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// 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
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