Sie sind auf Seite 1von 1

ButtonService

// 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

// mask for the number of active bits in the array of messages

// prototypes for private functions for this service.They should be functions


// relevant to the behavior of this service*/

// with the introduction of Gen2, we need a module level Priority variable


// myPriority;
// DeferQueue
// LastButtonState;
// CurrentState

// RunButtonDebounceSM pass in this event

// make static variable ButtonService NextState

// Set NextState to CurrentState

// 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

Das könnte Ihnen auch gefallen