Skip to content
Snippets Groups Projects
Commit caa0700c authored by David Sidrane's avatar David Sidrane Committed by Daniel Agar
Browse files

uavcan:Build system specify architecture

parent 0c3386d2
No related branches found
No related tags found
No related merge requests found
......@@ -34,21 +34,32 @@
px4_add_git_submodule(TARGET git_uavcan PATH "libuavcan")
set(UAVCAN_USE_CPP03 ON CACHE BOOL "uavcan cpp03")
set(UAVCAN_PLATFORM stm32 CACHE STRING "uavcan platform")
# The default is the stm32
if(NOT UAVCAN_PLATFORM)
set(UAVCAN_PLATFORM stm32 CACHE STRING "uavcan platform")
endif()
# The default timer the 5
if(NOT UAVCAN_TIMER)
set(UAVCAN_TIMER 5)
endif()
if(NOT config_uavcan_num_ifaces)
message(FATAL_ERROR "config_uavcan_num_ifaces not set")
endif()
string(TOUPPER "${OS}" OS_UPPER)
string(TOUPPER "${UAVCAN_PLATFORM}" UAVCAN_PLATFORM_UPPER)
add_definitions(
-DUAVCAN_CPP_VERSION=UAVCAN_CPP03
-DUAVCAN_MEM_POOL_BLOCK_SIZE=48
-DUAVCAN_NO_ASSERTIONS
-DUAVCAN_PLATFORM=stm32
-DUAVCAN_STM32_${OS_UPPER}=1
-DUAVCAN_STM32_NUM_IFACES=${config_uavcan_num_ifaces}
-DUAVCAN_STM32_TIMER_NUMBER=5
-DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
-DUAVCAN_DRIVER=uavcan_${UAVCAN_PLATFORM}
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_${OS_UPPER}=1
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_NUM_IFACES=${config_uavcan_num_ifaces}
-DUAVCAN_${UAVCAN_PLATFORM_UPPER}_TIMER_NUMBER=${UAVCAN_TIMER}
)
add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
......@@ -64,7 +75,7 @@ px4_add_module(
libuavcan/libuavcan/include
libuavcan/libuavcan/include/dsdlc_generated
libuavcan/libuavcan_drivers/posix/include
libuavcan/libuavcan_drivers/stm32/driver/include
libuavcan/libuavcan_drivers/${UAVCAN_PLATFORM}/driver/include
SRCS
# Main
uavcan_main.cpp
......@@ -89,5 +100,5 @@ px4_add_module(
# within libuavcan
libuavcan_dsdlc
uavcan
uavcan_stm32_driver
uavcan_${UAVCAN_PLATFORM}_driver
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment