用到CAN SEC中断,跳出中断后立刻又进入中断,不知道何故
void CAN1_SCE_IRQHandler(void)
{
CAN_ClearITPendingBit(CAN1,CAN_IT_LEC);
}
中断开启
CAN_ITConfig(CAN1,CAN_IT_FMP0|CAN_IT_LEC|CAN_IT_ERR, ENABLE);
/* enabling CAN ERR interrupt */
NVIC_InitStructure.NVIC_IRQChannel=CAN1_SCE_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure); |