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 #54, Use MSG APIs #55

Merged
merged 1 commit into from
Dec 1, 2020
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
21 changes: 7 additions & 14 deletions fsw/src/sch_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,20 @@
/*
** Global Structure
*/
typedef union
{
CFE_SB_Msg_t MsgHdr;
CFE_SB_CmdHdr_t CommandHeader;
} SCH_LAB_MessageBuffer_t;

typedef struct
{
SCH_LAB_MessageBuffer_t MsgBuf;
uint32 PacketRate;
uint32 Counter;
CFE_SB_CmdHdr_t CmdBuf;
uint32 PacketRate;
uint32 Counter;
} SCH_LAB_StateEntry_t;

typedef struct
{
SCH_LAB_StateEntry_t State[SCH_LAB_MAX_SCHEDULE_ENTRIES];
CFE_TBL_Handle_t TblHandle;

CFE_SB_Msg_t * CmdPipePktPtr;
CFE_SB_PipeId_t CmdPipe;
CFE_MSG_Message_t *CmdPipePktPtr;
CFE_SB_PipeId_t CmdPipe;

} SCH_LAB_GlobalData_t;

Expand Down Expand Up @@ -128,7 +122,7 @@ void SCH_Lab_AppMain(void)
if (LocalStateEntry->Counter >= LocalStateEntry->PacketRate)
{
LocalStateEntry->Counter = 0;
CFE_SB_SendMsg(&LocalStateEntry->MsgBuf.MsgHdr);
CFE_SB_SendMsg(&LocalStateEntry->CmdBuf.BaseMsg);
}
}
++LocalStateEntry;
Expand Down Expand Up @@ -204,8 +198,7 @@ int32 SCH_LAB_AppInit(void)
{
if (ConfigEntry->PacketRate != 0)
{
CFE_SB_InitMsg(&LocalStateEntry->MsgBuf.MsgHdr, ConfigEntry->MessageID, sizeof(LocalStateEntry->MsgBuf),
true);
CFE_MSG_Init(&LocalStateEntry->CmdBuf.BaseMsg, ConfigEntry->MessageID, sizeof(LocalStateEntry->CmdBuf));
LocalStateEntry->PacketRate = ConfigEntry->PacketRate;
}
++ConfigEntry;
Expand Down