Skip to content

Commit

Permalink
Merge pull request #188 from thnkslprpt:fix-187-set-RunStatus-to-APP_…
Browse files Browse the repository at this point in the history
…ERROR-if-init-fails

Fix #187, Zero-out global data during init + set RunStatus to APP_ERROR if init fails
  • Loading branch information
dzbaker committed Apr 16, 2024
2 parents ac34408 + d87f662 commit 9c73e6d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fsw/src/to_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ void TO_LAB_AppMain(void)

if (status != CFE_SUCCESS)
{
return;
/*
** Set request to terminate main loop...
*/
RunStatus = CFE_ES_RunStatus_APP_ERROR;
}

/*
Expand Down Expand Up @@ -107,6 +110,9 @@ CFE_Status_t TO_LAB_init(void)
TO_LAB_Sub_t *SubEntry;
char VersionString[TO_LAB_CFG_MAX_VERSION_STR_LEN];

/* Zero out the global data structure */
memset(&TO_LAB_Global, 0, sizeof(TO_LAB_Global));

TO_LAB_Global.downlink_on = false;
PipeDepth = TO_LAB_CMD_PIPE_DEPTH;
strcpy(PipeName, "TO_LAB_CMD_PIPE");
Expand Down

0 comments on commit 9c73e6d

Please sign in to comment.