[stm32F4] adapt 168M frequency of 1M can baud, remember to add the define of BSP_USING_CAN168M in kconfig while using 168M frequency

This commit is contained in:
zuozuojia 2022-01-05 20:07:56 +08:00 committed by guo
parent 9b6bc0fcc7
commit 10b71175eb
1 changed files with 4 additions and 0 deletions

View File

@ -54,7 +54,11 @@ static const struct stm32_baud_rate_tab can_baud_rate_tab[] =
#else /* APB1 45MHz(max) */
static const struct stm32_baud_rate_tab can_baud_rate_tab[] =
{
#ifdef BSP_USING_CAN168M
{CAN1MBaud, (CAN_SJW_1TQ | CAN_BS1_3TQ | CAN_BS2_3TQ | 6)},
#else
{CAN1MBaud, (CAN_SJW_2TQ | CAN_BS1_9TQ | CAN_BS2_5TQ | 3)},
#endif
{CAN800kBaud, (CAN_SJW_2TQ | CAN_BS1_8TQ | CAN_BS2_5TQ | 4)},
{CAN500kBaud, (CAN_SJW_2TQ | CAN_BS1_9TQ | CAN_BS2_5TQ | 6)},
{CAN250kBaud, (CAN_SJW_2TQ | CAN_BS1_9TQ | CAN_BS2_5TQ | 12)},