From 16f7a454dbefa6aea911980f0600a9133dd6fb2c Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 19 Oct 2025 16:10:15 +0200 Subject: [PATCH] use vector instead of dequeue for memory optimization --- src/core/emsesp.cpp | 32 ++++++++++++++++---------------- src/core/emsesp.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/core/emsesp.cpp b/src/core/emsesp.cpp index ee1c68efe..120514952 100644 --- a/src/core/emsesp.cpp +++ b/src/core/emsesp.cpp @@ -29,22 +29,22 @@ static_assert(uuid::console::thread_safe, "uuid-console must be thread-safe"); namespace emsesp { // Static member definitions -std::deque> EMSESP::emsdevices{}; -std::vector EMSESP::device_library_; -uuid::log::Logger EMSESP::logger_{F_(emsesp), uuid::log::Facility::KERN}; -uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; -uint8_t EMSESP::watch_ = 0; -uint16_t EMSESP::read_id_ = WATCH_ID_NONE; -bool EMSESP::read_next_ = false; -uint16_t EMSESP::publish_id_ = 0; -uint16_t EMSESP::response_id_ = 0; -bool EMSESP::tap_water_active_ = false; -uint8_t EMSESP::publish_all_idx_ = 0; -uint8_t EMSESP::unique_id_count_ = 0; -bool EMSESP::trace_raw_ = false; -uint16_t EMSESP::wait_validate_ = 0; -bool EMSESP::wait_km_ = false; -uint32_t EMSESP::last_fetch_ = 0; +std::vector> EMSESP::emsdevices{}; +std::vector EMSESP::device_library_; +uuid::log::Logger EMSESP::logger_{F_(emsesp), uuid::log::Facility::KERN}; +uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; +uint8_t EMSESP::watch_ = 0; +uint16_t EMSESP::read_id_ = WATCH_ID_NONE; +bool EMSESP::read_next_ = false; +uint16_t EMSESP::publish_id_ = 0; +uint16_t EMSESP::response_id_ = 0; +bool EMSESP::tap_water_active_ = false; +uint8_t EMSESP::publish_all_idx_ = 0; +uint8_t EMSESP::unique_id_count_ = 0; +bool EMSESP::trace_raw_ = false; +uint16_t EMSESP::wait_validate_ = 0; +bool EMSESP::wait_km_ = false; +uint32_t EMSESP::last_fetch_ = 0; AsyncWebServer webServer(80); diff --git a/src/core/emsesp.h b/src/core/emsesp.h index f1a952b53..2821eecc6 100644 --- a/src/core/emsesp.h +++ b/src/core/emsesp.h @@ -222,7 +222,7 @@ class EMSESP { static void scan_devices(); static void clear_all_devices(); - static std::deque> emsdevices; + static std::vector> emsdevices; // services static Mqtt mqtt_;