From df7df4aeff72babdf20b2ba2ebc65e85c385447b Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Mon, 17 Apr 2023 13:54:38 +1000 Subject: [PATCH] Fix #80, Update Command Code underscores for consistency --- fsw/inc/cs_msg.h | 6 ++--- fsw/inc/cs_msgdefs.h | 53 +++++++++++++++++++++++----------------- fsw/src/cs_app.c | 12 ++++----- fsw/src/cs_cmds.h | 12 ++++----- unit-test/cs_app_tests.c | 12 ++++----- 5 files changed, 52 insertions(+), 43 deletions(-) diff --git a/fsw/inc/cs_msg.h b/fsw/inc/cs_msg.h index f708138..45356e3 100644 --- a/fsw/inc/cs_msg.h +++ b/fsw/inc/cs_msg.h @@ -80,10 +80,10 @@ typedef struct * \brief No arguments command data type * * For command details see #CS_NOOP_CC #CS_RESET_CC, #CS_ENABLE_ALL_CS_CC, - * #CS_DISABLE_ALL_CS_CC, #CS_ENABLE_CFECORE_CC, #CS_DISABLE_CFECORE_CC, #CS_ENABLE_OS_CC, + * #CS_DISABLE_ALL_CS_CC, #CS_ENABLE_CFE_CORE_CC, #CS_DISABLE_CFE_CORE_CC, #CS_ENABLE_OS_CC, * #CS_DISABLE_OS_CC, #CS_ENABLE_EEPROM_CC, #CS_DISABLE_EEPROM_CC, #CS_ENABLE_MEMORY_CC, * #CS_DISABLE_MEMORY_CC, #CS_ENABLE_TABLES_CC, #CS_DISABLE_TABLES_CC - * #CS_ENABLE_APPS_CC, #CS_DISABLE_APPS_CC, #CS_CANCEL_ONESHOT_CC + * #CS_ENABLE_APPS_CC, #CS_DISABLE_APPS_CC, #CS_CANCEL_ONE_SHOT_CC */ typedef struct { @@ -140,7 +140,7 @@ typedef struct /** * \brief Command type for sending one shot calculation * - * For command details see #CS_ONESHOT_CC + * For command details see #CS_ONE_SHOT_CC */ typedef struct { diff --git a/fsw/inc/cs_msgdefs.h b/fsw/inc/cs_msgdefs.h index 421fda3..6960601 100644 --- a/fsw/inc/cs_msgdefs.h +++ b/fsw/inc/cs_msgdefs.h @@ -136,15 +136,15 @@ * \par Criticality * None * - * \sa #CS_CANCEL_ONESHOT_CC, - * #CS_RECOMPUTE_BASELINE_CFECORE_CC, + * \sa #CS_CANCEL_ONE_SHOT_CC, + * #CS_RECOMPUTE_BASELINE_CFE_CORE_CC, * #CS_RECOMPUTE_BASELINE_OS_CC, * #CS_RECOMPUTE_BASELINE_EEPROM_CC, * #CS_RECOMPUTE_BASELINE_MEMORY_CC, * #CS_RECOMPUTE_BASELINE_TABLE_CC, * #CS_RECOMPUTE_BASELINE_APP_CC */ -#define CS_ONESHOT_CC 2 +#define CS_ONE_SHOT_CC 2 /** * \brief Cancel one shot @@ -177,9 +177,9 @@ * \par Criticality * None * - * \sa #CS_ONESHOT_CC + * \sa #CS_ONE_SHOT_CC */ -#define CS_CANCEL_ONESHOT_CC 3 +#define CS_CANCEL_ONE_SHOT_CC 3 /** * \brief Enable Global Checksumming @@ -273,9 +273,9 @@ * \par Criticality * None * - * \sa #CS_DISABLE_CFECORE_CC + * \sa #CS_DISABLE_CFE_CORE_CC */ -#define CS_ENABLE_CFECORE_CC 6 +#define CS_ENABLE_CFE_CORE_CC 6 /** * \brief Disable checksumming of cFE core @@ -305,9 +305,9 @@ * \par Criticality * None * - * \sa #CS_ENABLE_CFECORE_CC + * \sa #CS_ENABLE_CFE_CORE_CC */ -#define CS_DISABLE_CFECORE_CC 7 +#define CS_DISABLE_CFE_CORE_CC 7 /** * \brief Report Baseline checksum of cFE core @@ -340,7 +340,7 @@ * None * */ -#define CS_REPORT_BASELINE_CFECORE_CC 8 +#define CS_REPORT_BASELINE_CFE_CORE_CC 8 /** * \brief Recompute Baseline checksum of cFE core @@ -376,14 +376,14 @@ * \par Criticality * None * - * \sa #CS_ONESHOT_CC, + * \sa #CS_ONE_SHOT_CC, * #CS_RECOMPUTE_BASELINE_OS_CC, * #CS_RECOMPUTE_BASELINE_EEPROM_CC, * #CS_RECOMPUTE_BASELINE_MEMORY_CC, * #CS_RECOMPUTE_BASELINE_TABLE_CC, * #CS_RECOMPUTE_BASELINE_APP_CC */ -#define CS_RECOMPUTE_BASELINE_CFECORE_CC 9 +#define CS_RECOMPUTE_BASELINE_CFE_CORE_CC 9 /** * \brief Enable checksumming of OS code segment @@ -514,8 +514,8 @@ * * \par Criticality * None - * \sa #CS_ONESHOT_CC, - * #CS_RECOMPUTE_BASELINE_CFECORE_CC, + * \sa #CS_ONE_SHOT_CC, + * #CS_RECOMPUTE_BASELINE_CFE_CORE_CC, * #CS_RECOMPUTE_BASELINE_EEPROM_CC, * #CS_RECOMPUTE_BASELINE_MEMORY_CC, * #CS_RECOMPUTE_BASELINE_TABLE_CC, @@ -661,8 +661,8 @@ * \par Criticality * None * - * \sa #CS_ONESHOT_CC, - * #CS_RECOMPUTE_BASELINE_CFECORE_CC, + * \sa #CS_ONE_SHOT_CC, + * #CS_RECOMPUTE_BASELINE_CFE_CORE_CC, * #CS_RECOMPUTE_BASELINE_OS_CC, * #CS_RECOMPUTE_BASELINE_MEMORY_CC, * #CS_RECOMPUTE_BASELINE_TABLE_CC, @@ -905,8 +905,8 @@ * \par Criticality * None * - * \sa #CS_ONESHOT_CC, - * #CS_RECOMPUTE_BASELINE_CFECORE_CC, + * \sa #CS_ONE_SHOT_CC, + * #CS_RECOMPUTE_BASELINE_CFE_CORE_CC, * #CS_RECOMPUTE_BASELINE_OS_CC, * #CS_RECOMPUTE_BASELINE_EEPROM_CC, * #CS_RECOMPUTE_BASELINE_TABLE_CC, @@ -1156,8 +1156,8 @@ * \par Criticality * None * - * \sa #CS_ONESHOT_CC, - * #CS_RECOMPUTE_BASELINE_CFECORE_CC, + * \sa #CS_ONE_SHOT_CC, + * #CS_RECOMPUTE_BASELINE_CFE_CORE_CC, * #CS_RECOMPUTE_BASELINE_OS_CC, * #CS_RECOMPUTE_BASELINE_EEPROM_CC, * #CS_RECOMPUTE_BASELINE_MEMORY_CC, @@ -1368,8 +1368,8 @@ * \par Criticality * None * - * \sa #CS_ONESHOT_CC, - * #CS_RECOMPUTE_BASELINE_CFECORE_CC, + * \sa #CS_ONE_SHOT_CC, + * #CS_RECOMPUTE_BASELINE_CFE_CORE_CC, * #CS_RECOMPUTE_BASELINE_OS_CC, * #CS_RECOMPUTE_BASELINE_EEPROM_CC, * #CS_RECOMPUTE_BASELINE_MEMORY_CC, @@ -1468,4 +1468,13 @@ #define CS_STATE_UNDEFINED 0x03 /**< \brief Entry not found state undefined */ /**\}*/ +#ifndef CS_OMIT_DEPRECATED +#define CS_ONESHOT_CC CS_ONE_SHOT_CC +#define CS_CANCEL_ONESHOT_CC CS_CANCEL_ONE_SHOT_CC +#define CS_ENABLE_CFECORE_CC CS_ENABLE_CFE_CORE_CC +#define CS_DISABLE_CFECORE_CC CS_DISABLE_CFE_CORE_CC +#define CS_REPORT_BASELINE_CFECORE_CC CS_REPORT_BASELINE_CFE_CORE_CC +#define CS_RECOMPUTE_BASELINE_CFECORE_CC CS_RECOMPUTE_BASELINE_CFE_CORE_CC +#endif + #endif diff --git a/fsw/src/cs_app.c b/fsw/src/cs_app.c index 7c669ee..5de8386 100644 --- a/fsw/src/cs_app.c +++ b/fsw/src/cs_app.c @@ -282,11 +282,11 @@ void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr) CS_ResetCmd((CS_NoArgsCmd_t *)BufPtr); break; - case CS_ONESHOT_CC: + case CS_ONE_SHOT_CC: CS_OneShotCmd((CS_OneShotCmd_t *)BufPtr); break; - case CS_CANCEL_ONESHOT_CC: + case CS_CANCEL_ONE_SHOT_CC: CS_CancelOneShotCmd((CS_NoArgsCmd_t *)BufPtr); break; @@ -299,19 +299,19 @@ void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr) break; /* cFE core Commands */ - case CS_ENABLE_CFECORE_CC: + case CS_ENABLE_CFE_CORE_CC: CS_EnableCfeCoreCmd((CS_NoArgsCmd_t *)BufPtr); break; - case CS_DISABLE_CFECORE_CC: + case CS_DISABLE_CFE_CORE_CC: CS_DisableCfeCoreCmd((CS_NoArgsCmd_t *)BufPtr); break; - case CS_REPORT_BASELINE_CFECORE_CC: + case CS_REPORT_BASELINE_CFE_CORE_CC: CS_ReportBaselineCfeCoreCmd((CS_NoArgsCmd_t *)BufPtr); break; - case CS_RECOMPUTE_BASELINE_CFECORE_CC: + case CS_RECOMPUTE_BASELINE_CFE_CORE_CC: CS_RecomputeBaselineCfeCoreCmd((CS_NoArgsCmd_t *)BufPtr); break; diff --git a/fsw/src/cs_cmds.h b/fsw/src/cs_cmds.h index dab710c..391a494 100644 --- a/fsw/src/cs_cmds.h +++ b/fsw/src/cs_cmds.h @@ -123,7 +123,7 @@ void CS_EnableAllCSCmd(const CS_NoArgsCmd_t *CmdPtr); * * \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain * - * \sa #CS_DISABLE_CFECORE_CC + * \sa #CS_DISABLE_CFE_CORE_CC */ void CS_DisableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr); @@ -142,7 +142,7 @@ void CS_DisableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr); * * \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain * - * \sa #CS_ENABLE_CFECORE_CC + * \sa #CS_ENABLE_CFE_CORE_CC */ void CS_EnableCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr); @@ -196,7 +196,7 @@ void CS_EnableOSCmd(const CS_NoArgsCmd_t *CmdPtr); * * \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain * - * \sa #CS_REPORT_BASELINE_CFECORE_CC + * \sa #CS_REPORT_BASELINE_CFE_CORE_CC */ void CS_ReportBaselineCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr); @@ -228,7 +228,7 @@ void CS_ReportBaselineOSCmd(const CS_NoArgsCmd_t *CmdPtr); * * \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain * - * \sa #CS_RECOMPUTE_BASELINE_CFECORE_CC + * \sa #CS_RECOMPUTE_BASELINE_CFE_CORE_CC */ void CS_RecomputeBaselineCfeCoreCmd(const CS_NoArgsCmd_t *CmdPtr); @@ -259,7 +259,7 @@ void CS_RecomputeBaselineOSCmd(const CS_NoArgsCmd_t *CmdPtr); * * \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain * - * \sa #CS_ONESHOT_CC + * \sa #CS_ONE_SHOT_CC */ void CS_OneShotCmd(const CS_OneShotCmd_t *CmdPtr); @@ -274,7 +274,7 @@ void CS_OneShotCmd(const CS_OneShotCmd_t *CmdPtr); * * \param[in] CmdPtr Command pointer, verified non-null in CS_AppMain * - * \sa #CS_CANCEL_ONESHOT_CC + * \sa #CS_CANCEL_ONE_SHOT_CC */ void CS_CancelOneShotCmd(const CS_NoArgsCmd_t *CmdPtr); diff --git a/unit-test/cs_app_tests.c b/unit-test/cs_app_tests.c index 18f703a..437e35c 100644 --- a/unit-test/cs_app_tests.c +++ b/unit-test/cs_app_tests.c @@ -994,7 +994,7 @@ void CS_AppPipe_Test_OneShotCmd(void) CS_AppData.ChildTaskTable = -1; TestMsgId = CFE_SB_ValueToMsgId(CS_CMD_MID); - FcnCode = CS_ONESHOT_CC; + FcnCode = CS_ONE_SHOT_CC; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); @@ -1023,7 +1023,7 @@ void CS_AppPipe_Test_CancelOneShotCmd(void) CS_AppData.ChildTaskTable = -1; TestMsgId = CFE_SB_ValueToMsgId(CS_CMD_MID); - FcnCode = CS_CANCEL_ONESHOT_CC; + FcnCode = CS_CANCEL_ONE_SHOT_CC; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); @@ -1110,7 +1110,7 @@ void CS_AppPipe_Test_EnableCfeCoreCmd(void) CS_AppData.ChildTaskTable = -1; TestMsgId = CFE_SB_ValueToMsgId(CS_CMD_MID); - FcnCode = CS_ENABLE_CFECORE_CC; + FcnCode = CS_ENABLE_CFE_CORE_CC; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); @@ -1139,7 +1139,7 @@ void CS_AppPipe_Test_DisableCfeCoreCmd(void) CS_AppData.ChildTaskTable = -1; TestMsgId = CFE_SB_ValueToMsgId(CS_CMD_MID); - FcnCode = CS_DISABLE_CFECORE_CC; + FcnCode = CS_DISABLE_CFE_CORE_CC; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); @@ -1168,7 +1168,7 @@ void CS_AppPipe_Test_ReportBaselineCfeCoreCmd(void) CS_AppData.ChildTaskTable = -1; TestMsgId = CFE_SB_ValueToMsgId(CS_CMD_MID); - FcnCode = CS_REPORT_BASELINE_CFECORE_CC; + FcnCode = CS_REPORT_BASELINE_CFE_CORE_CC; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); @@ -1197,7 +1197,7 @@ void CS_AppPipe_Test_RecomputeBaselineCfeCoreCmd(void) CS_AppData.ChildTaskTable = -1; TestMsgId = CFE_SB_ValueToMsgId(CS_CMD_MID); - FcnCode = CS_RECOMPUTE_BASELINE_CFECORE_CC; + FcnCode = CS_RECOMPUTE_BASELINE_CFE_CORE_CC; UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false);