mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 02:33:33 +08:00
remove BOARD_NAME from board_config.h and set automatically
This commit is contained in:
committed by
David Sidrane
parent
2d052c02fa
commit
ec4c9da253
@@ -75,7 +75,16 @@ if (DEFINED ENV{BUILD_URI})
|
||||
endif()
|
||||
|
||||
add_library(version version.c)
|
||||
target_compile_definitions(version PRIVATE BUILD_URI=${BUILD_URI})
|
||||
|
||||
string(TOUPPER "${PX4_BOARD}" PX4_BOARD_NAME)
|
||||
|
||||
target_compile_definitions(version
|
||||
PUBLIC
|
||||
PX4_BOARD_NAME="${PX4_BOARD_NAME}"
|
||||
PRIVATE
|
||||
BUILD_URI=${BUILD_URI}
|
||||
)
|
||||
|
||||
target_link_libraries(version PRIVATE git_ver)
|
||||
target_link_libraries(version PRIVATE drivers_board)
|
||||
add_dependencies(version prebuild_targets)
|
||||
|
||||
@@ -47,15 +47,6 @@
|
||||
#include <systemlib/px4_macros.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* The preferred method for publishing a board name is to
|
||||
* define it in board_config.h as BOARD_NAME
|
||||
*/
|
||||
|
||||
#ifndef BOARD_NAME
|
||||
# error "board_config.h must define BOARD_NAME"
|
||||
#endif
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
@@ -63,7 +54,7 @@ __BEGIN_DECLS
|
||||
*/
|
||||
static inline const char *px4_board_name(void)
|
||||
{
|
||||
return BOARD_NAME;
|
||||
return PX4_BOARD_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,6 +95,7 @@ px4_add_module(
|
||||
|
||||
DEPENDS
|
||||
mixer
|
||||
version
|
||||
|
||||
git_uavcan
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ px4_add_module(
|
||||
DEPENDS
|
||||
drivers_bootloaders
|
||||
git_uavcan
|
||||
version
|
||||
|
||||
# within libuavcan
|
||||
libuavcan_dsdlc
|
||||
|
||||
@@ -78,6 +78,7 @@ px4_add_module(
|
||||
DEPENDS
|
||||
drivers_bootloaders
|
||||
git_uavcan
|
||||
version
|
||||
|
||||
# within libuavcan
|
||||
libuavcan_dsdlc
|
||||
|
||||
@@ -101,4 +101,5 @@ px4_add_module(
|
||||
git_ecl
|
||||
ecl_geo_lookup # TODO: move this
|
||||
pwm_limit
|
||||
version
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user