Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #86, split configuration #89

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###########################################################
#
# LC 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(LC_PLATFORM_CONFIG_FILE_LIST
lc_internal_cfg.h
lc_msgids.h
lc_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(LC_CFGFILE ${LC_PLATFORM_CONFIG_FILE_LIST})
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${LC_CFGFILE}")
generate_config_includefile(
FILE_NAME "${LC_CFGFILE}"
FALLBACK_FILE "${DEFAULT_SOURCE}"
)
endforeach()
95 changes: 4 additions & 91 deletions fsw/inc/lc_msgdefs.h → config/default_lc_fcncodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,102 +20,16 @@
/**
* @file
* Specification for the CFS Limit Checker (LC) command and telemetry
* message constant definitions.
*
* @note
* These Macro definitions have been put in this file (instead of
* lc_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 lc_msg.h IF NEEDED!
* message function code definitions.
*
*/
#ifndef LC_MSGDEFS_H
#define LC_MSGDEFS_H

/************************************************************************
* Includes
************************************************************************/
#include <lc_platform_cfg.h>
#ifndef LC_FCNCODES_H
#define LC_FCNCODES_H

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

/**
* \name LC Application States
* \{
*/
#define LC_STATE_ACTIVE 1 /**< \brief LC Application State Active */
#define LC_STATE_PASSIVE 2 /**< \brief LC Application State Pasive */
#define LC_STATE_DISABLED 3 /**< \brief LC Application State Disabled */
#define LC_STATE_FROM_CDS 4 /**< \brief Used for reset processing, not valid state */
/**\}*/

/**
* \name Actionpoint States
* \{
*/
#define LC_APSTATE_NOT_USED 0xFF /**< \brief Actionpoint unused, not valid command argument */
#define LC_APSTATE_ACTIVE 1 /**< \brief Actionpoint state active */
#define LC_APSTATE_PASSIVE 2 /**< \brief Actionpoint state passive */
#define LC_APSTATE_DISABLED 3 /**< \brief Actionpoint state disabled */
#define LC_APSTATE_PERMOFF 4 /**< \brief Actionpoint state permanently off, see #LC_SET_AP_PERM_OFF_CC */
/**\}*/

/**
* \name Special Values for Commands
* \{
*/
#define LC_ALL_ACTIONPOINTS 0xFFFF /**< \brief Special number indicating all actionpoints */
#define LC_ALL_WATCHPOINTS 0xFFFF /**< \brief Special number indicating all watchpoints */
/**\}*/

/**
* \name Housekeeping Packed Watch Results
* \{
*/
#define LC_HKWR_FALSE 0x00 /**< \brief Two bit value used for FALSE */
#define LC_HKWR_TRUE 0x01 /**< \brief Two bit value used for TRUE */
#define LC_HKWR_ERROR 0x02 /**< \brief Two bit value used for ERROR */
#define LC_HKWR_STALE 0x03 /**< \brief Two bit value used for STALE */
/**\}*/

/**
* \name Housekeeping Packed Action Results
* \{
*/
#define LC_HKAR_PASS 0x00 /**< \brief Two bit value used for PASS */
#define LC_HKAR_FAIL 0x01 /**< \brief Two bit value used for FAIL */
#define LC_HKAR_ERROR 0x02 /**< \brief Two bit value used for ERROR */
#define LC_HKAR_STALE 0x03 /**< \brief Two bit value used for STALE */
/**\}*/

/**
* \name Housekeeping Packed Action Results, State Identifiers
* \{
*/
#define LC_HKAR_STATE_NOT_USED 0x00 /**< \brief Two bit value used for NOT USED and PERMOFF */
#define LC_HKAR_STATE_ACTIVE 0x01 /**< \brief Two bit value used for ACTIVE */
#define LC_HKAR_STATE_PASSIVE 0x02 /**< \brief Two bit value used for PASSIVE */
#define LC_HKAR_STATE_DISABLED 0x03 /**< \brief Two bit value used for DISABLED */
/**\}*/

/**
* \name Housekeeping Packed Results, Array Sizes
* \{
*/
#define LC_HKWR_NUM_BYTES \
(((LC_MAX_WATCHPOINTS + 15) / 16) * 4) /**< \brief 2 bits per WP and keeping \
* array on longword boundary \
*/

#define LC_HKAR_NUM_BYTES \
(((LC_MAX_ACTIONPOINTS + 7) / 8) * 4) /**< \brief 4 bits per AP and keeping \
* array on longword boundary \
*/
/**\}*/

/**
* \defgroup cfslccmdcodes CFS Limit Checker Command Codes
* \{
Expand Down Expand Up @@ -361,7 +275,6 @@

#ifndef LC_OMIT_DEPRECATED
#define LC_SET_AP_PERMOFF_CC LC_SET_AP_PERM_OFF_CC
#define LC_ACTION_NOT_USED LC_APSTATE_NOT_USED
#endif

#endif
166 changes: 166 additions & 0 deletions config/default_lc_interface_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/************************************************************************
* NASA Docket No. GSC-18,921-1, and identified as “CFS Limit Checker
* Application version 2.2.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 Limit Checker (LC) 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/or the public API, if applicable.
*
* @note This file may be overridden/superceded by mission-provided defintions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef LC_INTERFACE_CFG_H
#define LC_INTERFACE_CFG_H

/**
* \defgroup cfslcmissioncfg CFS Limit Checker Mission Configuration
* \{
*/

/**
* \brief RTS Request Message ID
*
* \par Description:
* Message ID that will be used by the #LC_ExecuteRTS function
* to construct the RTS request message.
*
* We define this here to allow the LC application to be built
* without including headers from the application (e.g. SC) that
* will receive the command. Obviously, this definition must
* match the message ID expectyed by the receiving application.
*
* A mission may choose to modify the #LC_ExecuteRTS function not
* to use this or define it using a message ID constant that is
* defined numerically elsewhere.
*
* \par Limits:
* This parameter shouldn't be larger than the value set for
* #CFE_PLATFORM_SB_HIGHEST_VALID_MSGID.
*/
#define LC_RTS_REQ_MID 0x18A9

/**
* \brief RTS Request Command Code
*
* \par Description:
* Command code that will be used by the #LC_ExecuteRTS function
* to construct the RTS request message.
*
* We define this here to allow the LC application to be built
* without including headers from the application (e.g. SC) that
* will receive the command. Obviously, this definition must
* match the command code expected by the receiving application.
*
* \par Limits:
* This parameter can't be larger than 127 (the maximum value of
* 7-bit number).
*/
#define LC_RTS_REQ_CC 4

/**
* \brief Maximum number of watchpoints
*
* \par Description:
* Maximum number of watchpoints that can be defined in the
* Watchpoint Definition Table (WDT)
*
* \par Limits:
* This parameter can't be larger than 65520 (0xFFF0) because
* higher values are reserved for use as Reverse Polish
* operators. It must be a multiple of 4 to avoid
* indexing past the end of the array as LC indexes
* ahead to build the packed status bytes.
*
* This parameter will dictate the size of the Watchpoint
* Definition Table:
*
* WDT Size = LC_MAX_WATCHPOINTS * sizeof(#LC_WDTEntry_t)
*
* The total size of this table should not exceed the
* cFE size limit for a single buffered table set by the
* #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter
*/
#define LC_MAX_WATCHPOINTS 176

/**
* \brief Maximum number of actionpoints
*
* \par Description:
* Maximum number of actionpoints that can be defined in the
* Actionpoint Definition Table (ADT)
*
* \par Limits:
* This parameter can't be larger than an unsigned 16 bit
* integer (65535). It must be a multiple of 2 to avoid
* indexing past the end of the array as LC indexes
* ahead to build the packed status bytes.
*
* This parameter will dictate the size of the Actionpoint
* Definition Table:
*
* ADT Size = LC_MAX_ACTIONPOINTS * sizeof(#LC_ADTEntry_t)
*
* The total size of this table should not exceed the
* cFE size limit for a single buffered table set by the
* #CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE parameter
*/
#define LC_MAX_ACTIONPOINTS 176

/**
* \brief Maximum actionpoint event text string size
*
* \par Description:
* Maximum length of the event message string that can specified
* in an actionpoint definition (including NUL terminator)
*
* \par Limits:
* LC appends the trailer text #LC_AP_EVENT_TAIL_STR to this
* string when reporting actionpoint failures. The size of this
* string is #LC_AP_EVENT_TAIL_LEN
*
* The total value of LC_MAX_ACTION_TEXT + #LC_AP_EVENT_TAIL_LEN
* should be less than #CFE_MISSION_EVS_MAX_MESSAGE_LENGTH to avoid
* event message truncation
*
* Raising this value will also increase the size of the
* Actionpoint Definition Table (ADT)
*/
#define LC_MAX_ACTION_TEXT 32

/**
* \brief Maximum reverse polish (RPN) equation size
*
* \par Description:
* Maximum combined number of operators and operands that may
* exist in an actionpoint definition's reverse polish equation
*
* \par Limits:
* The LC app limits this parameter to 32.
* Increasing this value will increase the size of the
* Actionpoint Definition Table (ADT)
*/
#define LC_MAX_RPN_EQU_SIZE 20

/**\}*/

#endif
Loading