Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hc32]hc32f460 has only one CAN, and it is defined as CM_CAN in hc32f… #9805

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bsp/hc32/ev_hc32f460_lqfp100_v2/board/board_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ rt_err_t rt_hw_board_can_init(CM_CAN_TypeDef *CANx)
switch ((rt_uint32_t)CANx)
{
#if defined(BSP_USING_CAN1)
case (rt_uint32_t)CM_CAN1:
case (rt_uint32_t)CM_CAN:
GPIO_SetFunc(CAN1_TX_PORT, CAN1_TX_PIN, CAN1_TX_PIN_FUNC);
GPIO_SetFunc(CAN1_RX_PORT, CAN1_RX_PIN, CAN1_RX_PIN_FUNC);
break;
Expand Down
2 changes: 2 additions & 0 deletions bsp/hc32/libraries/hc32_drivers/drv_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ static uint8_t _get_can_data_bytes_len(uint32_t dlc)
{
data_bytes = dlc;
}
#ifdef RT_CAN_USING_CANFD
else
{
switch (dlc)
Expand Down Expand Up @@ -355,6 +356,7 @@ static uint8_t _get_can_data_bytes_len(uint32_t dlc)
break;
}
}
#endif

return data_bytes;
}
Expand Down
Loading