mirror of
https://github.com/apache/nuttx.git
synced 2026-08-11 07:25:13 +00:00
imxrt/flexcan: Initialize union and allow BRS control
- Zero initialize union in imxrt_transmit() - Allow setting BRS from Signed-off-by: Takashi Furuya <takashi.furuya@nttedt.co.jp>
This commit is contained in:
parent
8f62ee1389
commit
5f8a3ea68d
1 changed files with 2 additions and 0 deletions
|
|
@ -656,6 +656,7 @@ static int imxrt_transmit(struct imxrt_driver_s *priv)
|
|||
(peak_tx_mailbox_index_ > mbi ? peak_tx_mailbox_index_ : mbi);
|
||||
|
||||
union cs_e cs;
|
||||
cs.cs = 0;
|
||||
cs.code = CAN_TXMB_DATAORREMOTE;
|
||||
struct mb_s *mb = flexcan_get_mb(priv, mbi);
|
||||
mb->cs.code = CAN_TXMB_INACTIVE;
|
||||
|
|
@ -698,6 +699,7 @@ static int imxrt_transmit(struct imxrt_driver_s *priv)
|
|||
}
|
||||
|
||||
cs.rtr = frame->can_id & FLAGRTR ? 1 : 0;
|
||||
cs.brs = frame->flags & CANFD_BRS ? 1 : 0;
|
||||
|
||||
cs.dlc = g_len_to_can_dlc[frame->len];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue