From e96f4e1944bd54ccf75bdd2ccf354f656dc0df63 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 11 Oct 2015 14:06:43 +0200 Subject: [PATCH] FMUv1: Fix CAN compilation --- cmake/configs/nuttx_px4fmu-v1_default.cmake | 1 + src/modules/uavcan/uavcan_main.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmake/configs/nuttx_px4fmu-v1_default.cmake b/cmake/configs/nuttx_px4fmu-v1_default.cmake index ed48bd4f34..d42d5adf75 100644 --- a/cmake/configs/nuttx_px4fmu-v1_default.cmake +++ b/cmake/configs/nuttx_px4fmu-v1_default.cmake @@ -98,6 +98,7 @@ set(config_module_list modules/controllib modules/uORB modules/dataman + modules/uavcan # # Libraries diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index 57bc6c1809..1ba9d345fb 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -530,8 +530,10 @@ 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 stm32_configgpio(GPIO_CAN1_RX); stm32_configgpio(GPIO_CAN1_TX); + #endif stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP); stm32_configgpio(GPIO_CAN2_TX);