diff --git a/ports/stm32/can.h b/ports/stm32/can.h index 085070b60..bb26c0b7e 100644 --- a/ports/stm32/can.h +++ b/ports/stm32/can.h @@ -28,6 +28,8 @@ #include "py/obj.h" +#if MICROPY_HW_ENABLE_CAN + #define PYB_CAN_1 (1) #define PYB_CAN_2 (2) #define PYB_CAN_3 (3) @@ -86,4 +88,6 @@ int can_receive(CAN_HandleTypeDef *can, int fifo, CanRxMsgTypeDef *msg, uint8_t HAL_StatusTypeDef CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout); void pyb_can_handle_callback(pyb_can_obj_t *self, uint fifo_id, mp_obj_t callback, mp_obj_t irq_reason); +#endif // MICROPY_HW_ENABLE_CAN + #endif // MICROPY_INCLUDED_STM32_CAN_H