2 %% linux_ert_target_generate_main.tlc
5 %% TLC script which generates ert_main function according
6 %% to the number of model tasks and bitrates.
10 %% author: Lukas Hamacek
11 %% e-mail: hamacl1@fel.cvut.cz
12 %% Department of Control Engineering
13 %% Faculty of Electrical Engineering
14 %% Czech Technical University in Prague
17 %% 2009/2/2 - Lukas Hamacek
18 %% creation of the file
20 %% 2009/4/18 - Lukas Hamacek
21 %% asynchronous sample times checked and removed from generation
24 %assign ert_mainC = LibCreateSourceFile("Source", "Custom", "ert_main")
26 %assign ::modelName = CompiledModel.Name
27 %assign ::solverMode = CompiledModel.FixedStepOpts.SolverMode
28 %assign ::fundamentalStepSize = CompiledModel.FundamentalStepSize
29 %assign ::numSampleTimes = CompiledModel.NumSynchronousSampleTimes
30 %assign ::extMode = CompiledModel.ConfigSet.ExtMode
32 %% parse sample times and offsets
34 %foreach i = CompiledModel.NumSampleTimes
35 %if CompiledModel.SampleTime[i].Asynchronous == "no"
36 %assign ::sampleTime%<j> = CompiledModel.SampleTime[i].PeriodAndOffset[0]
37 %assign ::offset%<j> = CompiledModel.SampleTime[i].PeriodAndOffset[1]
42 %% Generate ert_main.c
43 %include "ert_linux_main.tlc"
46 %<generateDeclarations()>
48 %<LibSetSourceFileSection(ert_mainC, "Declarations", buff)>
51 %<generateRtOneStep()>
54 %<LibSetSourceFileSection(ert_mainC, "Functions", buff)>