> I resolved this by commenting out another place that defined the interrupt.
Maybe the original programmer intended all the interrupts to be defined in the one place (in that place), and in that case you should probably try to write your code with the same "philosophy" as is already there. If the "other place" is meant to list only "all the unused interrupts", then what you've done may be what is intended.
> my program is being flooded by this interrupt although I have transmitted nothing.
That's the point. A Receive interrupt means you have to receive a message/data to clear the interrupt, and to clear a Transmit interrupt you have to send something.
For the purpose of this explanation, as far as interrupts, a CAN controller is just like a complicated UART.
There are two sorts or UARTS in the world. There are are ones designed to fit in a clean, regular and properly designed system architecture (PDP-11, 68000, ColdFire), and ones designed to fit into hardware that "just happened at random" like those derived from PC architecture, with no overall system design and where things just don't fit together neatly.
UARTs can either generate a transmit interrupt when they ARE empty (level trigger), or when they BECOME empty (edge trigger). The "clean" ones use Levels, and that's what the ColdFire one is.
You should read this part of the Reference Manual:
Table 11-11. CANTFLG Register Field Descriptions
TXE[2:0]: This flag indicates that the associated transmit message buffer is empty, and thus
not scheduled for transmission. ... If not masked, a transmit interrupt is pending while this flag is set.
That means you have to MASK the transmit interrupt when you've got nothing to send.
The advantage of the "level" approach is that it makes transmitting simpler. Assume you have a "transmit buffer" or "transmit message ring". When your code goes to transmit something, all it has to do is to put the data into the ring or buffer, and then unmask the interrupt. The interrupt routine will then automatically send the first message. When the interrupt routine finds the buffer is empty it masks the transmit interrupt. The "edge" case is more complicated and more likely to go wrong as you have to separately "send" the first message to get the first interrupt when that one is sent.
Tom