diff --git a/arch_build.cmake b/arch_build.cmake new file mode 100644 index 0000000..a0f5517 --- /dev/null +++ b/arch_build.cmake @@ -0,0 +1,28 @@ +########################################################### +# +# HS App 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 HS configuration +set(HS_PLATFORM_CONFIG_FILE_LIST + hs_internal_cfg.h + hs_custom.h + hs_msgids.h + hs_platform_cfg.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(HS_CFGFILE ${HS_PLATFORM_CONFIG_FILE_LIST}) + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${HS_CFGFILE}") + generate_config_includefile( + FILE_NAME "${HS_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach() diff --git a/fsw/inc/hs_custom.h b/config/default_hs_custom.h similarity index 100% rename from fsw/inc/hs_custom.h rename to config/default_hs_custom.h diff --git a/fsw/inc/hs_platform_cfg.h b/config/default_hs_internal_cfg.h similarity index 82% rename from fsw/inc/hs_platform_cfg.h rename to config/default_hs_internal_cfg.h index d0d6226..0f4d754 100644 --- a/fsw/inc/hs_platform_cfg.h +++ b/config/default_hs_internal_cfg.h @@ -19,10 +19,19 @@ /** * @file - * CFS Health and Safety (HS) Application Platform Configuration Header File + * CFS Health and Safety (HS) Application Private Config Definitions + * + * This provides default values for configurable items that are internal + * to this module and do NOT affect the interface(s) of this module. Changes + * to items in this file only affect the local module and will be transparent + * to external entities that are using the public interface(s). + * + * @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 HS_PLATFORM_CFG_H -#define HS_PLATFORM_CFG_H +#ifndef HS_INTERNAL_CFG_H +#define HS_INTERNAL_CFG_H /** * \defgroup cfshsplatformcfg CFS Health and Safety Platform Configuration @@ -77,122 +86,6 @@ */ #define HS_IDLE_TASK_PRIORITY 252 -/** - * \brief Maximum reported execution counters - * - * \par Description: - * Maximum number of execution counters that can be - * specified to be reported in telemetry. - * - * \par Limits: - * This parameter can't be larger than an unsigned 32 bit - * integer (4294967295). - * - * This parameter will dictate the size of the Execution - * Counter Table (XCT): - * - * XCT Size = HS_MAX_EXEC_CNT_SLOTS * sizeof(#HS_XCTEntry_t) - * - * The total size of this table should not exceed the - * cFE size limit for a single buffered table set by the - * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter - */ -#define HS_MAX_EXEC_CNT_SLOTS 32 - -/** - * \brief Maximum message action types - * - * \par Description: - * Maximum number of Message Action action types. - * - * \par Limits: - * This parameter can't be larger than 4 less than an - * unsigned 16 bit integer (65531). - * - * This parameter must be greater than 0. - * - * This parameter will influence the size of the Message - * Action Table (MAT): - * - * MAT Size = HS_MAX_MSG_ACT_TYPES * (HS_MAX_MSG_ACT_SIZE + 4) - * - * The total size of this table should not exceed the - * cFE size limit for a single buffered table set by the - * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter - */ -#define HS_MAX_MSG_ACT_TYPES 8 - -/** - * \brief Maximum message action size (in bytes) - * - * \par Description: - * Size in bytes of maximum length of software bus message that - * can be sent using a Message Action action type. - * - * \par Limits: - * This parameter can't be larger than #CFE_MISSION_SB_MAX_SB_MSG_SIZE - * - * This parameter can't be smaller than a packet header - * - * This parameter will influence the size of the Message - * Action Table (MAT): - * - * MAT Size = HS_MAX_MSG_ACT_TYPES * (HS_MAX_MSG_ACT_SIZE + 4) - * - * The total size of this table should not exceed the - * cFE size limit for a single buffered table set by the - * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter - */ -#define HS_MAX_MSG_ACT_SIZE 16 - -/** - * \brief Maximum number of monitored applications - * - * \par Description: - * Maximum number of applications that can be - * monitored to assure check-ins - * - * \par Limits: - * This parameter can't be larger than an unsigned 32 bit - * integer (4294967295). - * - * This parameter must be greater than 0. - * - * This parameter will dictate the size of the Application - * Monitor Table (AMT): - * - * AMT Size = HS_MAX_MONITORED_APPS * sizeof(#HS_AMTEntry_t) - * - * The total size of this table should not exceed the - * cFE size limit for a single buffered table set by the - * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter - */ -#define HS_MAX_MONITORED_APPS 32 - -/** - * \brief Maximum number of monitored events - * - * \par Description: - * Maximum number of events that can be - * monitored - * - * \par Limits: - * This parameter can't be larger than an unsigned 32 bit - * integer (4294967295). - * - * This parameter must be greater than 0. - * - * This parameter will dictate the size of the Event - * Monitor Table (EMT): - * - * EMT Size = HS_MAX_MONITORED_EVENTS * sizeof(#HS_EMTEntry_t) - * - * The total size of this table should not exceed the - * cFE size limit for a single buffered table set by the - * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter - */ -#define HS_MAX_MONITORED_EVENTS 16 - /** * \brief Watchdog Timeout Value * diff --git a/config/default_hs_mission_cfg.h b/config/default_hs_mission_cfg.h new file mode 100644 index 0000000..86d72d2 --- /dev/null +++ b/config/default_hs_mission_cfg.h @@ -0,0 +1,158 @@ +/************************************************************************ + * NASA Docket No. GSC-18,920-1, and identified as “Core Flight + * System (cFS) Health & Safety (HS) Application version 2.4.1” + * + * Copyright (c) 2021 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 Health and Safety (HS) Application Public Definitions + * + * This provides default values for configurable items that affect + * the interface(s) of this module. This includes the CMD/TLM message + * interface, tables definitions, and/or the public API, if applicable. + * + * @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 HS_MISSION_CFG_H +#define HS_MISSION_CFG_H + +/** + * \defgroup cfshsplatformcfg CFS Health and Safety Platform Configuration + * \{ + */ + +/** + * \brief Maximum reported execution counters + * + * \par Description: + * Maximum number of execution counters that can be + * specified to be reported in telemetry. + * + * \par Limits: + * This parameter can't be larger than an unsigned 32 bit + * integer (4294967295). + * + * This parameter will dictate the size of the Execution + * Counter Table (XCT): + * + * XCT Size = HS_MAX_EXEC_CNT_SLOTS * sizeof(#HS_XCTEntry_t) + * + * The total size of this table should not exceed the + * cFE size limit for a single buffered table set by the + * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter + */ +#define HS_MAX_EXEC_CNT_SLOTS 32 + +/** + * \brief Maximum message action types + * + * \par Description: + * Maximum number of Message Action action types. + * + * \par Limits: + * This parameter can't be larger than 4 less than an + * unsigned 16 bit integer (65531). + * + * This parameter must be greater than 0. + * + * This parameter will influence the size of the Message + * Action Table (MAT): + * + * MAT Size = HS_MAX_MSG_ACT_TYPES * (HS_MAX_MSG_ACT_SIZE + 4) + * + * The total size of this table should not exceed the + * cFE size limit for a single buffered table set by the + * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter + */ +#define HS_MAX_MSG_ACT_TYPES 8 + +/** + * \brief Maximum message action size (in bytes) + * + * \par Description: + * Size in bytes of maximum length of software bus message that + * can be sent using a Message Action action type. + * + * \par Limits: + * This parameter can't be larger than #CFE_MISSION_SB_MAX_SB_MSG_SIZE + * + * This parameter can't be smaller than a packet header + * + * This parameter will influence the size of the Message + * Action Table (MAT): + * + * MAT Size = HS_MAX_MSG_ACT_TYPES * (HS_MAX_MSG_ACT_SIZE + 4) + * + * The total size of this table should not exceed the + * cFE size limit for a single buffered table set by the + * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter + */ +#define HS_MAX_MSG_ACT_SIZE 16 + +/** + * \brief Maximum number of monitored applications + * + * \par Description: + * Maximum number of applications that can be + * monitored to assure check-ins + * + * \par Limits: + * This parameter can't be larger than an unsigned 32 bit + * integer (4294967295). + * + * This parameter must be greater than 0. + * + * This parameter will dictate the size of the Application + * Monitor Table (AMT): + * + * AMT Size = HS_MAX_MONITORED_APPS * sizeof(#HS_AMTEntry_t) + * + * The total size of this table should not exceed the + * cFE size limit for a single buffered table set by the + * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter + */ +#define HS_MAX_MONITORED_APPS 32 + +/** + * \brief Maximum number of monitored events + * + * \par Description: + * Maximum number of events that can be + * monitored + * + * \par Limits: + * This parameter can't be larger than an unsigned 32 bit + * integer (4294967295). + * + * This parameter must be greater than 0. + * + * This parameter will dictate the size of the Event + * Monitor Table (EMT): + * + * EMT Size = HS_MAX_MONITORED_EVENTS * sizeof(#HS_EMTEntry_t) + * + * The total size of this table should not exceed the + * cFE size limit for a single buffered table set by the + * #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter + */ +#define HS_MAX_MONITORED_EVENTS 16 + +/**\}*/ + +#endif diff --git a/config/default_hs_msg.h b/config/default_hs_msg.h new file mode 100644 index 0000000..7f227bc --- /dev/null +++ b/config/default_hs_msg.h @@ -0,0 +1,38 @@ +/************************************************************************ + * NASA Docket No. GSC-18,920-1, and identified as “Core Flight + * System (cFS) Health & Safety (HS) Application version 2.4.1” + * + * Copyright (c) 2021 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 Health and Safety (HS) command and telemetry + * message data types. + * + * This is a compatibility header for the "hs_msg.h" file that has + * traditionally provided the message definitions for cFS apps. + * + * @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 HK_MSG_H +#define HK_MSG_H + +#include "hs_msgdefs.h" +#include "hs_msg_structs.h" + +#endif diff --git a/fsw/inc/hs_msg.h b/config/default_hs_msg_structs.h similarity index 98% rename from fsw/inc/hs_msg.h rename to config/default_hs_msg_structs.h index d557c66..25fadf0 100644 --- a/fsw/inc/hs_msg.h +++ b/config/default_hs_msg_structs.h @@ -26,15 +26,15 @@ * Constants and enumerated types related to these message structures * are defined in hs_msgdefs.h. */ -#ifndef HS_MSG_H -#define HS_MSG_H +#ifndef HS_MSG_STRUCTS_H +#define HS_MSG_STRUCTS_H /************************************************************************ * Includes ************************************************************************/ -#include -#include -#include +#include "hs_msgdefs.h" +#include "hs_mission_cfg.h" +#include "cfe_msg_hdr.h" /************************************************************************ * Macro Definitions diff --git a/fsw/inc/hs_msgdefs.h b/config/default_hs_msgdefs.h similarity index 96% rename from fsw/inc/hs_msgdefs.h rename to config/default_hs_msgdefs.h index 969e602..2153837 100644 --- a/fsw/inc/hs_msgdefs.h +++ b/config/default_hs_msgdefs.h @@ -35,32 +35,6 @@ * Macro Definitions ************************************************************************/ -/** - * \name HS Switch States (AppMon, EventMon, Aliveness) - * \{ - */ -#define HS_STATE_DISABLED 0 -#define HS_STATE_ENABLED 1 -/**\}*/ - -/** - * \name HS Internal Status Flags - * \{ - */ -#define HS_LOADED_XCT 0x01 -#define HS_LOADED_MAT 0x02 -#define HS_LOADED_AMT 0x04 -#define HS_LOADED_EMT 0x08 -#define HS_CDS_IN_USE 0x10 -/**\}*/ - -/** - * \name HS Invalid Execution Counter - * \{ - */ -#define HS_INVALID_EXECOUNT 0xFFFFFFFF -/**\}*/ - /** * \defgroup cfshscmdcodes CFS Health and Safety Command Codes * \{ diff --git a/fsw/inc/hs_msgids.h b/config/default_hs_msgids.h similarity index 100% rename from fsw/inc/hs_msgids.h rename to config/default_hs_msgids.h diff --git a/config/default_hs_platform_cfg.h b/config/default_hs_platform_cfg.h new file mode 100644 index 0000000..c346b58 --- /dev/null +++ b/config/default_hs_platform_cfg.h @@ -0,0 +1,42 @@ +/************************************************************************ + * NASA Docket No. GSC-18,920-1, and identified as “Core Flight + * System (cFS) Health & Safety (HS) Application version 2.4.1” + * + * Copyright (c) 2021 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 Health and Safety (HS) Application Platform Configuration Header File + * + * This is a compatibility header for the "platform_cfg.h" file that has + * traditionally provided both public and private config definitions + * for each CFS app. + * + * These definitions are now provided in two separate files, one for + * the public/mission scope and one for internal scope. + * + * @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 HS_PLATFORM_CFG_H +#define HS_PLATFORM_CFG_H + +#include "hs_mission_cfg.h" +#include "hs_internal_cfg.h" + +#endif diff --git a/config/default_hs_table_structs.h b/config/default_hs_table_structs.h new file mode 100644 index 0000000..e23b4b2 --- /dev/null +++ b/config/default_hs_table_structs.h @@ -0,0 +1,114 @@ +/************************************************************************ + * NASA Docket No. GSC-18,920-1, and identified as “Core Flight + * System (cFS) Health & Safety (HS) Application version 2.4.1” + * + * Copyright (c) 2021 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 Health and Safety (HS) table structures + * + * Provides default definitions for HK 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 HS_TABLE_STRUCTS_H +#define HS_TABLE_STRUCTS_H + +/************************************************************************* + * Includes + *************************************************************************/ +#include "hs_tbldefs.h" +#include "hs_mission_cfg.h" +#include "cfe_mission_cfg.h" +#include "cfe_sb_api_typedefs.h" + +/************************************************************************ + * Macro Definitions + ************************************************************************/ + +/** + * \name Macros for Action Type numbers of Message Actions + * \{ + */ +#define HS_AMT_ACT_MSG(num) (HS_AMT_ACT_LAST_NONMSG + 1 + (num)) +#define HS_EMT_ACT_MSG(num) (HS_EMT_ACT_LAST_NONMSG + 1 + (num)) +/**\}*/ + +/************************************************************************* + * Type Definitions + *************************************************************************/ + +/* +** In the following definitions, NullTerm may have a differing size for alignment purposes +** specifically it must be 32 bits in the XCT to align Resource Type, while it can be 16 bits +** in the other two. +*/ + +/** + * \brief Application Monitor Table (AMT) Entry + */ +typedef struct +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Name of application to be monitored */ + uint16 NullTerm; /**< \brief Buffer of nulls to terminate string */ + uint16 CycleCount; /**< \brief Number of cycles before application is missing */ + uint16 ActionType; /**< \brief Action to take if application is missing */ +} HS_AMTEntry_t; + +/** + * \brief Event Monitor Table (EMT) Entry + */ +typedef struct +{ + char AppName[CFE_MISSION_MAX_API_LEN]; /**< \brief Name of application generating event */ + uint16 NullTerm; /**< \brief Buffer of nulls to terminate string */ + uint16 EventID; /**< \brief Event number of monitored event */ + uint16 ActionType; /**< \brief Action to take if event is received */ +} HS_EMTEntry_t; + +/** + * \brief Execution Counters Table (XCT) Entry + */ +typedef struct +{ + char ResourceName[CFE_MISSION_MAX_API_LEN]; /**< \brief Name of resource being monitored */ + uint32 NullTerm; /**< \brief Buffer of nulls to terminate string */ + uint32 ResourceType; /**< \brief Type of execution counter */ +} HS_XCTEntry_t; + +/** + * \brief Message Action Table buffer + */ +typedef union +{ + uint8 Message[HS_MAX_MSG_ACT_SIZE]; /**< \brief Raw message array for sizing */ + CFE_SB_Buffer_t Buffer; /**< \brief Message Buffer for alignment */ +} HS_MATMsgBuf_t; + +/** + * \brief Message Actions Table (MAT) Entry + */ +typedef struct +{ + uint16 EnableState; /**< \brief If entry contains message */ + uint16 Cooldown; /**< \brief Minimum rate at which message can be sent */ + HS_MATMsgBuf_t MsgBuf; /**< \brief Message to be sent */ +} HS_MATEntry_t; + +#endif diff --git a/fsw/inc/hs_tbl.h b/config/default_hs_tbl.h similarity index 66% rename from fsw/inc/hs_tbl.h rename to config/default_hs_tbl.h index b79ff0f..a6ae682 100644 --- a/fsw/inc/hs_tbl.h +++ b/config/default_hs_tbl.h @@ -28,23 +28,7 @@ #ifndef HS_TBL_H #define HS_TBL_H -/************************************************************************* - * Includes - *************************************************************************/ -#include -#include -#include - -/************************************************************************ - * Macro Definitions - ************************************************************************/ - -/** - * \name Macros for Action Type numbers of Message Actions - * \{ - */ -#define HS_AMT_ACT_MSG(num) (HS_AMT_ACT_LAST_NONMSG + 1 + (num)) -#define HS_EMT_ACT_MSG(num) (HS_EMT_ACT_LAST_NONMSG + 1 + (num)) -/**\}*/ +#include "hs_mission_cfg.h" +#include "hs_table_structs.h" #endif diff --git a/fsw/inc/hs_tbldefs.h b/config/default_hs_tbldefs.h similarity index 90% rename from fsw/inc/hs_tbldefs.h rename to config/default_hs_tbldefs.h index f62a258..889c654 100644 --- a/fsw/inc/hs_tbldefs.h +++ b/config/default_hs_tbldefs.h @@ -35,6 +35,34 @@ * Macro Definitions ************************************************************************/ +/* TODO: These flags may not really belong here, but this gets things working */ + +/** + * \name HS Switch States (AppMon, EventMon, Aliveness) + * \{ + */ +#define HS_STATE_DISABLED 0 +#define HS_STATE_ENABLED 1 +/**\}*/ + +/** + * \name HS Invalid Execution Counter + * \{ + */ +#define HS_INVALID_EXECOUNT 0xFFFFFFFF +/**\}*/ + +/** + * \name HS Internal Status Flags + * \{ + */ +#define HS_LOADED_XCT 0x01 +#define HS_LOADED_MAT 0x02 +#define HS_LOADED_AMT 0x04 +#define HS_LOADED_EMT 0x08 +#define HS_CDS_IN_USE 0x10 +/**\}*/ + /** * \name HS Table Name Strings * \{ diff --git a/fsw/inc/hs_extern_typedefs.h b/fsw/inc/hs_extern_typedefs.h deleted file mode 100644 index c4de3ea..0000000 --- a/fsw/inc/hs_extern_typedefs.h +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************ - * NASA Docket No. GSC-18,447-1, and identified as “CFS CFDP (CF) - * Application version 3.0.0” - * - * Copyright (c) 2019 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 - * - * Declarations and prototypes for fm_extern_typedefs module - */ - -#ifndef HS_EXTERN_TYPEDEFS_H -#define HS_EXTERN_TYPEDEFS_H - -#include -#include - -/************************************************************************* - * Type Definitions - *************************************************************************/ - -/* -** In the following definitions, NullTerm may have a differing size for alignment purposes -** specifically it must be 32 bits in the XCT to align Resource Type, while it can be 16 bits -** in the other two. -*/ - -/** - * \brief Application Monitor Table (AMT) Entry - */ -typedef struct -{ - char AppName[OS_MAX_API_NAME]; /**< \brief Name of application to be monitored */ - uint16 NullTerm; /**< \brief Buffer of nulls to terminate string */ - uint16 CycleCount; /**< \brief Number of cycles before application is missing */ - uint16 ActionType; /**< \brief Action to take if application is missing */ -} HS_AMTEntry_t; - -/** - * \brief Event Monitor Table (EMT) Entry - */ -typedef struct -{ - char AppName[OS_MAX_API_NAME]; /**< \brief Name of application generating event */ - uint16 NullTerm; /**< \brief Buffer of nulls to terminate string */ - uint16 EventID; /**< \brief Event number of monitored event */ - uint16 ActionType; /**< \brief Action to take if event is received */ -} HS_EMTEntry_t; - -/** - * \brief Execution Counters Table (XCT) Entry - */ -typedef struct -{ - char ResourceName[OS_MAX_API_NAME]; /**< \brief Name of resource being monitored */ - uint32 NullTerm; /**< \brief Buffer of nulls to terminate string */ - uint32 ResourceType; /**< \brief Type of execution counter */ -} HS_XCTEntry_t; - -/** - * \brief Message Action Table buffer - */ -typedef union -{ - uint8 Message[HS_MAX_MSG_ACT_SIZE]; /**< \brief Raw message array for sizing */ - CFE_SB_Buffer_t Buffer; /**< \brief Message Buffer for alignment */ -} HS_MATMsgBuf_t; - -/** - * \brief Message Actions Table (MAT) Entry - */ -typedef struct -{ - uint16 EnableState; /**< \brief If entry contains message */ - uint16 Cooldown; /**< \brief Minimum rate at which message can be sent */ - HS_MATMsgBuf_t MsgBuf; /**< \brief Message to be sent */ -} HS_MATEntry_t; - -#endif /* HS_EXTERN_TYPEDEFS_H */ diff --git a/fsw/src/hs_app.h b/fsw/src/hs_app.h index 050ff05..86a5bce 100644 --- a/fsw/src/hs_app.h +++ b/fsw/src/hs_app.h @@ -29,10 +29,11 @@ * Includes ************************************************************************/ #include "hs_msg.h" +#include "hs_tbldefs.h" #include "hs_tbl.h" +#include "hs_platform_cfg.h" #include "cfe.h" #include "cfe_msgids.h" -#include "hs_extern_typedefs.h" /************************************************************************ * Macro Definitions diff --git a/fsw/tables/hs_amt.c b/fsw/tables/hs_amt.c index 4b0d732..731339c 100644 --- a/fsw/tables/hs_amt.c +++ b/fsw/tables/hs_amt.c @@ -26,7 +26,8 @@ ** Includes *************************************************************************/ #include "cfe.h" -#include "hs_extern_typedefs.h" +#include "hs_platform_cfg.h" +#include "hs_tbl.h" #include "hs_tbldefs.h" #include "cfe_tbl_filedef.h" diff --git a/fsw/tables/hs_emt.c b/fsw/tables/hs_emt.c index 5f09d96..006739a 100644 --- a/fsw/tables/hs_emt.c +++ b/fsw/tables/hs_emt.c @@ -26,7 +26,8 @@ ** Includes *************************************************************************/ #include "cfe.h" -#include "hs_extern_typedefs.h" +#include "hs_platform_cfg.h" +#include "hs_tbl.h" #include "hs_tbldefs.h" #include "cfe_tbl_filedef.h" diff --git a/fsw/tables/hs_mat.c b/fsw/tables/hs_mat.c index e418e01..b5ade8d 100644 --- a/fsw/tables/hs_mat.c +++ b/fsw/tables/hs_mat.c @@ -26,7 +26,8 @@ ** Includes *************************************************************************/ #include "cfe.h" -#include "hs_extern_typedefs.h" +#include "hs_platform_cfg.h" +#include "hs_tbl.h" #include "hs_tbldefs.h" #include "cfe_tbl_filedef.h" diff --git a/fsw/tables/hs_xct.c b/fsw/tables/hs_xct.c index 600b306..c46fc11 100644 --- a/fsw/tables/hs_xct.c +++ b/fsw/tables/hs_xct.c @@ -26,7 +26,8 @@ ** Includes *************************************************************************/ #include "cfe.h" -#include "hs_extern_typedefs.h" +#include "hs_platform_cfg.h" +#include "hs_tbl.h" #include "hs_tbldefs.h" #include "cfe_tbl_filedef.h" diff --git a/mission_build.cmake b/mission_build.cmake index 4e930b1..43d7a8a 100644 --- a/mission_build.cmake +++ b/mission_build.cmake @@ -1,4 +1,34 @@ -# App specific mission scope configuration +########################################################### +# +# HS App 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 +# +########################################################### # Add stand alone documentation add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/docs/dox_src ${MISSION_BINARY_DIR}/docs/hs-usersguide) + +# The list of header files that control the HS configuration +set(HS_MISSION_CONFIG_FILE_LIST + hs_mission_cfg.h + hs_msgdefs.h + hs_msg.h + hs_msg_structs.h + hs_table_structs.h + hs_tbldefs.h + hs_tbl.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(HS_CFGFILE ${HS_MISSION_CONFIG_FILE_LIST}) + set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${HS_CFGFILE}") + generate_config_includefile( + FILE_NAME "${HS_CFGFILE}" + FALLBACK_FILE ${DEFAULT_SOURCE} + ) +endforeach()