test
Fork of CANnucleo by
Diff: CAN.h
- Revision:
- 21:bcd8161f8f6c
- Parent:
- 14:0344705e6fb8
--- a/CAN.h Sat Mar 19 21:16:10 2016 +0000 +++ b/CAN.h Thu May 19 17:16:59 2016 +0000 @@ -250,7 +250,7 @@ * @param format format to filter on (Default CANAny) * @param handle message filter handle (Optional) * - * @returns 0 - successful + * @retval 0 - successful * 1 - error * 2 - busy * 3 - time out @@ -294,19 +294,15 @@ */ template<typename T> void attach(T* tptr, void (T::*mptr)(void), IrqType type=RxIrq) { - if((mptr != NULL) && (tptr != NULL)) { + HAL_NVIC_DisableIRQ(CAN_IRQ); + if((tptr != NULL) && (mptr != NULL)) _irq[type].attach(tptr, mptr); -// can_irq_set(&_can, (CanIrqType)type, 1); - } -// else { -// can_irq_set(&_can, (CanIrqType)type, 0); -// } + HAL_NVIC_EnableIRQ(CAN_IRQ); } static void _irq_handler(uint32_t id, CanIrqType type); protected: - can_t _can; FunctionPointer _irq[9]; };