mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
version: remove FW_GIT & FW_BUILD_URI, use the correct methods instead
This is cleanup after rebasing
This commit is contained in:
parent
3d0f1e4a4f
commit
5e9bdff205
@ -47,8 +47,6 @@
|
||||
|
||||
#define FREEZE_STR(s) #s
|
||||
#define STRINGIFY(s) FREEZE_STR(s)
|
||||
#define FW_GIT STRINGIFY(GIT_VERSION)
|
||||
#define FW_BUILD_URI STRINGIFY(BUILD_URI)
|
||||
|
||||
/* The preferred method for publishing a board name is to
|
||||
* define it in board_config.h as BOARD_NAME
|
||||
@ -81,6 +79,14 @@ static inline const char *px4_board_name(void)
|
||||
return BOARD_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the build URI (used for crash logging)
|
||||
*/
|
||||
static inline const char *px4_build_uri(void)
|
||||
{
|
||||
return STRINGIFY(BUILD_URI);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the PX4 Firmware version
|
||||
* @return version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type @see FIRMWARE_TYPE)
|
||||
|
||||
@ -619,7 +619,7 @@ void UavcanNode::fill_node_info()
|
||||
/* software version */
|
||||
uavcan::protocol::SoftwareVersion swver;
|
||||
|
||||
// Extracting the first 8 hex digits of GIT_VERSION and converting them to int
|
||||
// Extracting the first 8 hex digits of the git hash and converting them to int
|
||||
char fw_git_short[9] = {};
|
||||
std::memmove(fw_git_short, px4_firmware_version_string(), 8);
|
||||
assert(fw_git_short[8] == '\0');
|
||||
|
||||
@ -211,9 +211,9 @@ void UavcanEsc::fill_node_info()
|
||||
/* software version */
|
||||
uavcan::protocol::SoftwareVersion swver;
|
||||
|
||||
// Extracting the first 8 hex digits of FW_GIT and converting them to int
|
||||
// Extracting the first 8 hex digits of the git hash and converting them to int
|
||||
char fw_git_short[9] = {};
|
||||
std::memmove(fw_git_short, FW_GIT, 8);
|
||||
std::memmove(fw_git_short, px4_firmware_version_string(), 8);
|
||||
assert(fw_git_short[8] == '\0');
|
||||
char *end = nullptr;
|
||||
swver.vcs_commit = std::strtol(fw_git_short, &end, 16);
|
||||
|
||||
@ -238,9 +238,9 @@ void UavcanNode::fill_node_info()
|
||||
/* software version */
|
||||
uavcan::protocol::SoftwareVersion swver;
|
||||
|
||||
// Extracting the first 8 hex digits of FW_GIT and converting them to int
|
||||
// Extracting the first 8 hex digits of the git hash and converting them to int
|
||||
char fw_git_short[9] = {};
|
||||
std::memmove(fw_git_short, FW_GIT, 8);
|
||||
std::memmove(fw_git_short, px4_firmware_version_string(), 8);
|
||||
assert(fw_git_short[8] == '\0');
|
||||
char *end = nullptr;
|
||||
swver.vcs_commit = std::strtol(fw_git_short, &end, 16);
|
||||
|
||||
@ -483,7 +483,7 @@ static int write_dump_info(int fdout, info_s *info, struct bbsramd_s *desc,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
n = snprintf(buffer, sz, " FW git-hash: %s\n", FW_GIT);
|
||||
n = snprintf(buffer, sz, " FW git-hash: %s\n", px4_firmware_version_string());
|
||||
|
||||
if (n != write(fdout, buffer, n)) {
|
||||
return -EIO;
|
||||
@ -495,7 +495,7 @@ static int write_dump_info(int fdout, info_s *info, struct bbsramd_s *desc,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
n = snprintf(buffer, sz, " Build url: %s \n", FW_BUILD_URI);
|
||||
n = snprintf(buffer, sz, " Build url: %s \n", px4_build_uri());
|
||||
|
||||
if (n != write(fdout, buffer, n)) {
|
||||
return -EIO;
|
||||
|
||||
@ -152,7 +152,7 @@ int ver_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (show_all || !strncmp(argv[1], sz_ver_buri_str, sizeof(sz_ver_buri_str))) {
|
||||
printf("Build uri: %s\n", FW_BUILD_URI);
|
||||
printf("Build uri: %s\n", px4_build_uri());
|
||||
ret = 0;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user