From 3cc2bec97001d9de0caaa7a36df1b37a888c11b0 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 7 Apr 2020 17:11:11 -0400 Subject: [PATCH] WIP: more updates for CFE proposal --- fsw/platform_inc/sch_lab_sched_tab.h | 7 ++----- fsw/src/sch_lab_app.c | 5 ++--- fsw/src/sch_lab_table.c | 18 +++++++++--------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/fsw/platform_inc/sch_lab_sched_tab.h b/fsw/platform_inc/sch_lab_sched_tab.h index a77b057..f641d55 100644 --- a/fsw/platform_inc/sch_lab_sched_tab.h +++ b/fsw/platform_inc/sch_lab_sched_tab.h @@ -61,11 +61,8 @@ */ typedef struct { - /* Note - this currently needs to be a MsgId "value" (integer) due to the way - this table is currently initialized at compile-time. This should change back - to a CFE_SB_MsgId_t value in a future revision */ - CFE_SB_MsgId_Atom_t MsgIDVal; /* Message ID for the table entry */ - uint32 PacketRate; /* Rate: Send packet every N seconds */ + CFE_SB_MsgId_t MessageID; /* Message ID for the table entry */ + uint32 PacketRate; /* Rate: Send packet every N seconds */ } SCH_LAB_ScheduleTableEntry_t; diff --git a/fsw/src/sch_lab_app.c b/fsw/src/sch_lab_app.c index 496a399..03b24a7 100644 --- a/fsw/src/sch_lab_app.c +++ b/fsw/src/sch_lab_app.c @@ -214,7 +214,7 @@ int32 SCH_LAB_AppInit(void) if (ConfigEntry->PacketRate != 0) { CFE_SB_InitMsg(&LocalStateEntry->MsgBuf.MsgHdr, - CFE_SB_ValueToMsgId(ConfigEntry->MsgIDVal), + ConfigEntry->MessageID, sizeof(LocalStateEntry->MsgBuf), true); LocalStateEntry->PacketRate = ConfigEntry->PacketRate; } @@ -240,8 +240,7 @@ int32 SCH_LAB_AppInit(void) OS_printf("SCH Error creating pipe!\n"); } - Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_TIME_1HZ_CMD_MID), - SCH_LAB_Global.CmdPipe); + Status = CFE_SB_Subscribe(CFE_TIME_1HZ_CMD_MID,SCH_LAB_Global.CmdPipe); if ( Status != CFE_SUCCESS ) { OS_printf("SCH Error subscribing to 1hz!\n"); diff --git a/fsw/src/sch_lab_table.c b/fsw/src/sch_lab_table.c index 9a84ea0..1e04edc 100644 --- a/fsw/src/sch_lab_table.c +++ b/fsw/src/sch_lab_table.c @@ -22,7 +22,7 @@ #include "cfe_tbl_filedef.h" /* Required to obtain the CFE_TBL_FILEDEF macro definition */ #include "sch_lab_sched_tab.h" - +#include "cfe_sb.h" /* Required to use the CFE_SB_MSGID_WRAP_VALUE macro */ /* ** SCH Lab schedule table @@ -37,14 +37,14 @@ SCH_LAB_ScheduleTable_t SCH_TBL_Structure = { .Config = { - { CFE_ES_SEND_HK_MID, 4 }, - { CFE_EVS_SEND_HK_MID, 4 }, - { CFE_TIME_SEND_HK_MID, 4 }, - { CFE_SB_SEND_HK_MID, 4 }, - { CFE_TBL_SEND_HK_MID, 4 }, - { CI_LAB_SEND_HK_MID, 4 }, - { TO_LAB_SEND_HK_MID, 4 }, - { SAMPLE_APP_SEND_HK_MID, 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_ES_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CI_LAB_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(TO_LAB_SEND_HK_MID_VALUE), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_SEND_HK_MID_VALUE), 4 }, #if 0 { SC_SEND_HK_MID, 4, 0 }, { SC_1HZ_WAKEUP_MID, 1, 0 }, /* Example of a 1hz packet */