Professional Documents
Culture Documents
// include header files for this state machine as well as any machines at the
// next lower level in the hierarchy that are sub-machines to this machine
// If CurrentState is DEBOUNCING
// switch to CurrentState
// if case is DEBOUNCING :
// If EventType is ES_TIMEOUT & parameter is debounce
timer number
// Set CurrentState to Ready2Sample
// break
// if case is Ready2Sample:
// If EventType is ButtonUp
// Start debounce timer
// Set CurrentState to DEBOUNCING
// Post DBButtonUp to MorseElements &
DecodeMorse queues
// If EventType is ButtonDown
// Start debounce timer
// Set CurrentState to DEBOUNCING
// Post DBButtonDown to MorseElements &
DecodeMorse queues
//ThisEvent.EventType =
ES_DBButtonDown;
// post to game master\
// else if this event type is ES Supply depot
found
// Start debounce timer
// Set CurrentState to DEBOUNCING
// Post DBButtonDown to MorseElements &
DecodeMorse queues
//ThisEvent.EventType =
ES_DBButtonDown;
// post to game master
// break
// CurrentState = NextState;
// Return ES_NO_EVENT