From 2e3024ab61bd321d65a7dc34a42b9480eee9cab3 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 26 Jan 2025 13:56:50 +0100 Subject: [PATCH] move all statics up --- src/core/emsesp.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/core/emsesp.cpp b/src/core/emsesp.cpp index d3c425c5d..c6c2f125c 100644 --- a/src/core/emsesp.cpp +++ b/src/core/emsesp.cpp @@ -28,6 +28,24 @@ 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_ = true; +uint32_t EMSESP::last_fetch_ = 0; + AsyncWebServer webServer(80); #if defined(EMSESP_STANDALONE) @@ -56,10 +74,6 @@ WebLogService EMSESP::webLogService = WebLogService(&webServer, EMSESP using DeviceFlags = EMSdevice; using DeviceType = EMSdevice::DeviceType; -std::deque> EMSESP::emsdevices; // array of all the detected EMS devices -std::vector EMSESP::device_library_; // library of all our known EMS devices, in heap - -uuid::log::Logger EMSESP::logger_{F_(emsesp), uuid::log::Facility::KERN}; uuid::log::Logger EMSESP::logger() { return logger_; } @@ -79,21 +93,6 @@ AnalogSensor EMSESP::analogsensor_; // Analog sensors Shower EMSESP::shower_; // Shower logic Preferences EMSESP::nvs_; // NV Storage -// static/common variables -uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; // for when log is TRACE. 0 means no trace set -uint8_t EMSESP::watch_ = 0; // trace off -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; // for when Boiler states we having running warm water. used in Shower() -uint32_t EMSESP::last_fetch_ = 0; -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_ = true; - // for a specific EMS device go and request data values // or if device_id is 0 it will fetch from all our known and active devices void EMSESP::fetch_device_values(const uint8_t device_id) {