Lines Matching +full:- +full:- +full:exit +full:- +full:code
21 function implements the Exit actions. The prototype for these functions is as
99 if an initial transition to a child state is defined. A well-formed
104 :c:func:`smf_set_state` from Exit functions will generate a warning in the
112 smf_run_state if it returns a non-zero value.
125 should be called. It can be called from the entry, run, or exit actions. The
126 function takes a non-zero user defined value that will be returned by the
133 entry and exit actions of the least common ancestor are not executed on
142 of the source state, rather than after the exit actions are performed.
143 2. Only allowing external transitions to self, not to sub-states. A transition
145 3. Prohibiting transitions using :c:func:`smf_set_state` in exit actions.
158 This example turns the following state diagram into code using the SMF, where
171 init -> STATE_S0;
172 STATE_S0 -> STATE_S1;
173 STATE_S1 -> STATE_S2;
174 STATE_S2 -> STATE_S0;
177 Code::
234 /* State S2 does not have an exit action */
247 /* State machine terminates if a non-zero value is returned */
250 /* handle return code and terminate state machine */
260 This example turns the following state diagram into code using the SMF, where
277 STATE_S0 -> STATE_S1;
280 init -> STATE_S0;
281 STATE_S1 -> STATE_S2;
282 STATE_S2 -> STATE_S0;
285 Code::
335 /* Child states do not have entry or exit actions */
338 /* State S2 do not have entry or exit actions and no parent */
351 /* State machine terminates if a non-zero value is returned */
354 /* handle return code and terminate state machine */
362 - Ancestor entry actions are executed before the sibling entry actions. For
364 - Transitioning from one sibling to another with a shared ancestry does not
365 re-execute the ancestor\'s entry action or execute the exit action.
368 - Ancestor exit actions are executed after the exit action of the current
371 - The parent_run function only executes if the child_run function does not
389 init -> STATE_S0;
390 STATE_S0 -> STATE_S1 [label = "BTN EVENT"];
391 STATE_S1 -> STATE_S0 [label = "BTN EVENT"];
394 Code::
439 if (s->events & EVENT_BTN_PRESS) {
455 if (s->events & EVENT_BTN_PRESS) {
479 button.port->name);
486 ret, button.port->name, button.pin);
494 ret, button.port->name, button.pin);
513 /* State machine terminates if a non-zero value is returned */
516 /* handle return code and terminate state machine */
551 ab_init_state -> STATE_A;
552 STATE_A -> STATE_B;
558 STATE_B -> STATE_C [ltail=cluster_ab]
561 STATE_C -> DC [ltail=cluster_c, dir=none];
562 DC -> STATE_C [lhead=cluster_c];
563 STATE_C -> STATE_D
566 "smf_set_initial()" -> STATE_A [lhead=cluster_ab]