From 6b4666f8cf93121af00014351a659216824214e1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 23 Sep 2019 23:45:07 +1000 Subject: [PATCH] stm32/can: Guard header file by MICROPY_HW_ENABLE_CAN. Because not all MCU series have a CAN peripheral. --- ports/stm32/can.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/stm32/can.h b/ports/stm32/can.h index 085070b601..bb26c0b7e2 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