Skip to content

Commit

Permalink
Fix #50, Convert int32 return codes and variables to CFE_Status_t
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Apr 23, 2023
1 parent 116d298 commit 5d116a9
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CodeQl Analysis
on:
push:
pull_request:


jobs:
codeql:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ jobs:
format-check:
name: Run format check
uses: nasa/cFS/.github/workflows/format-check.yml@main

2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
name: Run cppcheck
uses: nasa/cFS/.github/workflows/static-analysis.yml@main
with:
strict-dir-list: './fsw'
strict-dir-list: './fsw'
6 changes: 3 additions & 3 deletions docs/dox_src/cfs_md.dox
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

This document provides a complete specification for the commands and telemetry associated
with the CFS Memory Dwell (MD) application software. The document is intended primarily
for users of the software (operations personal, test engineers, and maintenance personal).
for users of the software (operations personnel, test engineers, and maintenance personnel).
The deployment guide section, is intended for mission developers when deploying and
configuring the MD application software for a mission flight software build environment.

Expand Down Expand Up @@ -117,7 +117,7 @@

\section MD Design Overview

MD is a command driven, single threaded application. It will pend indefinitely
MD is a command-driven, single-threaded application. It will pend indefinitely
on the software bus message queue until messages arrive and then processes them sequentially.
Memory Dwell utilizes OSAL routines to:

Expand Down Expand Up @@ -304,7 +304,7 @@
</B> <BR> <BR> <I>
The first dwell always takes place when the first wakeup message is received following a
#MD_START_DWELL_CC command. Dwelling proceeds until the first entry
with a non-zero delay is reached. Thus, anytime a start command is sent for a dwell table
with a non-zero delay is reached. Thus, any time a start command is sent for a dwell table
that does not have non-zero delays for intermediate entries, a dwell packet will be issued
immediately. So, for example, a dwell table that is set up to sample several addresses
every 10 cycles, will actually issue dwell packets following the 1st, 11th, and 21st wakeup
Expand Down
20 changes: 10 additions & 10 deletions fsw/src/md_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ MD_AppData_t MD_AppData;
void MD_AppMain(void)
{
CFE_SB_MsgId_t MessageID = CFE_SB_INVALID_MSG_ID;
int32 Status = CFE_SUCCESS;
CFE_Status_t Status = CFE_SUCCESS;
uint8 TblIndex = 0;
CFE_SB_Buffer_t *BufPtr = NULL;
size_t ActualLength = 0;
Expand Down Expand Up @@ -169,12 +169,12 @@ void MD_AppMain(void)

/******************************************************************************/

int32 MD_AppInit(void)
CFE_Status_t MD_AppInit(void)
{
/*
** Locals
*/
int32 Status = CFE_SUCCESS;
CFE_Status_t Status = CFE_SUCCESS;

MD_AppData.CmdCounter = 0;
MD_AppData.ErrCounter = 0;
Expand Down Expand Up @@ -243,10 +243,10 @@ void MD_InitControlStructures(void)
}

/******************************************************************************/
int32 MD_InitSoftwareBusServices(void)
CFE_Status_t MD_InitSoftwareBusServices(void)
{
int32 Status = CFE_SUCCESS;
uint16 TblIndex;
CFE_Status_t Status = CFE_SUCCESS;
uint16 TblIndex;

/*
** Initialize housekeeping telemetry packet (clear user data area)
Expand Down Expand Up @@ -323,9 +323,9 @@ int32 MD_InitSoftwareBusServices(void)

/******************************************************************************/

int32 MD_InitTableServices(void)
CFE_Status_t MD_InitTableServices(void)
{
int32 Status = CFE_SUCCESS;
CFE_Status_t Status = CFE_SUCCESS;
int32 GetAddressResult = 0;
uint8 TblIndex;
bool RecoveredValidTable = true; /* for current table */
Expand Down Expand Up @@ -495,9 +495,9 @@ int32 MD_InitTableServices(void)
}

/******************************************************************************/
int32 MD_ManageDwellTable(uint8 TblIndex)
CFE_Status_t MD_ManageDwellTable(uint8 TblIndex)
{
int32 Status = CFE_SUCCESS;
CFE_Status_t Status = CFE_SUCCESS;
int32 GetAddressResult = 0;
bool FinishedManaging = false;
MD_DwellTableLoad_t *MD_LoadTablePtr = 0;
Expand Down
8 changes: 4 additions & 4 deletions fsw/src/md_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void MD_AppMain(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_AppInit(void);
CFE_Status_t MD_AppInit(void);

/**
* \brief Initialize local control structures
Expand All @@ -196,7 +196,7 @@ void MD_InitControlStructures(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_InitSoftwareBusServices(void);
CFE_Status_t MD_InitSoftwareBusServices(void);

/**
* \brief Initialize Table Services for the Memory Dwell Task
Expand All @@ -220,7 +220,7 @@ int32 MD_InitSoftwareBusServices(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_InitTableServices(void);
CFE_Status_t MD_InitTableServices(void);

/**
* \brief Check Table Status and take appropriate actions.
Expand All @@ -238,7 +238,7 @@ int32 MD_InitTableServices(void);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_ManageDwellTable(uint8 TblIndex);
CFE_Status_t MD_ManageDwellTable(uint8 TblIndex);

/**
* \brief Execute requested Memory Dwell commands
Expand Down
8 changes: 4 additions & 4 deletions fsw/src/md_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern MD_AppData_t MD_AppData;
void MD_ProcessStartCmd(const CFE_SB_Buffer_t *BufPtr)
{
int32 ErrorCount = 0;
int32 Status;
CFE_Status_t Status;
int32 NumTblInMask = 0; /* Purely as info for event message */
uint16 TableId = 0;
uint16 TableIndex;
Expand Down Expand Up @@ -132,7 +132,7 @@ void MD_ProcessStartCmd(const CFE_SB_Buffer_t *BufPtr)
void MD_ProcessStopCmd(const CFE_SB_Buffer_t *BufPtr)
{
int32 ErrorCount = 0;
int32 Status;
CFE_Status_t Status;
int32 NumTblInMask = 0; /* Purely as info for event message */
MD_CmdStartStop_t *Stop = (MD_CmdStartStop_t *)BufPtr;
uint16 TableId = 0;
Expand Down Expand Up @@ -193,7 +193,7 @@ void MD_ProcessStopCmd(const CFE_SB_Buffer_t *BufPtr)
void MD_ProcessJamCmd(const CFE_SB_Buffer_t *BufPtr)
{
/* Local variables */
int32 Status;
CFE_Status_t Status;
MD_CmdJam_t * Jam = 0;
bool AllInputsValid = true;
cpuaddr ResolvedAddr = 0;
Expand Down Expand Up @@ -408,7 +408,7 @@ void MD_ProcessJamCmd(const CFE_SB_Buffer_t *BufPtr)

void MD_ProcessSignatureCmd(const CFE_SB_Buffer_t *BufPtr)
{
int32 Status;
CFE_Status_t Status;
MD_CmdSetSignature_t *SignatureCmd = (MD_CmdSetSignature_t *)BufPtr;
uint16 TblId = 0;
uint16 StringLength;
Expand Down
23 changes: 12 additions & 11 deletions fsw/src/md_dwell_tbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ int32 MD_TableValidationFunc(void *TblPtr)
}

/******************************************************************************/
int32 MD_ReadDwellTable(const MD_DwellTableLoad_t *TblPtr, uint16 *ActiveAddrCountPtr, uint16 *SizePtr, uint32 *RatePtr)
CFE_Status_t MD_ReadDwellTable(const MD_DwellTableLoad_t *TblPtr, uint16 *ActiveAddrCountPtr, uint16 *SizePtr,
uint32 *RatePtr)
{
/* parameters cannot be NULL - checked by calling function */

Expand Down Expand Up @@ -332,11 +333,11 @@ void MD_CopyUpdatedTbl(MD_DwellTableLoad_t *MD_LoadTablePtr, uint8 TblIndex)
}

/******************************************************************************/
int32 MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue)
CFE_Status_t MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue)
{
int32 Status = CFE_SUCCESS;
CFE_Status_t Status = CFE_SUCCESS;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
int32 GetAddressResult;
CFE_Status_t GetAddressResult;

GetAddressResult = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);

Expand All @@ -363,11 +364,11 @@ int32 MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue)

/******************************************************************************/

int32 MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewLength, uint16 NewDelay,
MD_SymAddr_t NewDwellAddress)
CFE_Status_t MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewLength, uint16 NewDelay,
MD_SymAddr_t NewDwellAddress)
{
int32 Status = CFE_SUCCESS;
int32 GetAddressResult = 0;
CFE_Status_t Status = CFE_SUCCESS;
CFE_Status_t GetAddressResult = 0;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
MD_TableLoadEntry_t *EntryPtr = NULL;

Expand Down Expand Up @@ -412,11 +413,11 @@ int32 MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewL
/******************************************************************************/
#if MD_SIGNATURE_OPTION == 1

int32 MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIGNATURE_FIELD_LENGTH])
CFE_Status_t MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIGNATURE_FIELD_LENGTH])
{
int32 Status = CFE_SUCCESS;
CFE_Status_t Status = CFE_SUCCESS;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
int32 GetAddressResult;
CFE_Status_t GetAddressResult;

/* Get pointer to Table */
GetAddressResult = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);
Expand Down
12 changes: 6 additions & 6 deletions fsw/src/md_dwell_tbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void MD_CopyUpdatedTbl(MD_DwellTableLoad_t *MD_LoadTablePtr, uint8 TblIndex);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue);
CFE_Status_t MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue);

/**
* \brief Update Values for a Dwell Table Entry.
Expand All @@ -121,8 +121,8 @@ int32 MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue);
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewLength, uint16 NewDelay,
MD_SymAddr_t NewDwellAddress);
CFE_Status_t MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewLength, uint16 NewDelay,
MD_SymAddr_t NewDwellAddress);

#if MD_SIGNATURE_OPTION == 1

Expand All @@ -142,7 +142,7 @@ int32 MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewL
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIGNATURE_FIELD_LENGTH]);
CFE_Status_t MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIGNATURE_FIELD_LENGTH]);

#endif

Expand All @@ -165,8 +165,8 @@ int32 MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIGNATURE_
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
int32 MD_ReadDwellTable(const MD_DwellTableLoad_t *TblPtr, uint16 *ActiveAddrCountPtr, uint16 *SizePtr,
uint32 *RatePtr);
CFE_Status_t MD_ReadDwellTable(const MD_DwellTableLoad_t *TblPtr, uint16 *ActiveAddrCountPtr, uint16 *SizePtr,
uint32 *RatePtr);

/**
* \brief Validate dwell table entry.
Expand Down
Loading

0 comments on commit 5d116a9

Please sign in to comment.