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:
Takashi Furuya 2026-08-03 15:05:49 +09:00 committed by Xiang Xiao
parent 8f62ee1389
commit 5f8a3ea68d

View file

@ -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];