Skip to content

Commit

Permalink
WIP: more updates for CFE proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
jphickey committed Apr 7, 2020
1 parent efba0f7 commit 3cc2bec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
7 changes: 2 additions & 5 deletions fsw/platform_inc/sch_lab_sched_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down
5 changes: 2 additions & 3 deletions fsw/src/sch_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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");
Expand Down
18 changes: 9 additions & 9 deletions fsw/src/sch_lab_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */
Expand Down

0 comments on commit 3cc2bec

Please sign in to comment.