Skip to content

Commit

Permalink
Fix nasa#87, Combine consecutive, mutually-exclusive status checks
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Mar 14, 2023
1 parent 04c0154 commit 26683ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion fsw/inc/ds_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
*
* \par Limits:
* None -- however, the user should be cautioned that a very
* small value will allow an size limit that closes files too
* small value will allow a size limit that closes files too
* frequently, while a very large value will effectively
* prevent files from ever being closed due to size.
*/
Expand Down
24 changes: 11 additions & 13 deletions fsw/src/ds_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void DS_AppMain(void)
CFE_ES_PerfLogEntry(DS_APPMAIN_PERF_ID);

/*
** Perform application specific initialization...
** Perform application-specific initialization...
*/
Result = DS_AppInitialize();

Expand Down Expand Up @@ -116,7 +116,7 @@ void DS_AppMain(void)
{
/*
* Process data storage file age limits and check for
* table updates. This is usually done during the
* table updates. This is usually done during the
* housekeeping cycle, but if housekeeping requests are
* coming at a rate slower than 1Hz, we perform the operations
* here.
Expand Down Expand Up @@ -204,13 +204,13 @@ int32 DS_AppInitialize(void)
CFE_EVS_SendEvent(DS_INIT_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to register for EVS services, err = 0x%08X",
(unsigned int)Result);
}

/*
** Create application Software Bus message pipe...
*/
if (Result == CFE_SUCCESS)
else
{
/*
** Create application Software Bus message pipe...
*/
Result = CFE_SB_CreatePipe(&DS_AppData.InputPipe, DS_APP_PIPE_DEPTH, DS_APP_PIPE_NAME);

if (Result != CFE_SUCCESS)
{
CFE_EVS_SendEvent(DS_INIT_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to create input pipe, err = 0x%08X",
Expand Down Expand Up @@ -306,7 +306,6 @@ void DS_AppProcessMsg(const CFE_SB_Buffer_t *BufPtr)
** DS housekeeping request command...
*/
case DS_SEND_HK_MID:

CFE_MSG_GetSize(&BufPtr->Msg, &ActualLength);
ExpectedLength = sizeof(DS_NoopCmd_t);
if (ExpectedLength != ActualLength)
Expand All @@ -326,7 +325,7 @@ void DS_AppProcessMsg(const CFE_SB_Buffer_t *BufPtr)
break;

/*
** Unknown message ID's (must be something to store)...
** Unknown message IDs (must be something to store)...
*/
default:
DS_AppStorePacket(MessageID, BufPtr);
Expand Down Expand Up @@ -495,7 +494,7 @@ void DS_AppProcessCmd(const CFE_SB_Buffer_t *BufPtr)

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* Process hk request command */
/* Process HK request command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Expand Down Expand Up @@ -561,15 +560,15 @@ void DS_AppProcessHK(void)
HkPacket.AppEnableState = DS_AppData.AppEnableState;

/*
** Compute file growth rate from number of bytes since last HK request...
** Compute file growth rate from the number of bytes since the last HK request...
*/
for (i = 0; i < DS_DEST_FILE_CNT; i++)
{
DS_AppData.FileStatus[i].FileRate = DS_AppData.FileStatus[i].FileGrowth / DS_SECS_PER_HK_CYCLE;
DS_AppData.FileStatus[i].FileGrowth = 0;
}

/* Get the filter table info, put the file name in the hk pkt. */
/* Get the filter table info, put the file name in the HK pkt. */
Status = snprintf(FilterTblName, CFE_MISSION_TBL_MAX_NAME_LENGTH, "DS.%s", DS_FILTER_TBL_NAME);
if (Status >= 0)
{
Expand All @@ -579,7 +578,6 @@ void DS_AppProcessHK(void)
strncpy(HkPacket.FilterTblFilename, FilterTblInfo.LastFileLoaded, OS_MAX_PATH_LEN - 1);
HkPacket.FilterTblFilename[OS_MAX_PATH_LEN - 1] = '\0';
}

else
{
/* If the filter table name is invalid, send an event and erase any
Expand Down

0 comments on commit 26683ab

Please sign in to comment.