Skip to content

Commit 233a447

Browse files
m_can: enable automatic transceiver delay compensation
1 parent 88a5f06 commit 233a447

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/can/m_can.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ void can_enable(can_data_t *channel, uint32_t mode)
138138
HAL_FDCAN_Init(&channel->channel);
139139
HAL_FDCAN_EnableISOMode(&channel->channel);
140140

141+
/* Enable automatic transceiver delay compensation */
142+
HAL_FDCAN_ConfigTxDelayCompensation(&channel->channel,
143+
channel->channel.Init.DataTimeSeg1 * channel->channel.Init.DataPrescaler,
144+
0U);
145+
HAL_FDCAN_EnableTxDelayCompensation(&channel->channel);
146+
141147
/* Configure reception filter to Rx FIFO 0 on both FDCAN instances */
142148
FDCAN_FilterTypeDef sFilterConfig = {
143149
.IdType = FDCAN_STANDARD_ID,

0 commit comments

Comments
 (0)