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 4, 2023
1 parent bd4dd1c commit f28181d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 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
5 changes: 2 additions & 3 deletions fsw/src/cs_compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ CFE_Status_t CS_ComputeApp(CS_Res_App_Table_Entry_t *ResultsEntry, uint32 *Compu
CFE_Status_t Result;
CFE_Status_t ResultGetResourceID = CS_ERROR;
CFE_Status_t ResultGetResourceInfo = CS_ERROR;
int32 ResultAddressValid = false;
bool ResultAddressValid = false;

/* variables to get applications address */
CFE_ResourceId_t ResourceID = CFE_RESOURCEID_UNDEFINED;
Expand Down Expand Up @@ -350,8 +350,7 @@ CFE_Status_t CS_ComputeApp(CS_Res_App_Table_Entry_t *ResultsEntry, uint32 *Compu
{
CFE_EVS_SendEvent(CS_COMPUTE_APP_PLATFORM_DBG_EID, CFE_EVS_EventType_DEBUG,
"CS cannot get a valid address for %s, due to the platform", ResultsEntry->Name);
ResultAddressValid = false;
Result = CS_ERROR;
Result = CS_ERROR;
}
else
{
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 f28181d

Please sign in to comment.