Skip to content

Commit

Permalink
Fix nasa#199, 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 08a2e0c commit b91d649
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions fsw/src/cf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ CF_AppData_t CF_AppData;
*-----------------------------------------------------------------*/
void CF_HkCmd(void)
{
CFE_MSG_SetMsgTime(&CF_AppData.hk.tlm_header.Msg, CFE_TIME_GetTime());
/* return value ignored */ CFE_SB_TransmitMsg(&CF_AppData.hk.tlm_header.Msg, true);
CFE_MSG_SetMsgTime(CFE_MSG_PTR(CF_AppData.hk.tlm_header), CFE_TIME_GetTime());
/* return value ignored */ CFE_SB_TransmitMsg(CFE_MSG_PTR(CF_AppData.hk.tlm_header), true);
}

/*----------------------------------------------------------------
Expand Down Expand Up @@ -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.tlm_header.Msg, CFE_SB_ValueToMsgId(CF_HK_TLM_MID), sizeof(CF_AppData.hk));
CFE_MSG_Init(CFE_MSG_PTR(CF_AppData.hk.tlm_header), 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)
Expand Down
10 changes: 5 additions & 5 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,10 +1610,10 @@ void CF_CFDP_ResetTransaction(CF_Transaction_t *txn, int keep_history)
CF_Channel_t *chan = &CF_AppData.engine.channels[txn->chan_num];
CF_Assert(txn->chan_num < CF_NUM_CHANNELS);

if ( txn->flags.com.q_index == CF_QueueIdx_FREE)
if (txn->flags.com.q_index == CF_QueueIdx_FREE)
{
CFE_EVS_SendEvent(CF_EID_DBG_RESET_FREED_XACT, CFE_EVS_EventType_DEBUG, \
"CF: attempt to reset a transaction that has already been freed");
CFE_EVS_SendEvent(CF_EID_DBG_RESET_FREED_XACT, CFE_EVS_EventType_DEBUG,
"CF: attempt to reset a transaction that has already been freed");
return;
}

Expand Down Expand Up @@ -1720,7 +1720,7 @@ void CF_CFDP_SendEotPkt(CF_Transaction_t *txn)

if (PktBuf != NULL)
{
CFE_MSG_Init(&PktBuf->eot.tlm_header.Msg, CFE_SB_ValueToMsgId(CF_EOT_TLM_MID), sizeof(PktBuf->eot));
CFE_MSG_Init(CFE_MSG_PTR(PktBuf->eot.tlm_header), CFE_SB_ValueToMsgId(CF_EOT_TLM_MID), sizeof(PktBuf->eot));

PktBuf->eot.channel = txn->chan_num;
PktBuf->eot.direction = txn->history->dir;
Expand All @@ -1736,7 +1736,7 @@ void CF_CFDP_SendEotPkt(CF_Transaction_t *txn)
/*
** Timestamp and send eod of transaction telemetry
*/
CFE_SB_TimeStampMsg(&PktBuf->eot.tlm_header.Msg);
CFE_SB_TimeStampMsg(CFE_MSG_PTR(PktBuf->eot.tlm_header));
CFE_SB_TransmitBuffer(&PktBuf->SBBuf, true);
}
}
Expand Down

0 comments on commit b91d649

Please sign in to comment.