Skip to content

Commit baf2d18

Browse files
committed
Bump version v15.2.0.4
- Add Dingtian `SetOption81 1` to invert input and `SetOption133 1` to invert output (#24364) - Change Dingtian define `DINGTIAN_INPUTS_INVERTED` replaced by `SetOption81` (#24364) - Change all memmove_P to memmove (#24378)
1 parent 0d80cd4 commit baf2d18

File tree

6 files changed

+62
-30
lines changed

6 files changed

+62
-30
lines changed

CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,23 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased] - Development
55

6-
## [15.2.0.3]
6+
## [15.2.0.4]
77
### Added
8-
- Berry `path.listdir("file.tapp#")` to list directory inside '.tapp' archives (#24367)
8+
- Dingtian `SetOption81 1` to invert input and `SetOption133 1` to invert output (#24364)
99

1010
### Breaking Changed
1111

12+
### Changed
13+
- Dingtian define `DINGTIAN_INPUTS_INVERTED` replaced by `SetOption81` (#24364)
14+
15+
### Fixed
16+
17+
### Removed
18+
19+
## [15.2.0.3] 20260124
20+
### Added
21+
- Berry `path.listdir("file.tapp#")` to list directory inside '.tapp' archives (#24367)
22+
1223
### Changed
1324
- ESP8266 platform update from 2025.12.00 to 2026.01.00 (#24354)
1425
- ESP32 Platform from 2025.12.31 to 2026.01.30, Framework (Arduino Core) from v3.1.8 to v3.1.9 and IDF from v5.3.4.251223 to v5.3.4.251226 (#24354)
@@ -17,8 +28,6 @@ All notable changes to this project will be documented in this file.
1728
### Fixed
1829
- Display ST77xx and Parallel issues introduced after refactor UDisplay (#24368)
1930

20-
### Removed
21-
2231
## [15.2.0.2] 20260117
2332
### Added
2433
- Support for Adafruit I2C QT Rotary Encoder (#24270)

RELEASENOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
112112

113113
[Complete list](BUILDS.md) of available feature and sensors.
114114

115-
## Changelog v15.2.0.3
115+
## Changelog v15.2.0.4
116116
### Added
117117
- Support for TCA9554 8-bit I/O expander mutually exclusive with PCA9557
118118
- Support for Adafruit I2C QT Rotary Encoder [#24270](https://github.com/arendst/Tasmota/issues/24270)
119+
- Dingtian `SetOption81 1` to invert input and `SetOption133 1` to invert output [#24364](https://github.com/arendst/Tasmota/issues/24364)
119120
- Zigbee support for `int24` type [#24334](https://github.com/arendst/Tasmota/issues/24334)
120121
- Berry `path.listdir("file.tapp#")` to list directory inside '.tapp' archives [#24367](https://github.com/arendst/Tasmota/issues/24367)
121122

@@ -126,6 +127,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
126127
- IRremoteESP8266 library from v2.8.6 to v2.8.6-ca474a6 [#24226](https://github.com/arendst/Tasmota/issues/24226)
127128
- Refactor Adafruit Seesaw soil driver [#24270](https://github.com/arendst/Tasmota/issues/24270)
128129
- LM75AD output when no valid reading received from 0 to null [#24263](https://github.com/arendst/Tasmota/issues/24263)
130+
- Dingtian define `DINGTIAN_INPUTS_INVERTED` replaced by `SetOption81` [#24364](https://github.com/arendst/Tasmota/issues/24364)
129131
- Update Zigbee WebUI [#24224](https://github.com/arendst/Tasmota/issues/24224)
130132
- JPEG decoder [#24368](https://github.com/arendst/Tasmota/issues/24368)
131133

tasmota/include/tasmota_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222

2323
#define TASMOTA_SHA_SHORT // Filled by Github sed
2424

25-
const uint32_t TASMOTA_VERSION = 0x0F020003; // 15.2.0.3
25+
const uint32_t TASMOTA_VERSION = 0x0F020004; // 15.2.0.4
2626

2727
#endif // _TASMOTA_VERSION_H_

tasmota/tasmota_support/settings.ino

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,10 @@ bool SettingsUpdateText(uint32_t index, const char* replace_me) {
670670

671671
if (diff != 0) {
672672
// Shift Settings->text up or down
673-
memmove_P(Settings->text_pool + start_pos + replace_len, Settings->text_pool + end_pos, char_len - end_pos);
673+
memmove(Settings->text_pool + start_pos + replace_len, Settings->text_pool + end_pos, char_len - end_pos);
674674
}
675675
// Replace text
676-
memmove_P(Settings->text_pool + start_pos, replace, replace_len);
676+
memmove(Settings->text_pool + start_pos, replace, replace_len);
677677
// Fill for future use
678678
memset(Settings->text_pool + char_len + diff, 0x00, settings_text_size - char_len - diff);
679679

@@ -1696,8 +1696,8 @@ void SettingsDelta(void) {
16961696
if (Settings->version < 0x09050002) {
16971697
if (Settings->cfg_size != sizeof(TSettings)) {
16981698
// Fix onetime Settings layout due to changed ESP32-C3 myio and mytmplt types sizes
1699-
memmove_P((uint8_t*)&Settings->user_template, (uint8_t*)&Settings->free_esp32c3_3D8, sizeof(TSettings) - 0x3FC);
1700-
memmove_P((uint8_t*)&Settings->eth_type, (uint8_t*)&Settings->free_esp32c3_42A, sizeof(TSettings) - 0x446);
1699+
memmove((uint8_t*)&Settings->user_template, (uint8_t*)&Settings->free_esp32c3_3D8, sizeof(TSettings) - 0x3FC);
1700+
memmove((uint8_t*)&Settings->eth_type, (uint8_t*)&Settings->free_esp32c3_42A, sizeof(TSettings) - 0x446);
17011701
// Reset for future use
17021702
memset(&Settings->free_esp32c3_3D8, 0x00, sizeof(Settings->free_esp32c3_3D8));
17031703
memset(&Settings->free_esp32c3_42A, 0x00, sizeof(Settings->free_esp32c3_42A));
@@ -1876,22 +1876,32 @@ void SettingsDelta(void) {
18761876
}
18771877
if (Settings->version < 0x0E030007) { // 14.3.0.7
18781878
// move up uint8_t knx_CB_registered from 4A8 to 533
1879-
memmove_P((uint8_t*)&Settings->knx_CB_registered, (uint8_t*)&Settings->switchmode, 1);
1879+
memmove((uint8_t*)&Settings->knx_CB_registered, (uint8_t*)&Settings->switchmode, 1);
18801880
// move up uint8_t global_sensor_index[3] from 4C5 to 53C
1881-
memmove_P((uint8_t*)&Settings->global_sensor_index, (uint8_t*)&Settings->switchmode +29, 3);
1881+
memmove((uint8_t*)&Settings->global_sensor_index, (uint8_t*)&Settings->switchmode +29, 3);
18821882
// move dn uint8_t switchmode[MAX_SWITCHES_SET] from 4A9 to 4A8
1883-
memmove_P((uint8_t*)&Settings->switchmode, (uint8_t*)&Settings->switchmode +1, 28);
1883+
memmove((uint8_t*)&Settings->switchmode, (uint8_t*)&Settings->switchmode +1, 28);
18841884
for (uint32_t i = 28; i < MAX_SWITCHES_SET; i++) {
18851885
Settings->switchmode[i] = SWITCH_MODE;
18861886
}
18871887
// move up int8_t shutter_tilt_pos[MAX_SHUTTERS], uint16_t influxdb_period and uint16_t rf_duplicate_timefrom 51C to 534
1888-
memmove_P((uint8_t*)&Settings->shutter_tilt_pos, (uint8_t*)&Settings->shutter_tilt_config +12, 8);
1888+
memmove((uint8_t*)&Settings->shutter_tilt_pos, (uint8_t*)&Settings->shutter_tilt_config +12, 8);
18891889
// move up int8_t shutter_tilt_config[5][MAX_SHUTTERS] from 508 to 510
1890-
memmove_P((uint8_t*)&Settings->shutter_tilt_config, (uint8_t*)&Settings->shutter_tilt_config -8, 20);
1890+
memmove((uint8_t*)&Settings->shutter_tilt_config, (uint8_t*)&Settings->shutter_tilt_config -8, 20);
18911891
for (uint32_t i = 14; i < MAX_INTERLOCKS_SET; i++) {
18921892
Settings->interlock[i] = 0;
18931893
}
18941894
}
1895+
#ifdef USE_DINGTIAN_RELAY // Support the Dingian board using 74'595 and 74'165 shift registers
1896+
if (Settings->version < 0x0F020004) { // 15.2.0.4
1897+
Settings->flag5.shift595_invert_outputs = 0; // SetOption133 - Do not invert 74HC595 shift register outputs
1898+
#ifdef DINGTIAN_INPUTS_INVERTED
1899+
Settings->flag3.pcf8574_ports_inverted = 1; // SetOption81 - Invert inputs (74HC165)
1900+
#else
1901+
Settings->flag3.pcf8574_ports_inverted = 0; // SetOption81 - Do not invert inputs (74HC165)
1902+
#endif // DINGTIAN_INPUTS_INVERTED
1903+
}
1904+
#endif // USE_DINGTIAN_RELAY
18951905

18961906
Settings->version = TASMOTA_VERSION;
18971907
SettingsSave(1);

tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ void RulesVarReplace(String &commands, const String &sfind, const String &replac
696696
char *found_at;
697697
while ((found_at = strstr(read_from, find)) != nullptr) {
698698
write_to += (found_at - read_from);
699-
memmove_P(write_to, find, flen); // Make variable Uppercase
699+
memmove(write_to, find, flen); // Make variable Uppercase
700700
write_to += flen;
701701
read_from = found_at + flen;
702702
}

tasmota/tasmota_xdrv_driver/xdrv_90_esp32_dingtian_relay.ino

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#define XDRV_90 90
2424

2525
/********************************************************************************************************
26+
* SetOption133 - Inverts 74HC595 shift register outputs
27+
* SetOption81 - Inverts 74HC165 shift register inputs
28+
*
2629
* Check defines
2730
*/
2831

@@ -55,6 +58,10 @@ struct DINGTIAN_DATA {
5558

5659
uint32_t DingtianReadWrite(uint32_t outputs)
5760
{
61+
if (Settings->flag5.shift595_invert_outputs) { // SetOption133 - Inverts 74HC595 shift register outputs
62+
outputs = ~outputs;
63+
}
64+
5865
uint32_t inputs = 0;
5966
uint32_t in_bit = 1;
6067

@@ -82,11 +89,11 @@ uint32_t DingtianReadWrite(uint32_t outputs)
8289
Dingtian->outputs_initialized = true;
8390
}
8491

85-
#ifdef DINGTIAN_INPUTS_INVERTED
86-
return ~inputs;
87-
#else
88-
return inputs;
89-
#endif
92+
if (Settings->flag3.pcf8574_ports_inverted) { // SetOption81 - Inverts 74HC165 shift register inputs
93+
return ~inputs;
94+
} else {
95+
return inputs;
96+
}
9097
}
9198

9299
/********************************************************************************************************
@@ -95,22 +102,26 @@ uint32_t DingtianReadWrite(uint32_t outputs)
95102

96103
void DingtianInit(void) {
97104
if (PinUsed(GPIO_DINGTIAN_CLK, GPIO_ANY) && PinUsed(GPIO_DINGTIAN_SDI) && PinUsed(GPIO_DINGTIAN_Q7)
98-
&& (PinUsed(GPIO_DINGTIAN_PL) || PinUsed(GPIO_DINGTIAN_OE)) && PinUsed(GPIO_DINGTIAN_RCK)) {
105+
&& (PinUsed(GPIO_DINGTIAN_PL) || PinUsed(GPIO_DINGTIAN_OE))
106+
&& (PinUsed(GPIO_DINGTIAN_PL) || PinUsed(GPIO_DINGTIAN_RCK))) {
99107
// allocate Dingtian data structure
100108
Dingtian = (struct DINGTIAN_DATA*)calloc(1, sizeof(struct DINGTIAN_DATA));
101109
if (Dingtian) {
102110
// get pins
103-
Dingtian->pin_clk = Pin(GPIO_DINGTIAN_CLK, GPIO_ANY); // shift clock : 595's SCLK & 165's CLK
104-
Dingtian->pin_sdi = Pin(GPIO_DINGTIAN_SDI); // Serial out : 595's SER
105-
Dingtian->pin_q7 = Pin(GPIO_DINGTIAN_Q7); // Serial in : 165's Q7
106-
if (PinUsed(GPIO_DINGTIAN_PL)) Dingtian->pin_pl = Pin(GPIO_DINGTIAN_PL); // Input load : 595's nOE & 165's PL (or SH/LD on some datasheet)
107-
if (PinUsed(GPIO_DINGTIAN_OE)) Dingtian->pin_oe = Pin(GPIO_DINGTIAN_OE); // Output enable : 595's nOE (v3.6.10)
108-
Dingtian->pin_rck = Pin(GPIO_DINGTIAN_RCK); // Output load : 595's RCLK & 165's CLKINH
111+
Dingtian->pin_clk = Pin(GPIO_DINGTIAN_CLK, GPIO_ANY); // shift clock : 595's SCLK & 165's CLK
112+
Dingtian->pin_sdi = Pin(GPIO_DINGTIAN_SDI); // Serial out : 595's SER
113+
Dingtian->pin_q7 = Pin(GPIO_DINGTIAN_Q7); // Serial in : 165's Q7
114+
if (PinUsed(GPIO_DINGTIAN_PL)) Dingtian->pin_pl = Pin(GPIO_DINGTIAN_PL); // Input load : 595's nOE & 165's PL (or SH/LD on some datasheet)
115+
if (PinUsed(GPIO_DINGTIAN_OE)) Dingtian->pin_oe = Pin(GPIO_DINGTIAN_OE); // Output enable : 595's nOE & 165's nCE (v3.6.10)
116+
if (PinUsed(GPIO_DINGTIAN_RCK)) Dingtian->pin_rck = Pin(GPIO_DINGTIAN_RCK); // Output load : 595's RCLK & 165's CLKINH
117+
else Dingtian->pin_rck = Dingtian->pin_pl; // Use PL as RCK if not defined (shared pin boards)
109118
// number of shift registers is the CLK index
110119
Dingtian->count = ((GetPin(Dingtian->pin_clk) - AGPIO(GPIO_DINGTIAN_CLK)) + 1) * 8;
111120

112-
AddLog(LOG_LEVEL_DEBUG, PSTR("DNGT: clk:%d, sdi:%d, q7:%d, pl:%d, oe:%d, rck:%d, count:%d"),
113-
Dingtian->pin_clk, Dingtian->pin_sdi, Dingtian->pin_q7, Dingtian->pin_pl, Dingtian->pin_oe, Dingtian->pin_rck, Dingtian->count);
121+
AddLog(LOG_LEVEL_DEBUG, PSTR("DNGT: clk:%d, sdi:%d, q7:%d, pl:%d, oe:%d, rck:%d, count:%d, SO133:%d, SO81:%d"),
122+
Dingtian->pin_clk, Dingtian->pin_sdi, Dingtian->pin_q7, Dingtian->pin_pl, Dingtian->pin_oe, Dingtian->pin_rck, Dingtian->count,
123+
Settings->flag5.shift595_invert_outputs, // SetOption133 - Inverts 74HC595 shift register outputs
124+
Settings->flag3.pcf8574_ports_inverted); // SetOption81 - Inverts 74HC165 shift register inputs
114125

115126
DINGTIAN_SET_OUTPUT(Dingtian->pin_clk, 0);
116127
DINGTIAN_SET_OUTPUT(Dingtian->pin_sdi, 0);

0 commit comments

Comments
 (0)