From c2afe02507e2e9acfd8c1b956b29edb5f1ae6cb0 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Wed, 2 Dec 2020 21:30:28 +0800 Subject: [PATCH] CAN: Fix BRP field initialization onf ESP32 ECO3 This commit zero initializes the brp_div field on ESP32 ECO3 to prevent incorrect timing configuration. --- components/soc/esp32/include/hal/can_ll.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/soc/esp32/include/hal/can_ll.h b/components/soc/esp32/include/hal/can_ll.h index 170949634c..c46dac61b6 100644 --- a/components/soc/esp32/include/hal/can_ll.h +++ b/components/soc/esp32/include/hal/can_ll.h @@ -366,6 +366,8 @@ static inline void can_ll_set_bus_timing(can_dev_t *hw, uint32_t brp, uint32_t s //Need to set brp_div bit hw->interrupt_enable_reg.brp_div = 1; brp /= 2; + } else { + hw->interrupt_enable_reg.brp_div = 0; } #endif hw->bus_timing_0_reg.brp = (brp / 2) - 1;