pub
Fork of CANnucleo by
Diff: can_api.c
- Revision:
- 15:5123ead7b002
- Parent:
- 14:0344705e6fb8
- Child:
- 16:f4c8f45bded9
diff -r 0344705e6fb8 -r 5123ead7b002 can_api.c --- a/can_api.c Sun Dec 27 09:02:47 2015 +0000 +++ b/can_api.c Sun Dec 27 09:36:47 2015 +0000 @@ -50,7 +50,7 @@ * @retval */ void can_free(can_t* obj) { - HAL_CAN_MspDeInit(obj); + HAL_CAN_MspDeInit(&_canHandle); } /** @@ -60,15 +60,7 @@ * @retval */ int can_frequency(can_t* obj, int hz) { -#if defined(TARGET_NUCLEO_F103RB) - HAL_NVIC_DisableIRQ(USB_LP_CAN1_RX0_IRQn); -#elif defined(TARGET_NUCLEO_F302R8) || \ - defined(TARGET_NUCLEO_F303RE) || \ - defined(TARGET_NUCLEO_F303K8) || \ - defined(TARGET_NUCLEO_F334R8) || \ - defined(TARGET_DISCO_F334C8) - HAL_NVIC_DisableIRQ(CAN_RX1_IRQn); -#endif + HAL_NVIC_DisableIRQ(CAN_IRQ); // APB1 peripheral clock = 36000000Hz @@ -118,15 +110,7 @@ } HAL_CAN_Init(&_canHandle); -#if defined(TARGET_NUCLEO_F103RB) - HAL_NVIC_EnableIRQ(USB_LP_CAN1_RX0_IRQn); -#elif defined(TARGET_NUCLEO_F302R8) || \ - defined(TARGET_NUCLEO_F303RE) || \ - defined(TARGET_NUCLEO_F303K8) || \ - defined(TARGET_NUCLEO_F334R8) || \ - defined(TARGET_DISCO_F334C8) - HAL_NVIC_EnableIRQ(CAN_RX1_IRQn); -#endif + HAL_NVIC_EnableIRQ(CAN_IRQ); return 1; } @@ -320,4 +304,3 @@ -