From beaa27f23f8b92904618e711e2734b675ec6dda8 Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Tue, 5 Dec 2023 10:24:03 +1000 Subject: [PATCH] Fix #199, Use `CFE_MSG_PTR` instead of `&(x).Msg` --- fsw/src/cf_app.c | 6 +++--- fsw/src/cf_cfdp.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fsw/src/cf_app.c b/fsw/src/cf_app.c index 736dc5c9..dc1bf5d0 100644 --- a/fsw/src/cf_app.c +++ b/fsw/src/cf_app.c @@ -46,8 +46,8 @@ CF_AppData_t CF_AppData; *-----------------------------------------------------------------*/ void CF_HkCmd(void) { - CFE_MSG_SetMsgTime(&CF_AppData.hk.TelemetryHeader.Msg, CFE_TIME_GetTime()); - /* return value ignored */ CFE_SB_TransmitMsg(&CF_AppData.hk.TelemetryHeader.Msg, true); + CFE_MSG_SetMsgTime(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader), CFE_TIME_GetTime()); + /* return value ignored */ CFE_SB_TransmitMsg(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader), true); } /*---------------------------------------------------------------- @@ -205,7 +205,7 @@ CFE_Status_t CF_Init(void) CF_AppData.run_status = CFE_ES_RunStatus_APP_RUN; - CFE_MSG_Init(&CF_AppData.hk.TelemetryHeader.Msg, CFE_SB_ValueToMsgId(CF_HK_TLM_MID), sizeof(CF_AppData.hk)); + CFE_MSG_Init(CFE_MSG_PTR(CF_AppData.hk.TelemetryHeader), CFE_SB_ValueToMsgId(CF_HK_TLM_MID), sizeof(CF_AppData.hk)); status = CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY); if (status != CFE_SUCCESS) diff --git a/fsw/src/cf_cfdp.c b/fsw/src/cf_cfdp.c index 8e8fc64f..83a1078d 100644 --- a/fsw/src/cf_cfdp.c +++ b/fsw/src/cf_cfdp.c @@ -1723,7 +1723,7 @@ void CF_CFDP_SendEotPkt(CF_Transaction_t *txn) { EotPktPtr = (void *)BufPtr; - CFE_MSG_Init(&EotPktPtr->TelemetryHeader.Msg, CFE_SB_ValueToMsgId(CF_EOT_TLM_MID), sizeof(*EotPktPtr)); + CFE_MSG_Init(CFE_MSG_PTR(EotPktPtr->TelemetryHeader), CFE_SB_ValueToMsgId(CF_EOT_TLM_MID), sizeof(*EotPktPtr)); EotPktPtr->Payload.channel = txn->chan_num; EotPktPtr->Payload.direction = txn->history->dir; @@ -1739,7 +1739,7 @@ void CF_CFDP_SendEotPkt(CF_Transaction_t *txn) /* ** Timestamp and send eod of transaction telemetry */ - CFE_SB_TimeStampMsg(&EotPktPtr->TelemetryHeader.Msg); + CFE_SB_TimeStampMsg(CFE_MSG_PTR(EotPktPtr->TelemetryHeader)); CFE_SB_TransmitBuffer(BufPtr, true); } }