From 1b0db5e5ab37182d8dc8ad3e8da1eb2bbdc2dad5 Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 5 Sep 2020 21:25:36 +0200 Subject: [PATCH] automatic clang formatting --- src/devices/boiler.h | 3 ++- src/devices/mixing.cpp | 11 +++++------ src/devices/thermostat.cpp | 5 +++-- src/emsesp.cpp | 6 ++---- src/system.cpp | 6 +++--- src/system.h | 11 ++++++----- src/telegram.h | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/devices/boiler.h b/src/devices/boiler.h index 578c1789a..c149df1b5 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -53,7 +53,8 @@ class Boiler : public EMSdevice { uint8_t last_boilerState = 0xFF; // remember last state of heating and warm water on/off uint8_t mqtt_format_; // single, nested or ha - bool changed_ = false;; + bool changed_ = false; + ; static constexpr uint8_t EMS_TYPE_UBAParameterWW = 0x33; static constexpr uint8_t EMS_TYPE_UBAFunctionTest = 0x1D; diff --git a/src/devices/mixing.cpp b/src/devices/mixing.cpp index f0ead6797..caad1a3fd 100644 --- a/src/devices/mixing.cpp +++ b/src/devices/mixing.cpp @@ -77,7 +77,6 @@ void Mixing::device_info(JsonArray & root) { render_value_json(root, "", F("Current pump modulation"), pumpMod_, F_(percent)); render_value_json(root, "", F("Current valve status"), status_, nullptr); } - } // check to see if values have been updated @@ -168,8 +167,8 @@ void Mixing::publish_values() { // A0 0B FF 00 01 D7 00 00 00 80 00 00 00 00 03 80 void Mixing::process_MMPLUSStatusMessage_HC(std::shared_ptr telegram) { type_ = Type::HC; - hc_ = telegram->type_id - 0x02D7 + 1; // determine which circuit this is - changed_ |= telegram->read_value(flowTemp_, 3); // is * 10 + hc_ = telegram->type_id - 0x02D7 + 1; // determine which circuit this is + changed_ |= telegram->read_value(flowTemp_, 3); // is * 10 changed_ |= telegram->read_value(flowSetTemp_, 5); changed_ |= telegram->read_value(pumpMod_, 2); changed_ |= telegram->read_value(status_, 1); // valve status @@ -180,8 +179,8 @@ void Mixing::process_MMPLUSStatusMessage_HC(std::shared_ptr tele // A8 00 FF 00 02 31 02 35 00 3C 00 3C 3C 46 02 03 03 00 3C // in 0x29 void Mixing::process_MMPLUSStatusMessage_WWC(std::shared_ptr telegram) { type_ = Type::WWC; - hc_ = telegram->type_id - 0x0331 + 1; // determine which circuit this is. There are max 2. - changed_ |= telegram->read_value(flowTemp_, 0); // is * 10 + hc_ = telegram->type_id - 0x0331 + 1; // determine which circuit this is. There are max 2. + changed_ |= telegram->read_value(flowTemp_, 0); // is * 10 changed_ |= telegram->read_value(pumpMod_, 2); changed_ |= telegram->read_value(status_, 11); // temp status } @@ -197,7 +196,7 @@ void Mixing::process_IPMStatusMessage(std::shared_ptr telegram) if (ismixed == 0) { return; } - if (ismixed == 2) { // we have a mixed circuit + if (ismixed == 2) { // we have a mixed circuit changed_ |= telegram->read_value(flowTemp_, 3); // is * 10 changed_ |= telegram->read_value(flowSetTemp_, 5); changed_ |= telegram->read_value(status_, 2); // valve status diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 8ec94740b..904e6957d 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -973,8 +973,9 @@ void Thermostat::process_EasyMonitor(std::shared_ptr telegram) { // Settings Parameters - 0xA5 - RC30_1 void Thermostat::process_IBASettings(std::shared_ptr telegram) { // 22 - display line on RC35 - changed_ |= telegram->read_value(ibaMainDisplay_, - 0); // display on Thermostat: 0 int. temp, 1 int. setpoint, 2 ext. temp., 3 burner temp., 4 ww temp, 5 functioning mode, 6 time, 7 data, 8 smoke temp + changed_ |= + telegram->read_value(ibaMainDisplay_, + 0); // display on Thermostat: 0 int. temp, 1 int. setpoint, 2 ext. temp., 3 burner temp., 4 ww temp, 5 functioning mode, 6 time, 7 data, 8 smoke temp changed_ |= telegram->read_value(ibaLanguage_, 1); // language on Thermostat: 0 german, 1 dutch, 2 french, 3 italian changed_ |= telegram->read_value(ibaCalIntTemperature_, 2); // offset int. temperature sensor, by * 0.1 Kelvin changed_ |= telegram->read_value(ibaBuildingType_, 6); // building type: 0 = light, 1 = medium, 2 = heavy diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 522b1eeca..f7110cfbe 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -305,10 +305,8 @@ void EMSESP::publish_device_values(uint8_t device_type) { void EMSESP::publish_other_values() { if (Mqtt::connected()) { for (const auto & emsdevice : emsdevices) { - if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::BOILER) - && (emsdevice->device_type() != EMSdevice::DeviceType::THERMOSTAT) - && (emsdevice->device_type() != EMSdevice::DeviceType::SOLAR) - && (emsdevice->device_type() != EMSdevice::DeviceType::MIXING)) { + if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::BOILER) && (emsdevice->device_type() != EMSdevice::DeviceType::THERMOSTAT) + && (emsdevice->device_type() != EMSdevice::DeviceType::SOLAR) && (emsdevice->device_type() != EMSdevice::DeviceType::MIXING)) { emsdevice->publish_values(); } } diff --git a/src/system.cpp b/src/system.cpp index d0f356f49..b22300498 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -245,7 +245,7 @@ void System::measure_analog() { static uint32_t measure_last_ = 0; static uint32_t sum_ = 0; - if (!measure_last_ || (uint32_t)(uuid::get_uptime() - measure_last_) >= 1100) { + if (!measure_last_ || (uint32_t)(uuid::get_uptime() - measure_last_) >= SYSTEM_MEASURE_ANALOG_INTERVAL) { measure_last_ = uuid::get_uptime(); #if defined(ESP8266) uint16_t a = analogRead(A0); @@ -255,8 +255,8 @@ void System::measure_analog() { if (!analog_) { // init first time analog_ = a; sum_ = a * 256; - } else { // simple moving average filter - sum_ = sum_ * 255 / 256 + a; + } else { // simple moving average filter + sum_ = sum_ * 255 / 256 + a; analog_ = sum_ / 256; } } diff --git a/src/system.h b/src/system.h index e12855426..c63dd9f07 100644 --- a/src/system.h +++ b/src/system.h @@ -68,12 +68,13 @@ class System { static uuid::syslog::SyslogService syslog_; #endif - static constexpr uint32_t SYSTEM_CHECK_FREQUENCY = 5000; // check every 5 seconds - static constexpr uint32_t LED_WARNING_BLINK = 1000; // pulse to show no connection, 1 sec - static constexpr uint32_t LED_WARNING_BLINK_FAST = 100; // flash quickly for boot up sequence - static constexpr uint32_t SYSTEM_HEARTBEAT_INTERVAL = 60000; // in milliseconds, how often the MQTT heartbeat is sent (1 min) + static constexpr uint32_t SYSTEM_CHECK_FREQUENCY = 5000; // check every 5 seconds + static constexpr uint32_t LED_WARNING_BLINK = 1000; // pulse to show no connection, 1 sec + static constexpr uint32_t LED_WARNING_BLINK_FAST = 100; // flash quickly for boot up sequence + static constexpr uint32_t SYSTEM_HEARTBEAT_INTERVAL = 60000; // in milliseconds, how often the MQTT heartbeat is sent (1 min) + static constexpr uint32_t SYSTEM_MEASURE_ANALOG_INTERVAL = 1100; -// internal LED + // internal LED static constexpr uint8_t LED_ON = LOW; void led_monitor(); diff --git a/src/telegram.h b/src/telegram.h index e8430cf7b..40234ee23 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -89,7 +89,7 @@ class Telegram { return false; // out of bounds } uint8_t val = value; - value = (uint8_t)(((this->message_data[abs_index]) >> (bit)) & 0x01); + value = (uint8_t)(((this->message_data[abs_index]) >> (bit)) & 0x01); if (val != value) { return true; } @@ -110,7 +110,7 @@ class Telegram { return false; } auto val = value; - value = 0; + value = 0; for (uint8_t i = 0; i < num_bytes; i++) { value = (value << 8) + this->message_data[index - this->offset + i]; // shift by byte }