mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Support GPIO_CAN2_RX not defined
This commit is contained in:
committed by
Lorenz Meier
parent
09f83e78e5
commit
32ae638974
@@ -533,12 +533,17 @@ int UavcanNode::start(uavcan::NodeID node_id, uint32_t bitrate)
|
||||
* If no transceiver is connected, the RX pin will float, occasionally causing CAN controller to
|
||||
* fail during initialization.
|
||||
*/
|
||||
#ifdef GPIO_CAN1_RX
|
||||
#if defined(GPIO_CAN1_RX)
|
||||
stm32_configgpio(GPIO_CAN1_RX);
|
||||
stm32_configgpio(GPIO_CAN1_TX);
|
||||
#endif
|
||||
#endif
|
||||
#if defined(GPIO_CAN2_RX)
|
||||
stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP);
|
||||
stm32_configgpio(GPIO_CAN2_TX);
|
||||
#endif
|
||||
#if !defined(GPIO_CAN1_RX) && !defined(GPIO_CAN2_RX)
|
||||
# error "Need to define GPIO_CAN1_RX and/or GPIO_CAN2_RX"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CAN driver init
|
||||
|
||||
Reference in New Issue
Block a user