]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - rpp/blocks/tlc_c/sfunction_tror.tlc
Remove possibility of undetected overruns
[jenkicar/rpp-simulink.git] / rpp / blocks / tlc_c / sfunction_tror.tlc
1 %% Copyright (C) 2013, 2014, 2015 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             overrun_flag = FALSE;
53                         %% Call a function subsystem
54                         %foreach callIdx = NumSFcnSysOutputCalls
55                           %if LibIsEqual(SFcnSystemOutputCall[callIdx].BlockToCall,"unconnected")
56                                 %continue
57                           %endif
58                         %% call the downstream system
59                           %<LibBlockExecuteFcnCall(block, callIdx)>\
60                         %endforeach
61         }
62
63     %endif
64
65 %endfunction
66
67 %% [EOF]