forked from Archive/PX4-Autopilot
uavcannode: use correct PYTHON_EXECUTABLE and support stm32h7
- sync CMakeLists.txt with drivers/uavcan
This commit is contained in:
parent
d61fd0e4ca
commit
abbd335e4e
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
|
|
@ -43,9 +43,15 @@ if(CONFIG_ARCH_CHIP)
|
|||
if(${CONFIG_ARCH_CHIP} MATCHES "kinetis")
|
||||
set(UAVCAN_DRIVER "kinetis")
|
||||
set(UAVCAN_TIMER 1)
|
||||
elseif(${CONFIG_ARCH_CHIP} MATCHES "stm32h7")
|
||||
set(UAVCAN_DRIVER "stm32h7")
|
||||
set(UAVCAN_TIMER 5) # The default timer is TIM5
|
||||
if (DEFINED config_uavcan_timer_override)
|
||||
set (UAVCAN_TIMER ${config_uavcan_timer_override})
|
||||
endif()
|
||||
elseif(${CONFIG_ARCH_CHIP} MATCHES "stm32")
|
||||
set(UAVCAN_DRIVER "stm32")
|
||||
set(UAVCAN_TIMER 5) # The default timer the 5
|
||||
set(UAVCAN_TIMER 5) # The default timer is TIM5
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -71,7 +77,11 @@ add_definitions(
|
|||
-DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
|
||||
)
|
||||
|
||||
add_compile_options(-Wno-cast-align) # TODO: fix and enable
|
||||
add_compile_options(
|
||||
-Wno-cast-align # TODO: fix and enable
|
||||
-Wno-deprecated-copy # TODO: fix
|
||||
-Wno-address-of-packed-member
|
||||
)
|
||||
add_subdirectory(${LIBUAVCAN_DIR} libuavcan EXCLUDE_FROM_ALL)
|
||||
add_dependencies(uavcan prebuild_targets)
|
||||
|
||||
|
@ -93,7 +103,7 @@ foreach(DSDLC_INPUT ${DSDLC_INPUTS})
|
|||
list(APPEND DSDLC_INPUT_FILES ${DSDLC_NEW_INPUT_FILES})
|
||||
endforeach(DSDLC_INPUT)
|
||||
add_custom_command(OUTPUT px4_uavcan_dsdlc_run.stamp
|
||||
COMMAND ${PYTHON} ${LIBUAVCAN_DIR}/libuavcan/dsdl_compiler/libuavcan_dsdlc ${DSDLC_INPUTS} -O${DSDLC_OUTPUT}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${LIBUAVCAN_DIR}/libuavcan/dsdl_compiler/libuavcan_dsdlc ${DSDLC_INPUTS} -O${DSDLC_OUTPUT}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch px4_uavcan_dsdlc_run.stamp
|
||||
DEPENDS ${DSDLC_INPUT_FILES}
|
||||
COMMENT "PX4 UAVCAN dsdl compiler"
|
||||
|
@ -116,9 +126,13 @@ px4_add_module(
|
|||
UavcanNode.hpp
|
||||
DEPENDS
|
||||
px4_uavcan_dsdlc
|
||||
|
||||
drivers_bootloaders
|
||||
version
|
||||
|
||||
git_uavcan
|
||||
uavcan_${UAVCAN_DRIVER}_driver
|
||||
uavcan # within libuavcan
|
||||
|
||||
# within libuavcan
|
||||
uavcan
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue