Skip to content

Commit

Permalink
Merge pull request #53 from thnkslprpt/fix-52-combine-mutually-exclus…
Browse files Browse the repository at this point in the history
…ive-status-checks

Fix #52, Combine consecutive, mutually-exclusive status checks
  • Loading branch information
dzbaker authored May 4, 2023
2 parents 3e04a2e + 29f5fd9 commit c200dc0
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions fsw/src/md_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,17 @@ int32 MD_AppInit(void)
/* Register for event services...*/
Status = CFE_EVS_Register(NULL, 0, CFE_EVS_NO_FILTER);

if (Status != CFE_SUCCESS)
{
CFE_ES_WriteToSysLog("MD_APP:Call to CFE_EVS_Register Failed:RC=%d\n", Status);
}

/*
** Set up for Software Bus Services
*/
if (Status == CFE_SUCCESS)
{
/*
** Set up for Software Bus Services
*/
Status = MD_InitSoftwareBusServices();
}
else
{
CFE_ES_WriteToSysLog("MD_APP:Call to CFE_EVS_Register Failed:RC=%d\n", Status);
}

/*
** Register for Table Services
Expand Down Expand Up @@ -271,16 +270,11 @@ int32 MD_InitSoftwareBusServices(void)
*/
Status = CFE_SB_CreatePipe(&MD_AppData.CmdPipe, MD_PIPE_DEPTH, MD_PIPE_NAME);

if (Status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(MD_CREATE_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to create pipe. RC = %d", Status);
}

/*
** Subscribe to Housekeeping request commands
*/
if (Status == CFE_SUCCESS)
{
/*
** Subscribe to Housekeeping request commands
*/
Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MD_SEND_HK_MID), MD_AppData.CmdPipe);

if (Status != CFE_SUCCESS)
Expand All @@ -289,6 +283,10 @@ int32 MD_InitSoftwareBusServices(void)
Status);
}
}
else
{
CFE_EVS_SendEvent(MD_CREATE_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to create pipe. RC = %d", Status);
}

/*
** Subscribe to MD ground command packets
Expand Down

0 comments on commit c200dc0

Please sign in to comment.