This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好:
我现在在使用TMS320F280049例程can_ex2_loopback_interrupts测试CAN中断接收。看到例程使用的是CAN_INT_IE0,我想把其修改为CAN_INT_IE1,我做了如下的程序修改:
CAN_enableInterrupt(CANA_BASE, CAN_INT_IE1);
Interrupt_register(INT_CANA1, &canISR);
Interrupt_enable(INT_CANA1);
CAN_enableGlobalInterrupt(CANA_BASE, CAN_GLOBAL_INT_CANINT1);
canISR中断函数中修改CAN_clearGlobalInterruptStatus(CANA_BASE, CAN_GLOBAL_INT_CANINT1);
然后,我进行测试发现接收数据未进入到中断里。请问,我还需要修改哪些地方
请您参考TRM的 26.16.2.21 CAN_IP_MUX21 Register (Offset = D8h) [reset = 0h]
https://www.ti.com.cn/cn/lit/ug/sprui33c/sprui33c.pdf
在代码中您可以search一下
//***************************************************************************** // //! Set the CAN controller Interrupt Line for each mailbox //! //! \param base is the base address of the CAN controller. //! \param mux bit packed representation of which message objects should //! generate an interrupt on a given interrupt line. //! //! Selects which interrupt line each message object should assert when an //! interrupt occurs. Bit 0 corresponds to message object 32 and then bits //! 1 to 31 correspond to message object 1 through 31 respectively. Bits that //! are asserted indicate the message object should generate an interrupt on //! interrupt line 1, while bits that are not asserted indicate the message //! object should generate an interrupt on line 0. //! //! \return None. // //***************************************************************************** static inline void CAN_setInterruptMux(uint32_t base, uint32_t mux) { // // Check the arguments. // ASSERT(CAN_isBaseValid(base)); // // Set the interrupt muxing for the CAN peripheral // HWREG_BP(base + CAN_O_IP_MUX21) = mux; }