Skip to content

Commit

Permalink
Issue nasa#666, Change message definitions to ensure alignment
Browse files Browse the repository at this point in the history
Update the CFE_ES_ShellTlm_t, CFE_TIME_ToneSignalCmd_t, and
CFE_TIME_FakeToneCmd_t to use the CFE_SB_TlmHdr_t/CFE_SB_CmdHdr_t
types to define the buffer, rather than a uint8 array.

This should not change the size, as it was already defined using
sizeof() this structure, but it will make it aligned correctly
which resolves the compiler warning.

Note that all CMD/TLM should really be defined this way, but
this only selectively changes the places that were actually
generating a compiler warning about this.  There is a risk
that padding will be added, but this change should not change
the padding or size of messages in 32-bit builds.
  • Loading branch information
jphickey authored and astrogeco committed May 8, 2020
1 parent 492664b commit 2a0494e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ typedef struct
*/
typedef struct
{
uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_SB_TlmHdr_t TlmHeader; /**< \brief cFE Software Bus Telemetry Message Header */
CFE_ES_ShellPacket_Payload_t Payload;
}CFE_ES_ShellTlm_t;
#endif /* CFE_OMIT_DEPRECATED_6_7 */
Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/inc/cfe_time_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ typedef struct
*/
typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;

} CFE_TIME_ToneSignalCmd_t;

Expand All @@ -888,7 +888,7 @@ typedef struct
*/
typedef struct
{
uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE];
CFE_SB_CmdHdr_t CmdHeader;

} CFE_TIME_FakeToneCmd_t;

Expand Down
4 changes: 2 additions & 2 deletions fsw/cfe-core/src/time/cfe_time_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ typedef struct
/*
** Local 1Hz wake-up command packet (not related to time at tone)...
*/
CCSDS_CommandPacket_t Local1HzCmd;
CFE_SB_CmdHdr_t Local1HzCmd;

/*
** Time at the tone command packets (sent by time servers)...
Expand All @@ -294,7 +294,7 @@ typedef struct
* "tone signal" message above.
*/
#if (CFE_MISSION_TIME_CFG_FAKE_TONE == true)
CCSDS_CommandPacket_t ToneSendCmd;
CFE_SB_CmdHdr_t ToneSendCmd;
#endif

/*
Expand Down

0 comments on commit 2a0494e

Please sign in to comment.