From 9e6a809ba21f43bdab41694b0a39974ef922e8ad Mon Sep 17 00:00:00 2001 From: Yury Sannikov Date: Thu, 7 May 2020 11:58:17 +0300 Subject: [PATCH] adapt to the latest development branch changes --- tasmota/my_user_config.h | 2 ++ tasmota/settings.h | 5 ++++- tasmota/support_features.ino | 4 +++- tasmota/tasmota_template.h | 9 ++++++++- tasmota/xsns_68_opentherm.ino | 4 ++-- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index ff6771a60..df156cc8f 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -666,6 +666,8 @@ #define USE_TASMOTA_SLAVE_FLASH_SPEED 57600 // Usually 57600 for 3.3V variants and 115200 for 5V variants #define USE_TASMOTA_SLAVE_SERIAL_SPEED 57600 // Depends on the sketch that is running on the Uno/Pro Mini + //TODO: comment out before merging a PR. Enabled for the CI tests only + #define USE_OPENTHERM // Use OpenTherm implementation // -- End of general directives ------------------- /*********************************************************************************************\ diff --git a/tasmota/settings.h b/tasmota/settings.h index bcbe35fa7..2a7313fd9 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -482,7 +482,10 @@ struct { uint8_t shutter_startrelay[MAX_SHUTTERS]; // E84 uint8_t pcf8574_config[MAX_PCF8574]; // E88 - uint8_t free_e8c[4]; // E8C + uint8_t ot_hot_water_setpoint; // E8C + uint8_t ot_boiler_setpoint; // E8D + uint8_t ot_flags; // E8E + uint8_t free_e8f[1]; // E8F uint16_t dimmer_hw_min; // E90 uint16_t dimmer_hw_max; // E92 diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index aa02d676e..1fc3995a5 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -554,7 +554,9 @@ void GetFeatures(void) #ifdef USE_PING feature6 |= 0x00000080; // xdrv_38_ping.ino #endif - +#ifdef USE_THERMOSTAT + feature6 |= 0x00000200; // xsns_68_opentherm.ino +#endif // feature6 |= 0x00000100; // feature6 |= 0x00000200; // feature6 |= 0x00000400; diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 5f9c23b7c..fe689cc57 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -230,6 +230,8 @@ enum UserSelectablePins { GPIO_ELECTRIQ_MOODL_TX, // ElectriQ iQ-wifiMOODL Serial TX GPIO_AS3935, GPIO_PMS5003_TX, // Plantower PMS5003 Serial interface + GPIO_BOILER_OT_RX, // OpenTherm Boiler RX pin + GPIO_BOILER_OT_TX, // OpenTherm Boiler TX pin GPIO_SENSOR_END }; // Programmer selectable GPIO functionality @@ -317,7 +319,8 @@ const char kSensorNames[] PROGMEM = D_SENSOR_CC1101_GDO0 "|" D_SENSOR_CC1101_GDO2 "|" D_SENSOR_HRXL_RX "|" D_SENSOR_ELECTRIQ_MOODL "|" - D_SENSOR_AS3935 "|" D_SENSOR_PMS5003_TX + D_SENSOR_AS3935 "|" D_SENSOR_PMS5003_TX "|" + D_SENSOR_BOILER_OT_RX "|" D_SENSOR_BOILER_OT_TX ; const char kSensorNamesFixed[] PROGMEM = @@ -665,6 +668,10 @@ const uint8_t kGpioNiceList[] PROGMEM = { #ifdef USE_AS3935 GPIO_AS3935, #endif +#ifdef USE_OPENTHERM + GPIO_BOILER_OT_RX, + GPIO_BOILER_OT_TX, +#endif }; /********************************************************************************************/ diff --git a/tasmota/xsns_68_opentherm.ino b/tasmota/xsns_68_opentherm.ino index bbdc90f96..953f037e5 100644 --- a/tasmota/xsns_68_opentherm.ino +++ b/tasmota/xsns_68_opentherm.ino @@ -198,9 +198,9 @@ void sns_opentherm_processResponseCallback(unsigned long response, int st) bool sns_opentherm_Init() { - if (pin[GPIO_BOILER_OT_RX] < 99 && pin[GPIO_BOILER_OT_TX] < 99) + if (PinUsed(GPIO_BOILER_OT_RX) && PinUsed(GPIO_BOILER_OT_TX)) { - sns_ot_master = new OpenTherm(pin[GPIO_BOILER_OT_RX], pin[GPIO_BOILER_OT_TX]); + sns_ot_master = new OpenTherm(Pin(GPIO_BOILER_OT_RX), Pin(GPIO_BOILER_OT_TX)); sns_ot_master->begin(sns_opentherm_handleInterrupt, sns_opentherm_processResponseCallback); sns_ot_connection_status = OpenThermConnectionStatus::OTC_CONNECTING;