Skip to content

Commit

Permalink
Fix nasa#41, Moves interface definition files to inc
Browse files Browse the repository at this point in the history
  • Loading branch information
chillfig committed Dec 22, 2022
1 parent 9081653 commit 2e8578f
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 21 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
project(CFS_MD C)

include_directories(fsw/src)
include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)

set(APP_SRC_FILES
fsw/src/md_dwell_tbl.c
fsw/src/md_utils.c
Expand All @@ -15,6 +11,9 @@ set(APP_SRC_FILES
# Create the app module
add_cfe_app(md ${APP_SRC_FILES})

# This permits direct access to public headers in the fsw/inc directory
target_include_directories(md PUBLIC fsw/inc)

set(APP_TABLE_FILES
fsw/tables/md_dw02.c
fsw/tables/md_dw03.c
Expand Down
1 change: 1 addition & 0 deletions docs/dox_src/md-common.doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# Include front material followed by everything in fsw
INPUT += @md_MISSION_DIR@/docs/dox_src/cfs_md.dox
INPUT += @md_MISSION_DIR@/fsw
INPUT += @md_MISSION_DIR@/fsw/inc

IMAGE_PATH += @md_MISSION_DIR@/docs/dox_src
13 changes: 13 additions & 0 deletions fsw/src/md_events.h → fsw/inc/md_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,19 @@
*/
#define MD_CC_NOT_IN_TBL_ERR_EID 16

/**
* \brief MD Command Code Not In Command Processing Loop Event ID
*
* \par Type: ERROR
*
* \par Cause:
*
* This event is issued when a command for the Memory Dwell task is
* received with a function code which is not included in the task's
* command code processing loop.
*/
#define MD_CC_NOT_IN_LOOP_ERR_EID 17

/**
* \brief MD Dwell Table Get Status Failed Event ID
*
Expand Down
42 changes: 42 additions & 0 deletions fsw/inc/md_extern_typedefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/************************************************************************
* 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:https://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 md_extern_typedefs module
*/

#ifndef MD_EXTERN_TYPEDEFS_H
#define MD_EXTERN_TYPEDEFS_H

/************************************************************************
* Type Definitions
************************************************************************/

/**
* \brief MD enum used for representing values for enable state
*/
enum MD_Dwell_States
{
MD_DWELL_STREAM_DISABLED, /**< \brief MD Dwell Stream Disabled */
MD_DWELL_STREAM_ENABLED /**< \brief MD Dwell Stream Enabled */
};

#endif /* MD_EXTERN_TYPEDEFS_H */
1 change: 1 addition & 0 deletions fsw/src/md_msg.h → fsw/inc/md_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader; /**< Command Header */

} MD_NoArgsCmd_t;

/**
Expand Down
13 changes: 10 additions & 3 deletions fsw/src/md_msgdefs.h → fsw/inc/md_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@
* message constant definitions.
*
* @note
* DO NOT PUT ANY TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE!
* ADD THEM TO md_msg.h IF NEEDED! */
* These Macro definitions have been put in this file (instead of
* md_msg.h) so this file can be included directly into ASIST build
* test scripts. ASIST RDL files can accept C language \#defines but
* can't handle type definitions. As a result: DO NOT PUT ANY
* TYPEDEFS OR STRUCTURE DEFINITIONS IN THIS FILE!
* ADD THEM TO md_msg.h IF NEEDED!
*/
#ifndef MD_MSGDEFS_H
#define MD_MSGDEFS_H

#include "md_platform_cfg.h"

/**
* \defgroup cfsmdcmdcodes CFS Memory Dwell Command Codes
* \{
Expand Down Expand Up @@ -285,13 +292,13 @@
* \par Error Conditions
* This command may fail for the following reason(s):
* - Unexpected command length. (Event message #MD_CMD_LEN_ERR_EID is issued)
* - Signature string argument is not terminated. (Event message #MD_SIGNATURE_TOO_LONG_ERR_EID is issued)
* - Dwell Table ID is invalid. (Event message #MD_INVALID_SIGNATURE_TABLE_ERR_EID is issued)
*
* Any time the command fails, #MD_HkTlm_t.InvalidCmdCntr increments.
*
* \par Criticality
* None.
* \sa #MD_SET_SIGNATURE_CC
*/
#define MD_SET_SIGNATURE_CC 5

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions fsw/src/md_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "md_utils.h"
#include "md_perfids.h"
#include "md_version.h"
#include "md_extern_typedefs.h"

/* Constant Data */
const MD_CmdHandlerTblRec_t MD_CmdHandlerTbl[] = {
Expand Down
9 changes: 0 additions & 9 deletions fsw/src/md_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@
* Type Definitions
************************************************************************/

/**
* \brief MD enum used for representing values for enable state
*/
enum MD_Dwell_States
{
MD_DWELL_STREAM_DISABLED, /**< \brief MD Dwell Stream Disabled */
MD_DWELL_STREAM_ENABLED /**< \brief MD Dwell Stream Enabled */
};

/**
* \brief MD structure for specifying individual memory dwell
*/
Expand Down
1 change: 1 addition & 0 deletions fsw/src/md_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "md_app.h"
#include "md_events.h"
#include "md_dwell_tbl.h"
#include "md_extern_typedefs.h"

/* Global Data */
extern MD_AppData_t MD_AppData;
Expand Down
1 change: 1 addition & 0 deletions fsw/src/md_dwell_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "md_app.h"
#include "md_events.h"
#include <string.h>
#include "md_extern_typedefs.h"

extern MD_AppData_t MD_AppData;

Expand Down
1 change: 1 addition & 0 deletions fsw/src/md_dwell_tbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "md_events.h"
#include <string.h>
#include "md_tbldefs.h"
#include "md_extern_typedefs.h"

extern MD_AppData_t MD_AppData;

Expand Down
2 changes: 1 addition & 1 deletion fsw/tables/md_dw01.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*************************************************************************/
#include "cfe.h"
#include "md_tbldefs.h"
#include "md_app.h"
#include "md_extern_typedefs.h"
#include "cfe_tbl_filedef.h"
#include "md_platform_cfg.h"

Expand Down
2 changes: 1 addition & 1 deletion fsw/tables/md_dw02.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*************************************************************************/
#include "cfe.h"
#include "md_tbldefs.h"
#include "md_app.h"
#include "md_extern_typedefs.h"
#include "cfe_tbl_filedef.h"
#include "md_platform_cfg.h"

Expand Down
2 changes: 1 addition & 1 deletion fsw/tables/md_dw03.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*************************************************************************/
#include "cfe.h"
#include "md_tbldefs.h"
#include "md_app.h"
#include "md_extern_typedefs.h"
#include "cfe_tbl_filedef.h"
#include "md_platform_cfg.h"

Expand Down
2 changes: 1 addition & 1 deletion fsw/tables/md_dw04.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*************************************************************************/
#include "cfe.h"
#include "md_tbldefs.h"
#include "md_app.h"
#include "md_extern_typedefs.h"
#include "cfe_tbl_filedef.h"
#include "md_platform_cfg.h"

Expand Down
4 changes: 3 additions & 1 deletion unit-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ add_cfe_coverage_stubs(md_internal
# Link with the cfe core stubs and unit test assert libs
target_link_libraries(coverage-md_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-md_internal-stubs PUBLIC utilities)
target_include_directories(coverage-md_internal-stubs PUBLIC ../fsw/inc)
target_include_directories(coverage-md_internal-stubs PUBLIC ../fsw/src)

# Stub includes needed for all targets
include_directories(stubs)
Expand Down
1 change: 1 addition & 0 deletions unit-test/utilities/md_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "md_platform_cfg.h"
#include "utstubs.h"
#include "cfe_msgids.h"
#include "md_extern_typedefs.h"

extern MD_AppData_t MD_AppData;

Expand Down

0 comments on commit 2e8578f

Please sign in to comment.