From abbd335e4e3d950664db567ca771fd70698c14f4 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 18 Sep 2020 12:33:43 -0400 Subject: [PATCH] uavcannode: use correct PYTHON_EXECUTABLE and support stm32h7 - sync CMakeLists.txt with drivers/uavcan --- Tools/make_can_boot_descriptor.py | 2 +- src/drivers/uavcannode/CMakeLists.txt | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Tools/make_can_boot_descriptor.py b/Tools/make_can_boot_descriptor.py index 7649d41e84..6f03e8a1e0 100755 --- a/Tools/make_can_boot_descriptor.py +++ b/Tools/make_can_boot_descriptor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys diff --git a/src/drivers/uavcannode/CMakeLists.txt b/src/drivers/uavcannode/CMakeLists.txt index 889fa25838..a7071b082a 100644 --- a/src/drivers/uavcannode/CMakeLists.txt +++ b/src/drivers/uavcannode/CMakeLists.txt @@ -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 )