From 8b44c977bbd0c12e814655a7f997a6d182388a47 Mon Sep 17 00:00:00 2001 From: diplfranzhoepfinger Date: Thu, 27 Feb 2025 14:14:42 +0100 Subject: [PATCH] Update twai_hal_iram.c --- components/hal/twai_hal_iram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/hal/twai_hal_iram.c b/components/hal/twai_hal_iram.c index 76b532a20c..8bebf01c84 100644 --- a/components/hal/twai_hal_iram.c +++ b/components/hal/twai_hal_iram.c @@ -63,7 +63,9 @@ static inline uint32_t twai_hal_decode_interrupt(twai_hal_context_t *hal_ctx) } //Transmit interrupt set whenever TX buffer becomes free #ifdef CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST - if ((interrupts & TWAI_LL_INTR_TI || hal_ctx->state_flags & TWAI_HAL_STATE_FLAG_TX_BUFF_OCCUPIED) && status & TWAI_LL_STATUS_TBS) { + if ((interrupts & TWAI_LL_INTR_TI || hal_ctx->state_flags & TWAI_HAL_STATE_FLAG_TX_BUFF_OCCUPIED) + && status & TWAI_LL_STATUS_TBS + && !(state_flags & TWAI_HAL_STATE_FLAG_BUS_OFF)) { #else if (interrupts & TWAI_LL_INTR_TI) { #endif