30#include "cfe_platform_cfg.h"
32#include "sch_tbldefs.h"
46#define SCH_WORST_CLOCK_ACCURACY (SCH_NORMAL_SLOT_PERIOD/(SCH_TOTAL_SLOTS-1))
50#define SCH_MAX_SYNC_ATTEMPTS (SCH_TOTAL_SLOTS * 3)
60#define SCH_PIPE_NAME "SCH_CMD_PIPE"
68#define SCH_FILTER_COUNT 5
76#define SCH_TIME_SYNC_SLOT (SCH_TOTAL_SLOTS-1)
78#define SCH_NORMAL_SLOT_PERIOD (SCH_MICROS_PER_MAJOR_FRAME / SCH_TOTAL_SLOTS)
79#define SCH_SYNC_SLOT_PERIOD (SCH_NORMAL_SLOT_PERIOD + SCH_SYNC_SLOT_DRIFT_WINDOW)
80#define SCH_SHORT_SLOT_PERIOD (SCH_NORMAL_SLOT_PERIOD - SCH_SYNC_SLOT_DRIFT_WINDOW)
88#define SCH_SCHEDULE_TABLE_NAME "SCHED_DEF"
89#define SCH_MESSAGE_TABLE_NAME "MSG_DEFS"
97#define SCH_SUCCESS (0)
99#define SCH_BAD_MSG_LENGTH_RC (-2)
100#define SCH_UNKNOWN_ACTIVITY (-3)
106#define SCH_SEM_NAME "SCH_TIME_SEM"
107#define SCH_SEM_VALUE 0
108#define SCH_SEM_OPTIONS 0
113#define SCH_SDT_GARBAGE_ENTRY (-1)
114#define SCH_SDT_NO_FREQUENCY (-2)
115#define SCH_SDT_BAD_REMAINDER (-3)
116#define SCH_SDT_BAD_ACTIVITY (-4)
117#define SCH_SDT_BAD_MSG_INDEX (-5)
118#define SCH_SDT_BAD_ENABLE_STATE (-6)
123#define SCH_MDT_GARBAGE_ENTRY (-1)
124#define SCH_MDT_INVALID_LENGTH (-2)
125#define SCH_MDT_BAD_MSG_ID (-3)
150 CFE_EVS_BinFilter_t EventFilters[SCH_FILTER_COUNT];
264void SCH_AppMain(
void);
290int32 SCH_AppInit(
void);
310int32 SCH_EvsInit(
void);
330int32 SCH_SbInit(
void);
350int32 SCH_TblInit(
void);
371int32 SCH_TimerInit(
void);
393int32 SCH_ProcessScheduleTable(
void);
414int32 SCH_ProcessNextSlot(
void);
447int32 SCH_ProcessCommands(
void);
467int32 SCH_ValidateScheduleData(
void *TableData);
487int32 SCH_ValidateMessageData(
void *TableData);
Definition: sch_app.h:137
uint16 MultipleSlotsCount
Number of times that multiple slots processed.
Definition: sch_app.h:197
CFE_TBL_Handle_t ScheduleTableHandle
Handle for Schedule Definition Table.
Definition: sch_app.h:147
SCH_HkPacket_t HkPacket
Housekeeping Telemetry Packet.
Definition: sch_app.h:152
CFE_TBL_Handle_t MessageTableHandle
Handle for Message Definition Table.
Definition: sch_app.h:148
uint16 SyncAttemptsLeft
Timeout counter used when syncing Major Frame to MET.
Definition: sch_app.h:229
uint8 MajorFrameSource
Major Frame Signal source identifier.
Definition: sch_app.h:172
uint32 AppID
SCH Application's Application ID.
Definition: sch_app.h:164
CFE_SB_PipeId_t CmdPipe
Pipe ID for SCH Command Pipe.
Definition: sch_app.h:142
SCH_MessageEntry_t * MessageTable
Ptr to Message Table contents.
Definition: sch_app.h:144
uint32 ValidMajorFrameCount
# of valid Major Frame tones received
Definition: sch_app.h:219
uint16 MinorFramesSinceTone
# of Minor Frames since last Major Frame tone
Definition: sch_app.h:226
CFE_SB_MsgPtr_t MsgPtr
Ptr to most recently received cmd message.
Definition: sch_app.h:141
uint32 ConsecutiveNoisyFrameCounter
# of consecutive noisy Major Frames
Definition: sch_app.h:224
uint32 ScheduleActivityFailureCount
Number of unsuccessful activities attempted.
Definition: sch_app.h:178
uint16 TableVerifyFailureCount
# of times table loads unsuccessfully verified
Definition: sch_app.h:217
uint16 SameSlotCount
# of times SCH woke up in the same slot as last time
Definition: sch_app.h:205
uint32 ClockAccuracy
Accuracy of Minor Frame Timer.
Definition: sch_app.h:159
uint32 UnexpectedMajorFrameCount
# of unexpected Major Frame tones
Definition: sch_app.h:221
uint16 LastSyncMETSlot
MET Slot # where Time Sync last occurred.
Definition: sch_app.h:228
uint8 SyncToMET
Slots should be aligned with subseconds.
Definition: sch_app.h:171
uint32 MissedMajorFrameCount
# of missing Major Frame tones
Definition: sch_app.h:220
uint8 CmdCounter
Number of successful ground cmds received.
Definition: sch_app.h:169
SCH_ScheduleEntry_t * ScheduleTable
Ptr to Schedule Table contents.
Definition: sch_app.h:145
uint32 TimeSemaphore
Semaphore used by time references to control main loop.
Definition: sch_app.h:158
uint32 LastProcessCount
Number of Slots Processed Last Cycle.
Definition: sch_app.h:155
uint32 ScheduleActivitySuccessCount
Number of successfully performed activities.
Definition: sch_app.h:177
uint16 TableVerifySuccessCount
# of times table loads successfully verified
Definition: sch_app.h:216
uint16 SkippedSlotsCount
Number of times that slots were skipped.
Definition: sch_app.h:189
uint32 WorstCaseSlotsPerMinorFrame
When syncing to MET, worst case # of slots that may need.
Definition: sch_app.h:160
uint32 SlotsProcessedCount
Total # of Schedule Slots (Minor Frames) Processed.
Definition: sch_app.h:183
SCH_DiagPacket_t DiagPacket
Diagnostic Telemetry Packet.
Definition: sch_app.h:153
uint16 NextSlotNumber
Next Minor Frame to be processed.
Definition: sch_app.h:227
uint32 TablePassCount
# of times Schedule Table has been processed
Definition: sch_app.h:223
uint8 ErrCounter
Number of unsuccessful ground cmds received.
Definition: sch_app.h:170
boolean IgnoreMajorFrameMsgSent
Major Frame Event Message has been sent.
Definition: sch_app.h:232
boolean IgnoreMajorFrame
Major Frame too noisy to trust.
Definition: sch_app.h:231
boolean UnexpectedMajorFrame
Major Frame signal was unexpected.
Definition: sch_app.h:233
uint32 TimerId
OSAL assigned timer ID for minor frame timer.
Definition: sch_app.h:157
uint16 BadTableDataCount
# of times corrupted table entries were processed
Definition: sch_app.h:211
Definition: sch_msg.h:231
Definition: sch_msg.h:109
Definition: sch_tbldefs.h:55
Definition: sch_tbldefs.h:40