Skip to content

Commit

Permalink
Merge pull request #46 from havencarlson/fix#8
Browse files Browse the repository at this point in the history
Fix #8, reorder conditions in if statements to optimize code
  • Loading branch information
dzbaker authored Sep 21, 2023
2 parents afe3cf4 + 6623362 commit df0a57b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fsw/src/sc_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void SC_ProcessAtpCmd(void)
** 3.) The atp is currently EXECUTING
*/

if ((!SC_CompareAbsTime(SC_AppData.NextCmdTime[SC_ATP], SC_AppData.CurrentTime)) &&
(SC_AppData.NextProcNumber == SC_ATP) && (SC_OperData.AtsCtrlBlckAddr->AtpState == SC_EXECUTING))
if ((SC_OperData.AtsCtrlBlckAddr->AtpState == SC_EXECUTING) && (SC_AppData.NextProcNumber == SC_ATP) &&
(!SC_CompareAbsTime(SC_AppData.NextCmdTime[SC_ATP], SC_AppData.CurrentTime)))
{
/*
** Get a pointer to the next ats command
Expand Down Expand Up @@ -125,7 +125,7 @@ void SC_ProcessAtpCmd(void)
CFE_MSG_GetMsgId(&EntryPtr->Msg, &MessageID);
CFE_MSG_GetFcnCode(&EntryPtr->Msg, &CommandCode);

if (CFE_SB_MsgIdToValue(MessageID) == SC_CMD_MID && CommandCode == SC_SWITCH_ATS_CC)
if (CommandCode == SC_SWITCH_ATS_CC && CFE_SB_MsgIdToValue(MessageID) == SC_CMD_MID)
{
/*
** call the ground switch module
Expand Down

0 comments on commit df0a57b

Please sign in to comment.