diff --git a/lib/stm32/can.c b/lib/stm32/can.c index a7ca00fd..d1621674 100644 --- a/lib/stm32/can.c +++ b/lib/stm32/can.c @@ -36,18 +36,7 @@ LGPL License Terms @ref lgpl_license */ #include - -#if defined(STM32F1) -# include -#elif defined(STM32F2) -# include -#elif defined(STM32F3) -# include -#elif defined(STM32F4) -# include -#else -# error "stm32 family not defined." -#endif +#include /* Timeout for CAN INIT acknowledge * this value is difficult to define. @@ -74,12 +63,10 @@ can_reg_base. void can_reset(uint32_t canport) { if (canport == CAN1) { - rcc_peripheral_reset(&RCC_APB1RSTR, RCC_APB1RSTR_CAN1RST); - rcc_peripheral_clear_reset(&RCC_APB1RSTR, RCC_APB1RSTR_CAN1RST); + rcc_periph_reset_pulse(RCC_CAN1); } else { #if defined(BX_CAN2_BASE) - rcc_peripheral_reset(&RCC_APB1RSTR, RCC_APB1RSTR_CAN2RST); - rcc_peripheral_clear_reset(&RCC_APB1RSTR, RCC_APB1RSTR_CAN2RST); + rcc_periph_reset_pulse(RCC_CAN2); #endif } }