You are on page 1of 1

Pseudo-code for the ExitingTimerService module (a service)

Data private to the module: MyPriority

Functions private to the module: None

InitExitingTimerService
Takes a priority number, returns True.

Set MyPriority

Post Event ES_Init to this service

End of InitExitingTimerService

PostExitingTimerService
Takes an ES_Event_t, returns boolean outcome of ES_PostToService

Call ES_PostToService with MyPriority and ThisEvent

End of PostExitingTimerService

RunExitingTimerService
The EventType field of ThisEvent will be one of: START_EXITING_TIMER,
ES_TIMEOUT

Set ReturnEvent to ES_NO_EVENT

ThisEvent is START_EXITING_TIMER
Start EXITING_TIMER for three seconds

ThisEvent is ES_TIMEOUT
Set NewEvent to STOP_EXITING
Post to MasterSM

Return ES_NO_EVENT
End of RunExitingTimerService

You might also like