Decomposition Language: Activity Chart Implementation
The Activity Chart is the focus of the graphical language used to decompose functionality into realizable sub-functions.
The classic illustration of Functional Decomposition is shown the following figure:
With regard to decomposition in MicroC, each non-basic Activity is being composed out of its sub-activities. We distinguish between 2 cases. The first case is when that non-basic Activity does not contain immediate descendant that is a control activity. In that case, all of the sub-activities are considered active when that Activity is active. The code for such a non-basic Activity (e.g. A11 with sub-activities A111 and A112 and with no immediate descendant controller) will look like:
The order in which the sub-activities are called within the A11 Activity body is determined by the sub-activities attribute “Execution Order,” as defined in the Dictionary of A111, A112 and A113. In the example above, the “Execution Order” of sub-activity A111 is 1 and of A112 is 2. When that attribute is not set, the calling order is not defined.
If it is desired to save function calls overhead, it is possible to set (in the Compilation Profile->Options->Settings->General Tab dialog) the field to true. The resulting code will be:
This setting is always applicable for non-TASK and non-ISR, and will not be repeated as the result might be derived from the examples given adding the “ \” at the end of each line, and defining instead of function a C Preprocessor macro.