From c6f0ef5c13e878c3b143aa9d24cb98e8cc71bb5a Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 8 Jan 2020 15:13:23 -0500 Subject: [PATCH] Fix #37, Opaque CFE_SB_MsgId_t values Do not assume CFE_SB_MsgId_t is implicitly integral in nature. When an integer value is required for printing or backward compatibility, use the explicit conversion routine to get this. --- fsw/src/sch_lab_app.c | 2 +- fsw/src/sch_lab_table.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fsw/src/sch_lab_app.c b/fsw/src/sch_lab_app.c index f2f30bc..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->MessageID), + ConfigEntry->MessageID, sizeof(LocalStateEntry->MsgBuf), true); LocalStateEntry->PacketRate = ConfigEntry->PacketRate; } diff --git a/fsw/src/sch_lab_table.c b/fsw/src/sch_lab_table.c index 9a84ea0..4bd43fb 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), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_EVS_SEND_HK_MID), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_TIME_SEND_HK_MID), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_SB_SEND_HK_MID), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CFE_TBL_SEND_HK_MID), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(CI_LAB_SEND_HK_MID), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(TO_LAB_SEND_HK_MID), 4 }, + { CFE_SB_MSGID_WRAP_VALUE(SAMPLE_APP_SEND_HK_MID), 4 }, #if 0 { SC_SEND_HK_MID, 4, 0 }, { SC_1HZ_WAKEUP_MID, 1, 0 }, /* Example of a 1hz packet */