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:
@@ -319,7 +319,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
|
#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
|
/* ADC over I2S Microphone
|
||||||
This microphone is an ADC pin sampled via the I2S interval
|
This microphone is an ADC pin sampled via the I2S interval
|
||||||
|
|||||||
@@ -25,10 +25,14 @@
|
|||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
#define WLED_MAX_BUSSES 3
|
#define WLED_MAX_BUSSES 3
|
||||||
#else
|
#else
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||||
#define WLED_MAX_BUSSES 5
|
#define WLED_MAX_BUSSES 5
|
||||||
#else
|
#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
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -219,11 +219,20 @@ PinOwner PinManagerClass::getPinOwner(byte gpio) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#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)
|
byte PinManagerClass::allocateLedc(byte channels)
|
||||||
{
|
{
|
||||||
if (channels > 16 || channels == 0) return 255;
|
if (channels > MAX_LED_CHANNELS || channels == 0) return 255;
|
||||||
byte ca = 0;
|
byte ca = 0;
|
||||||
for (byte i = 0; i < 16; i++) {
|
for (byte i = 0; i < MAX_LED_CHANNELS; i++) {
|
||||||
byte by = i >> 3;
|
byte by = i >> 3;
|
||||||
byte bi = i - 8*by;
|
byte bi = i - 8*by;
|
||||||
if (bitRead(ledcAlloc[by], bi)) { //found occupied pin
|
if (bitRead(ledcAlloc[by], bi)) { //found occupied pin
|
||||||
@@ -248,7 +257,7 @@ byte PinManagerClass::allocateLedc(byte channels)
|
|||||||
void PinManagerClass::deallocateLedc(byte pos, byte channels)
|
void PinManagerClass::deallocateLedc(byte pos, byte channels)
|
||||||
{
|
{
|
||||||
for (byte j = pos; j < pos + channels; j++) {
|
for (byte j = pos; j < pos + channels; j++) {
|
||||||
if (j > 16) return;
|
if (j > MAX_LED_CHANNELS) return;
|
||||||
byte by = j >> 3;
|
byte by = j >> 3;
|
||||||
byte bi = j - 8*by;
|
byte bi = j - 8*by;
|
||||||
bitWrite(ledcAlloc[by], bi, false);
|
bitWrite(ledcAlloc[by], bi, false);
|
||||||
|
|||||||
@@ -317,9 +317,9 @@ void getSettingsJS(byte subPage, char* dest)
|
|||||||
|
|
||||||
// set limits
|
// set limits
|
||||||
oappend(SET_F("bLimits("));
|
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
|
// 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
|
#else
|
||||||
oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(",");
|
oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(",");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user