//*****************************************************************************
// CAN中断服务函数
//*****************************************************************************
void
CANIntHandler(void)
{
unsigned long ulStatus;
// Read the CAN interrupt status to find the cause of the interrupt
ulStatus = CANIntStatus(CAN0_BASE, CAN_INT_STS_CAUSE);//控制器中断寄存器的值并表示中断产生的原因
// If the cause is a controller status interrupt, then get the status
if(ulStatus == CAN_INT_INTID_STATUS)//中断产生的原因是一个状态中断
{
//在读取主控制器状态寄存器时,将清除一个正詆诠移鸬淖刺?卸?
g_bErrFlag = 1;// 表示有错误发生
}
//! \b CAN_INT_INTID_STATUS if the cause is a status interrupt. In this case,
//! the status register should be read with the CANStatusGet() function.
//! Calling this function to read the status also clears the status
//! interrupt. If the value of the interrupt register is in the range 1-32,
//! then this indicates the number of the highest priority message object that
//! has an interrupt pending. The message object interrupt can be cleared by
//! using the CANIntClear() function, or by reading the message using
//! CANMessageGet() in the case of a received message. The interrupt handler
//! can read the interrupt status again to make sure all pending interrupts are
//! cleared before returning from the interrupt.
应该调用一下 CANStatusGet() 来清除一下标记
详情回复
发表于 2013-3-20 14:31
//! \\b CAN_INT_INTID_STATUS if the cause is a status interrupt. In this case,
//! the status register should be read with the CANStatusGet() function.
//! Calling this function to read the status
详情回复
发表于 2013-3-20 14:31
//! \b CAN_INT_INTID_STATUS if the cause is a status interrupt. In this case,
//! the status register should be read with the CANStatusGet() function.
//! Calling this function to read the status also clears the status
//! interrupt. If the value of the interrupt register is in the range 1-32,
//! then this indicates the number of the highest priority message object that
//! has an interrupt pending. The message object interrupt can be cleared by
//! using the CANIntClear() function, or by reading the message using
//! CANMessageGet() in the case of a received message. The interrupt handler
//! can read the interrupt status again to make sure all pending interrupts are
//! cleared before returning from the interrupt.