Skip to content

Commit

Permalink
Fix nasa#5, Use CFE_MSG_PTR instead of &(x).Msg
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Dec 5, 2023
1 parent b0ae64d commit dbe1833
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions fsw/inc/md_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< Command Header */
CFE_MSG_CommandHeader_t CommandHeader; /**< Command Header */
} MD_NoArgsCmd_t;

/**
Expand All @@ -105,7 +105,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t Header; /**< \brief Command header */
CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
MD_CmdStartStop_Payload_t Payload;
} MD_CmdStartStop_t;

Expand All @@ -116,7 +116,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t Header; /**< \brief Command header */
CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
MD_CmdJam_Payload_t Payload;
} MD_CmdJam_t;

Expand All @@ -129,7 +129,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t Header; /**< \brief Command Header */
CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command Header */
MD_CmdSetSignature_Payload_t Payload;
} MD_CmdSetSignature_t;

Expand Down Expand Up @@ -182,7 +182,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
MD_HkTlm_Payload_t Payload;
} MD_HkTlm_t;

Expand All @@ -196,7 +196,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
MD_DwellPkt_Payload_t Payload;
} MD_DwellPkt_t;

Expand Down
8 changes: 4 additions & 4 deletions fsw/src/md_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ CFE_Status_t MD_InitSoftwareBusServices(void)
/*
** Initialize housekeeping telemetry packet (clear user data area)
*/
CFE_MSG_Init(&MD_AppData.HkPkt.TlmHeader.Msg, CFE_SB_ValueToMsgId(MD_HK_TLM_MID), MD_HK_TLM_LNGTH);
CFE_MSG_Init(CFE_MSG_PTR(MD_AppData.HkPkt.TelemetryHeader), CFE_SB_ValueToMsgId(MD_HK_TLM_MID), MD_HK_TLM_LNGTH);
/*
** Initialize dwell packets (clear user data area)
*/
for (TblIndex = 0; TblIndex < MD_NUM_DWELL_TABLES; TblIndex++)
{
CFE_MSG_Init(&MD_AppData.MD_DwellPkt[TblIndex].TlmHeader.Msg,
CFE_MSG_Init(CFE_MSG_PTR(MD_AppData.MD_DwellPkt[TblIndex].TelemetryHeader),
CFE_SB_ValueToMsgId(MD_DWELL_PKT_MID_BASE + TblIndex),
MD_DWELL_PKT_LNGTH); /* this is max pkt size */

Expand Down Expand Up @@ -699,8 +699,8 @@ void MD_HkStatus()
/*
** Send housekeeping telemetry packet...
*/
CFE_SB_TimeStampMsg(&HkPktPtr->TlmHeader.Msg);
CFE_SB_TransmitMsg(&HkPktPtr->TlmHeader.Msg, true);
CFE_SB_TimeStampMsg(CFE_MSG_PTR(HkPktPtr->TelemetryHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(HkPktPtr->TelemetryHeader), true);
}

/******************************************************************************/
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/md_dwell_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ void MD_SendDwellPkt(uint16 TableIndex)

DwellPktSize = MD_DWELL_PKT_LNGTH - MD_DWELL_TABLE_SIZE * 4 + TblPtr->DataSize;

CFE_MSG_SetSize(&PktPtr->TlmHeader.Msg, DwellPktSize);
CFE_MSG_SetSize(CFE_MSG_PTR(PktPtr->TelemetryHeader), DwellPktSize);

/*
** Send dwell telemetry packet.
*/
CFE_SB_TimeStampMsg(&PktPtr->TlmHeader.Msg);
CFE_SB_TransmitMsg(&PktPtr->TlmHeader.Msg, true);
CFE_SB_TimeStampMsg(CFE_MSG_PTR(PktPtr->TelemetryHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(PktPtr->TelemetryHeader), true);
}

/******************************************************************************/
Expand Down

0 comments on commit dbe1833

Please sign in to comment.