Merge branch 'dev' into single-doc

This commit is contained in:
Blaž Kristan
2021-11-04 10:05:02 +01:00
26 changed files with 987 additions and 99 deletions

View File

@@ -138,13 +138,10 @@ void WLED::loop()
bool aligned = strip.checkSegmentAlignment(); //see if old segments match old bus(ses)
busses.removeAll();
uint32_t mem = 0;
ledCount = 1;
for (uint8_t i = 0; i < WLED_MAX_BUSSES; i++) {
if (busConfigs[i] == nullptr) break;
mem += BusManager::memUsage(*busConfigs[i]);
if (mem <= MAX_LED_MEMORY) {
uint16_t totalNew = busConfigs[i]->start + busConfigs[i]->count;
if (totalNew > ledCount && totalNew <= MAX_LEDS) ledCount = totalNew; //total is end of last bus (where start + len is max.)
busses.add(*busConfigs[i]);
}
delete busConfigs[i]; busConfigs[i] = nullptr;