stm32/can: Guard header file by MICROPY_HW_ENABLE_CAN.

Because not all MCU series have a CAN peripheral.
pull/1/head
Damien George 2019-09-23 23:45:07 +10:00
parent ca8ff99e8c
commit 6b4666f8cf
1 changed files with 4 additions and 0 deletions

View File

@ -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