Error using interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Error using interrupt

772 次查看
kdn
Contributor III

I have attached error file which I am getting while using interrupt , can anyone please provide me solution for it.

标签 (1)
标记 (3)
1 回复

593 次查看
iggi
NXP Employee
NXP Employee

Hi,

See the snapshot below. The ISR inside the pragma segment in CAN1.c source file must be available (out of comment; not in red)

CAn1.png

You can use the following code inside the ISR to service the CANRx interrupt:

ISR(CANRxISR)

{

   unsigned char length, index;

    unsigned char rxdata[8];

    length = (CAN0RXDLR & 0x0F);

      for (index=0; index<length; index++)

          rxdata[index] = *(&CAN0RXDSR0 + index); /* Get received data */

    CAN0RFLG = 0x01;   /* Clear RXF */

}

Hopefully the info helps.

Regards.

iggi