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 #5, Use CFE_MSG_PTR instead of &(x).Msg #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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