From 248cd45503987a657536b8448fb82993518c6afc Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 6 Oct 2016 05:42:13 -1000 Subject: [PATCH] Added missig can_devinit prototype The Nuttx CAN driver is not used with UAVCAN. However to facilitate compilation to allow the Nuttx CAN Example to be compiled and linked, the missing proto type was needed. Futhermore to include the NuttX CAN eaxample the following changes are needed: 1 ) In cmake/configs/.cmake Add can to config_extra_builtin_cmds as: set(config_extra_builtin_cmds serdis sercon can ) Add: add_custom_target(can) set_target_properties(can PROPERTIES PRIORITY "SCHED_PRIORITY_DEFAULT" MAIN "can" STACK_MAIN "2048" COMPILE_FLAGS "-Os") 2) Update the nuttx-configs//nsh/defconfig Run make oldconfig and make menuconfig and set the follwoing: CONFIG_CAN=y CONFIG_STM32_CAN1=y or CONFIG_STM32_CAN2=y CONFIG_CAN_EXTID=y CONFIG_CAN1_BAUD=250000 CONFIG_CAN_FIFOSIZE=8 CONFIG_CAN_NPENDINGRTR=4 CONFIG_EXAMPLES_CAN=y --- src/drivers/boards/mindpx-v2/mindpx_can.c | 4 ++-- src/drivers/boards/px4fmu-v2/px4fmu_can.c | 3 ++- src/drivers/boards/px4fmu-v4/px4fmu_can.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/drivers/boards/mindpx-v2/mindpx_can.c b/src/drivers/boards/mindpx-v2/mindpx_can.c index 84c7a28bf2..2e818c5b10 100644 --- a/src/drivers/boards/mindpx-v2/mindpx_can.c +++ b/src/drivers/boards/mindpx-v2/mindpx_can.c @@ -96,7 +96,7 @@ /************************************************************************************ * Public Functions ************************************************************************************/ - +int can_devinit(void); /************************************************************************************ * Name: can_devinit * @@ -141,4 +141,4 @@ int can_devinit(void) return OK; } -#endif \ No newline at end of file +#endif diff --git a/src/drivers/boards/px4fmu-v2/px4fmu_can.c b/src/drivers/boards/px4fmu-v2/px4fmu_can.c index 62f170957d..2aaae19a87 100644 --- a/src/drivers/boards/px4fmu-v2/px4fmu_can.c +++ b/src/drivers/boards/px4fmu-v2/px4fmu_can.c @@ -96,6 +96,7 @@ /************************************************************************************ * Public Functions ************************************************************************************/ +int can_devinit(void); /************************************************************************************ * Name: can_devinit @@ -141,4 +142,4 @@ int can_devinit(void) return OK; } -#endif \ No newline at end of file +#endif diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_can.c b/src/drivers/boards/px4fmu-v4/px4fmu_can.c index 62f170957d..2aaae19a87 100644 --- a/src/drivers/boards/px4fmu-v4/px4fmu_can.c +++ b/src/drivers/boards/px4fmu-v4/px4fmu_can.c @@ -96,6 +96,7 @@ /************************************************************************************ * Public Functions ************************************************************************************/ +int can_devinit(void); /************************************************************************************ * Name: can_devinit @@ -141,4 +142,4 @@ int can_devinit(void) return OK; } -#endif \ No newline at end of file +#endif