BusManager static method.
This commit is contained in:
parent
7a8ba7d47d
commit
23b5fd1c12
@ -335,7 +335,7 @@ class BusManager {
|
||||
};
|
||||
|
||||
//utility to get the approx. memory usage of a given BusConfig
|
||||
uint32_t memUsage(BusConfig &bc) {
|
||||
static uint32_t memUsage(BusConfig &bc) {
|
||||
uint8_t type = bc.type;
|
||||
uint16_t len = bc.count;
|
||||
if (type < 32) {
|
||||
|
@ -134,7 +134,7 @@ void deserializeConfig() {
|
||||
s++;
|
||||
lC += length;
|
||||
BusConfig bc = BusConfig(ledType, pins, start, length, colorOrder, reversed, skipFirst);
|
||||
mem += busses.memUsage(bc);
|
||||
mem += BusManager::memUsage(bc);
|
||||
if (mem <= MAX_LED_MEMORY) busses.add(bc);
|
||||
}
|
||||
if (lC > ledCount) ledCount = lC; // fix incorrect total length (honour analog setup)
|
||||
|
@ -226,7 +226,7 @@ void WLED::loop()
|
||||
uint32_t mem = 0;
|
||||
for (uint8_t i = 0; i < WLED_MAX_BUSSES; i++) {
|
||||
if (busConfigs[i] == nullptr) break;
|
||||
mem += busses.memUsage(*busConfigs[i]);
|
||||
mem += BusManager::memUsage(*busConfigs[i]);
|
||||
if (mem <= MAX_LED_MEMORY) busses.add(*busConfigs[i]);
|
||||
delete busConfigs[i]; busConfigs[i] = nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user