Skip to content

What did you intend for getting event data to a state? #39

Answered by kiishor
jnz86 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

Yes, event is an unsigned integer in this state machine framework. It is a member of state machine structure as shown below,

//! Abstract state machine structure
struct state_machine_t
{
   uint32_t Event;          //!< Pending Event for state machine
   const state_t* State;    //!< State of state machine.
};

Here the intention is, user shall inherit state_machine_t structure as shown below,

// Derived state machine
struct user_state_machine
{
  state_machine_t;    // Base state machine. Must be the first member of user derived state machine.

  // User specific state machine members
  uint32_t data1;
  uint32_t data2;
  uint32_t data3;
};

This framework doesn't mix event and the …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kiishor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants