Skip to content

Commit

Permalink
Add TIME Files
Browse files Browse the repository at this point in the history
  • Loading branch information
astrogeco committed Apr 19, 2021
1 parent 8f81285 commit a047917
Show file tree
Hide file tree
Showing 16 changed files with 8,473 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
!modules/tbl/CMakeLists.txt

# Time Services (TIME)
# !modules/core_private/fsw/inc/cfe_time*
# !modules/core_api/fsw/inc/cfe_time*
!modules/core_private/fsw/inc/cfe_time*
!modules/core_api/fsw/inc/cfe_time*

# !modules/time/fsw/**
# !modules/time/CMakeLists.txt
!modules/time/fsw/**
!modules/time/CMakeLists.txt

722 changes: 722 additions & 0 deletions modules/core_api/fsw/inc/cfe_time.h

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions modules/core_api/fsw/inc/cfe_time_api_typedefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** 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
*
* Purpose: cFE Time Services (TIME) library API header file
*
* Author: S.Walling/Microtel
*
* Notes:
*
*/

#ifndef CFE_TIME_API_TYPEDEFS_H
#define CFE_TIME_API_TYPEDEFS_H

/*
** Includes
*/
#include "common_types.h"
#include "cfe_time_extern_typedefs.h"

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

#define CFE_TIME_PRINTED_STRING_SIZE \
24 /**< \brief Required size of buffer to be passed into #CFE_TIME_Print (includes null terminator) */

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

/**
** \brief Enumerated types identifying the relative relationships of two times
**
** \par Description
** Since time fields contain numbers that are relative to an epoch time, then it is possible for a time value
** to be "negative". This can lead to some confusion about what relationship exists between two time values.
** To resolve this confusion, the cFE provides the API #CFE_TIME_Compare which returns these enumerated values.
*/
typedef enum CFE_TIME_Compare
{
CFE_TIME_A_LT_B = -1, /**< \brief The first specified time is considered to be before the second specified time */
CFE_TIME_EQUAL = 0, /**< \brief The two specified times are considered to be equal */
CFE_TIME_A_GT_B = 1 /**< \brief The first specified time is considered to be after the second specified time */
} CFE_TIME_Compare_t;

/**
** \brief Time Synchronization Callback Function Ptr Type
**
** \par Description
** Applications that wish to get direct notification of the receipt of the cFE Time Synchronization signal
** (typically a 1 Hz signal), must register a callback function with the following prototype via the
** #CFE_TIME_RegisterSynchCallback API.
*/
typedef int32 (*CFE_TIME_SynchCallbackPtr_t)(void);

#endif /* CFE_TIME_API_TYPEDEFS_H */
88 changes: 88 additions & 0 deletions modules/core_api/fsw/inc/cfe_time_core_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** 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
*
* Purpose: cFE Time Services (TIME) library API header file
*
* Author: S.Walling/Microtel
*
* Notes:
*
*/

#ifndef CFE_TIME_CORE_INTERNAL_H
#define CFE_TIME_CORE_INTERNAL_H

#include "common_types.h"
#include "cfe_es_extern_typedefs.h"

/*
* The internal APIs prototyped within this block are only intended to be invoked from
* other CFE core apps. They still need to be prototyped in the shared header such that
* they can be called from other core modules, but applications should not call these.
*/

/** @defgroup CFEAPITIMECoreInternal cFE Internal Time APIs, internal to CFE core
* @{
*/

/*****************************************************************************/
/**
** \brief Entry Point for cFE Core Application
**
** \par Description
** This is the entry point to the cFE TIME Core Application.
**
** \par Assumptions, External Events, and Notes:
** None
**
******************************************************************************/
extern void CFE_TIME_TaskMain(void);

/*****************************************************************************/
/**
** \brief Initializes the cFE core module API Library
**
** \par Description
** Initializes the cFE core module API Library
**
** \par Assumptions, External Events, and Notes:
** -# This function MUST be called before any module API's are called.
**
******************************************************************************/
extern int32 CFE_TIME_EarlyInit(void);

/*****************************************************************************/
/**
** \brief Removes TIME resources associated with specified Application
**
** \par Description
** This function is called by cFE Executive Services to cleanup after
** an Application has been terminated. It frees resources
** that have been allocated to the specified Application.
**
******************************************************************************/
extern int32 CFE_TIME_CleanUpApp(CFE_ES_AppId_t AppId);

/**@}*/

#endif /* CFE_TIME_CORE_INTERNAL_H */
Loading

0 comments on commit a047917

Please sign in to comment.