Architecture of Generated C Code : Main Task: Partition and Flow Control for C : State Enter/Exit Procedures

State Enter/Exit Procedures

Depending on the modularity style, the enter/exit (including history enter) sequences are grouped into procedures. The example shows the default entering sequence (i.e. entering via a transition that goes to the edge of the state) for the NIGHT state:

Change parent status variable to NIGHT.
Generate the event en(NIGHT) represented as enst_NIGHT.

 

void entdef_st_NIGHT()
{
st_LIGHT_MODES_isin = st_NIGHT;
gen(&enst_NIGHT);
..........
} /* entdef_st_NIGHT */