From c2d6b131035d71e6e909689877f2ff8103ad2e1e Mon Sep 17 00:00:00 2001 From: Sam Perry <17242713+sdp8483@users.noreply.github.com> Date: Sun, 20 Feb 2022 16:57:10 -0500 Subject: [PATCH] fix speed halved in ESP32-WROOM-32E ESP32 ECO3 added a configurable bit that will cause CAN bus speeds to be halved in new V3 core 32E module. This bit is in `TWAI_INT_ENA_REG`, bit4 which was previously reserved. Change respects reserved bit and should not cause issues for previous versions since this bit should not have been written to. --- src/CAN.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CAN.c b/src/CAN.c index 826f9db..c6e1b7b 100644 --- a/src/CAN.c +++ b/src/CAN.c @@ -226,7 +226,7 @@ int CAN_init() { MODULE_CAN->BTR1.B.SAM = 0x1; // enable all interrupts - MODULE_CAN->IER.U = 0xff; + MODULE_CAN->IER.U = 0xef; // Set acceptance filter MODULE_CAN->MOD.B.AFM = __filter.FM; @@ -296,4 +296,4 @@ int CAN_config_filter(const CAN_filter_t* p_filter) { __filter.AMR3 = p_filter->AMR3; return 0; -} \ No newline at end of file +}