Speeduino
Loading...
Searching...
No Matches
Typedefs | Functions
Schedule finite state machine

All Schedule instances move through the same set of states (status) in the same sequence: they are a Finite State Machine (FSM). These methods enforce this ordering for the timer driven state transitions. More...

Typedefs

typedef void(* scheduleStateTranstionFunc) (Schedule *)
 The type of function that is called during a state transition. Captures the actions to take as a result of the state transition.
 

Functions

void movetoNextState (Schedule &schedule, scheduleStateTranstionFunc pendingToRunning, scheduleStateTranstionFunc runningToOff, scheduleStateTranstionFunc runningToPending)
 The engine/pump that moves a schedule through it's various timer driven states.
 
void defaultPendingToRunning (Schedule *schedule)
 Default action for PENDING to RUNNING state transition.
 
void defaultRunningToOff (Schedule *schedule)
 Default action for RUNNING to OFF state transition.
 
void defaultRunningToPending (Schedule *schedule)
 Default action for RUNNING to PENDING state transition.
 

Detailed Description

All Schedule instances move through the same set of states (status) in the same sequence: they are a Finite State Machine (FSM). These methods enforce this ordering for the timer driven state transitions.

The states transitions are (roughly):

*  PENDING <--
*     |      |
*     V      |
*  RUNNING ---
*     |
*     V
*    OFF
* 

The OFF to PENDING transition is handled by setFuelSchedule & setIgnitionSchedule

Typedef Documentation

◆ scheduleStateTranstionFunc

typedef void(* scheduleStateTranstionFunc) (Schedule *)

The type of function that is called during a state transition. Captures the actions to take as a result of the state transition.

Function Documentation

◆ defaultPendingToRunning()

void defaultPendingToRunning ( Schedule schedule)

Default action for PENDING to RUNNING state transition.

This should be called by another function that handles PENDING to RUNNING

Parameters
scheduleThe schedule that is/will be moving from PENDING to RUNNING
Here is the caller graph for this function:

◆ defaultRunningToOff()

void defaultRunningToOff ( Schedule schedule)

Default action for RUNNING to OFF state transition.

This should be called by another function that handles RUNNING to OFF

Parameters
scheduleThe schedule that is/will be moving from RUNNING to OFF
Here is the caller graph for this function:

◆ defaultRunningToPending()

void defaultRunningToPending ( Schedule schedule)

Default action for RUNNING to PENDING state transition.

This should be called by another function that handles RUNNING to PENDING

Parameters
scheduleThe schedule that is/will be moving from RUNNING to PENDING
Here is the caller graph for this function:

◆ movetoNextState()

void movetoNextState ( Schedule schedule,
scheduleStateTranstionFunc  pendingToRunning,
scheduleStateTranstionFunc  runningToOff,
scheduleStateTranstionFunc  runningToPending 
)

The engine/pump that moves a schedule through it's various timer driven states.

Note
: expectation is that this is called by the same timer interrupt that the schedule is linked to via it's compare & counter members.
Parameters
scheduleThe schedule to change the state of
pendingToRunningFunction to call if the schedule is moving from PENDING to RUNNING
runningToOffFunction to call if the schedule is moving from RUNNING to OFF
runningToPendingFunction to call if the schedule is moving from RUNNING to PENDING
Here is the caller graph for this function: