if (ECanaRegs.CANTRS.bit .TRS4==1) {//当TRS=1时,清0 TRS? ECanaRegs.CANTRR.bit.TRR4=1; } ECana32Temp.CANME.all = ECanaRegs.CANME.all; ECana32Temp.CANME.all &= 0xFFFFFFEF;//禁用邮箱4,此时可以配置邮箱 ECanaRegs.CANME.all = ECana32Temp.CANME.all; ECanaMboxes.MBOX4.MSGID.all=0xC60F8003;//发送指定的目标是F0 ECanaMboxes.MBOX4.MSGCTRL.all = 0x00000008;//数据长度8 ECanaRegs.CANMD.all &= 0xFFFFFFEF; //邮箱4用来发送 ECana32Temp.CANME.all = ECanaRegs.CANME.all; ECana32Temp.CANME.all |= 0x00000010;//启用邮箱4 ECanaRegs.CANME.all = ECana32Temp.CANME.all; ECanaMboxes.MBOX4.MDL.word.HI_WORD=0x0001; ECanaMboxes.MBOX4.MDL.word.LOW_WORD =0x0001; ECanaMboxes.MBOX4.MDH.word.LOW_WORD =0x0001; ECanaMboxes.MBOX4.MDH.word.HI_WORD =0x0001; ECanaRegs.CANTRS.bit.TRS4 =1; if (ECanaRegs.CANTA.bit .TA4==1) {//Mailbox 4 Mdl send to Controller, waiting for response data // send data in box 4 success, Reset TA4 ECanaRegs.CANTA.all = 0x00000010; } 我的目的就是要让邮箱4发送一条消息,问问大家,发送消息成功的标志是什么?是不是发送成功(但消息没有被接收)TA4就置1 还有我的接收部分的代码是 ECana32Temp.CANME.all = ECanaRegs.CANME.all; ECana32Temp.CANME.all &= 0xFFFFFFFE;//禁用邮箱0,此时可以配置邮箱 ECanaRegs.CANME.all = ECana32Temp.CANME.all; ECanaMboxes.MBOX0.MSGID.all=0xC60F8003;//ID ECanaLAMRegs.LAM0.all=0x800807FC; //11-18位是目的地址,必须一一对应 ECanaRegs.CANMD.all |= 0x0001; //邮箱0用来接收 ECana32Temp.CANME.all = ECanaRegs.CANME.all; ECana32Temp.CANME.all |= 0x00000001;//使能邮箱0 ECanaRegs.CANME.all = ECana32Temp.CANME.all; if(ECanaRegs.CANRMP.bit .RMP0==1) { ECanaRegs.CANRMP.bit .RMP0=0; } 也帮我看看对不 |