Move RGBW activation to wled.cpp
This commit is contained in:
parent
4264c2a173
commit
806221bc3f
@ -88,7 +88,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
|||||||
uint8_t colorOrder, type;
|
uint8_t colorOrder, type;
|
||||||
uint16_t length, start;
|
uint16_t length, start;
|
||||||
uint8_t pins[5] = {255, 255, 255, 255, 255};
|
uint8_t pins[5] = {255, 255, 255, 255, 255};
|
||||||
useRGBW = false;
|
|
||||||
|
|
||||||
for (uint8_t s = 0; s < WLED_MAX_BUSSES; s++) {
|
for (uint8_t s = 0; s < WLED_MAX_BUSSES; s++) {
|
||||||
char lp[4] = "L0"; lp[2] = 48+s; lp[3] = 0; //ascii 0-9 //strip data pin
|
char lp[4] = "L0"; lp[2] = 48+s; lp[3] = 0; //ascii 0-9 //strip data pin
|
||||||
@ -106,7 +105,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
|||||||
pins[i] = (request->arg(lp).length() > 0) ? request->arg(lp).toInt() : 255;
|
pins[i] = (request->arg(lp).length() > 0) ? request->arg(lp).toInt() : 255;
|
||||||
}
|
}
|
||||||
type = request->arg(lt).toInt();
|
type = request->arg(lt).toInt();
|
||||||
//if (BusManager::isRgbw(type)) useRGBW = true; //30fps
|
//if (isRgbw(type)) useRGBW = true; //30fps
|
||||||
|
//useRGBW = true;
|
||||||
|
|
||||||
if (request->hasArg(lc) && request->arg(lc).toInt() > 0) {
|
if (request->hasArg(lc) && request->arg(lc).toInt() > 0) {
|
||||||
length = request->arg(lc).toInt();
|
length = request->arg(lc).toInt();
|
||||||
@ -120,6 +120,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
|||||||
if (busConfigs[s] != nullptr) delete busConfigs[s];
|
if (busConfigs[s] != nullptr) delete busConfigs[s];
|
||||||
busConfigs[s] = new BusConfig(type, pins, start, length, colorOrder, request->hasArg(cv));
|
busConfigs[s] = new BusConfig(type, pins, start, length, colorOrder, request->hasArg(cv));
|
||||||
//if (BusManager::isRgbw(type)) useRGBW = true; //20fps
|
//if (BusManager::isRgbw(type)) useRGBW = true; //20fps
|
||||||
|
//useRGBW = true;
|
||||||
doInitBusses = true;
|
doInitBusses = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,10 +241,12 @@ void WLED::loop()
|
|||||||
doInitBusses = false;
|
doInitBusses = false;
|
||||||
busses.removeAll();
|
busses.removeAll();
|
||||||
uint32_t mem = 0;
|
uint32_t mem = 0;
|
||||||
|
//useRGBW = false;
|
||||||
for (uint8_t i = 0; i < WLED_MAX_BUSSES; i++) {
|
for (uint8_t i = 0; i < WLED_MAX_BUSSES; i++) {
|
||||||
if (busConfigs[i] == nullptr) break;
|
if (busConfigs[i] == nullptr) break;
|
||||||
mem += busses.memUsage(*busConfigs[i]);
|
mem += busses.memUsage(*busConfigs[i]);
|
||||||
if (mem <= MAX_LED_MEMORY) busses.add(*busConfigs[i]);
|
if (mem <= MAX_LED_MEMORY) busses.add(*busConfigs[i]);
|
||||||
|
//if (BusManager::isRgbw(busConfigs[i]->type)) useRGBW = true;
|
||||||
delete busConfigs[i]; busConfigs[i] = nullptr;
|
delete busConfigs[i]; busConfigs[i] = nullptr;
|
||||||
}
|
}
|
||||||
strip.finalizeInit(useRGBW, ledCount, skipFirstLed);
|
strip.finalizeInit(useRGBW, ledCount, skipFirstLed);
|
||||||
|
Loading…
Reference in New Issue
Block a user