Enable ESP32 TWAI in default binary

This commit is contained in:
Theo Arends 2025-01-02 12:44:49 +01:00
parent d5d757fd3d
commit aafe528682
5 changed files with 16 additions and 7 deletions

View File

@ -105,8 +105,9 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
| USE_I2C | - | x / x | x | x | - | x |
| USE_RTC_CHIPS | - | - / x | - | - | - | - |
| -USE_DS3231 | - | - / - | - | - | - | - |
| -USE_BM8563 | - | - / x | - | - | - | - |
| -USE_DS3231 | - | - / - | - | - | - | - |
| -USE_PCF85063 | - | - / - | - | - | - | - |
| -USE_PCF85363 | - | - / - | - | - | - | - |
| -USE_RX8010 | - | - / - | - | - | - | - |
| USE_SHT | - | - / x | - | x | - | - |
@ -249,6 +250,7 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| USE_DYP | - | - / - | - | - | - | - |
| USE_TM1638 | - | - / x | - | x | - | - |
| USE_HX711 | - | - / x | - | x | - | - |
| -USE_HX711_M5SCALES | - | - / - | - | - | - | - |
| USE_TX2x_WIND_SENSOR | - | - / - | - | - | - | - |
| USE_WINDMETER | - | - / - | - | - | - | - |
| USE_RC_SWITCH | - | - / x | - | x | - | - |
@ -283,6 +285,7 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| USE_SONOFF_SPM | | / x | | | | |
| USE_DISPLAY_TM1621_SONOFF | | / x | | | | |
| USE_SHELLY_PRO | | / x | | | | |
| USE_ESP32_TWAI | | / x | | | | |
| USE_DALI | | / x | | | | |
| USE_DINGTIAN_RELAY | | / - | | | | |
| USE_MATTER_DEVICE | | / x | | | | | See SetOption151 |

View File

@ -802,6 +802,7 @@
#define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem)
#endif
#define USE_DALI // Add support for DALI gateway (+5k code)
#define USE_ESP32_TWAI // Add support for TWAI/CAN interface (+7k code)
#endif // FIRMWARE_TASMOTA32

View File

@ -931,8 +931,12 @@ constexpr uint32_t feature[] = {
#if defined(USE_I2C) && defined(USE_RTC_CHIPS) && defined(USE_RX8010)
0x00000200 | // xdrv_56_rtc_chips.ino
#endif
// 0x00000400 | //
// 0x00000800 | //
#if defined(USE_I2C) && defined(USE_RTC_CHIPS) && defined(USE_PCF85063)
0x00000400 | // xdrv_56_rtc_chips.ino
#endif
#ifdef USE_ESP32_TWAI
0x00000800 | // xdrv_91_esp32_twai.ino
#endif
// 0x00001000 | //
// 0x00002000 | //
// 0x00004000 | //

View File

@ -114,6 +114,7 @@ class twai_cls
var id = ident & 0x1fffffff
if id == 0x076 # Incremental counter from 0 to 255
# tasmota.log(f"RMH: 0x{id:03x} Count {data1}", 3)
# elif id == 0x080 # Heartbeat every second
elif id == 0x100 # Date and Time
var epoch = 441763200 + (data2 * 24 * 60 * 60) + (data1 / 1000)
# tasmota.log(f"RMH: 0x{id:03x} Time {tasmota.time_str(epoch)}", 3)
@ -411,8 +412,8 @@ void TWAIInit(void) {
Twai.supported = false;
for (uint32_t bus = 0; bus < MAX_TWAI; bus++) {
if (PinUsed(GPIO_TWAI_TX, bus) && PinUsed(GPIO_TWAI_RX, bus)) {
Twai.speed[bus] = TWAI_SPEED_1MBITS;
Twai.mode[bus] = TWAI_MODE_LISTEN_ONLY; // 0 = TWAI_MODE_NORMAL, 1 = TWAI_MODE_NO_ACK, 2 = TWAI_MODE_LISTEN_ONLY
Twai.speed[bus] = TWAI_SPEED_100KBITS;
Twai.mode[bus] = TWAI_MODE_NORMAL; // 0 = TWAI_MODE_NORMAL, 1 = TWAI_MODE_NO_ACK, 2 = TWAI_MODE_LISTEN_ONLY
#ifdef USE_BERRY
TWAIBerryConfig(bus);
#endif // USE_BERRY

View File

@ -309,7 +309,7 @@ a_features = [[
],[
"USE_MAGIC_SWITCH","USE_PIPSOLAR","USE_GPIO_VIEWER","USE_AMSX915",
"USE_SPI_LORA","USE_SPL06_007","USE_QMP6988","USE_WOOLIIS",
"USE_HX711_M5SCALES","USE_RX8010","","",
"USE_HX711_M5SCALES","USE_RX8010","USE_PCF85063","USE_ESP32_TWAI",
"","","","",
"","","","",
"","","","",
@ -342,7 +342,7 @@ else:
obj = json.load(fp)
def StartDecode():
print ("\n*** decode-status.py v14.4.1.1 by Theo Arends and Jacek Ziolkowski ***")
print ("\n*** decode-status.py v14.4.1.2 by Theo Arends and Jacek Ziolkowski ***")
# print("Decoding\n{}".format(obj))