Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #106, Consolidate HK variables that are duplicated in the global struct #107

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions fsw/src/fm_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ CFE_Status_t FM_AppInit(void)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr)
{
FM_HousekeepingPkt_Payload_t *PayloadPtr;
FM_HousekeepingPkt_Payload_t *PayloadPtr = &FM_GlobalData.HousekeepingPkt.Payload;

FM_ReleaseTablePointers();

Expand All @@ -258,25 +258,8 @@ void FM_SendHkCmd(const CFE_SB_Buffer_t *BufPtr)
CFE_MSG_Init(CFE_MSG_PTR(FM_GlobalData.HousekeepingPkt.TelemetryHeader), CFE_SB_ValueToMsgId(FM_HK_TLM_MID),
sizeof(FM_HousekeepingPkt_t));

PayloadPtr = &FM_GlobalData.HousekeepingPkt.Payload;

/* Report application command counters */
PayloadPtr->CommandCounter = FM_GlobalData.CommandCounter;
PayloadPtr->CommandErrCounter = FM_GlobalData.CommandErrCounter;

PayloadPtr->NumOpenFiles = FM_GetOpenFilesData(NULL);

/* Report child task command counters */
PayloadPtr->ChildCmdCounter = FM_GlobalData.ChildCmdCounter;
PayloadPtr->ChildCmdErrCounter = FM_GlobalData.ChildCmdErrCounter;
PayloadPtr->ChildCmdWarnCounter = FM_GlobalData.ChildCmdWarnCounter;

PayloadPtr->ChildQueueCount = FM_GlobalData.ChildQueueCount;

/* Report current and previous commands executed by the child task */
PayloadPtr->ChildCurrentCC = FM_GlobalData.ChildCurrentCC;
PayloadPtr->ChildPreviousCC = FM_GlobalData.ChildPreviousCC;

CFE_SB_TimeStampMsg(CFE_MSG_PTR(FM_GlobalData.HousekeepingPkt.TelemetryHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(FM_GlobalData.HousekeepingPkt.TelemetryHeader), true);
}
18 changes: 3 additions & 15 deletions fsw/src/fm_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,9 @@ typedef struct
osal_id_t ChildSemaphore; /**< \brief Child task wakeup counting semaphore */
osal_id_t ChildQueueCountSem; /**< \brief Child queue counter mutex semaphore */

uint8 ChildCmdCounter; /**< \brief Child task command success counter */
uint8 ChildCmdErrCounter; /**< \brief Child task command error counter */
uint8 ChildCmdWarnCounter; /**< \brief Child task command warning counter */

uint8 ChildWriteIndex; /**< \brief Array index for next write to command args */
uint8 ChildReadIndex; /**< \brief Array index for next read from command args */
uint8 ChildQueueCount; /**< \brief Number of pending commands in queue */

uint8 CommandCounter; /**< \brief Application command success counter */
uint8 CommandErrCounter; /**< \brief Application command error counter */
uint8 Spare8a; /**< \brief Placeholder for unused command warning counter */

uint8 ChildCurrentCC; /**< \brief Command code currently executing */
uint8 ChildPreviousCC; /**< \brief Command code previously executed */
uint8 Spare8b; /**< \brief Structure alignment spare */
uint8 ChildWriteIndex; /**< \brief Array index for next write to command args */
uint8 ChildReadIndex; /**< \brief Array index for next read from command args */
uint16 Padding; /**< \brief Structure padding to align to 32-bit boundaries */

uint32 FileStatTime; /**< \brief Modify time from most recent OS_stat */
uint32 FileStatSize; /**< \brief File size from most recent OS_stat */
Expand Down
Loading