diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index d036d615..ddbef221 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -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) { diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 1717a4f3..f3e81ae0 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -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) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 272522cd..0b72d2e6 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -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; }