From 762cbeb95d18f7acf908260e59bd25aeb313031d Mon Sep 17 00:00:00 2001 From: Justin Figueroa Date: Tue, 6 Dec 2022 11:19:52 -0500 Subject: [PATCH] Fix #32, Moves interface definition files to inc --- CMakeLists.txt | 7 ++-- fsw/{src => inc}/hk_events.h | 0 fsw/inc/hk_extern_typedefs.h | 40 +++++++++++++++++++++ fsw/{src => inc}/hk_msg.h | 0 fsw/{src => inc}/hk_msgdefs.h | 0 fsw/{platform_inc => inc}/hk_msgids.h | 0 fsw/{mission_inc => inc}/hk_perfids.h | 0 fsw/{platform_inc => inc}/hk_platform_cfg.h | 11 ------ fsw/{src => inc}/hk_tbldefs.h | 0 fsw/src/hk_app.h | 1 + fsw/tables/hk_cpy_tbl.c | 3 +- unit-test/CMakeLists.txt | 4 ++- 12 files changed, 48 insertions(+), 18 deletions(-) rename fsw/{src => inc}/hk_events.h (100%) create mode 100644 fsw/inc/hk_extern_typedefs.h rename fsw/{src => inc}/hk_msg.h (100%) rename fsw/{src => inc}/hk_msgdefs.h (100%) rename fsw/{platform_inc => inc}/hk_msgids.h (100%) rename fsw/{mission_inc => inc}/hk_perfids.h (100%) rename fsw/{platform_inc => inc}/hk_platform_cfg.h (93%) rename fsw/{src => inc}/hk_tbldefs.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0341ff6..f01c22f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,5 @@ project(CFS_HK C) -include_directories(fsw/src) -include_directories(fsw/mission_inc) -include_directories(fsw/platform_inc) - set(APP_SRC_FILES fsw/src/hk_app.c fsw/src/hk_utils.c @@ -12,6 +8,9 @@ set(APP_SRC_FILES # Create the app module add_cfe_app(hk ${APP_SRC_FILES}) +# This permits direct access to public headers in the fsw/inc directory +target_include_directories(hk PUBLIC fsw/inc) + set(APP_TABLE_FILES fsw/tables/hk_cpy_tbl.c ) diff --git a/fsw/src/hk_events.h b/fsw/inc/hk_events.h similarity index 100% rename from fsw/src/hk_events.h rename to fsw/inc/hk_events.h diff --git a/fsw/inc/hk_extern_typedefs.h b/fsw/inc/hk_extern_typedefs.h new file mode 100644 index 0000000..7ada491 --- /dev/null +++ b/fsw/inc/hk_extern_typedefs.h @@ -0,0 +1,40 @@ +/************************************************************************ + * 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 hk_extern_typedefs module + */ + +#ifndef HK_EXTERN_TYPEDEFS_H +#define HK_EXTERN_TYPEDEFS_H + +/** + * \brief Maximum Number of HK Copy Table Entries + * + * \par Description: + * Dictates the number of elements in the hk copy table. + * + * \par Limits + * The maximum size of this paramater is 8192 + */ +#define HK_COPY_TABLE_ENTRIES 128 + +#endif /* HK_EXTERN_TYPEDEFS_H */ \ No newline at end of file diff --git a/fsw/src/hk_msg.h b/fsw/inc/hk_msg.h similarity index 100% rename from fsw/src/hk_msg.h rename to fsw/inc/hk_msg.h diff --git a/fsw/src/hk_msgdefs.h b/fsw/inc/hk_msgdefs.h similarity index 100% rename from fsw/src/hk_msgdefs.h rename to fsw/inc/hk_msgdefs.h diff --git a/fsw/platform_inc/hk_msgids.h b/fsw/inc/hk_msgids.h similarity index 100% rename from fsw/platform_inc/hk_msgids.h rename to fsw/inc/hk_msgids.h diff --git a/fsw/mission_inc/hk_perfids.h b/fsw/inc/hk_perfids.h similarity index 100% rename from fsw/mission_inc/hk_perfids.h rename to fsw/inc/hk_perfids.h diff --git a/fsw/platform_inc/hk_platform_cfg.h b/fsw/inc/hk_platform_cfg.h similarity index 93% rename from fsw/platform_inc/hk_platform_cfg.h rename to fsw/inc/hk_platform_cfg.h index f3042ff..3b8d162 100644 --- a/fsw/platform_inc/hk_platform_cfg.h +++ b/fsw/inc/hk_platform_cfg.h @@ -55,17 +55,6 @@ */ #define HK_DISCARD_INCOMPLETE_COMBO 0 -/** - * \brief Maximum Number of HK Copy Table Entries - * - * \par Description: - * Dictates the number of elements in the hk copy table. - * - * \par Limits - * The maximum size of this paramater is 8192 - */ -#define HK_COPY_TABLE_ENTRIES 128 - /** * \brief Number of bytes in the HK Memory Pool * diff --git a/fsw/src/hk_tbldefs.h b/fsw/inc/hk_tbldefs.h similarity index 100% rename from fsw/src/hk_tbldefs.h rename to fsw/inc/hk_tbldefs.h diff --git a/fsw/src/hk_app.h b/fsw/src/hk_app.h index b55f6c6..0ad95cf 100644 --- a/fsw/src/hk_app.h +++ b/fsw/src/hk_app.h @@ -33,6 +33,7 @@ #include "hk_msg.h" #include "hk_utils.h" #include "hk_platform_cfg.h" +#include "hk_extern_typedefs.h" /************************************************************************* * Macro definitions diff --git a/fsw/tables/hk_cpy_tbl.c b/fsw/tables/hk_cpy_tbl.c index 0b8bf9f..fc7f38a 100644 --- a/fsw/tables/hk_cpy_tbl.c +++ b/fsw/tables/hk_cpy_tbl.c @@ -27,8 +27,7 @@ *************************************************************************/ #include "cfe.h" #include "cfe_msgids.h" -#include "hk_utils.h" -#include "hk_app.h" +#include "hk_extern_typedefs.h" #include "hk_msgids.h" #include "hk_tbldefs.h" #include "cfe_tbl_filedef.h" diff --git a/unit-test/CMakeLists.txt b/unit-test/CMakeLists.txt index 66ef92c..3d31c10 100644 --- a/unit-test/CMakeLists.txt +++ b/unit-test/CMakeLists.txt @@ -16,8 +16,10 @@ add_cfe_coverage_stubs("hk_internal" # Link with the cfe core stubs and unit test assert libs target_link_libraries(coverage-hk_internal-stubs ut_core_api_stubs ut_assert) -# Include and expose unit test utilities includes +# Include and expose unit test utilities, fsw/inc, and fsw/src includes target_include_directories(coverage-hk_internal-stubs PUBLIC utilities) +target_include_directories(coverage-hk_internal-stubs PUBLIC ../fsw/inc) +target_include_directories(coverage-hk_internal-stubs PUBLIC ../fsw/src) # Generate a dedicated "testrunner" executable for each test file # Accomplish this by cycling through all the app's source files, there must be