From 7ca2688378a1f56710fc6623d481c3e8a7c4f1bc Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Mon, 19 Jul 2021 17:33:58 +0800 Subject: [PATCH] TWAI: Fix incorrect configuration initializers for low speed bit rates This commit fixes the timing configuration initializers for the 1K, 5K, and 10K bit rates. --- components/soc/include/hal/twai_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/soc/include/hal/twai_types.h b/components/soc/include/hal/twai_types.h index 1e6fc7ed8b..152badafe5 100644 --- a/components/soc/include/hal/twai_types.h +++ b/components/soc/include/hal/twai_types.h @@ -56,9 +56,9 @@ extern "C" { * @note The available bit rates are dependent on the chip target and revision. */ #if (TWAI_BRP_MAX > 256) -#define TWAI_TIMING_CONFIG_1KBITS() {.brp = 4000, .tseg_1 = 15, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} -#define TWAI_TIMING_CONFIG_5KBITS() {.brp = 800, .tseg_1 = 15, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} -#define TWAI_TIMING_CONFIG_10KBITS() {.brp = 400, .tseg_1 = 15, .tseg_2 = 8, .sjw = 3, .triple_sampling = false} +#define TWAI_TIMING_CONFIG_1KBITS() {.brp = 4000, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} +#define TWAI_TIMING_CONFIG_5KBITS() {.brp = 800, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} +#define TWAI_TIMING_CONFIG_10KBITS() {.brp = 400, .tseg_1 = 15, .tseg_2 = 4, .sjw = 3, .triple_sampling = false} #endif #if (TWAI_BRP_MAX > 128) || (CONFIG_ESP32_REV_MIN >= 2) #define TWAI_TIMING_CONFIG_12_5KBITS() {.brp = 256, .tseg_1 = 16, .tseg_2 = 8, .sjw = 3, .triple_sampling = false}