From fab15ea07e2b3209077093983c89588a48b33584 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Tue, 4 Jun 2024 14:38:58 +1000 Subject: [PATCH] AP_Periph: fix missing custom firmware version SW-130 --- .github/workflows/carbonix_build.yml | 2 +- Tools/AP_Periph/AP_Periph.h | 1 + libraries/AP_Common/AP_FWVersionDefine.h | 5 +---- libraries/AP_Common/CxVersion.h | 5 +++++ 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 libraries/AP_Common/CxVersion.h diff --git a/.github/workflows/carbonix_build.yml b/.github/workflows/carbonix_build.yml index d3ac52fbbb..07ddbcf90c 100644 --- a/.github/workflows/carbonix_build.yml +++ b/.github/workflows/carbonix_build.yml @@ -202,7 +202,7 @@ jobs: - name: Extract firmware version and commit id id: extract_info run: | - FIRMWARE_VERSION=$(grep -oP '#define AP_CUSTOM_FIRMWARE_STRING "\K(.*)(?=")' libraries/AP_Common/AP_FWVersionDefine.h) + FIRMWARE_VERSION=$(grep -oP '#define AP_CUSTOM_FIRMWARE_STRING "\K(.*)(?=")' libraries/AP_Common/CxVersion.h) COMMIT_ID=$(git rev-parse --short HEAD) echo "firmware_version=$FIRMWARE_VERSION" >> $GITHUB_ENV echo "commit_id=$COMMIT_ID" >> $GITHUB_ENV diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index c885f26f8e..606a02412b 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -21,6 +21,7 @@ #include #include #include +#include #if HAL_GCS_ENABLED #include "GCS_MAVLink.h" diff --git a/libraries/AP_Common/AP_FWVersionDefine.h b/libraries/AP_Common/AP_FWVersionDefine.h index 049121b03b..fa8755753a 100644 --- a/libraries/AP_Common/AP_FWVersionDefine.h +++ b/libraries/AP_Common/AP_FWVersionDefine.h @@ -22,10 +22,7 @@ #include #include - -#ifdef CARBOPILOT -#define AP_CUSTOM_FIRMWARE_STRING "CxPilot-5.1.1" -#endif +#include /* allow vendors to set AP_CUSTOM_FIRMWARE_STRING in hwdef.dat diff --git a/libraries/AP_Common/CxVersion.h b/libraries/AP_Common/CxVersion.h new file mode 100644 index 0000000000..2c9c3c899c --- /dev/null +++ b/libraries/AP_Common/CxVersion.h @@ -0,0 +1,5 @@ +#ifdef CARBOPILOT +#ifndef AP_CUSTOM_FIRMWARE_STRING +#define AP_CUSTOM_FIRMWARE_STRING "CxPilot-5.1.1" +#endif +#endif