Skip to content

Commit

Permalink
Fix nasa#50, Separate config files
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Oct 26, 2023
1 parent 22a36f1 commit cb7fdaa
Show file tree
Hide file tree
Showing 28 changed files with 352 additions and 51 deletions.
27 changes: 27 additions & 0 deletions arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###########################################################
#
# HK 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 app configuration
set(HK_PLATFORM_CONFIG_FILE_LIST
hk_internal_cfg.h
hk_msgids.h
hk_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(HK_CFGFILE ${HK_PLATFORM_CONFIG_FILE_LIST})
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${HK_CFGFILE}")
generate_config_includefile(
FILE_NAME "${HK_CFGFILE}"
FALLBACK_FILE "${DEFAULT_SOURCE}"
)
endforeach()
13 changes: 8 additions & 5 deletions fsw/inc/hk_msgdefs.h → config/default_hk_fcncodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

/**
* @file
* The CFS Housekeeping (HK) Application header file
* Specification for the CFS Housekeeping (HK) command function codes
*
* @note
* This file should be strictly limited to the command/function code (CC)
* macro definitions. Other definitions such as enums, typedefs, or other
* macros should be placed in the hk_msgdefs.h or hk_msg.h files.
*/
#ifndef HK_MSGDEFS_H
#define HK_MSGDEFS_H

#include <cfe.h>
#ifndef HK_FCNCODES_H
#define HK_FCNCODES_H

/**
* \defgroup cfshkcmdcodes CFS Housekeeping Command Codes
Expand Down
38 changes: 38 additions & 0 deletions config/default_hk_interface_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/************************************************************************
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.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 Housekeeping (HK) 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 any other data products that
* serve to exchange information with other entities.
*
* @note This file may be overridden/superseded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef HK_INTERFACE_CFG_H
#define HK_INTERFACE_CFG_H

/* Place definitions for configurable items that affect the public interface here. */

#endif
15 changes: 12 additions & 3 deletions fsw/inc/hk_platform_cfg.h → config/default_hk_internal_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,19 @@

/**
* @file
* The CFS Housekeeping (HK) Application platform configuration header file
* CFS Housekeeping (HK) 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/superseded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef HK_PLATFORM_CFG_H
#define HK_PLATFORM_CFG_H
#ifndef HK_INTERNAL_CFG_H
#define HK_INTERNAL_CFG_H

/**
* \defgroup cfshkplatformcfg CFS Housekeeping Platform Configuration
Expand Down
37 changes: 37 additions & 0 deletions config/default_hk_mission_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/************************************************************************
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.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 Housekeeping (HK) 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/superseded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef HK_MISSION_CFG_H
#define HK_MISSION_CFG_H

#include "hk_interface_cfg.h"

#endif
39 changes: 39 additions & 0 deletions config/default_hk_msg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/************************************************************************
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.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 Housekeeping (HK) command and telemetry
* message data types.
*
* This is a compatibility header for the "hk_msg.h" file that has
* traditionally provided the message definitions for cFS apps.
*
* @note This file may be overridden/superseded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef HK_MSG_H
#define HK_MSG_H

#include "hk_interface_cfg.h"
#include "hk_msgdefs.h"
#include "hk_msgstruct.h"

#endif
32 changes: 32 additions & 0 deletions config/default_hk_msgdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/************************************************************************
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.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 Housekeeping (HK) command and telemetry
* message constant definitions (currently just includes the
* function/command codes).
*/

#ifndef HK_MSGDEFS_H
#define HK_MSGDEFS_H

#include "hk_fcncodes.h"

#endif
File renamed without changes.
9 changes: 5 additions & 4 deletions fsw/inc/hk_msg.h → config/default_hk_msgstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@

/**
* @file
* The CFS Housekeeping (HK) Application header file
* Specification for the CFS Housekeeping (HK) command and telemetry
* message data types.
*/
#ifndef HK_MSG_H
#define HK_MSG_H
#ifndef HK_MSGSTRUCT_H
#define HK_MSGSTRUCT_H

#include <cfe.h>
#include "cfe.h"

/**
* \defgroup cfshkcmdstructs CFS Housekeeping Command Structures
Expand Down
42 changes: 42 additions & 0 deletions config/default_hk_platform_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/************************************************************************
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.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 Housekeeping (HK) 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/superseded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/

#ifndef HK_PLATFORM_CFG_H
#define HK_PLATFORM_CFG_H

#include "hk_mission_cfg.h"
#include "hk_internal_cfg.h"

#endif
34 changes: 34 additions & 0 deletions config/default_hk_tbl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/************************************************************************
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.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 Housekeeping (HK) table related data
* structures
*
*/

#ifndef HK_TBL_H
#define HK_TBL_H

#include "hk_interface_cfg.h"
#include "hk_tbldefs.h"
#include "hk_tblstruct.h"

#endif
18 changes: 9 additions & 9 deletions fsw/inc/hk_extern_typedefs.h → config/default_hk_tbldefs.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/************************************************************************
* NASA Docket No. GSC-18,447-1, and identified as “CFS CFDP (CF)
* Application version 3.0.0
* NASA Docket No. GSC-18,919-1, and identified as “Core Flight
* System (cFS) Housekeeping (HK) Application version 2.5.1
*
* Copyright (c) 2019 United States Government as represented by the
* Copyright (c) 2021 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -19,12 +19,12 @@

/**
* @file
*
* Declarations and prototypes for hk_extern_typedefs module
* Specification for the CFS Housekeeping (HK) table related
* constant definitions.
*/

#ifndef HK_EXTERN_TYPEDEFS_H
#define HK_EXTERN_TYPEDEFS_H
#ifndef HK_TBLDEFS_H
#define HK_TBLDEFS_H

/**
* \brief Maximum Number of HK Copy Table Entries
Expand All @@ -33,8 +33,8 @@
* Dictates the number of elements in the hk copy table.
*
* \par Limits
* The maximum size of this paramater is 8192
* The maximum size of this parameter is 8192
*/
#define HK_COPY_TABLE_ENTRIES 128

#endif /* HK_EXTERN_TYPEDEFS_H */
#endif
21 changes: 11 additions & 10 deletions fsw/inc/hk_tbldefs.h → config/default_hk_tblstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@

/**
* @file
* The CFS Housekeeping (HK) Application header file
*
* CFS Housekeeping (HK) Application Table Structure Definition
*
* Provides default definitions for HK table structures
*
* @note This file may be overridden/superseded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef HK_TBLDEFS_H
#define HK_TBLDEFS_H

/************************************************************************
** Includes
*************************************************************************/
#include <cfe.h>
#ifndef HK_TBLSTRUCT_H
#define HK_TBLSTRUCT_H

/*************************************************************************
** Type definitions
**************************************************************************/
#include "cfe.h"

/** \brief HK Copy Table Entry Format
*/
Expand Down
1 change: 1 addition & 0 deletions docs/dox_src/hk-common.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
# Include front material followed by everything in fsw
INPUT += @hk_MISSION_DIR@/docs/dox_src/cfs_hk.dox
INPUT += @hk_MISSION_DIR@/fsw
INPUT += @hk_MISSION_DIR@/config
File renamed without changes.
Loading

0 comments on commit cb7fdaa

Please sign in to comment.