From e534f636262740c55b3eaacc8d3e21159b474480 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 26 Dec 2023 11:41:21 -0500 Subject: [PATCH] Fix #147, updating sch_lab to use new versioning system. --- fsw/src/sch_lab_app.c | 7 ++++++- fsw/src/sch_lab_version.h | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/fsw/src/sch_lab_app.c b/fsw/src/sch_lab_app.c index 2fe95c2..724f024 100644 --- a/fsw/src/sch_lab_app.c +++ b/fsw/src/sch_lab_app.c @@ -28,6 +28,7 @@ #include "cfe.h" #include "cfe_msgids.h" +#include "cfe_config.h" #include "sch_lab_perfids.h" #include "sch_lab_version.h" @@ -159,6 +160,7 @@ CFE_Status_t SCH_LAB_AppInit(void) SCH_LAB_ScheduleTableEntry_t *ConfigEntry; SCH_LAB_StateEntry_t * LocalStateEntry; void * TableAddr; + char VersionString[SCH_LAB_CFG_MAX_VERSION_STR_LEN]; memset(&SCH_LAB_Global, 0, sizeof(SCH_LAB_Global)); @@ -298,7 +300,10 @@ CFE_Status_t SCH_LAB_AppInit(void) CFE_ES_WriteToSysLog("%s: OS_TimerSet failed:RC=%ld\n", __func__, (long)OsStatus); } - OS_printf("SCH Lab Initialized.%s\n", SCH_LAB_VERSION_STRING); + CFE_Config_GetVersionString(VersionString, SCH_LAB_CFG_MAX_VERSION_STR_LEN, "SCH Lab", SCH_LAB_BUILD_TYPE, + SCH_LAB_VERSION, SCH_LAB_BUILD_CODENAME, SCH_LAB_LAST_OFFICIAL); + + OS_printf("SCH Lab Initialized.%s\n", VersionString); return CFE_SUCCESS; } diff --git a/fsw/src/sch_lab_version.h b/fsw/src/sch_lab_version.h index 93b31d1..8300f06 100644 --- a/fsw/src/sch_lab_version.h +++ b/fsw/src/sch_lab_version.h @@ -25,9 +25,11 @@ */ /* Development Build Macro Definitions */ -#define SCH_LAB_BUILD_NUMBER 75 /*!< Development Build: Number of commits since baseline */ -#define SCH_LAB_BUILD_BASELINE \ - "v2.5.0-rc4" /*!< Development Build: git tag that is the base for the current development */ +#define SCH_LAB_BUILD_NUMBER 75 /*!< Development Build: Number of commits since baseline */ +#define SCH_LAB_BUILD_BASELINE "equuleus-rc1" /*!< Development Build: git tag that is the base for the current development */ +#define SCH_LAB_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */ +#define SCH_LAB_BUILD_TYPE "Development Build" /**< @brief: Development: Type of build (Development Build or Release) */ +#define SCH_LAB_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */ /* * Version Macros, see \ref cfsversions for definitions. @@ -36,6 +38,11 @@ #define SCH_LAB_MINOR_VERSION 3 /*!< @brief Minor version number */ #define SCH_LAB_REVISION 99 /*!< @brief Revision version number. Value of 99 indicates a development version.*/ +/** + * @brief Last official release. + */ +#define SCH_LAB_LAST_OFFICIAL "v2.3.0" + /*! * @brief Mission revision. * @@ -43,7 +50,7 @@ * Values 1-254 are reserved for mission use to denote patches/customizations as needed. NOTE: Reserving 0 and 0xFF for * cFS open-source development use (pending resolution of nasa/cFS#440) */ -#define SCH_LAB_MISSION_REV 0xFF +#define SCH_LAB_MISSION_REV 0x00 #define SCH_LAB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */ #define SCH_LAB_STR(x) SCH_LAB_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer macros */ @@ -54,12 +61,12 @@ */ #define SCH_LAB_VERSION SCH_LAB_BUILD_BASELINE "+dev" SCH_LAB_STR(SCH_LAB_BUILD_NUMBER) -/*! @brief Development Build Version String. - * @details Reports the current development build's baseline, number, and name. Also includes a note about the latest - * official version. @n See @ref cfsversions for format differences between development and release versions. +/** + * @brief Max Version String length. + * + * Maximum length that an SCH LAB version string can be. + * */ -#define SCH_LAB_VERSION_STRING \ - " SCH Lab DEVELOPMENT BUILD " SCH_LAB_VERSION \ - ", Last Official Release: v2.3.0" /* For full support please use this version */ +#define SCH_LAB_CFG_MAX_VERSION_STR_LEN 256 #endif