You are on page 1of 1

InitMainMasterSM

StartMainMasterSM to be run with ES_ENTRY

RunMainMasterSM
switch Current State
case GAME
CurrentEvent=DuringGame
If Current Event is ES_FRONTCRASH, make Next State to OBSTACLE, perform Exit function for current state and
entry function for next state

case Obstacle
CurrentEvent=DuringObstacle
If Current Event is ES_Backtogame, make Next State to Game, perform Exit function for current state and entry
function for next state

StartMainMasterSM
CurrentState to be made as Game
RunMainMasterSM to be run with CurrentEvent

DuringGame
StartLowerSM if it is an Entry Event
ReturnEvent=RunLowerSM if its not an entry or exit function

DuringObstacle
As an Entry event, make motor to go fullback for crashtimer duration.
If timeout is received, hold the motors and post ES_BACKTOGAME to service.

You might also like