diff --git a/boards/nxp/fmuk66-v3/default-boardconfig b/boards/nxp/fmuk66-v3/default-boardconfig index 758fd1adfe..9ddc278a7b 100644 --- a/boards/nxp/fmuk66-v3/default-boardconfig +++ b/boards/nxp/fmuk66-v3/default-boardconfig @@ -27,6 +27,7 @@ CONFIG_DRIVERS_SAFETY_BUTTON=y CONFIG_DRIVERS_TELEMETRY=y CONFIG_DRIVERS_TONE_ALARM=y CONFIG_DRIVERS_UAVCAN=y +CONFIG_UAVCAN_INTERFACES=2 CONFIG_MODULES_AIRSPEED_SELECTOR=y CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y CONFIG_MODULES_BATTERY_STATUS=y diff --git a/boards/nxp/fmuk66-v3/default.cmake b/boards/nxp/fmuk66-v3/default.cmake index c48579705e..0c54d9c283 100644 --- a/boards/nxp/fmuk66-v3/default.cmake +++ b/boards/nxp/fmuk66-v3/default.cmake @@ -5,7 +5,6 @@ px4_add_board( ARCHITECTURE cortex-m4 CONSTRAINED_MEMORY ROMFSROOT px4fmu_common - UAVCAN_INTERFACES 2 SERIAL_PORTS GPS1:/dev/ttyS3 TEL1:/dev/ttyS4 diff --git a/cmake/kconfig.cmake b/cmake/kconfig.cmake index 081acb4d82..ef1e07418f 100644 --- a/cmake/kconfig.cmake +++ b/cmake/kconfig.cmake @@ -151,5 +151,17 @@ if(EXISTS ${BOARD_DEFCONFIG}) list(APPEND config_module_list examples/${example}) endif() + + # Find variable name + string(REGEX MATCH "^CONFIG_UAVCAN_INTERFACES" UAVCAN_INTERFACES ${NameAndValue}) + + # Temporary located here to maintain binary compatibility, have to be removed later + if(UAVCAN_INTERFACES) + # Find the value + string(REPLACE "${Name}=" "" Value ${NameAndValue}) + + set(config_uavcan_num_ifaces ${Value} CACHE INTERNAL "UAVCAN interfaces" FORCE) + endif() + endforeach() endif() diff --git a/src/drivers/Kconfig b/src/drivers/Kconfig index d41a6b0070..11d491e83f 100644 --- a/src/drivers/Kconfig +++ b/src/drivers/Kconfig @@ -223,6 +223,10 @@ menuconfig DRIVERS_UAVCAN ---help--- Enable support for uavcan +if DRIVERS_UAVCAN +source "src/drivers/uavcan/Kconfig" +endif #DRIVERS_UAVCAN + menuconfig DRIVERS_UAVCAN_V1 bool "UAVCANv1" default n diff --git a/src/drivers/uavcan/Kconfig b/src/drivers/uavcan/Kconfig new file mode 100644 index 0000000000..b093b244db --- /dev/null +++ b/src/drivers/uavcan/Kconfig @@ -0,0 +1,5 @@ +menuconfig UAVCAN_INTERFACES + int "UAVCANv0 interface count" + default 0 + ---help--- + Interface count for UAVCANv0