Skip to content
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
8 changes: 8 additions & 0 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ name: "CodeQL Analysis"

on:
push:
branches:
- dev
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
codeql:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Format Check

# Run on all push and pull requests
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
format-check:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ name: Static Analysis
# Run on all push and pull requests
on:
push:
branches:
- dev
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
static-analysis:
Expand Down
16 changes: 2 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
cmake_minimum_required(VERSION 3.5)
project(CFS_SCH_LAB C)

# These references are specifically needed for the table build
# it is easiest to add them as directory properties so they won't
# be considered include directories for TO_LAB itself. Each one
# gets a macro for conditional inclusion in the subscription table.
foreach(EXT_APP ci_lab to_lab sample_app sc hs lc ds fm)
list (FIND TGTSYS_${SYSVAR}_APPS ${EXT_APP} HAVE_APP)
if (HAVE_APP GREATER_EQUAL 0)
include_directories($<TARGET_PROPERTY:${EXT_APP},INTERFACE_INCLUDE_DIRECTORIES>)
string(TOUPPER "HAVE_${EXT_APP}" APP_MACRO)
add_definitions(-D${APP_MACRO})
endif()
endforeach()

# Create the app module
add_cfe_app(sch_lab fsw/src/sch_lab_app.c)
add_cfe_tables(sch_lab fsw/tables/sch_lab_table.c)

target_include_directories(sch_lab PUBLIC fsw/inc)
13 changes: 4 additions & 9 deletions arch_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@

# The list of header files that control the SCH_LAB configuration
set(SCH_LAB_PLATFORM_CONFIG_FILE_LIST
sch_lab_internal_cfg_values.h
sch_lab_platform_cfg.h
sch_lab_perfids.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(SCH_LAB_CFGFILE ${SCH_LAB_PLATFORM_CONFIG_FILE_LIST})
generate_config_includefile(
FILE_NAME "${SCH_LAB_CFGFILE}"
FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${SCH_LAB_CFGFILE}"
)
endforeach()
generate_configfile_set(${SCH_LAB_PLATFORM_CONFIG_FILE_LIST})

38 changes: 38 additions & 0 deletions config/default_sch_lab_interface_cfg_values.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/************************************************************************
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2023 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
* SCH_LAB 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 any other data products that
* serve to exchange information with other entities.
*
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef DEFAULT_SCH_LAB_INTERFACE_CFG_VALUES_H
#define DEFAULT_SCH_LAB_INTERFACE_CFG_VALUES_H

/* Use the default configuration value for all */
#define SCH_LAB_MISSION_CFGVAL(x) DEFAULT_SCH_LAB_MISSION_##x

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SCH_LAB_MISSION_CFGVAL(x) uses token pasting and is not allowed.

#endif
38 changes: 38 additions & 0 deletions config/default_sch_lab_internal_cfg_values.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/************************************************************************
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2023 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
* SCH_LAB Application Private Config Definitions
*
* This provides default values for configurable items that are internal
* to this module and do NOT affect the interface(s) of this module. Changes
* to items in this file only affect the local module and will be transparent
* to external entities that are using the public interface(s).
*
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef DEFAULT_SCH_LAB_INTERNAL_CFG_VALUES_H
#define DEFAULT_SCH_LAB_INTERNAL_CFG_VALUES_H

/* Use the default configuration value for all */
#define SCH_LAB_PLATFORM_CFGVAL(x) DEFAULT_SCH_LAB_PLATFORM_##x

Check notice

Code scanning / CodeQL

Undisciplined macro Note

The macro SCH_LAB_PLATFORM_CFGVAL(x) uses token pasting and is not allowed.

#endif
28 changes: 21 additions & 7 deletions config/default_sch_lab_mission_cfg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -24,13 +24,27 @@
* This is a compatibility header for the "mission_cfg.h" file that has
* traditionally provided public config definitions for each CFS app.
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef SCH_LAB_MISSION_CFG_H
#define SCH_LAB_MISSION_CFG_H
#ifndef DEFAULT_SCH_LAB_MISSION_CFG_H
#define DEFAULT_SCH_LAB_MISSION_CFG_H

#include "sch_lab_interface_cfg.h"
#include "sch_lab_interface_cfg_values.h"

#endif /* SCH_LAB_MISSION_CFG_H */
/**
* @brief The maximum number of schedule table entries
*/
#define SCH_LAB_MISSION_MAX_SCHEDULE_ENTRIES SCH_LAB_MISSION_CFGVAL(MAX_SCHEDULE_ENTRIES)
#define DEFAULT_SCH_LAB_MISSION_MAX_SCHEDULE_ENTRIES 32

/**
* @brief The maximum number of arguments to each schedule message entry
*
* This is allocated in units of 16 bit words.
*/
#define SCH_LAB_MISSION_MAX_ARGS_PER_ENTRY SCH_LAB_MISSION_CFGVAL(MAX_ARGS_PER_ENTRY)
#define DEFAULT_SCH_LAB_MISSION_MAX_ARGS_PER_ENTRY 32

#endif /* DEFAULT_SCH_LAB_MISSION_CFG_H */
8 changes: 4 additions & 4 deletions config/default_sch_lab_perfids.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -23,8 +23,8 @@
* These ID values need to be unique across a CFS deployment, so they may be customized
* as needed to avoid collision with other apps.
*/
#ifndef SCH_LAB_PERFIDS_H
#define SCH_LAB_PERFIDS_H
#ifndef DEFAULT_SCH_LAB_PERFIDS_H
#define DEFAULT_SCH_LAB_PERFIDS_H

#define SCH_LAB_MAIN_TASK_PERF_ID 36

Expand Down
37 changes: 37 additions & 0 deletions config/default_sch_lab_platform_cfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/************************************************************************
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2023 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 SCH_LAB Application Mission Configuration Header File
*
* This is a compatibility header for the "mission_cfg.h" file that has
* traditionally provided public config definitions for each CFS app.
*
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef DEFAULT_SCH_LAB_PLATFORM_CFG_H
#define DEFAULT_SCH_LAB_PLATFORM_CFG_H

#include "sch_lab_mission_cfg.h"
#include "sch_lab_internal_cfg.h"

#endif /* DEFAULT_SCH_LAB_PLATFORM_CFG_H */
23 changes: 4 additions & 19 deletions config/default_sch_lab_tbl.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -24,25 +24,10 @@
* Constants and enumerated types related to these table structures
* are defined in sch_lab_tbldefs.h.
*/
#ifndef SCH_LAB_TBL_H
#define SCH_LAB_TBL_H
#ifndef DEFAULT_SCH_LAB_TBL_H
#define DEFAULT_SCH_LAB_TBL_H

#include "sch_lab_tbldefs.h"
#include "sch_lab_tblstruct.h"

/*
** Defines
*/
#ifdef SOFTWARE_BIG_BIT_ORDER
#define SCH_PACK_32BIT(value) (uint16)((value & 0xFFFF0000) >> 16), (uint16)(value & 0x0000FFFF)
#else
#define SCH_PACK_32BIT(value) (uint16)(value & 0x0000FFFF), (uint16)((value & 0xFFFF0000) >> 16)
#endif

/*
* There is no extra encapsulation here, this header only
* defines the default file name to use for the SCH table
*/
#define SCH_LAB_TBL_DEFAULT_FILE "/cf/sch_lab_table.tbl"

#endif
27 changes: 18 additions & 9 deletions config/default_sch_lab_tbldefs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -25,25 +25,34 @@
* of the application. Any modification to these structures will likely need
* a correpsonding update to the source code.
*/
#ifndef SCH_LAB_TBLDEFS_H
#define SCH_LAB_TBLDEFS_H
#ifndef DEFAULT_SCH_LAB_TBLDEFS_H
#define DEFAULT_SCH_LAB_TBLDEFS_H

#include "cfe_sb_extern_typedefs.h" /* for CFE_SB_MsgId_t */
#include "cfe_msg_api_typedefs.h" /* For CFE_MSG_FcnCode_t */
#include "cfe_msgids.h"

#include "sch_lab_mission_cfg.h"

/*
** Defines
*/
#ifdef SOFTWARE_BIG_BIT_ORDER
#define SCH_PACK_32BIT(value) (uint16)((value & 0xFFFF0000) >> 16), (uint16)(value & 0x0000FFFF)
#else
#define SCH_PACK_32BIT(value) (uint16)(value & 0x0000FFFF), (uint16)((value & 0xFFFF0000) >> 16)
#endif

/*
** Typedefs
*/
typedef struct
{
CFE_SB_MsgId_t MessageID; /* Message ID for the table entry */
uint32 PacketRate; /* Rate: Send packet every N ticks */
CFE_MSG_FcnCode_t FcnCode; /* Command/Function code to set */
uint16 PayloadLength; /* Length of additional command args */
uint16 MessageBuffer[SCH_LAB_MAX_ARGS_PER_ENTRY]; /* Command args in 16 bit words */
CFE_SB_MsgId_t MessageID; /* Message ID for the table entry */
uint32 PacketRate; /* Rate: Send packet every N ticks */
CFE_MSG_FcnCode_t FcnCode; /* Command/Function code to set */
uint16 PayloadLength; /* Length of additional command args */
uint16 MessageBuffer[SCH_LAB_MISSION_MAX_ARGS_PER_ENTRY]; /* Command args in 16 bit words */
} SCH_LAB_ScheduleTableEntry_t;

#endif
12 changes: 6 additions & 6 deletions config/default_sch_lab_tblstruct.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes”
* NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
*
* Copyright (c) 2020 United States Government as represented by the
* Copyright (c) 2023 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -22,20 +22,20 @@
*
* Provides default definitions for SCH_LAB table structures
*
* @note This file may be overridden/superceded by mission-provided defintions
* @note This file may be overridden/superceded by mission-provided definitions
* either by overriding this header or by generating definitions from a command/data
* dictionary tool.
*/
#ifndef SCH_LAB_TBLSTRUCT_H
#define SCH_LAB_TBLSTRUCT_H
#ifndef DEFAULT_SCH_LAB_TBLSTRUCT_H
#define DEFAULT_SCH_LAB_TBLSTRUCT_H

#include "sch_lab_mission_cfg.h"
#include "sch_lab_tbldefs.h"

typedef struct
{
uint32 TickRate; /* Ticks per second to configure for timer (0=default) */
SCH_LAB_ScheduleTableEntry_t Config[SCH_LAB_MAX_SCHEDULE_ENTRIES];
SCH_LAB_ScheduleTableEntry_t Config[SCH_LAB_MISSION_MAX_SCHEDULE_ENTRIES];
} SCH_LAB_ScheduleTable_t;

#endif
Loading
Loading