Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #84, split configuration #87

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions arch_build.cmake
Original file line number Diff line number Diff line change
@@ -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}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider consolidating the target_defs search patterns.
Tables has: https://github.com/nasa/cFE/blob/7af467efdc15f788d44d67cb807403b10c4f0c99/cmake/arch_build.cmake#L187-L201.
Then there's the file list:
https://github.com/nasa/cFE/blob/7af467efdc15f788d44d67cb807403b10c4f0c99/cmake/arch_build.cmake#L703-L712
Maybe there's more? Would be nice if the search logic was intuitive, consistent, and well documented.

generate_config_includefile(
FILE_NAME "${HS_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
)
endforeach()
File renamed without changes.
131 changes: 12 additions & 119 deletions fsw/inc/hs_platform_cfg.h → config/default_hs_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down
158 changes: 158 additions & 0 deletions config/default_hs_mission_cfg.h
Original file line number Diff line number Diff line change
@@ -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
38 changes: 38 additions & 0 deletions config/default_hs_msg.h
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions fsw/inc/hs_msg.h → config/default_hs_msg_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hs_msgdefs.h>
#include <hs_platform_cfg.h>
#include <cfe.h>
#include "hs_msgdefs.h"
#include "hs_mission_cfg.h"
#include "cfe_msg_hdr.h"

/************************************************************************
* Macro Definitions
Expand Down
Loading