From f3b1c4d543bbbb06d990f50dca859392be2fe6d0 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:24:53 +0200 Subject: [PATCH] Add POWR3xxD and THR3xxD overflow display --- CHANGELOG.md | 1 + RELEASENOTES.md | 3 ++- .../tasmota_xdrv_driver/xdrv_87_tm1621_sonoff.ino | 13 ++++++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0a5f013..0f1a260d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. ### Changed - Driver DHT v6 consolidation for both ESP8266 and ESP32 to support SI7021, THS01 and MS01 on ESP32 (#15856) +- Tasmota ESP32 Arduino core from v2.0.3 to v2.0.4 (#15940) ### Fixed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index da2b1b939..833ce1892 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -77,7 +77,7 @@ Historical binaries can be downloaded from The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` ### ESP32, ESP32-C3, ESP32-S2 and ESP32-S3 based -The following binary downloads have been compiled with ESP32/Arduino library core version **2.0.3**. +The following binary downloads have been compiled with ESP32/Arduino library core version **2.0.4**. - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32xy.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3/S2/S3 and 4M+ flash. @@ -118,6 +118,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo ### Breaking Changed ### Changed +- Tasmota ESP32 Arduino core from v2.0.3 to v2.0.4 [#15940](https://github.com/arendst/Tasmota/issues/15940) - Driver DHT v6 consolidation for both ESP8266 and ESP32 to support SI7021, THS01 and MS01 on ESP32 [#15856](https://github.com/arendst/Tasmota/issues/15856) ### Fixed diff --git a/tasmota/tasmota_xdrv_driver/xdrv_87_tm1621_sonoff.ino b/tasmota/tasmota_xdrv_driver/xdrv_87_tm1621_sonoff.ino index 969fb0382..17a1d486b 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_87_tm1621_sonoff.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_87_tm1621_sonoff.ino @@ -112,6 +112,9 @@ void TM1621SendCommon(uint8_t common) { } void TM1621SendRows(void) { + // Tm1621.row[x] = "text", "----", " " or a number with one decimal like "0.4", "237.5", "123456.7" + // "123456.7" will be shown as "9999" being a four digit overflow + // AddLog(LOG_LEVEL_DEBUG, PSTR("TM1: Row1 '%s', Row2 '%s'"), Tm1621.row[0], Tm1621.row[1]); uint8_t buffer[8] = { 0 }; // TM1621 16-segment 4-bit common buffer @@ -119,12 +122,16 @@ void TM1621SendRows(void) { for (uint32_t j = 0; j < 2; j++) { // 0.4V => " 04", 0.0A => " ", 1234.5V => "1234" uint32_t len = strlen(Tm1621.row[j]); - char *dp = nullptr; - int row_idx = len -3; - if (len <= 5) { + char *dp = nullptr; // Expect number larger than "123" + int row_idx = len -3; // "1234.5" + if (len <= 5) { // "----", " ", "0.4", "237.5" dp = strchr(Tm1621.row[j], '.'); row_idx = len -1; } + else if (len > 6) { // "12345.6" + snprintf_P(Tm1621.row[j], sizeof(Tm1621.row[j]), PSTR("9999")); + row_idx = 3; + } row[3] = (row_idx >= 0) ? Tm1621.row[j][row_idx--] : ' '; if ((row_idx >= 0) && dp) { row_idx--; } row[2] = (row_idx >= 0) ? Tm1621.row[j][row_idx--] : ' ';