[Kconfig] Move UAVCANv0 num interfaces to Kconfig

This commit is contained in:
Peter van der Perk 2021-03-12 20:53:19 +01:00 committed by Daniel Agar
parent 16f86a99c2
commit a0821afafd
5 changed files with 22 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,5 @@
menuconfig UAVCAN_INTERFACES
int "UAVCANv0 interface count"
default 0
---help---
Interface count for UAVCANv0