Skip to content

Commit

Permalink
Fix #101, Remove redundant assignment of RecomputeInProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Nov 30, 2024
1 parent f958cc0 commit 1d6cbd7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fsw/inc/cs_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@
/**\}*/

/**
* \name CS Checkum States
* \name CS Checksum States
* \{
*/
#define CS_STATE_EMPTY 0x00 /**< \brief Entry unused */
Expand Down
4 changes: 2 additions & 2 deletions fsw/src/cs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr)
CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID;
uint16 CommandCode = 0;

CFE_MSG_GetMsgId(&BufPtr->Msg, &MessageID);

CFE_MSG_GetFcnCode(&BufPtr->Msg, &CommandCode);

switch (CommandCode)
Expand Down Expand Up @@ -561,6 +559,8 @@ void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr)
break;

default:
CFE_MSG_GetMsgId(&BufPtr->Msg, &MessageID);

CFE_EVS_SendEvent(CS_CC_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid ground command code: ID = 0x%08lX, CC = %d",
(unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode);
Expand Down
4 changes: 1 addition & 3 deletions fsw/src/cs_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ void CS_OneShotCmd(const CS_OneShotCmd_t *CmdPtr)
CS_AppData.HkPacket.Payload.OneShotInProgress == false)
{
/* There is no child task running right now, we can use it*/
CS_AppData.HkPacket.Payload.RecomputeInProgress = false;
CS_AppData.HkPacket.Payload.OneShotInProgress = true;

CS_AppData.HkPacket.Payload.LastOneShotAddress = CmdPtr->Payload.Address;
Expand Down Expand Up @@ -486,7 +485,7 @@ void CS_OneShotCmd(const CS_OneShotCmd_t *CmdPtr)
else /* child task creation failed */
{
CFE_EVS_SendEvent(CS_ONESHOT_CREATE_CHDTASK_ERR_EID, CFE_EVS_EventType_ERROR,
"OneShot checkum failed, CFE_ES_CreateChildTask returned: 0x%08X",
"OneShot checksum failed, CFE_ES_CreateChildTask returned: 0x%08X",
(unsigned int)Status);

CS_AppData.HkPacket.Payload.CmdErrCounter++;
Expand Down Expand Up @@ -531,7 +530,6 @@ void CS_CancelOneShotCmd(const CS_NoArgsCmd_t *CmdPtr)
if (Status == CFE_SUCCESS)
{
CS_AppData.ChildTaskID = CFE_ES_TASKID_UNDEFINED;
CS_AppData.HkPacket.Payload.RecomputeInProgress = false;
CS_AppData.HkPacket.Payload.OneShotInProgress = false;
CS_AppData.HkPacket.Payload.CmdCounter++;
CFE_EVS_SendEvent(CS_ONESHOT_CANCELLED_INF_EID, CFE_EVS_EventType_INFORMATION,
Expand Down
2 changes: 1 addition & 1 deletion unit-test/cs_cmds_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ void CS_OneShotCmd_Test_CreateChildTaskError(void)
memset(&CmdPacket, 0, sizeof(CmdPacket));

snprintf(ExpectedEventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
"OneShot checkum failed, CFE_ES_CreateChildTask returned: 0x%%08X");
"OneShot checksum failed, CFE_ES_CreateChildTask returned: 0x%%08X");

CS_AppData.HkPacket.Payload.RecomputeInProgress = false;

Expand Down

0 comments on commit 1d6cbd7

Please sign in to comment.