//使用canUpdateID函数更新ID后,发送的数据帧变成远程帧了,我不知道原因,
//msgBoxArbitVal传过来的是0XA1300000
void canUpdateID(canBASE_t *node, uint32 messageBox, uint32 msgBoxArbitVal)
{
/** - Wait until IF2 is ready for use */
while ((node->IF2STAT & 0x80U) ==0x80U)
{
} /* Wait */
/** - Configure IF2 for
* - Message direction - Read
* - Data Read
* - Clears NewDat bit in the message object.
*/
node->IF2CMD = 0xA0U;
/* Copy passed value into the arbitration register. */
node->IF2ARB &= 0x80000000U;
node->IF2ARB |= (msgBoxArbitVal & 0x7FFFFFFFU);
/** - Update message box number. */
/*SAFETYMCUSW 93 S MR: 6.1,6.2,10.1,10.2,10.3,10.4 <APPROVED> "LDRA Tool issue" */
node->IF2NO = (uint8) messageBox;
/** - Wait until data are copied into IF2 */
while ((node->IF2STAT & 0x80U) ==0x80U)
{
} /* Wait */
}