Skip to content

Commit

Permalink
example fited for FSM_TRANSITION_SELF()
Browse files Browse the repository at this point in the history
  • Loading branch information
UlrichBecker committed Aug 4, 2020
1 parent 77d11a6 commit 3efa6bd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions examples/general/fsm_switch_case_entry_exit_docfsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct FSM_T
};

#define FSM_TRANSITION( _newState, attr... ) pFsm->newState = _newState
#define FSM_TRANSITION_SELF( attr... )

void executeFsm( struct FSM_T* pFsm )
{
Expand Down Expand Up @@ -61,9 +62,7 @@ void executeFsm( struct FSM_T* pFsm )
break;
}
(*pMyCounter)--;
#ifdef __DOCFSM__ /* Following macro isn't really necessary for compiling. */
FSM_TRANSITION( TICK, label='counter != 0' );
#endif
FSM_TRANSITION_SELF( TICK, label='counter != 0' );
break;
}

Expand All @@ -76,9 +75,7 @@ void executeFsm( struct FSM_T* pFsm )
break;
}
(*pMyCounter)--;
#ifdef __DOCFSM__ /* Following macro isn't really necessary for compiling. */
FSM_TRANSITION( TACK, label='counter != 0' );
#endif
FSM_TRANSITION_SELF( label='counter != 0' );
break;
}
default: assert( 0 ); break;
Expand Down Expand Up @@ -130,4 +127,4 @@ int main( void )
sleep( 1 );
}
return 0;
}
}

0 comments on commit 3efa6bd

Please sign in to comment.