From a4aa0204601a59df7ce5c9c0c7f6535452a50ee0 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Mon, 12 Aug 2013 08:45:13 -0400 Subject: [PATCH] Disable interrupt for MB if there are no frames to send This patch was suggested by bodynek and fixes a problem where too many interrupts will trigger for no reason. --- due_can.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/due_can.cpp b/due_can.cpp index 8b2fee7..8ca40e2 100644 --- a/due_can.cpp +++ b/due_can.cpp @@ -871,6 +871,9 @@ void CANRaw::mailbox_int_handler(uint8_t mb, uint32_t ul_status) { global_send_transfer_cmd((0x1u << mb)); tx_buffer_head = (tx_buffer_head + 1) % SIZE_TX_BUFFER; } + else { + disable_interrupt(0x01 << mb); + } break; case 5: //producer - technically still a transmit buffer break;