diff --git a/platforms/stm32f405/include/can.h b/platforms/stm32f405/include/can.h index d923022..dc1919e 100644 --- a/platforms/stm32f405/include/can.h +++ b/platforms/stm32f405/include/can.h @@ -26,7 +26,7 @@ typedef struct { } can_msg_t; HAL_StatusTypeDef can_init(can_t *can); -HAL_StatusTypeDef can_send_msg(can_t *can, can_msg_t *msg); +HAL_StatusTypeDef can_add_filter(can_t *can, uint32_t id1, uint32_t id2, uint32_t id3, uint32_t id4); HAL_StatusTypeDef can_send_msg(can_t *can, can_msg_t *msg); HAL_StatusTypeDef can_send_extended_msg(can_t *can, can_msg_t *msg); diff --git a/platforms/stm32f405/src/can.c b/platforms/stm32f405/src/can.c index f478b26..d6b2b19 100644 --- a/platforms/stm32f405/src/can.c +++ b/platforms/stm32f405/src/can.c @@ -61,7 +61,8 @@ HAL_StatusTypeDef can_init(can_t *can) return err; } -HAL_StatusTypeDef can_add_filter(can_t *can, uint32_t id1, uint32_t id2, uint32_t id3, uint32_t id4) { +HAL_StatusTypeDef can_add_filter(can_t *can, uint32_t id1, uint32_t id2, uint32_t id3, uint32_t id4) +{ CAN_FilterTypeDef filter; filter.FilterActivation = ENABLE; @@ -80,7 +81,7 @@ HAL_StatusTypeDef can_add_filter(can_t *can, uint32_t id1, uint32_t id2, uint32_ err = HAL_CAN_ConfigFilter(can->hcan, &filter); if (err != HAL_OK) return err; - + return HAL_CAN_Start(can->hcan); }