mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
[DO NOT MERGE] UAVCAN embedded peripheral firmware hacks
This commit is contained in:
@@ -187,6 +187,50 @@ foreach(board_rc_file ${OPTIONAL_BOARD_RC})
|
||||
|
||||
endforeach()
|
||||
|
||||
|
||||
if(config_uavcan_peripheral_firmware)
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
foreach(uavcan_peripheral_config ${config_uavcan_peripheral_firmware})
|
||||
# include the px4io binary in ROMFS
|
||||
message(STATUS "ROMFS: Building and including UAVCAN peripheral ${uavcan_peripheral_config}")
|
||||
ExternalProject_Add(build_${uavcan_peripheral_config}
|
||||
SOURCE_DIR ${CMAKE_SOURCE_DIR}
|
||||
DOWNLOAD_COMMAND ""
|
||||
UPDATE_COMMAND ""
|
||||
CMAKE_ARGS -DCONFIG=${uavcan_peripheral_config}
|
||||
INSTALL_COMMAND ""
|
||||
USES_TERMINAL_BUILD true
|
||||
DEPENDS git_nuttx git_nuttx_apps
|
||||
BUILD_ALWAYS 1
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(build_${uavcan_peripheral_config} BINARY_DIR)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${romfs_gen_root_dir}/uavcan/fw/org.ardupilot.cuav_gps/gps.bin
|
||||
#${romfs_gen_root_dir}/uavcan/fw/org.ardupilot.cuav_gps/3.233/gps.bin
|
||||
#${romfs_gen_root_dir}/uavcan/fw/${uavcan_peripheral_config}
|
||||
${uavcan_peripheral_config}.stamp
|
||||
#COMMAND mkdir -p ${romfs_gen_root_dir}/uavcan/fw/org.cuav.can-gps-v1/0.1/
|
||||
#COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/*.uavcan.bin ${romfs_gen_root_dir}/uavcan/fw/org.cuav.can-gps-v1/0.1/
|
||||
COMMAND mkdir -p ${romfs_gen_root_dir}/uavcan/fw/org.ardupilot.cuav_gps/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${BINARY_DIR}/*.uavcan.bin ${romfs_gen_root_dir}/uavcan/fw/org.ardupilot.cuav_gps/gps.bin
|
||||
COMMAND ls -lsa ${romfs_gen_root_dir}/uavcan/fw/
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${uavcan_peripheral_config}.stamp
|
||||
DEPENDS
|
||||
build_${uavcan_peripheral_config}
|
||||
COMMENT "ROMFS: copying ${uavcan_peripheral_config}"
|
||||
)
|
||||
|
||||
list(APPEND extras_dependencies
|
||||
${uavcan_peripheral_config}.stamp
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
list(APPEND extras_dependencies
|
||||
${config_romfs_extra_dependencies}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user