From 9b258cadcfc6b8edaa51a36ec8337f668cb9709a Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 17 Feb 2025 22:24:50 +0100 Subject: [PATCH 1/3] Wrong RMT channels for ESP32S3, now depends on 'soc_caps.h' (#23021) --- CHANGELOG.md | 1 + tasmota/include/tasmota.h | 33 +++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a08d06ad..877e9b0e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Berry parser error in rare case (#22997) - ESP32 TasMesh broker MAC address all zeros (#23005) +- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` ### Removed diff --git a/tasmota/include/tasmota.h b/tasmota/include/tasmota.h index 79a3cc486..78286966a 100644 --- a/tasmota/include/tasmota.h +++ b/tasmota/include/tasmota.h @@ -93,24 +93,29 @@ const uint16_t VL53LXX_MAX_SENSORS = 8; // Max number of VL53L0X sensors const uint8_t MAX_SR04 = 3; // Max number of SR04 ultrasonic sensors #ifdef ESP32 + +// SPI const uint8_t MAX_SPI = 2; // Max number of Hardware SPI controllers (ESP32 = 2) -const uint8_t MAX_I2S = 2; // Max number of Hardware I2S controllers (ESP32 = 2) - #if CONFIG_IDF_TARGET_ESP32 - const uint8_t MAX_RMT = 8; // Max number or RMT channels (ESP32 only) - #elif CONFIG_IDF_TARGET_ESP32S2 - const uint8_t MAX_RMT = 4; // Max number or RMT channels (ESP32S2 only) - #elif CONFIG_IDF_TARGET_ESP32S3 - const uint8_t MAX_RMT = 1; // Max number or RMT channels (ESP32S3 only) - #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 - const uint8_t MAX_RMT = 2; // Max number or RMT channels (ESP32C3 only) - #else - const uint8_t MAX_RMT = 0; // Max number or RMT channels (0 if unknown) - #endif -#else + +// I2S +#ifdef SOC_I2S_SUPPORTED + const uint8_t MAX_I2S = SOC_I2S_NUM; +#else // SOC_I2S_SUPPORTED + const uint8_t MAX_I2S = 0; +#endif // SOC_I2S_SUPPORTED + +// RMT +#ifdef SOC_RMT_SUPPORTED + const uint8_t MAX_RMT = (SOC_RMT_GROUPS) * (SOC_RMT_TX_CANDIDATES_PER_GROUP); +#else // SOC_RMT_SUPPORTED + const uint8_t MAX_RMT = 0; +#endif // SOC_RMT_SUPPORTED + +#else // ESP32 - now ESP8266 const uint8_t MAX_SPI = 1; // Max number of Hardware SPI controllers const uint8_t MAX_I2S = 0; // Max number of Hardware I2S controllers (ESP8266 = 0, no choice) const uint8_t MAX_RMT = 0; // No RMT channel on ESP8266 -#endif +#endif // ESP32 // Changes to the following MAX_ defines need to be in line with enum SettingsTextIndex const uint8_t MAX_MQTT_PREFIXES = 3; // Max number of MQTT prefixes (cmnd, stat, tele) From 4306823ba60b6266f25b861da325016ba47f2d26 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Mon, 17 Feb 2025 23:04:04 +0100 Subject: [PATCH 2/3] HASPmota exception when clicking on a checkbox (#23022) --- CHANGELOG.md | 1 + .../lv_haspmota/src/embedded/lv_haspmota.be | 16 ++++- .../src/solidify/solidified_lv_haspmota.h | 66 ++++++++++++++++++- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 877e9b0e9..2bbe05605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file. - Berry parser error in rare case (#22997) - ESP32 TasMesh broker MAC address all zeros (#23005) - Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` +- HASPmota exception when clicking on a checkbox ### Removed diff --git a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be index b8a77a7cc..6c4a1f3cf 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be +++ b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be @@ -1051,7 +1051,7 @@ class lvh_obj : lvh_root style_modifier = self.digits_to_style(suffix_digits) end end - # print(f">>>: getmember {k=} {style_modifier=}") + #print(f">>>: member {k=} {style_modifier=}") # if attribute name is in ignore list, abort if self._attr_ignore.find(k) != nil return end @@ -2537,7 +2537,19 @@ end #@ solidify:lvh_btn,weak class lvh_btn : lvh_obj static var _lv_class = lv.button end #@ solidify:lvh_checkbox,weak -class lvh_checkbox : lvh_obj static var _lv_class = lv.checkbox end +class lvh_checkbox : lvh_obj + static var _lv_class = lv.checkbox + static var _lv_part2_selector = lv.PART_INDICATOR + # static var _EVENTS = EVENTS_ALL + # map val to toggle + def set_val(t) + self._val = t + return self.set_toggle(t) + end + def get_val() + return self.get_toggle() + end +end # class lvh_textarea : lvh_obj static var _lv_class = lv.textarea end # special case for scr (which is actually lv_obj) #@ solidify:lvh_scr,weak diff --git a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h index 01dea9fb7..52f67557f 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h +++ b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h @@ -11145,6 +11145,65 @@ be_local_class(lvh_btn, extern const bclass be_class_lvh_checkbox; +/******************************************************************** +** Solidified function: set_val +********************************************************************/ +be_local_closure(class_lvh_checkbox_set_val, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(_val), + /* K1 */ be_nested_str_weak(set_toggle), + }), + be_str_weak(set_val), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x8C080101, // 0001 GETMET R2 R0 K1 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_val +********************************************************************/ +be_local_closure(class_lvh_checkbox_get_val, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(get_toggle), + }), + be_str_weak(get_val), + &be_const_str_solidified, + ( &(const binstruction[ 3]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x80040200, // 0002 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: lvh_checkbox ********************************************************************/ @@ -11152,9 +11211,12 @@ extern const bclass be_class_lvh_obj; be_local_class(lvh_checkbox, 0, &be_class_lvh_obj, - be_nested_map(1, + be_nested_map(4, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_checkbox) }, + { be_const_key_weak(get_val, 1), be_const_closure(class_lvh_checkbox_get_val_closure) }, + { be_const_key_weak(set_val, -1), be_const_closure(class_lvh_checkbox_set_val_closure) }, + { be_const_key_weak(_lv_part2_selector, -1), be_const_int(131072) }, + { be_const_key_weak(_lv_class, 0), be_const_class(be_class_lv_checkbox) }, })), be_str_weak(lvh_checkbox) ); From c6b975561ff80633c96c967d592b05577fb23a4a Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:16:49 +0100 Subject: [PATCH 3/3] Update changelogs --- CHANGELOG.md | 4 ++-- RELEASENOTES.md | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bbe05605..35097aa0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,8 @@ All notable changes to this project will be documented in this file. ### Fixed - Berry parser error in rare case (#22997) - ESP32 TasMesh broker MAC address all zeros (#23005) -- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` -- HASPmota exception when clicking on a checkbox +- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` (#23021) +- HASPmota exception when clicking on a checkbox (#23022) ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e419a44f5..35608e413 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -158,8 +158,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - LVGL `lv.set_paint_cb()` to register a callback when screen is refreshed [#22909](https://github.com/arendst/Tasmota/issues/22909) - HASPmota support for `buttonmatrix` events [#22898](https://github.com/arendst/Tasmota/issues/22898) -### Breaking Changed - ### Changed - ESP32 Platform from 2024.12.30 to 2025.02.30, Framework (Arduino Core) from v3.1.0.241206 to v3.1.1.250203 and IDF to 5.3.2 [#22943](https://github.com/arendst/Tasmota/issues/22943) - GPIOViewer from v1.5.6 to v1.6.1 (No functional change) @@ -180,12 +178,12 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - LoraWan decoding of Dragino LDS02 and MerryIoT DW10 [#22880](https://github.com/arendst/Tasmota/issues/22880) - ESP32 TasMesh broker MAC address all zeros [#23005](https://github.com/arendst/Tasmota/issues/23005) - ESP32-Cx compilation fails on Windows [#22832](https://github.com/arendst/Tasmota/issues/22832) +- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` [#23021](https://github.com/arendst/Tasmota/issues/23021) - Sonoff SPM `PowerOnState` overrules `SSPMPowerOnState` in mixed 4Relay setup with 4Relay version 1.0.0 - Webcam compilation with `define USE_WEBCAM` but without `define ENABLE_RTSPSERVER` [#22686](https://github.com/arendst/Tasmota/issues/22686) - Berry Zigbee fix wrong attributes [#22684](https://github.com/arendst/Tasmota/issues/22684) - Berry walrus operator [#22685](https://github.com/arendst/Tasmota/issues/22685) - Berry parser error in rare case [#22997](https://github.com/arendst/Tasmota/issues/22997) - LVGL updated `Antiburn.tapp` [#22699](https://github.com/arendst/Tasmota/issues/22699) +- HASPmota exception when clicking on a checkbox [#23022](https://github.com/arendst/Tasmota/issues/23022) - Matter Air Quality sensor [#22708](https://github.com/arendst/Tasmota/issues/22708) - -### Removed