Skip to content

Commit

Permalink
Fix nasa#82, Convert integers holding boolean truth values to bool
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed May 2, 2023
1 parent bd4dd1c commit 3d8269d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions fsw/inc/cs_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ typedef struct
uint8 TablesCSState; /**< \brief CS Tables table checksum state */
uint8 OSCSState; /**< \brief OS code segment checksum state */
uint8 CfeCoreCSState; /**< \brief cFE Core code segment checksum stat e*/
uint8 RecomputeInProgress; /**< \brief CS "Recompute In Progress" flag */
uint8 OneShotInProgress; /**< \brief CS "OneShot In Progress" flag */
bool RecomputeInProgress; /**< \brief CS "Recompute In Progress" flag */
bool OneShotInProgress; /**< \brief CS "OneShot In Progress" flag */
uint8 Filler8; /**< \brief 8 bit padding */
uint16 EepromCSErrCounter; /**< \brief EEPROM miscompare counter */
uint16 MemoryCSErrCounter; /**< \brief Memory miscompare counter */
Expand Down
10 changes: 6 additions & 4 deletions fsw/inc/cs_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
bool ComputedYet; /**< \brief Have we computed an Integrity value yet */
bool Filler8; /** <\brief Padding */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
Expand Down Expand Up @@ -114,14 +115,14 @@ typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
bool 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 calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
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 */
uint16 Filler16; /**< \brief Padding */
char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief name of the table */
} CS_Res_Tables_Table_Entry_t;

Expand All @@ -132,7 +133,8 @@ typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
bool ComputedYet; /**< \brief Have we computed an Integrity value yet */
bool Filler8; /** <\brief Padding */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
Expand Down
8 changes: 4 additions & 4 deletions unit-test/cs_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -2188,8 +2188,8 @@ void CS_HousekeepingCmd_Test_Nominal(void)
CS_AppData.HkPacket.TablesCSState = 7;
CS_AppData.HkPacket.OSCSState = 8;
CS_AppData.HkPacket.CfeCoreCSState = 9;
CS_AppData.HkPacket.RecomputeInProgress = 10;
CS_AppData.HkPacket.OneShotInProgress = 11;
CS_AppData.HkPacket.RecomputeInProgress = true;
CS_AppData.HkPacket.OneShotInProgress = true;
CS_AppData.HkPacket.EepromCSErrCounter = 12;
CS_AppData.HkPacket.MemoryCSErrCounter = 13;
CS_AppData.HkPacket.AppCSErrCounter = 14;
Expand Down Expand Up @@ -2219,8 +2219,8 @@ void CS_HousekeepingCmd_Test_Nominal(void)
UtAssert_True(CS_AppData.HkPacket.TablesCSState == 7, "CS_AppData.HkPacket.TablesCSState == 7");
UtAssert_True(CS_AppData.HkPacket.OSCSState == 8, "CS_AppData.HkPacket.OSCSState == 8");
UtAssert_True(CS_AppData.HkPacket.CfeCoreCSState == 9, "CS_AppData.HkPacket.CfeCoreCSState == 9");
UtAssert_True(CS_AppData.HkPacket.RecomputeInProgress == 10, "CS_AppData.HkPacket.ChildTaskInUse == 10");
UtAssert_True(CS_AppData.HkPacket.OneShotInProgress == 11, "CS_AppData.HkPacket.OneShotInProgress == 11");
UtAssert_True(CS_AppData.HkPacket.RecomputeInProgress == true, "CS_AppData.HkPacket.ChildTaskInUse == true");
UtAssert_True(CS_AppData.HkPacket.OneShotInProgress == true, "CS_AppData.HkPacket.OneShotInProgress == true");
UtAssert_True(CS_AppData.HkPacket.EepromCSErrCounter == 12, "CS_AppData.HkPacket.EepromCSErrCounter == 12");
UtAssert_True(CS_AppData.HkPacket.MemoryCSErrCounter == 13, "CS_AppData.HkPacket.MemoryCSErrCounter == 13");
UtAssert_True(CS_AppData.HkPacket.AppCSErrCounter == 14, "CS_AppData.HkPacket.AppCSErrCounter == 14");
Expand Down

0 comments on commit 3d8269d

Please sign in to comment.