The
IS_IN_VALID_STATE_<ctrl-activity-name>
macro is defined in the generated file macro_def.h for each Control-Activity Statechart hierarchy. This macro includes code for validating that the state variable has a valid value. The validation is accomplished using theinLeafState()(inState()
for And States macros against all possible leaf states in the hierarchy. In addition, there is a test against the valid “0” value.For example, for the Control Activity (CTRL) with two leaf states (S2 and S2), the generated macro is as follows:
#define IS_IN_VALID_STATE_CTRL ( \
inLeafState(currentState_CTRL, S1, StateInfo_CTRL) || \