Skip to content

Commit

Permalink
Fix #6, Update documentation, apply clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
dmknutsen authored and astrogeco committed May 3, 2022
1 parent b32cb44 commit ad5b8dd
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 74 deletions.
72 changes: 44 additions & 28 deletions fsw/src/cs_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef struct
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calculation left off */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
uint32 Filler32; /**< \brief Padding */
} CS_Res_EepromMemory_Table_Entry_t;
Expand Down Expand Up @@ -117,9 +117,9 @@ typedef struct
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calculation left off */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
CFE_TBL_Handle_t TblHandle; /**< \brief handle recieved from table services */
CFE_TBL_Handle_t TblHandle; /**< \brief handle recieved from CFE_TBL */
bool IsCSOwner; /**< \brief Is CS the original owner of this table */
bool Filler8; /**< \brief Padding */
char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief name of the table */
Expand All @@ -135,7 +135,7 @@ typedef struct
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calculation left off */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
char Name[OS_MAX_API_NAME]; /**< \brief name of the app */
} CS_Res_App_Table_Entry_t;
Expand Down Expand Up @@ -301,46 +301,57 @@ void CS_ProcessNewAppDefinitionTable(const CS_Def_App_Table_Entry_t *DefinitionT
*
* \param [in] DefinitionTableHandle A #CFE_TBL_Handle_t pointer
* that will get filled in with the
* table handle to the definition table
* table handle to the definition
* table
*
* \param [in] ResultsTableHandle A #CFE_TBL_Handle_t pointer
* that will get filled in with the
* table handle to the results table
* table handle to the results
* table
*
* \param [in] DefinitionTblPtr A pointer to the definiton table
* that we are operating on, it will get
* assigned during this call
* that we are operating on, it
* will get assigned during this
* call
*
* \param [in] ResultsTblPtr A pointer to the result table
* to operate on , it will get
* assigned during this call
*
* \param [in] Table The specific table we are operating on
* \param [in] Table The specific table we are
* operating on
*
* \param [in] DefinitionTableName The name of the definition table
*
* \param [in] ResultsTableName The name of the results table
*
* \param [in] NumEntries The number of entries in the table
*
* \param [in] DefinitionTableFileName The name of the file to load the definition
* table from
* \param [in] DefaultDefTableAddress The address of the default definition table
* that we may have to load from memory if the
* file is absent
* \param [in] NumEntries The number of entries in the
* table
*
* \param [in] SizeofDefinitionTableEntry The sizeof an entry in the definition table
* \param [in] DefinitionTableFileName The name of the file to load the
* definition table from
*
* \param [in] SizeofResultsTableEntry The size of an enrty in the results table
* \param [in] DefaultDefTableAddress The address of the default
* definition table that we may
* have to load from memory if
* the file is absent
*
* \param [in] CallBackFunction A pointer to a function used to validate the
* \param [in] SizeofDefinitionTableEntry The sizeof an entry in the
* definition table
* \param [out] * DefinitionTableHandle A #CFE_TBL_Handle_t pointer
* that will get filled in with the
* table handle to the definition table
* \param [out] * ResultsTableHandle A #CFE_TBL_Handle_t pointer
* that will get filled in with the
* table handle to the results table
*
* \param [in] SizeofResultsTableEntry The size of an enrty in the
* results table
*
* \param [in] CallBackFunction A pointer to a function used to
* validate the definition table
*
* \param [out] * DefinitionTableHandle A #CFE_TBL_Handle_t pointer that
* will get filled in with the tbl
* handle to the definition table
*
* \param [out] * ResultsTableHandle A #CFE_TBL_Handle_t pointer that
* will get filled in with the tbl
* handle to the results table
*
* \param [out] * DefinitionTblPtr A pointer to the definiton table
* that we are operating on
Expand Down Expand Up @@ -373,11 +384,16 @@ int32 CS_TableInit(CFE_TBL_Handle_t *DefinitionTableHandle, CFE_TBL_Handle_t *Re
*
* \param [in] ResultsTblPtr A pointer to the result table
* to operate on
* \param [in] DefinitionTableHandle A table handle to the definition table
* \param [in] ResultsTableHandle A table handle to the results table
* \param [in] DefinitionTableHandle A table handle to the definition
* table
*
* \param [in] ResultsTableHandle A table handle to the results
* table
*
* \param [in] NumEntries The number of entries in the table
* \param [in] Table The specific table we are operating on
*
* \param [in] Table The specific table we are operating
* on
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
Expand Down
7 changes: 3 additions & 4 deletions fsw/tables/cs_apptbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
** Includes
*************************************************************************/
#include "cfe.h"
#include "cs_platform_cfg.h"
#include "cfe_tbl_filedef.h"
#include "cs_msgdefs.h"
#include "cs_platform_cfg.h"
#include "cs_tbldefs.h"
#include "cfe_tbl_filedef.h"

CS_Def_App_Table_Entry_t CS_AppTable[CS_MAX_NUM_APP_TABLE_ENTRIES] = {
/* State Name */
Expand All @@ -56,8 +56,7 @@ CS_Def_App_Table_Entry_t CS_AppTable[CS_MAX_NUM_APP_TABLE_ENTRIES] = {
/* 20 */ {.State = CS_STATE_EMPTY, .Name = ""},
/* 21 */ {.State = CS_STATE_EMPTY, .Name = ""},
/* 22 */ {.State = CS_STATE_EMPTY, .Name = ""},
/* 23 */ {.State = CS_STATE_EMPTY, .Name = ""}
};
/* 23 */ {.State = CS_STATE_EMPTY, .Name = ""}};

/*
** Table file header
Expand Down
53 changes: 34 additions & 19 deletions fsw/tables/cs_eepromtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,45 @@
** Includes
*************************************************************************/
#include "cfe.h"
#include "cs_platform_cfg.h"
#include "cfe_tbl_filedef.h"
#include "cs_msgdefs.h"
#include "cs_platform_cfg.h"
#include "cs_tbldefs.h"
#include "cfe_tbl_filedef.h"

CS_Def_EepromMemory_Table_Entry_t CS_EepromTable[CS_MAX_NUM_EEPROM_TABLE_ENTRIES] = {
/* State Filler StartAddress NumBytes */
/* 0 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 1 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 2 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 3 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 4 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 5 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 6 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 7 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 8 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 9 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 10 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 11 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 12 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 13 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 14 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 15 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000}
};
/* 0 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 1 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 2 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 3 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 4 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 5 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 6 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 7 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 8 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 9 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 10 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 11 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 12 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 13 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 14 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 15 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000}};

/*
** Table file header
Expand Down
53 changes: 34 additions & 19 deletions fsw/tables/cs_memorytbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,45 @@
** Includes
*************************************************************************/
#include "cfe.h"
#include "cs_platform_cfg.h"
#include "cfe_tbl_filedef.h"
#include "cs_msgdefs.h"
#include "cs_platform_cfg.h"
#include "cs_tbldefs.h"
#include "cfe_tbl_filedef.h"

CS_Def_EepromMemory_Table_Entry_t CS_MemoryTable[CS_MAX_NUM_MEMORY_TABLE_ENTRIES] = {
/* State Filler StartAddress NumBytes */
/* 0 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 1 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 2 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 3 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 4 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 5 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 6 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 7 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 8 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 9 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 10 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 11 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 12 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 13 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 14 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 15 */ {.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000}
};
/* 0 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 1 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 2 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 3 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 4 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 5 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 6 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 7 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 8 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 9 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 10 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 11 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 12 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 13 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 14 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000},
/* 15 */
{.State = CS_STATE_EMPTY, .Filler16 = 0x1234, .StartAddress = 0x00000000, .NumBytesToChecksum = 0x00000000}};

/*
** Table file header
Expand Down
7 changes: 3 additions & 4 deletions fsw/tables/cs_tablestbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
** Includes
*************************************************************************/
#include "cfe.h"
#include "cs_platform_cfg.h"
#include "cfe_tbl_filedef.h"
#include "cs_msgdefs.h"
#include "cs_platform_cfg.h"
#include "cs_tbldefs.h"
#include "cfe_tbl_filedef.h"

CS_Def_Tables_Table_Entry_t CS_TablesTable[CS_MAX_NUM_TABLES_TABLE_ENTRIES] = {
/* State Name */
Expand Down Expand Up @@ -57,8 +57,7 @@ CS_Def_Tables_Table_Entry_t CS_TablesTable[CS_MAX_NUM_TABLES_TABLE_ENTRIES] = {
/* 20 */ {.State = CS_STATE_EMPTY, .Name = ""},
/* 21 */ {.State = CS_STATE_EMPTY, .Name = ""},
/* 22 */ {.State = CS_STATE_EMPTY, .Name = ""},
/* 23 */ {.State = CS_STATE_EMPTY, .Name = ""}
};
/* 23 */ {.State = CS_STATE_EMPTY, .Name = ""}};

/*
** Table file header
Expand Down

0 comments on commit ad5b8dd

Please sign in to comment.