我用的是AT917X256,带CAN控制器。数据手册上说若将CAN_MR的DRPT域(Disable Repeat)设置为0,则“When a transmit mailbox loses the bus arbitration, the transfer request remains pending.”,若设置为1,则“When a transmit mailbox lose the bus arbitration, the transfer request is automatically aborted. It automatically raises
the MABT and MRDT flags in the corresponding CAN_MSRx.”,是否是后者。但后者似乎表明报文一旦仲裁失效就不会继续竞争,除非重新激活。另外,你说的设置成中断具体为何?
引用 2 楼 wei_119856 的回复:
我用的是AT917X256,带CAN控制器。数据手册上说若将CAN_MR的DRPT域(Disable Repeat)设置为0,则“When a transmit mailbox loses the bus arbitration, the transfer request remains pending.”,若设置为1,则“When a transmit mailbox lose the bus arbitration, the transfer request is automatically aborted. It automatically raises
the MABT and MRDT flags in the corresponding CAN_MSRx.”,是否是后者。但后者似乎表明报文一旦仲裁失效就不会继续竞争,除非重新激活。另外,你说的设置成中断具体为何?
看说明,如果设0,一次仲裁失败后,仍然保持请求,会等待下次总线的IDLE状态,也就是说还会继续尝试申请总线控制权。
如果设1,一旦失败就不会继续竞争了,自动放弃,并且将MABT and MRDT标志位置位。
那么你就可以读取MABT and MRDT来判断是否仲裁失败了。如果你希望能持续竞争,那就设0,让controller自动反复竞争,直到成功为止。