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 #138, adjust table based on apps present #139

Merged
merged 1 commit into from
Apr 13, 2023
Merged
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
Fix #138, adjust table based on apps present
Create an inclusion preprocessor macro for each app referred to in the
subscription table, and only include that line if the app is present in
the current configuration.

In particular, do not assume that sample_app will always be there.
  • Loading branch information
jphickey committed Apr 12, 2023
commit 5000323a20a8c0950b0fa08ad486eecb7e0e2b96
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -3,12 +3,16 @@ 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 SCH_LAB itself.
include_directories(
$<TARGET_PROPERTY:ci_lab,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:to_lab,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:sample_app,INTERFACE_INCLUDE_DIRECTORIES>
)
# 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)
76 changes: 55 additions & 21 deletions fsw/tables/sch_lab_table.c
Original file line number Diff line number Diff line change
@@ -23,16 +23,35 @@
/*
** Include headers for message IDs here
*/
#ifdef HAVE_CI_LAB
#include "ci_lab_msgids.h"
#endif

#ifdef HAVE_TO_LAB
#include "to_lab_msgids.h"
#endif

#ifdef HAVE_SAMPLE_APP
#include "sample_app_msgids.h"
#endif

#if 0
#include "sc_msgids.h"
#ifdef HAVE_HS_APP
#include "hs_msgids.h"
#endif

#ifdef HAVE_FM_APP
#include "fm_msgids.h"
#endif

#ifdef HAVE_SC_APP
#include "sc_msgids.h"
#endif

#ifdef HAVE_DS_APP
#include "ds_msgids.h"
#endif

#ifdef HAVE_LC_APP
#include "lc_msgids.h"
#endif

@@ -45,25 +64,40 @@
** 3. If the table grows too big, increase SCH_LAB_MAX_SCHEDULE_ENTRIES
*/

SCH_LAB_ScheduleTable_t SCH_TBL_Structure = {.TickRate = 1,
.Config = {
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CI_LAB_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(TO_LAB_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_SEND_HK_MID), 4, 0},
#if 0
{CFE_SB_MSGID_WRAP_VALUE(SC_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(SC_1HZ_WAKEUP_MID), 1, 0}, /* Example of a 1hz packet */
{CFE_SB_MSGID_WRAP_VALUE(HS_SEND_HK_MID), 0, 0}, /* Example of a message that wouldn't be sent */
{CFE_SB_MSGID_WRAP_VALUE(FM_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(DS_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(LC_SEND_HK_MID), 4, 0},
#endif
}};
SCH_LAB_ScheduleTable_t SCH_TBL_Structure = {
.TickRate = 1,
.Config = {
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_SEND_HK_MID), 4, 0},
#ifdef HAVE_CI_LAB
{CFE_SB_MSGID_WRAP_VALUE(CI_LAB_SEND_HK_MID), 4, 0},
#endif
#ifdef HAVE_TO_LAB
{CFE_SB_MSGID_WRAP_VALUE(TO_LAB_SEND_HK_MID), 4, 0},
#endif
#ifdef HAVE_SAMPLE_APP
{CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_SEND_HK_MID), 4, 0},
#endif
#ifdef HAVE_SC_APP
{CFE_SB_MSGID_WRAP_VALUE(SC_SEND_HK_MID), 4, 0},
{CFE_SB_MSGID_WRAP_VALUE(SC_1HZ_WAKEUP_MID), 1, 0}, /* Example of a 1hz packet */
#endif
#ifdef HAVE_HS_APP
{CFE_SB_MSGID_WRAP_VALUE(HS_SEND_HK_MID), 0, 0}, /* Example of a message that wouldn't be sent */
#endif
#ifdef HAVE_FM_APP
{CFE_SB_MSGID_WRAP_VALUE(FM_SEND_HK_MID), 4, 0},
#endif
#ifdef HAVE_DS_APP
{CFE_SB_MSGID_WRAP_VALUE(DS_SEND_HK_MID), 4, 0},
#endif
#ifdef HAVE_LC_APP
{CFE_SB_MSGID_WRAP_VALUE(LC_SEND_HK_MID), 4, 0},
#endif
}};

/*
** The macro below identifies: