Prevent I2S use for LEDs w/ Audioreactive on ESP32

This commit is contained in:
Blaž Kristan 2022-07-22 08:59:04 +02:00
parent 1f3a1a0a95
commit 35250677b9
3 changed files with 8 additions and 4 deletions

View File

@ -299,7 +299,7 @@ class UsermodManager {
void onUpdateBegin(bool);
bool add(Usermod* um);
Usermod* lookup(uint16_t mod_id);
byte getModCount();
byte getModCount() {return numMods;};
};
//usermods_list.cpp

View File

@ -59,5 +59,3 @@ bool UsermodManager::add(Usermod* um)
ums[numMods++] = um;
return true;
}
byte UsermodManager::getModCount() {return numMods;}

View File

@ -308,9 +308,15 @@ void getSettingsJS(byte subPage, char* dest)
// set limits
oappend(SET_F("bLimits("));
#ifdef ESP32
// requested by @softhack007 https://github.com/blazoncek/WLED/issues/33
if (usermods.lookup(USERMOD_ID_AUDIOREACTIVE))
oappend(itoa(WLED_MAX_BUSSES-2,nS,10)); // prevent use of I2S buses if audio installed
else
#endif
oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(",");
oappend(itoa(MAX_LEDS_PER_BUS,nS,10)); oappend(",");
oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(",");
oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(",");
oappend(itoa(MAX_LEDS,nS,10));
oappend(SET_F(");"));