Skip to content

Commit

Permalink
Seed from sample_lib 1.0.0.0 code base
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Hageman committed May 16, 2019
1 parent 813b4c2 commit c65725c
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.6.4)
project(CFE_SAMPLE_LIB C)

include_directories(fsw/public_inc)

# The shared OSAL and cFE include directories should always be used
# Note that this intentionally does NOT include PSP-specific includes, just the generic
include_directories(${CFECORE_SOURCE_DIR}/src/inc)
include_directories(${CFEPSP_SOURCE_DIR}/fsw/inc)

aux_source_directory(fsw/src LIB_SRC_FILES)

# Create the app module
add_cfe_app(sample_lib ${LIB_SRC_FILES})

Binary file added LICENSE-18128-Apache-2_0.pdf
Binary file not shown.
112 changes: 112 additions & 0 deletions fsw/for_build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
###############################################################################
# File: CFS Application Makefile
#
# $Id: Makefile 1.6 2009/07/09 11:41:26EDT rmcgraw Exp $
#
# $Log: Makefile $
# Revision 1.6 2009/07/09 11:41:26EDT rmcgraw
# DCR8291:1 Changed CFE_MISSION_INC to CFS_MISSION_INC and added log if needed
#
###############################################################################
#
# Subsystem produced by this makefile.
#
APPTARGET = sample_lib

#
# Entry Point for task
#
ENTRY_PT = SAMPLE_LibInit

#
# Object files required to build subsystem.
#
OBJS = sample_lib.o

#
# Source files required to build subsystem; used to generate dependencies.
# As long as there are no assembly files this can be automated.
#
SOURCES = $(OBJS:.o=.c)


##
## Specify extra C Flags needed to build this subsystem
##
LOCAL_COPTS =


##
## EXEDIR is defined here, just in case it needs to be different for a custom
## build
##
EXEDIR=../exe

##
## Certain OSs and Application Loaders require the following option for
## Shared libraries. Currently only needed for vxWorks 5.5 and RTEMS.
## For each shared library that this app depends on, you need to have an
## entry like the following:
## -R../tst_lib/tst_lib.elf
##
SHARED_LIB_LINK =

########################################################################
# Should not have to change below this line, except for customized
# Mission and cFE directory structures
########################################################################

#
# Set build type to CFE_APP. This allows us to
# define different compiler flags for the cFE Core and Apps.
#
BUILD_TYPE = CFE_APP

##
## Include all necessary cFE make rules
## Any of these can be copied to a local file and
## changed if needed.
##
##
## cfe-config.mak contains PSP and OS selection
##
include ../cfe/cfe-config.mak
##
## debug-opts.mak contains debug switches
##
include ../cfe/debug-opts.mak
##
## compiler-opts.mak contains compiler definitions and switches/defines
##
include $(CFE_PSP_SRC)/$(PSP)/make/compiler-opts.mak

##
## Setup the include path for this subsystem
## The OS specific includes are in the build-rules.make file
##
## If this subsystem needs include files from another app, add the path here.
##
INCLUDE_PATH = \
-I$(OSAL_SRC)/inc \
-I$(CFE_CORE_SRC)/inc \
-I$(CFE_PSP_SRC)/inc \
-I$(CFE_PSP_SRC)/$(PSP)/inc \
-I$(CFS_APP_SRC)/inc \
-I$(CFS_APP_SRC)/$(APPTARGET)/fsw/src \
-I$(CFS_MISSION_INC) \
-I../cfe/inc \
-I../inc

##
## Define the VPATH make variable.
## This can be modified to include source from another directory.
## If there is no corresponding app in the cfs-apps directory, then this can be discarded, or
## if the mission chooses to put the src in another directory such as "src", then that can be
## added here as well.
##
VPATH = $(CFS_APP_SRC)/$(APPTARGET)/fsw/src

##
## Include the common make rules for building a cFE Application
##
include $(CFE_CORE_SRC)/make/app-rules.mak
62 changes: 62 additions & 0 deletions fsw/public_inc/sample_lib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*************************************************************************
**
** GSC-18128-1, "Core Flight Executive Version 6.6"
**
** Copyright (c) 2006-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: sample_lib.h
**
** Purpose:
** Specification for the sample library functions.
**
*************************************************************************/
#ifndef _sample_lib_h_
#define _sample_lib_h_

/************************************************************************
** Includes
*************************************************************************/
#include "cfe.h"

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

/*************************************************************************
** Exported Functions
*************************************************************************/
/************************************************************************/
/** \brief Sample Lib Function
**
** \par Description
** This is a sample function
**
** \par Assumptions, External Events, and Notes:
** None
**
** \returns
** \retstmt Returns #CFE_SUCCESS \endcode
** \endreturns
**
*************************************************************************/
int32 SAMPLE_Function( void );

#endif /* _sample_lib_h_ */

/************************/
/* End of File Comment */
/************************/
79 changes: 79 additions & 0 deletions fsw/src/sample_lib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*************************************************************************
**
** GSC-18128-1, "Core Flight Executive Version 6.6"
**
** Copyright (c) 2006-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:
** $Id: sample_lib.c $
**
** Purpose:
** Sample CFS library
**
*************************************************************************/

/*************************************************************************
** Includes
*************************************************************************/
#include "sample_lib.h"
#include "sample_lib_version.h"

/*************************************************************************
** Macro Definitions
*************************************************************************/


/*************************************************************************
** Private Function Prototypes
*************************************************************************/
int32 SAMPLE_LibInit(void);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* Library Initialization Routine */
/* cFE requires that a library have an initialization routine */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 SAMPLE_LibInit(void)
{

OS_printf ("SAMPLE Lib Initialized. Version %d.%d.%d.%d",
SAMPLE_LIB_MAJOR_VERSION,
SAMPLE_LIB_MINOR_VERSION,
SAMPLE_LIB_REVISION,
SAMPLE_LIB_MISSION_REV);

return CFE_SUCCESS;

}/* End SAMPLE_LibInit */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* Sample Lib function */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 SAMPLE_Function( void )
{
OS_printf ("SAMPLE_Function called\n");

return(CFE_SUCCESS);

} /* End SAMPLE_Function */

/************************/
/* End of File Comment */
/************************/
44 changes: 44 additions & 0 deletions fsw/src/sample_lib_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/************************************************************************
**
** GSC-18128-1, "Core Flight Executive Version 6.6"
**
** Copyright (c) 2006-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:
** $Id: sample_lib_version.h $
**
** Purpose:
** The SAMPLE Lib header file containing version number
**
** Notes:
**
*************************************************************************/
#ifndef _sample_lib_version_h_
#define _sample_lib_version_h_


#define SAMPLE_LIB_MAJOR_VERSION 1
#define SAMPLE_LIB_MINOR_VERSION 0
#define SAMPLE_LIB_REVISION 0
#define SAMPLE_LIB_MISSION_REV 0


#endif /* _sample_lib_version_h_ */

/************************/
/* End of File Comment */
/************************/

0 comments on commit c65725c

Please sign in to comment.