From 50b4ba4dc38963eaec5285b1e8cc781c1fccc6e9 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 27 May 2020 17:14:27 -0400 Subject: [PATCH] WIP-Trivial header redefine --- cmake/mission_build.cmake | 1 + cmake/sample_defs/sample_mission_cfg.h | 2 +- cmake/sample_defs/sample_mission_custom.h | 18 ++++++++++++++++++ fsw/cfe-core/src/inc/ccsds.h | 4 ++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 cmake/sample_defs/sample_mission_custom.h diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 786d98cab..6a96d6a25 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -112,6 +112,7 @@ function(prepare) endif (SIMULATION) # Generate the cfe_mission_cfg.h wrapper file + generate_config_includefile("inc/cfe_mission_custom.h" mission_custom.h ${MISSIONCONFIG}) generate_config_includefile("inc/cfe_mission_cfg.h" mission_cfg.h ${MISSIONCONFIG}) generate_config_includefile("inc/cfe_perfids.h" perfids.h ${MISSIONCONFIG} ) diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index 6043ecb32..528a650b4 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -64,7 +64,7 @@ ** MESSAGE_FORMAT_IS_CCSDS_VER_2 is optional */ /* #define MESSAGE_FORMAT_IS_CCSDS_VER_2 */ -#undef MESSAGE_FORMAT_IS_CCSDS_VER_2 +#define MESSAGE_FORMAT_IS_CUSTOM diff --git a/cmake/sample_defs/sample_mission_custom.h b/cmake/sample_defs/sample_mission_custom.h new file mode 100644 index 000000000..8addd3d72 --- /dev/null +++ b/cmake/sample_defs/sample_mission_custom.h @@ -0,0 +1,18 @@ +/* Mission custom command and telemetry packet headers */ +#include "ccsds.h" + +typedef struct +{ + CCSDS_SpacePacket_t SpacePacket; /**< \brief Standard Header on all packets */ + CCSDS_CmdSecHdr_t Sec; + uint32 customfield; +} CCSDS_CommandPacket_t; + +/*----- Generic combined telemetry header. -----*/ + +typedef struct +{ + CCSDS_SpacePacket_t SpacePacket; /**< \brief Standard Header on all packets */ + CCSDS_TlmSecHdr_t Sec; +} CCSDS_TelemetryPacket_t; + diff --git a/fsw/cfe-core/src/inc/ccsds.h b/fsw/cfe-core/src/inc/ccsds.h index f86e550c1..a2a97a17e 100644 --- a/fsw/cfe-core/src/inc/ccsds.h +++ b/fsw/cfe-core/src/inc/ccsds.h @@ -184,6 +184,9 @@ typedef struct +#ifdef MESSAGE_FORMAT_IS_CUSTOM +#include "cfe_mission_custom.h" /* Should resolve/refactor to avoid including mid-file */ +#else /*----- Generic combined command header. -----*/ typedef struct @@ -199,6 +202,7 @@ typedef struct CCSDS_SpacePacket_t SpacePacket; /**< \brief Standard Header on all packets */ CCSDS_TlmSecHdr_t Sec; } CCSDS_TelemetryPacket_t; +#endif /* * COMPATIBILITY TYPEDEFS: