mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
resolve lint warnings
This commit is contained in:
@@ -147,8 +147,6 @@ void NetworkSettingsService::setWiFiPowerOnRSSI() {
|
|||||||
min_tx_pwr = max_tx_pwr;
|
min_tx_pwr = max_tx_pwr;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t set_power = min_tx_pwr / 10; // this is the recommended power setting to use
|
|
||||||
|
|
||||||
// from WiFIGeneric.h use:
|
// from WiFIGeneric.h use:
|
||||||
// WIFI_POWER_19_5dBm = 78,// 19.5dBm
|
// WIFI_POWER_19_5dBm = 78,// 19.5dBm
|
||||||
// WIFI_POWER_19dBm = 76,// 19dBm
|
// WIFI_POWER_19dBm = 76,// 19dBm
|
||||||
@@ -183,6 +181,7 @@ void NetworkSettingsService::setWiFiPowerOnRSSI() {
|
|||||||
p = WIFI_POWER_5dBm;
|
p = WIFI_POWER_5dBm;
|
||||||
|
|
||||||
#ifdef EMSESP_DEBUG
|
#ifdef EMSESP_DEBUG
|
||||||
|
uint8_t set_power = min_tx_pwr / 10; // this is the recommended power setting to use
|
||||||
emsesp::EMSESP::logger().debug("Recommended set WiFi Tx Power (set_power %d, new power %d, rssi %d, threshold %d)", set_power, p, rssi, threshold);
|
emsesp::EMSESP::logger().debug("Recommended set WiFi Tx Power (set_power %d, new power %d, rssi %d, threshold %d)", set_power, p, rssi, threshold);
|
||||||
#else
|
#else
|
||||||
char result[10];
|
char result[10];
|
||||||
@@ -358,13 +357,13 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info)
|
|||||||
setWiFiPowerOnRSSI();
|
setWiFiPowerOnRSSI();
|
||||||
}
|
}
|
||||||
#if ESP_IDF_VERSION_MAJOR < 5
|
#if ESP_IDF_VERSION_MAJOR < 5
|
||||||
WiFi.enableIpV6();
|
WiFi.enableIpV6();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARDUINO_EVENT_ETH_CONNECTED:
|
case ARDUINO_EVENT_ETH_CONNECTED:
|
||||||
#if ESP_IDF_VERSION_MAJOR < 5
|
#if ESP_IDF_VERSION_MAJOR < 5
|
||||||
ETH.enableIpV6();
|
ETH.enableIpV6();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,6 @@
|
|||||||
|
|
||||||
#include "emsuart_standalone.h"
|
#include "emsuart_standalone.h"
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
|
|
||||||
namespace emsesp {
|
namespace emsesp {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ extra_configs =
|
|||||||
pio_local.ini
|
pio_local.ini
|
||||||
|
|
||||||
[common]
|
[common]
|
||||||
core_build_flags = -std=gnu++2a -Isrc -Wno-type-limits
|
core_build_flags = -std=gnu++2a -Isrc -Wno-type-limits -Wall -Wextra -Wno-unused-parameter
|
||||||
core_unbuild_flags = -std=gnu++11
|
core_unbuild_flags = -std=gnu++11
|
||||||
|
|
||||||
; my_build_flags is set in pio_local.ini
|
; my_build_flags is set in pio_local.ini
|
||||||
|
|||||||
@@ -1730,15 +1730,10 @@ void Boiler::process_UBASetPoints(std::shared_ptr<const Telegram> telegram) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
|
|
||||||
// 0x35 - not yet implemented, not readable, only for settings
|
// 0x35 - not yet implemented, not readable, only for settings
|
||||||
void Boiler::process_UBAFlags(std::shared_ptr<const Telegram> telegram) {
|
void Boiler::process_UBAFlags(std::shared_ptr<const Telegram> telegram) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
// 0x1C
|
// 0x1C
|
||||||
// 08 00 1C 94 0B 0A 1D 31 08 00 80 00 00 00 -> message for 29.11.2020
|
// 08 00 1C 94 0B 0A 1D 31 08 00 80 00 00 00 -> message for 29.11.2020
|
||||||
// 08 00 1C 94 0B 0A 1D 31 00 00 00 00 00 00 -> message reset
|
// 08 00 1C 94 0B 0A 1D 31 00 00 00 00 00 00 -> message reset
|
||||||
|
|||||||
@@ -187,9 +187,6 @@ void Heatpump::process_HPMonitor2(std::shared_ptr<const Telegram> telegram) {
|
|||||||
has_update(telegram, airHumidity_, 1);
|
has_update(telegram, airHumidity_, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Type 0x42B- HeatPump Monitor 1
|
* Type 0x42B- HeatPump Monitor 1
|
||||||
* e.g. "38 10 FF 00 03 2B 00 D1 08 2A 01"
|
* e.g. "38 10 FF 00 03 2B 00 D1 08 2A 01"
|
||||||
@@ -198,8 +195,6 @@ void Heatpump::process_HPMonitor1(std::shared_ptr<const Telegram> telegram) {
|
|||||||
// still to implement
|
// still to implement
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
// 0x09A0
|
// 0x09A0
|
||||||
// Heatpump(0x53) -> All(0x00), ?(0x09A0), data: 02 23 01 3E 01 39 00 5D 01 DE 01 38 00 40 00 5E 00 58 00 3F 01 34 00 02
|
// Heatpump(0x53) -> All(0x00), ?(0x09A0), data: 02 23 01 3E 01 39 00 5D 01 DE 01 38 00 40 00 5E 00 58 00 3F 01 34 00 02
|
||||||
void Heatpump::process_HPTemperature(std::shared_ptr<const Telegram> telegram) {
|
void Heatpump::process_HPTemperature(std::shared_ptr<const Telegram> telegram) {
|
||||||
|
|||||||
@@ -162,9 +162,6 @@ void Heatsource::process_amSettingMessage(std::shared_ptr<const Telegram> telegr
|
|||||||
has_update(telegram, releaseWait_, 15); // pos 15: Boiler release wait time (min)
|
has_update(telegram, releaseWait_, 15); // pos 15: Boiler release wait time (min)
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
|
|
||||||
// 0x054F AM200 not broadcasted message, 7 bytes long
|
// 0x054F AM200 not broadcasted message, 7 bytes long
|
||||||
// Boiler(0x60) -> Me(0x0B), amCommand(0x054F), data: 00 00 00 00 00 00 00
|
// Boiler(0x60) -> Me(0x0B), amCommand(0x054F), data: 00 00 00 00 00 00 00
|
||||||
void Heatsource::process_amCommandMessage(std::shared_ptr<const Telegram> telegram) {
|
void Heatsource::process_amCommandMessage(std::shared_ptr<const Telegram> telegram) {
|
||||||
@@ -182,8 +179,6 @@ void Heatsource::process_amExtraMessage(std::shared_ptr<const Telegram> telegram
|
|||||||
has_update(telegram, blockRemainWw_, 25); // minutes
|
has_update(telegram, blockRemainWw_, 25); // minutes
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
// Settings AM200
|
// Settings AM200
|
||||||
|
|
||||||
// pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
// pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone)
|
||||||
|
|||||||
@@ -154,9 +154,6 @@ void Mixer::process_MMPLUSConfigMessage_HC(std::shared_ptr<const Telegram> teleg
|
|||||||
has_update(telegram, flowTempOffset_, 2); // Mixer increase [0-20 K]
|
has_update(telegram, flowTempOffset_, 2); // Mixer increase [0-20 K]
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
|
|
||||||
// Thermostat(0x10) -> Mixer(0x20), ?(0x2E1), data: 01 1C 64 00 01
|
// Thermostat(0x10) -> Mixer(0x20), ?(0x2E1), data: 01 1C 64 00 01
|
||||||
// Thermostat(0x10) -> Mixing Module(0x20), (0x2E1), data: 01 00 00 00 01
|
// Thermostat(0x10) -> Mixing Module(0x20), (0x2E1), data: 01 00 00 00 01
|
||||||
// Thermostat(0x10) -> Mixing Module(0x20), (0x2EB), data: 00
|
// Thermostat(0x10) -> Mixing Module(0x20), (0x2EB), data: 00
|
||||||
@@ -180,8 +177,6 @@ void Mixer::process_IPMSetMessage(std::shared_ptr<const Telegram> telegram) {
|
|||||||
// pos 1: pump in %?
|
// pos 1: pump in %?
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
bool Mixer::set_flowSetTemp(const char * value, const int8_t id) {
|
bool Mixer::set_flowSetTemp(const char * value, const int8_t id) {
|
||||||
int v;
|
int v;
|
||||||
if (!Helpers::value2number(value, v)) {
|
if (!Helpers::value2number(value, v)) {
|
||||||
|
|||||||
@@ -614,9 +614,6 @@ void Thermostat::process_RC10Set(std::shared_ptr<const Telegram> telegram) {
|
|||||||
has_update(telegram, heatingpid_, 6);
|
has_update(telegram, heatingpid_, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
|
|
||||||
// type 0xB2, mode setting Data: 04 00
|
// type 0xB2, mode setting Data: 04 00
|
||||||
// not used, we read mode from monitor 0xB1
|
// not used, we read mode from monitor 0xB1
|
||||||
void Thermostat::process_RC10Set_2(std::shared_ptr<const Telegram> telegram) {
|
void Thermostat::process_RC10Set_2(std::shared_ptr<const Telegram> telegram) {
|
||||||
@@ -629,8 +626,6 @@ void Thermostat::process_RC10Set_2(std::shared_ptr<const Telegram> telegram) {
|
|||||||
// has_update(hc->mode, mode >> 1); // store as enum 0, 1, 2
|
// has_update(hc->mode, mode >> 1); // store as enum 0, 1, 2
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
// 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
// 0xA8 - for reading the mode from the RC20 thermostat (0x17)
|
||||||
// RC20Set(0xA8), data: 01 00 FF F6 01 06 00 01 0D 01 00 FF FF 01 02 02 02 00 00 05 1E 05 1E 02 1C 00 FF 00 00 26 02
|
// RC20Set(0xA8), data: 01 00 FF F6 01 06 00 01 0D 01 00 FF FF 01 02 02 02 00 00 05 1E 05 1E 02 1C 00 FF 00 00 26 02
|
||||||
void Thermostat::process_RC20Set(std::shared_ptr<const Telegram> telegram) {
|
void Thermostat::process_RC20Set(std::shared_ptr<const Telegram> telegram) {
|
||||||
@@ -1613,7 +1608,7 @@ void Thermostat::process_RCTime(std::shared_ptr<const Telegram> telegram) {
|
|||||||
tm_->tm_isdst = -1; // determine dst
|
tm_->tm_isdst = -1; // determine dst
|
||||||
ttime = mktime(tm_); // thermostat time
|
ttime = mktime(tm_); // thermostat time
|
||||||
}
|
}
|
||||||
struct timeval newnow = {.tv_sec = ttime};
|
struct timeval newnow = {.tv_sec = ttime, .tv_usec = 0};
|
||||||
settimeofday(&newnow, nullptr);
|
settimeofday(&newnow, nullptr);
|
||||||
LOG_INFO("ems-esp time set from thermostat");
|
LOG_INFO("ems-esp time set from thermostat");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,14 +168,11 @@ void Water::process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram) {
|
|||||||
has_update(telegram, wwPumpMod_, 9);
|
has_update(telegram, wwPumpMod_, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
||||||
// SM100wwCommand - 0x07AB
|
// SM100wwCommand - 0x07AB
|
||||||
// Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01
|
// Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01
|
||||||
void Water::process_SM100wwCommand(std::shared_ptr<const Telegram> telegram) {
|
void Water::process_SM100wwCommand(std::shared_ptr<const Telegram> telegram) {
|
||||||
// not implemented yet
|
// not implemented yet
|
||||||
}
|
}
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MM100 messages
|
* MM100 messages
|
||||||
|
|||||||
@@ -1701,7 +1701,7 @@ bool EMSdevice::generate_values(JsonObject output, const int8_t tag_filter, cons
|
|||||||
char time_s[60];
|
char time_s[60];
|
||||||
snprintf(time_s,
|
snprintf(time_s,
|
||||||
sizeof(time_s),
|
sizeof(time_s),
|
||||||
"%d %s %d %s %d %s",
|
"%lu %s %lu %s %lu %s",
|
||||||
(time_value / 1440),
|
(time_value / 1440),
|
||||||
Helpers::translated_word(FL_(days)),
|
Helpers::translated_word(FL_(days)),
|
||||||
((time_value % 1440) / 60),
|
((time_value % 1440) / 60),
|
||||||
|
|||||||
@@ -73,12 +73,13 @@ void EMSuart::uart_event_task(void * pvParameters) {
|
|||||||
void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t tx_gpio) {
|
void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t tx_gpio) {
|
||||||
if (tx_mode_ == 0xFF) {
|
if (tx_mode_ == 0xFF) {
|
||||||
uart_config_t uart_config = {
|
uart_config_t uart_config = {
|
||||||
.baud_rate = EMSUART_BAUD,
|
.baud_rate = EMSUART_BAUD,
|
||||||
.data_bits = UART_DATA_8_BITS,
|
.data_bits = UART_DATA_8_BITS,
|
||||||
.parity = UART_PARITY_DISABLE,
|
.parity = UART_PARITY_DISABLE,
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
.stop_bits = UART_STOP_BITS_1,
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||||
.source_clk = UART_SCLK_APB,
|
.rx_flow_ctrl_thresh = 0, // not used - https://docs.espressif.com/projects/esp-idf/en/v3.3.6/api-reference/peripherals/uart.html
|
||||||
|
.source_clk = UART_SCLK_APB,
|
||||||
};
|
};
|
||||||
#if defined(EMSUART_RX_INVERT)
|
#if defined(EMSUART_RX_INVERT)
|
||||||
inverse_mask |= UART_SIGNAL_RXD_INV;
|
inverse_mask |= UART_SIGNAL_RXD_INV;
|
||||||
|
|||||||
Reference in New Issue
Block a user