Skip to content

Commit

Permalink
Merge pull request #81 from thnkslprpt/fix-80-update-command-code-und…
Browse files Browse the repository at this point in the history
…erscores-for-consistency

Fix #80, Update Command Code underscores for consistency
  • Loading branch information
dzbaker authored Apr 27, 2023
2 parents 579979b + df7df4a commit bd4dd1c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 43 deletions.
6 changes: 3 additions & 3 deletions fsw/inc/cs_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down
53 changes: 31 additions & 22 deletions fsw/inc/cs_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
12 changes: 6 additions & 6 deletions fsw/src/cs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions fsw/src/cs_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down
12 changes: 6 additions & 6 deletions unit-test/cs_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bd4dd1c

Please sign in to comment.