Skip to content

Commit b670fe9

Browse files
committed
feat(twai): support twai on esp32h21
1 parent b0f2250 commit b670fe9

File tree

15 files changed

+968
-228
lines changed

15 files changed

+968
-228
lines changed

components/driver/test_apps/legacy_twai/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
2-
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-H21 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
2+
| ----------------- | ----- | -------- | -------- | -------- | --------- | -------- | -------- | -------- |
33

44
# Enable Socket CAN Device with bitrate 250Kbps
55

components/driver/test_apps/legacy_twai/main/test_twai_loop_back.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ TEST_CASE("twai_mode_ext_no_ack_250kbps", "[twai-loop-back]")
134134
}
135135
}
136136

137+
#if SOC_LIGHT_SLEEP_SUPPORTED
137138
static void s_test_sleep_retention(bool allow_pd)
138139
{
139140
// Prepare a TOP PD sleep
@@ -220,3 +221,4 @@ TEST_CASE("twai_mode_ext_no_ack_250kbps with sleep retention (no pd)", "[twai-lo
220221
{
221222
s_test_sleep_retention(false);
222223
}
224+
#endif // SOC_LIGHT_SLEEP_SUPPORTED
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
2-
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
1+
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-H21 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
2+
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- |

components/hal/esp32h2/include/hal/twai_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static inline void twai_ll_set_clock_source(int group_id, twai_clock_source_t cl
190190
{
191191
(void)group_id;
192192
switch (clk_src) {
193-
case TWAI_CLK_SRC_DEFAULT:
193+
case TWAI_CLK_SRC_XTAL:
194194
PCR.twai0_func_clk_conf.twai0_func_clk_sel = 0;
195195
break;
196196
default:

0 commit comments

Comments
 (0)