From 23b5fd1c1205f32e6a2c102dd215ebe0bdf76add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Fri, 26 Mar 2021 11:52:04 +0100 Subject: [PATCH] BusManager static method. --- wled00/bus_manager.h | 2 +- wled00/cfg.cpp | 2 +- wled00/wled.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index d036d6159..ddbef2212 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 1717a4f35..f3e81ae02 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 272522cda..0b72d2e6c 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; }