diff --git a/lib/framework/NetworkSettingsService.cpp b/lib/framework/NetworkSettingsService.cpp index 8b9349326..9f575f926 100644 --- a/lib/framework/NetworkSettingsService.cpp +++ b/lib/framework/NetworkSettingsService.cpp @@ -147,8 +147,6 @@ void NetworkSettingsService::setWiFiPowerOnRSSI() { 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: // WIFI_POWER_19_5dBm = 78,// 19.5dBm // WIFI_POWER_19dBm = 76,// 19dBm @@ -183,6 +181,7 @@ void NetworkSettingsService::setWiFiPowerOnRSSI() { p = WIFI_POWER_5dBm; #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); #else char result[10]; @@ -358,13 +357,13 @@ void NetworkSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) setWiFiPowerOnRSSI(); } #if ESP_IDF_VERSION_MAJOR < 5 - WiFi.enableIpV6(); + WiFi.enableIpV6(); #endif break; case ARDUINO_EVENT_ETH_CONNECTED: #if ESP_IDF_VERSION_MAJOR < 5 - ETH.enableIpV6(); + ETH.enableIpV6(); #endif break; diff --git a/lib_standalone/emsuart_standalone.cpp b/lib_standalone/emsuart_standalone.cpp index 56ac5271e..993ecd30b 100644 --- a/lib_standalone/emsuart_standalone.cpp +++ b/lib_standalone/emsuart_standalone.cpp @@ -20,9 +20,6 @@ #include "emsuart_standalone.h" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" - namespace emsesp { /* diff --git a/platformio.ini b/platformio.ini index 5cd6ee8f8..cd5ddb0f4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ extra_configs = pio_local.ini [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 ; my_build_flags is set in pio_local.ini diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index ed45fb263..e78bbf567 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -1730,15 +1730,10 @@ void Boiler::process_UBASetPoints(std::shared_ptr telegram) { } } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" - // 0x35 - not yet implemented, not readable, only for settings void Boiler::process_UBAFlags(std::shared_ptr telegram) { } -#pragma GCC diagnostic pop - // 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 00 00 00 00 00 00 -> message reset diff --git a/src/devices/heatpump.cpp b/src/devices/heatpump.cpp index dafc7393b..e86578358 100644 --- a/src/devices/heatpump.cpp +++ b/src/devices/heatpump.cpp @@ -187,9 +187,6 @@ void Heatpump::process_HPMonitor2(std::shared_ptr telegram) { has_update(telegram, airHumidity_, 1); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" - /* * Type 0x42B- HeatPump Monitor 1 * e.g. "38 10 FF 00 03 2B 00 D1 08 2A 01" @@ -198,8 +195,6 @@ void Heatpump::process_HPMonitor1(std::shared_ptr telegram) { // still to implement } -#pragma GCC diagnostic pop - // 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 void Heatpump::process_HPTemperature(std::shared_ptr telegram) { diff --git a/src/devices/heatsource.cpp b/src/devices/heatsource.cpp index 6001f2db7..061cb01b7 100644 --- a/src/devices/heatsource.cpp +++ b/src/devices/heatsource.cpp @@ -162,9 +162,6 @@ void Heatsource::process_amSettingMessage(std::shared_ptr telegr 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 // Boiler(0x60) -> Me(0x0B), amCommand(0x054F), data: 00 00 00 00 00 00 00 void Heatsource::process_amCommandMessage(std::shared_ptr telegram) { @@ -182,8 +179,6 @@ void Heatsource::process_amExtraMessage(std::shared_ptr telegram has_update(telegram, blockRemainWw_, 25); // minutes } -#pragma GCC diagnostic pop - // Settings AM200 // pos 12: off(00)/Keelbypass(01)/(hc1pump(02) only standalone) diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index c5c92e168..594e5573c 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -154,9 +154,6 @@ void Mixer::process_MMPLUSConfigMessage_HC(std::shared_ptr teleg 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) -> Mixing Module(0x20), (0x2E1), data: 01 00 00 00 01 // Thermostat(0x10) -> Mixing Module(0x20), (0x2EB), data: 00 @@ -180,8 +177,6 @@ void Mixer::process_IPMSetMessage(std::shared_ptr telegram) { // pos 1: pump in %? } -#pragma GCC diagnostic pop - bool Mixer::set_flowSetTemp(const char * value, const int8_t id) { int v; if (!Helpers::value2number(value, v)) { diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 612bb0a9c..8607fd2a9 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -614,9 +614,6 @@ void Thermostat::process_RC10Set(std::shared_ptr telegram) { has_update(telegram, heatingpid_, 6); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" - // type 0xB2, mode setting Data: 04 00 // not used, we read mode from monitor 0xB1 void Thermostat::process_RC10Set_2(std::shared_ptr telegram) { @@ -629,8 +626,6 @@ void Thermostat::process_RC10Set_2(std::shared_ptr telegram) { // 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) // 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 telegram) { @@ -1613,7 +1608,7 @@ void Thermostat::process_RCTime(std::shared_ptr telegram) { tm_->tm_isdst = -1; // determine dst ttime = mktime(tm_); // thermostat time } - struct timeval newnow = {.tv_sec = ttime}; + struct timeval newnow = {.tv_sec = ttime, .tv_usec = 0}; settimeofday(&newnow, nullptr); LOG_INFO("ems-esp time set from thermostat"); } diff --git a/src/devices/water.cpp b/src/devices/water.cpp index 5fcd943bb..772748062 100644 --- a/src/devices/water.cpp +++ b/src/devices/water.cpp @@ -168,14 +168,11 @@ void Water::process_SM100wwStatus2(std::shared_ptr telegram) { has_update(telegram, wwPumpMod_, 9); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" // SM100wwCommand - 0x07AB // Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01 void Water::process_SM100wwCommand(std::shared_ptr telegram) { // not implemented yet } -#pragma GCC diagnostic pop /* * MM100 messages diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 2b63fd65a..0170051f6 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -1701,7 +1701,7 @@ bool EMSdevice::generate_values(JsonObject output, const int8_t tag_filter, cons char time_s[60]; snprintf(time_s, sizeof(time_s), - "%d %s %d %s %d %s", + "%lu %s %lu %s %lu %s", (time_value / 1440), Helpers::translated_word(FL_(days)), ((time_value % 1440) / 60), diff --git a/src/uart/emsuart_esp32.cpp b/src/uart/emsuart_esp32.cpp index 54cffde9a..26736ba6f 100644 --- a/src/uart/emsuart_esp32.cpp +++ b/src/uart/emsuart_esp32.cpp @@ -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) { if (tx_mode_ == 0xFF) { uart_config_t uart_config = { - .baud_rate = EMSUART_BAUD, - .data_bits = UART_DATA_8_BITS, - .parity = UART_PARITY_DISABLE, - .stop_bits = UART_STOP_BITS_1, - .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, - .source_clk = UART_SCLK_APB, + .baud_rate = EMSUART_BAUD, + .data_bits = UART_DATA_8_BITS, + .parity = UART_PARITY_DISABLE, + .stop_bits = UART_STOP_BITS_1, + .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, + .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) inverse_mask |= UART_SIGNAL_RXD_INV;