Remove ledCount (#2300)

Bus initialization on reading from eeprom
This commit is contained in:
Christian Schwinne
2021-10-31 11:57:41 +01:00
committed by GitHub
parent a93f05c047
commit 7e1920dc4b
12 changed files with 40 additions and 35 deletions

View File

@@ -212,13 +212,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;