为什么在我的DSP编程中,我的CAN模块总是不停地往外发送数据?有什么办法让它只发一个数据?
中断程序:interruptvoidECAN0INTA_ISR(void)//eCAN-A{//InsertISRCodehereUint16CAN_RxD_Data=0...
中断程序:
interrupt void ECAN0INTA_ISR(void) // eCAN-A
{
// Insert ISR Code here
Uint16 CAN_RxD_Data = 0;
Uint32 CAN_Rxd_ID = 0;
CAN_RxD_Data = CAN_RxD_Data;
CAN_Rxd_ID = CAN_Rxd_ID;
// To receive more interrupts from this PIE group, acknowledge this interrupt
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP9;
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
CAN_RxD_Data = (Uint16)(ECanaRegs.CANGIF0.all&0x1F);
CAN_Rxd_ID = (Uint32)(ECanaMboxes.MBOX0.MSGID.all&0x1FFFFFFF);
CAN_Rxd_ID = ECanaMboxes.MBOX0.MDL.all;
CAN_Rxd_ID = ECanaMboxes.MBOX0.MDH.all;
switch(CAN_Rxd_ID)
{
case CAN_ID1:
{
break;
}
default:
break;
}
ECanaRegs.CANRMP.all = 0xFFFFFFFF;
ECanaRegs.CANGIF0.all = 0xFFFFFFFF;
PieCtrlRegs.PIEACK.bit.ACK9 = 1;
那么请问如何关中断程序呢?或者说用哪个寄存器控制啊? 展开
interrupt void ECAN0INTA_ISR(void) // eCAN-A
{
// Insert ISR Code here
Uint16 CAN_RxD_Data = 0;
Uint32 CAN_Rxd_ID = 0;
CAN_RxD_Data = CAN_RxD_Data;
CAN_Rxd_ID = CAN_Rxd_ID;
// To receive more interrupts from this PIE group, acknowledge this interrupt
// PieCtrlRegs.PIEACK.all = PIEACK_GROUP9;
// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
CAN_RxD_Data = (Uint16)(ECanaRegs.CANGIF0.all&0x1F);
CAN_Rxd_ID = (Uint32)(ECanaMboxes.MBOX0.MSGID.all&0x1FFFFFFF);
CAN_Rxd_ID = ECanaMboxes.MBOX0.MDL.all;
CAN_Rxd_ID = ECanaMboxes.MBOX0.MDH.all;
switch(CAN_Rxd_ID)
{
case CAN_ID1:
{
break;
}
default:
break;
}
ECanaRegs.CANRMP.all = 0xFFFFFFFF;
ECanaRegs.CANGIF0.all = 0xFFFFFFFF;
PieCtrlRegs.PIEACK.bit.ACK9 = 1;
那么请问如何关中断程序呢?或者说用哪个寄存器控制啊? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询