Hi,
You should not disable MB interrupt by modifying macros in the header file.
Either write value directly into respective register, use macro properly or reuse the drive function that set the Interrupt Mask register.
Anyway, if driver is used, and you prepare TX MB, then within FLEXCAN_DRV_SEND the interrupt for the given MB is enabled. Once the message is successfully transmitted the interrupt is called. And if callback is defined it is called too within an interrupt function; FLEXCAN_IRQHandler().
The driver is written in this way.
You can use Callback function to distinguish between TX, RX, etc interrupts
void can_Callback(uint8_t instance, flexcan_event_type_t eventType, flexcan_state_t *flexcanState)
{
(void)flexcanState;
(void)instance;
switch(eventType)
{
case FLEXCAN_EVENT_RX_COMPLETE:
dataReceived = true;
break;
case FLEXCAN_EVENT_TX_COMPLETE:
break;
default:
break;
}
}
BR, Petr