]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - rpp/blocks/tlc_c/sfunction_tror.tlc
412165a3c8b8163870045bdf94090f294b1eaaf7
[jenkicar/rpp-simulink.git] / rpp / blocks / tlc_c / sfunction_tror.tlc
1 %% Copyright (C) 2013, 2014 Czech Technical University in Prague
2 %%
3 %% Authors:
4 %%
5 %% This document contains proprietary information belonging to Czech
6 %% Technical University in Prague. Passing on and copying of this
7 %% document, and communication of its contents is not permitted
8 %% without prior written authorization.
9 %%
10 %% File : sfunction_tror.tlc
11 %% Abstract:
12 %%     TLC file for inlining RPP Overrun block.
13 %%
14 %% References:
15 %%     BlockTypeSetup() : rtw_tlc.pdf p. 277
16 %%     Start()          : rtw_tlc.pdf p. 279
17 %%     Outputs()        : rtw_tlc.pdf p. 281
18
19
20 %implements sfunction_tror "C"
21
22 %include "common.tlc"
23
24
25 %% Function: BlockTypeSetup ====================================================
26 %function BlockTypeSetup(block, system) void
27
28     %% Ensure required header files are included
29     %<RppCommonBlockTypeSetup(block, system)>
30     %assign ::rpp_tror_present=1
31
32 %endfunction
33
34
35 %% Function: Start =============================================================
36 %function Start(block, system) Output
37
38     %if !SLibCodeGenForSim()
39     %endif
40
41 %endfunction
42
43
44 %% Function: Outputs ===========================================================
45 %function Outputs(block, system) Output
46
47     %if !SLibCodeGenForSim()
48
49         %<LibAddToCommonIncludes("rpp_simulink_runtime.h")>
50
51         if (overrun_flag) {
52                         %% Call a function subsystem
53                         %foreach callIdx = NumSFcnSysOutputCalls
54                           %if LibIsEqual(SFcnSystemOutputCall[callIdx].BlockToCall,"unconnected")
55                                 %continue
56                           %endif
57                         %% call the downstream system
58                           %<LibBlockExecuteFcnCall(block, callIdx)>\
59                         %endforeach
60         }
61
62     %endif
63
64 %endfunction
65
66 %% [EOF]