From 0fd023b0a0110734dba4148b45f2d89d5c5a6be7 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 6 Oct 2023 14:06:46 -0400 Subject: [PATCH] Fix #150, implement header file convention for SCH_LAB Move configurable header files into a separate directory with names according to the pattern documented in CFE. --- CMakeLists.txt | 5 -- arch_build.cmake | 24 ++++++ config/default_sch_lab_interface_cfg.h | 46 ++++++++++ config/default_sch_lab_mission_cfg.h | 36 ++++++++ .../default_sch_lab_perfids.h | 3 + config/default_sch_lab_tbl.h | 48 +++++++++++ config/default_sch_lab_tbldefs.h | 49 +++++++++++ config/default_sch_lab_tblstruct.h | 41 +++++++++ fsw/platform_inc/sch_lab_table.h | 67 --------------- fsw/src/sch_lab_app.c | 33 +++----- fsw/tables/sch_lab_table.c | 84 +++++++++---------- mission_build.cmake | 35 ++++++++ 12 files changed, 333 insertions(+), 138 deletions(-) create mode 100644 arch_build.cmake create mode 100644 config/default_sch_lab_interface_cfg.h create mode 100644 config/default_sch_lab_mission_cfg.h rename fsw/mission_inc/sch_lab_perfids.h => config/default_sch_lab_perfids.h (88%) create mode 100644 config/default_sch_lab_tbl.h create mode 100644 config/default_sch_lab_tbldefs.h create mode 100644 config/default_sch_lab_tblstruct.h delete mode 100644 fsw/platform_inc/sch_lab_table.h create mode 100644 mission_build.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2762141..a3d93c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,3 @@ endforeach() # Create the app module add_cfe_app(sch_lab fsw/src/sch_lab_app.c) add_cfe_tables(sch_lab fsw/tables/sch_lab_table.c) - -target_include_directories(sch_lab PUBLIC - fsw/mission_inc - fsw/platform_inc -) diff --git a/arch_build.cmake b/arch_build.cmake new file mode 100644 index 0000000..862874d --- /dev/null +++ b/arch_build.cmake @@ -0,0 +1,24 @@ +########################################################### +# +# SCH_LAB platform build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the SCH_LAB configuration +set(SCH_LAB_PLATFORM_CONFIG_FILE_LIST + sch_lab_perfids.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(SCH_LAB_CFGFILE ${SCH_LAB_PLATFORM_CONFIG_FILE_LIST}) + generate_config_includefile( + FILE_NAME "${SCH_LAB_CFGFILE}" + FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SCH_LAB_CFGFILE}" + ) +endforeach() diff --git a/config/default_sch_lab_interface_cfg.h b/config/default_sch_lab_interface_cfg.h new file mode 100644 index 0000000..176aa31 --- /dev/null +++ b/config/default_sch_lab_interface_cfg.h @@ -0,0 +1,46 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFS SCH_LAB Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef SCH_LAB_INTERFACE_CFG_H +#define SCH_LAB_INTERFACE_CFG_H + +/** + * @brief The maximum number of schedule table entries + */ +#define SCH_LAB_MAX_SCHEDULE_ENTRIES 32 + +/** + * @brief The maximum number of arguments to each schedule message entry + * + * This is allocated in units of 16 bit words. + */ +#define SCH_LAB_MAX_ARGS_PER_ENTRY 32 + +#endif /* SCH_LAB_INTERFACE_CFG_H */ diff --git a/config/default_sch_lab_mission_cfg.h b/config/default_sch_lab_mission_cfg.h new file mode 100644 index 0000000..94374ea --- /dev/null +++ b/config/default_sch_lab_mission_cfg.h @@ -0,0 +1,36 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * + * CFS SCH_LAB Application Mission Configuration Header File + * + * This is a compatibility header for the "mission_cfg.h" file that has + * traditionally provided public config definitions for each CFS app. + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef SCH_LAB_MISSION_CFG_H +#define SCH_LAB_MISSION_CFG_H + +#include "sch_lab_interface_cfg.h" + +#endif /* SCH_LAB_MISSION_CFG_H */ diff --git a/fsw/mission_inc/sch_lab_perfids.h b/config/default_sch_lab_perfids.h similarity index 88% rename from fsw/mission_inc/sch_lab_perfids.h rename to config/default_sch_lab_perfids.h index 370004a..62ce922 100644 --- a/fsw/mission_inc/sch_lab_perfids.h +++ b/config/default_sch_lab_perfids.h @@ -19,6 +19,9 @@ /** * @file * Define SCH Lab Performance IDs + * + * These ID values need to be unique across a CFS deployment, so they may be customized + * as needed to avoid collision with other apps. */ #ifndef SCH_LAB_PERFIDS_H #define SCH_LAB_PERFIDS_H diff --git a/config/default_sch_lab_tbl.h b/config/default_sch_lab_tbl.h new file mode 100644 index 0000000..9c37b08 --- /dev/null +++ b/config/default_sch_lab_tbl.h @@ -0,0 +1,48 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the SCH_LAB table structures + * + * @note + * Constants and enumerated types related to these table structures + * are defined in sch_lab_tbldefs.h. + */ +#ifndef SCH_LAB_TBL_H +#define SCH_LAB_TBL_H + +#include "sch_lab_tbldefs.h" +#include "sch_lab_tblstruct.h" + +/* +** Defines +*/ +#ifdef SOFTWARE_BIG_BIT_ORDER +#define SCH_PACK_32BIT(value) (uint16)((value & 0xFFFF0000) >> 16), (uint16)(value & 0x0000FFFF) +#else +#define SCH_PACK_32BIT(value) (uint16)(value & 0x0000FFFF), (uint16)((value & 0xFFFF0000) >> 16) +#endif + +/* + * There is no extra encapsulation here, this header only + * defines the default file name to use for the SCH table + */ +#define SCH_TBL_DEFAULT_FILE "/cf/sch_lab_table.tbl" + +#endif diff --git a/config/default_sch_lab_tbldefs.h b/config/default_sch_lab_tbldefs.h new file mode 100644 index 0000000..41ef4ee --- /dev/null +++ b/config/default_sch_lab_tbldefs.h @@ -0,0 +1,49 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFS SCH_LAB table related data structures and + * constant definitions. + * + * The structure definitions in this file are closely related to the implementation + * of the application. Any modification to these structures will likely need + * a correpsonding update to the source code. + */ +#ifndef SCH_LAB_TBLDEFS_H +#define SCH_LAB_TBLDEFS_H + +#include "cfe_sb_extern_typedefs.h" /* for CFE_SB_MsgId_t */ +#include "cfe_msg_api_typedefs.h" /* For CFE_MSG_FcnCode_t */ +#include "cfe_msgids.h" + +#include "sch_lab_mission_cfg.h" + +/* +** Typedefs +*/ +typedef struct +{ + CFE_SB_MsgId_t MessageID; /* Message ID for the table entry */ + uint32 PacketRate; /* Rate: Send packet every N ticks */ + CFE_MSG_FcnCode_t FcnCode; /* Command/Function code to set */ + uint16 PayloadLength; /* Length of additional command args */ + uint16 MessageBuffer[SCH_LAB_MAX_ARGS_PER_ENTRY]; /* Command args in 16 bit words */ +} SCH_LAB_ScheduleTableEntry_t; + +#endif diff --git a/config/default_sch_lab_tblstruct.h b/config/default_sch_lab_tblstruct.h new file mode 100644 index 0000000..c41ad19 --- /dev/null +++ b/config/default_sch_lab_tblstruct.h @@ -0,0 +1,41 @@ +/************************************************************************ + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” + * + * Copyright (c) 2020 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ************************************************************************/ + +/** + * @file + * Specification for the CFS SCH_LAB table encapsulation structures + * + * Provides default definitions for SCH_LAB table structures + * + * @note This file may be overridden/superceded by mission-provided defintions + * either by overriding this header or by generating definitions from a command/data + * dictionary tool. + */ +#ifndef SCH_LAB_TBLSTRUCT_H +#define SCH_LAB_TBLSTRUCT_H + +#include "sch_lab_mission_cfg.h" +#include "sch_lab_tbldefs.h" + +typedef struct +{ + uint32 TickRate; /* Ticks per second to configure for timer (0=default) */ + SCH_LAB_ScheduleTableEntry_t Config[SCH_LAB_MAX_SCHEDULE_ENTRIES]; +} SCH_LAB_ScheduleTable_t; + +#endif diff --git a/fsw/platform_inc/sch_lab_table.h b/fsw/platform_inc/sch_lab_table.h deleted file mode 100644 index c37d675..0000000 --- a/fsw/platform_inc/sch_lab_table.h +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” - * - * Copyright (c) 2020 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ************************************************************************/ - -/** - * @file - * This file contains the schedule tables for the SCH Lab app. - * It is intended to go in the platform include directory so the SCH_LAB - * app source code does not have to be modified. - */ -#ifndef SCH_LAB_TABLE_H -#define SCH_LAB_TABLE_H - -#include "cfe_sb_extern_typedefs.h" /* for CFE_SB_MsgId_t */ -#include "cfe_msg_api_typedefs.h" /* For CFE_MSG_FcnCode_t */ -#include "cfe_msgids.h" - -/* -** Defines -*/ -#define SCH_LAB_END_OF_TABLE 0 -#define SCH_LAB_MAX_SCHEDULE_ENTRIES 32 -#define SCH_TBL_DEFAULT_FILE "/cf/sch_lab_table.tbl" - -#define SCH_MAX_MSG_WORDS 32 - -#ifdef SOFTWARE_BIG_BIT_ORDER -#define SCH_PACK_32BIT(value) \ -(uint16)((value & 0xFFFF0000) >> 16), (uint16)(value & 0x0000FFFF) -#else -#define SCH_PACK_32BIT(value) \ -(uint16)(value & 0x0000FFFF), (uint16)((value & 0xFFFF0000) >> 16) -#endif - -/* -** Typedefs -*/ -typedef struct -{ - CFE_SB_MsgId_t MessageID; /* Message ID for the table entry */ - uint32 PacketRate; /* Rate: Send packet every N ticks */ - CFE_MSG_FcnCode_t FcnCode; /* Command/Function code to set */ - uint16 PayloadLength; /* Length of additional command args */ - uint16 MessageBuffer[SCH_MAX_MSG_WORDS]; /* Command args in 16 bit words */ -} SCH_LAB_ScheduleTableEntry_t; - -typedef struct -{ - uint32 TickRate; /* Ticks per second to configure for timer (0=default) */ - SCH_LAB_ScheduleTableEntry_t Config[SCH_LAB_MAX_SCHEDULE_ENTRIES]; -} SCH_LAB_ScheduleTable_t; - -#endif diff --git a/fsw/src/sch_lab_app.c b/fsw/src/sch_lab_app.c index d699768..eee9119 100644 --- a/fsw/src/sch_lab_app.c +++ b/fsw/src/sch_lab_app.c @@ -27,18 +27,12 @@ #include #include "cfe.h" -#include "cfe_sb.h" -#include "osapi.h" -#include "cfe_es.h" -#include "cfe_error.h" +#include "cfe_msgids.h" #include "sch_lab_perfids.h" #include "sch_lab_version.h" - -/* -** SCH Lab Schedule table from the platform inc directory -*/ -#include "sch_lab_table.h" +#include "sch_lab_mission_cfg.h" +#include "sch_lab_tbl.h" /* ** Global Structure @@ -46,7 +40,7 @@ typedef struct { CFE_MSG_CommandHeader_t CommandHeader; - uint16 MessageBuffer[SCH_MAX_MSG_WORDS]; + uint16 MessageBuffer[SCH_LAB_MAX_ARGS_PER_ENTRY]; uint16 PayloadLength; uint32 PacketRate; uint32 Counter; @@ -66,7 +60,6 @@ typedef struct */ SCH_LAB_GlobalData_t SCH_LAB_Global; - /* ** Local Function Prototypes */ @@ -195,12 +188,12 @@ int32 SCH_LAB_AppInit(void) /* ** Register tables with cFE and load default data */ - Status = CFE_TBL_Register(&SCH_LAB_Global.TblHandle, "SCH_LAB_SchTbl", sizeof(SCH_LAB_ScheduleTable_t), + Status = CFE_TBL_Register(&SCH_LAB_Global.TblHandle, "ScheduleTable", sizeof(SCH_LAB_ScheduleTable_t), CFE_TBL_OPT_DEFAULT, NULL); if (Status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("SCH_LAB: Error Registering SCH_LAB_SchTbl, RC = 0x%08lX\n", (unsigned long)Status); + CFE_ES_WriteToSysLog("SCH_LAB: Error Registering ScheduleTable, RC = 0x%08lX\n", (unsigned long)Status); return Status; } @@ -212,7 +205,7 @@ int32 SCH_LAB_AppInit(void) Status = CFE_TBL_Load(SCH_LAB_Global.TblHandle, CFE_TBL_SRC_FILE, SCH_TBL_DEFAULT_FILE); if (Status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("SCH_LAB: Error Loading Table SCH_LAB_SchTbl, RC = 0x%08lX\n", (unsigned long)Status); + CFE_ES_WriteToSysLog("SCH_LAB: Error Loading Table ScheduleTable, RC = 0x%08lX\n", (unsigned long)Status); CFE_TBL_ReleaseAddress(SCH_LAB_Global.TblHandle); return Status; @@ -225,7 +218,7 @@ int32 SCH_LAB_AppInit(void) Status = CFE_TBL_GetAddress(&TableAddr, SCH_LAB_Global.TblHandle); if (Status != CFE_SUCCESS && Status != CFE_TBL_INFO_UPDATED) { - CFE_ES_WriteToSysLog("SCH_LAB: Error Getting Table's Address SCH_LAB_SchTbl, RC = 0x%08lX\n", + CFE_ES_WriteToSysLog("SCH_LAB: Error Getting Table's Address ScheduleTable, RC = 0x%08lX\n", (unsigned long)Status); return Status; @@ -245,15 +238,15 @@ int32 SCH_LAB_AppInit(void) { /* Initialize the message with the length of the header + payload */ CFE_MSG_Init(CFE_MSG_PTR(LocalStateEntry->CommandHeader), ConfigEntry->MessageID, - sizeof(LocalStateEntry->CommandHeader) + ConfigEntry->PayloadLength); + sizeof(LocalStateEntry->CommandHeader) + ConfigEntry->PayloadLength); CFE_MSG_SetFcnCode(CFE_MSG_PTR(LocalStateEntry->CommandHeader), ConfigEntry->FcnCode); - LocalStateEntry->PacketRate = ConfigEntry->PacketRate; + LocalStateEntry->PacketRate = ConfigEntry->PacketRate; LocalStateEntry->PayloadLength = ConfigEntry->PayloadLength; - for (x =0; x < SCH_MAX_MSG_WORDS; x++) + for (x = 0; x < SCH_LAB_MAX_ARGS_PER_ENTRY; x++) { - LocalStateEntry->MessageBuffer[x]=ConfigEntry->MessageBuffer[x]; + LocalStateEntry->MessageBuffer[x] = ConfigEntry->MessageBuffer[x]; } } ++ConfigEntry; @@ -282,7 +275,7 @@ int32 SCH_LAB_AppInit(void) Status = CFE_TBL_ReleaseAddress(SCH_LAB_Global.TblHandle); if (Status != CFE_SUCCESS) { - CFE_ES_WriteToSysLog("SCH_LAB: Error Releasing Table SCH_LAB_SchTbl, RC = 0x%08lX\n", (unsigned long)Status); + CFE_ES_WriteToSysLog("SCH_LAB: Error Releasing Table ScheduleTable, RC = 0x%08lX\n", (unsigned long)Status); } /* Create pipe and subscribe to the 1Hz pkt */ diff --git a/fsw/tables/sch_lab_table.c b/fsw/tables/sch_lab_table.c index bfee7a9..3eb0595 100644 --- a/fsw/tables/sch_lab_table.c +++ b/fsw/tables/sch_lab_table.c @@ -17,7 +17,7 @@ ************************************************************************/ #include "cfe_tbl_filedef.h" /* Required to obtain the CFE_TBL_FILEDEF macro definition */ -#include "sch_lab_table.h" +#include "sch_lab_tbl.h" #include "cfe_sb.h" /* Required to use the CFE_SB_MSGID_WRAP_VALUE macro */ #ifdef HAVE_CI_LAB @@ -52,15 +52,6 @@ #include "lc_msgids.h" #endif - -/* -** Include headers for message IDs here -*/ -#include "ci_lab_msgids.h" -#include "to_lab_msgids.h" - -#include "sample_app_msgids.h" - /* ** SCH Lab schedule table ** When populating this table: @@ -70,43 +61,44 @@ ** 3. If the table grows too big, increase SCH_LAB_MAX_SCHEDULE_ENTRIES */ -SCH_LAB_ScheduleTable_t SCH_TBL_Structure = {.TickRate = 100, - .Config = { - {CFE_SB_MSGID_WRAP_VALUE(CFE_ES_SEND_HK_MID), 100, 0}, /* Example of a 1hz packet */ - {CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_SEND_HK_MID), 50, 0}, - {CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID), 98, 0}, - {CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID), 97, 0}, - {CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID), 96, 0}, +SCH_LAB_ScheduleTable_t SCH_LAB_ScheduleTable = { + .TickRate = 100, + .Config = { + {CFE_SB_MSGID_WRAP_VALUE(CFE_ES_SEND_HK_MID), 100, 0}, /* Example of a 1hz packet */ + {CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_SEND_HK_MID), 50, 0}, + {CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID), 98, 0}, + {CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID), 97, 0}, + {CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID), 96, 0}, - /* Example of including additional open source apps */ - #ifdef HAVE_CI_LAB - {CFE_SB_MSGID_WRAP_VALUE(CI_LAB_SEND_HK_MID), 95, 0}, - #endif - #ifdef HAVE_TO_LAB - {CFE_SB_MSGID_WRAP_VALUE(TO_LAB_SEND_HK_MID), 94, 0}, - #endif - #ifdef HAVE_SAMPLE_APP - {CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_SEND_HK_MID), 93, 0}, - #endif - #ifdef HAVE_SC - {CFE_SB_MSGID_WRAP_VALUE(SC_SEND_HK_MID), 92, 0}, - {CFE_SB_MSGID_WRAP_VALUE(SC_1HZ_WAKEUP_MID), 91, 0}, - #endif - #ifdef HAVE_HS - {CFE_SB_MSGID_WRAP_VALUE(HS_SEND_HK_MID), 90, 0}, /* Example of a message that wouldn't be sent */ - #endif - #ifdef HAVE_FM - {CFE_SB_MSGID_WRAP_VALUE(FM_SEND_HK_MID), 101, 0}, - #endif - #ifdef HAVE_DS - {CFE_SB_MSGID_WRAP_VALUE(DS_SEND_HK_MID), 102, 0}, - #endif - #ifdef HAVE_LC - {CFE_SB_MSGID_WRAP_VALUE(LC_SEND_HK_MID), 103, 0}, - {CFE_SB_MSGID_WRAP_VALUE(LC_SAMPLE_AP_MID), 500, 0, 8, { 0, 175, 1 }}, - #endif +/* Example of including additional open source apps */ +#ifdef HAVE_CI_LAB + {CFE_SB_MSGID_WRAP_VALUE(CI_LAB_SEND_HK_MID), 95, 0}, +#endif +#ifdef HAVE_TO_LAB + {CFE_SB_MSGID_WRAP_VALUE(TO_LAB_SEND_HK_MID), 94, 0}, +#endif +#ifdef HAVE_SAMPLE_APP + {CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_SEND_HK_MID), 93, 0}, +#endif +#ifdef HAVE_SC + {CFE_SB_MSGID_WRAP_VALUE(SC_SEND_HK_MID), 92, 0}, + {CFE_SB_MSGID_WRAP_VALUE(SC_1HZ_WAKEUP_MID), 91, 0}, +#endif +#ifdef HAVE_HS + {CFE_SB_MSGID_WRAP_VALUE(HS_SEND_HK_MID), 90, 0}, /* Example of a message that wouldn't be sent */ +#endif +#ifdef HAVE_FM + {CFE_SB_MSGID_WRAP_VALUE(FM_SEND_HK_MID), 101, 0}, +#endif +#ifdef HAVE_DS + {CFE_SB_MSGID_WRAP_VALUE(DS_SEND_HK_MID), 102, 0}, +#endif +#ifdef HAVE_LC + {CFE_SB_MSGID_WRAP_VALUE(LC_SEND_HK_MID), 103, 0}, + {CFE_SB_MSGID_WRAP_VALUE(LC_SAMPLE_AP_MID), 500, 0, 8, {0, 175, 1}}, +#endif - }}; + }}; /* ** The macro below identifies: @@ -115,4 +107,4 @@ SCH_LAB_ScheduleTable_t SCH_TBL_Structure = {.TickRate = 100, ** 3) a brief description of the contents of the file image ** 4) the desired name of the table image binary file that is cFE compatible */ -CFE_TBL_FILEDEF(SCH_TBL_Structure, SCH_LAB_APP.SCH_LAB_SchTbl, Schedule Lab MsgID Table, sch_lab_table.tbl) +CFE_TBL_FILEDEF(SCH_LAB_ScheduleTable, SCH_LAB_APP.ScheduleTable, Schedule Lab MsgID Table, sch_lab_table.tbl) diff --git a/mission_build.cmake b/mission_build.cmake new file mode 100644 index 0000000..d93c150 --- /dev/null +++ b/mission_build.cmake @@ -0,0 +1,35 @@ +########################################################### +# +# SCH_LAB mission build setup +# +# This file is evaluated as part of the "prepare" stage +# and can be used to set up prerequisites for the build, +# such as generating header files +# +########################################################### + +# The list of header files that control the SCH_LAB configuration +set(SCH_LAB_MISSION_CONFIG_FILE_LIST + sch_lab_interface_cfg.h + sch_lab_mission_cfg.h + sch_lab_perfids.h + sch_lab_tbldefs.h + sch_lab_tbl.h + sch_lab_tblstruct.h +) + +# Create wrappers around the all the config header files +# This makes them individually overridable by the missions, without modifying +# the distribution default copies +foreach(SCH_LAB_CFGFILE ${SCH_LAB_MISSION_CONFIG_FILE_LIST}) + get_filename_component(CFGKEY "${SCH_LAB_CFGFILE}" NAME_WE) + if (DEFINED SCH_LAB_CFGFILE_SRC_${CFGKEY}) + set(DEFAULT_SOURCE GENERATED_FILE "${SCH_LAB_CFGFILE_SRC_${CFGKEY}}") + else() + set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SCH_LAB_CFGFILE}") + endif() + generate_config_includefile( + FILE_NAME "${SCH_LAB_CFGFILE}" + ${DEFAULT_SOURCE} + ) +endforeach()