From cc3b0478018b381d8e674dede008c6ede838faab Mon Sep 17 00:00:00 2001 From: RaphDaMan Date: Sat, 20 Mar 2021 16:20:23 +0100 Subject: [PATCH] Squashed commit of the following: commit ab21a5e25a74a609f4e4ff50e1e723586f28b141 Author: RaphDaMan Date: Sat Mar 20 16:12:11 2021 +0100 v0.8 final with ESP32 build fix. --- tasmota/my_user_config.h | 2 +- tasmota/tasmota_template.h | 3 +++ tasmota/xsns_88_tfminiplus.ino | 9 ++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 9716f92f2..10de5d9fc 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -699,7 +699,7 @@ // #define USE_PROJECTOR_CTRL_OPTOMA // Use codes for OPTOMA //#define USE_AS608 // Add support for AS608 optical and R503 capacitive fingerprint sensor (+3k code) // #define USE_AS608_MESSAGES // Add verbose error messages (+0k4 code) -//#define USE_TFMINIPLUS // Add suppoer for TFmini Plus (TFmini, TFmini-S) LiDAR modules via UART interface +//#define USE_TFMINIPLUS // Add support for TFmini Plus (TFmini, TFmini-S) LiDAR modules via UART interface (+0k8) // -- Power monitoring sensors -------------------- #define USE_ENERGY_MARGIN_DETECTION // Add support for Energy Margin detection (+1k6 code) diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 69be04616..2fa3882d6 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -330,7 +330,10 @@ const char kSensorNames[] PROGMEM = D_SENSOR_SSD1351_DC "|" D_SENSOR_XPT2046_CS "|" D_SENSOR_CSE7761_TX "|" D_SENSOR_CSE7761_RX "|" +<<<<<<< HEAD D_SENSOR_VL53L0X_XSHUT "|" +======= +>>>>>>> TFmini+ D_SENSOR_TFMINIPLUS_TX "|" D_SENSOR_TFMINIPLUS_RX "|" ; diff --git a/tasmota/xsns_88_tfminiplus.ino b/tasmota/xsns_88_tfminiplus.ino index 22905ae64..5a7b7e830 100644 --- a/tasmota/xsns_88_tfminiplus.ino +++ b/tasmota/xsns_88_tfminiplus.ino @@ -105,7 +105,8 @@ void TfmpInit(void) { if (PinUsed(GPIO_TFMINIPLUS_RX) && PinUsed(GPIO_TFMINIPLUS_TX)) { - TfmpSerial = new TasmotaSerial(Pin(GPIO_TFMINIPLUS_RX), Pin(GPIO_TFMINIPLUS_TX)); +#ifdef ESP8266 + TfmpSerial = new TasmotaSerial(Pin(GPIO_TFMINIPLUS_RX), Pin(GPIO_TFMINIPLUS_TX), 1); if (TfmpSerial->begin(BAUDRATE)) { if (TfmpSerial->hardwareSerial()) @@ -115,6 +116,12 @@ void TfmpInit(void) tfminiplus_sensor.ready = true; TfmpSerial->flush(); } +#endif // ESP8266 +#ifdef ESP32 + TfmpSerial = new HardwareSerial(2); + TfmpSerial->begin(BAUDRATE, SERIAL_8N1, Pin(GPIO_TFMINIPLUS_RX), Pin(GPIO_TFMINIPLUS_TX)); + TfmpSerial->flush(); +#endif // ESP32 } } }