Skip to content

Commit

Permalink
Fix #187, Zero-out global data during init + set RunStatus to `APP_…
Browse files Browse the repository at this point in the history
…ERROR` if init fails
  • Loading branch information
thnkslprpt committed Jan 17, 2024
1 parent 9b1d6d0 commit d87f662
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 @@ -53,7 +53,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 @@ -105,6 +108,9 @@ CFE_Status_t TO_LAB_init(void)
void * TblPtr;
TO_LAB_Sub_t *SubEntry;

/* 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 d87f662

Please sign in to comment.