From 35c342386e04cc624f822ed5ef715406d083ad76 Mon Sep 17 00:00:00 2001 From: Stuart W Baker Date: Thu, 1 Dec 2022 11:41:17 -0600 Subject: [PATCH] Fix bus-off error handling. (#681) --- src/freertos_drivers/ti/TivaCan.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/freertos_drivers/ti/TivaCan.cxx b/src/freertos_drivers/ti/TivaCan.cxx index d08607a60..6a7bce120 100644 --- a/src/freertos_drivers/ti/TivaCan.cxx +++ b/src/freertos_drivers/ti/TivaCan.cxx @@ -210,17 +210,15 @@ void TivaCan::interrupt_handler() txBuf->flush(); txPending = false; txBuf->signal_condition_from_isr(); + + /* attempt recovery */ + MAP_CANEnable(base); } if (status & CAN_STATUS_EWARN) { /* One of the error counters has exceded a value of 96 */ ++softErrorCount; canState = CAN_STATE_BUS_PASSIVE; - - /* flush data in the tx pipeline */ - txBuf->flush(); - txPending = false; - txBuf->signal_condition_from_isr(); } if (status & CAN_STATUS_EPASS) {