Skip to content

Commit

Permalink
fix bug : can send err.(can frame type)
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhy-2020 committed Sep 1, 2021
1 parent dde425a commit 332f3d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rtt_default_project_0/drivers/drv_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,12 @@ static int _can_sendmsg(struct rt_can_device *can, const void *buf, rt_uint32_t
h_can->perh->TxMailBox[box_num].TXID &= CAN_TXID0_TXMREQ_MSK;
/* Set up the Id */
if (RT_CAN_STDID == pmsg->ide)
{
h_can->perh->TxMailBox[box_num].TXID |= (txheader.std << CAN_TXID0_STDID_POSS) | txheader.rtr;
{
h_can->perh->TxMailBox[box_num].TXID |= (txheader.std << CAN_TXID0_STDID_POSS) | (txheader.rtr << CAN_TXID0_RTR_POS);
}
else
{
h_can->perh->TxMailBox[box_num].TXID |= (txheader.ext << CAN_TXID0_EXID_POSS) | txheader.type | txheader.rtr;
h_can->perh->TxMailBox[box_num].TXID |= (txheader.ext << CAN_TXID0_EXID_POSS) | (txheader.type << CAN_TXID0_IDE_POS) | (txheader.rtr << CAN_TXID0_RTR_POS);
}
/* Set up the DLC */
h_can->perh->TxMailBox[box_num].TXFCON = pmsg->len & 0x0FU;
Expand Down

0 comments on commit 332f3d1

Please sign in to comment.