adapt to the latest development branch changes

This commit is contained in:
Yury Sannikov 2020-05-07 11:58:17 +03:00
parent 049ddad17b
commit 9e6a809ba2
5 changed files with 19 additions and 5 deletions

View File

@ -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 -------------------
/*********************************************************************************************\

View File

@ -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

View File

@ -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;

View File

@ -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
};
/********************************************************************************************/

View File

@ -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;