##// END OF EJS Templates
wf_handler updated with sequence counters...
paul -
r63:82d0f7d680ce default
parent child
Show More
@@ -1,305 +1,305
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.1, 2013-11-12T11:17:40. -->
3 <!-- Written by QtCreator 2.8.1, 2013-11-12T12:44:53. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
7 <value type="int">0</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 <value type="QString" key="language">Cpp</value>
16 <value type="QString" key="language">Cpp</value>
17 <valuemap type="QVariantMap" key="value">
17 <valuemap type="QVariantMap" key="value">
18 <value type="QString" key="CurrentPreferences">CppGlobal</value>
18 <value type="QString" key="CurrentPreferences">CppGlobal</value>
19 </valuemap>
19 </valuemap>
20 </valuemap>
20 </valuemap>
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 <value type="QString" key="language">QmlJS</value>
22 <value type="QString" key="language">QmlJS</value>
23 <valuemap type="QVariantMap" key="value">
23 <valuemap type="QVariantMap" key="value">
24 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
24 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
25 </valuemap>
25 </valuemap>
26 </valuemap>
26 </valuemap>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 <value type="int" key="EditorConfiguration.TabSize">8</value>
38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 </valuemap>
45 </valuemap>
46 </data>
46 </data>
47 <data>
47 <data>
48 <variable>ProjectExplorer.Project.PluginSettings</variable>
48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 <valuemap type="QVariantMap"/>
49 <valuemap type="QVariantMap"/>
50 </data>
50 </data>
51 <data>
51 <data>
52 <variable>ProjectExplorer.Project.Target.0</variable>
52 <variable>ProjectExplorer.Project.Target.0</variable>
53 <valuemap type="QVariantMap">
53 <valuemap type="QVariantMap">
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
63 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
63 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
67 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
67 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
69 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
69 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
70 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
70 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
71 </valuemap>
71 </valuemap>
72 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
72 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
73 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
73 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
74 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
74 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
77 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
77 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
78 <value type="QString">-w</value>
78 <value type="QString">-w</value>
79 <value type="QString">-r</value>
79 <value type="QString">-r</value>
80 </valuelist>
80 </valuelist>
81 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
81 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
82 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value>
82 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value>
83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
84 </valuemap>
84 </valuemap>
85 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
85 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
89 </valuemap>
89 </valuemap>
90 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
90 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
92 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
92 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
96 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
96 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
97 <value type="QString">-w</value>
97 <value type="QString">-w</value>
98 <value type="QString">-r</value>
98 <value type="QString">-r</value>
99 </valuelist>
99 </valuelist>
100 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
100 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
101 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
101 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
103 </valuemap>
103 </valuemap>
104 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
104 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
105 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
105 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
108 </valuemap>
108 </valuemap>
109 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
109 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
110 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
110 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
111 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
111 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
115 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
115 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
116 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
116 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
118 </valuemap>
118 </valuemap>
119 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
119 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
122 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
122 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
126 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
126 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
127 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
127 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
128 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
128 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
129 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
129 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
130 </valuemap>
130 </valuemap>
131 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
131 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
132 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
132 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
133 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
133 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
134 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
134 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
136 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
136 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
137 <value type="QString">-w</value>
137 <value type="QString">-w</value>
138 <value type="QString">-r</value>
138 <value type="QString">-r</value>
139 </valuelist>
139 </valuelist>
140 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
140 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
141 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value>
141 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value>
142 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
142 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
143 </valuemap>
143 </valuemap>
144 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
144 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
146 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
146 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
147 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
147 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
148 </valuemap>
148 </valuemap>
149 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
149 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
150 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
150 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
151 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
151 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
153 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
153 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
154 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
154 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
155 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
155 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
156 <value type="QString">-w</value>
156 <value type="QString">-w</value>
157 <value type="QString">-r</value>
157 <value type="QString">-r</value>
158 </valuelist>
158 </valuelist>
159 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
159 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
160 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
160 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
161 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
161 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
162 </valuemap>
162 </valuemap>
163 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
163 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
165 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
165 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
166 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
166 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
167 </valuemap>
167 </valuemap>
168 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
168 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
169 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
169 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
170 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
170 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
174 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
174 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
175 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
175 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
176 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
176 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
177 </valuemap>
177 </valuemap>
178 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
178 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
179 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
179 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
180 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
180 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
181 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
181 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
182 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
182 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
183 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
183 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
184 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
184 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
185 </valuemap>
185 </valuemap>
186 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
186 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
187 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
187 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
188 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
188 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
189 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
189 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
190 </valuemap>
190 </valuemap>
191 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
191 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
192 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
192 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
193 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
193 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
194 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
194 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
195 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
196 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
196 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
197 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
197 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
198 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
198 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
199 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
199 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
200 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
200 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
201 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
201 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
202 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
202 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
203 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
203 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
204 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
204 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
205 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
205 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
206 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
206 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
207 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
207 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
208 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
208 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
209 <value type="int">0</value>
209 <value type="int">0</value>
210 <value type="int">1</value>
210 <value type="int">1</value>
211 <value type="int">2</value>
211 <value type="int">2</value>
212 <value type="int">3</value>
212 <value type="int">3</value>
213 <value type="int">4</value>
213 <value type="int">4</value>
214 <value type="int">5</value>
214 <value type="int">5</value>
215 <value type="int">6</value>
215 <value type="int">6</value>
216 <value type="int">7</value>
216 <value type="int">7</value>
217 <value type="int">8</value>
217 <value type="int">8</value>
218 <value type="int">9</value>
218 <value type="int">9</value>
219 <value type="int">10</value>
219 <value type="int">10</value>
220 <value type="int">11</value>
220 <value type="int">11</value>
221 <value type="int">12</value>
221 <value type="int">12</value>
222 <value type="int">13</value>
222 <value type="int">13</value>
223 <value type="int">14</value>
223 <value type="int">14</value>
224 </valuelist>
224 </valuelist>
225 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
225 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
226 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
226 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
228 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
228 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
229 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
229 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
230 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
230 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
231 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
231 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
232 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
232 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
233 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
233 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
234 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
234 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
235 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
235 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
236 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
236 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
237 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
237 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
238 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
238 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
239 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
239 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
240 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
240 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
241 </valuemap>
241 </valuemap>
242 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
242 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
243 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
243 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
244 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
244 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
245 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
245 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
246 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
246 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
247 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
247 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
248 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
248 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
249 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
249 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
250 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
250 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
251 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
251 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
252 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
252 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
253 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
253 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
254 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
254 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
255 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
255 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
256 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
256 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
257 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
257 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
258 <value type="int">0</value>
258 <value type="int">0</value>
259 <value type="int">1</value>
259 <value type="int">1</value>
260 <value type="int">2</value>
260 <value type="int">2</value>
261 <value type="int">3</value>
261 <value type="int">3</value>
262 <value type="int">4</value>
262 <value type="int">4</value>
263 <value type="int">5</value>
263 <value type="int">5</value>
264 <value type="int">6</value>
264 <value type="int">6</value>
265 <value type="int">7</value>
265 <value type="int">7</value>
266 <value type="int">8</value>
266 <value type="int">8</value>
267 <value type="int">9</value>
267 <value type="int">9</value>
268 <value type="int">10</value>
268 <value type="int">10</value>
269 <value type="int">11</value>
269 <value type="int">11</value>
270 <value type="int">12</value>
270 <value type="int">12</value>
271 <value type="int">13</value>
271 <value type="int">13</value>
272 <value type="int">14</value>
272 <value type="int">14</value>
273 </valuelist>
273 </valuelist>
274 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
274 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
275 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
275 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
276 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
276 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
277 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value>
277 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value>
278 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value>
278 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value>
279 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value>
279 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value>
280 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value>
280 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value>
281 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
281 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
282 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
282 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
283 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
283 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
284 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
284 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
285 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
285 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
286 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
286 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
287 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
287 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
288 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
288 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
289 </valuemap>
289 </valuemap>
290 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
290 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
291 </valuemap>
291 </valuemap>
292 </data>
292 </data>
293 <data>
293 <data>
294 <variable>ProjectExplorer.Project.TargetCount</variable>
294 <variable>ProjectExplorer.Project.TargetCount</variable>
295 <value type="int">1</value>
295 <value type="int">1</value>
296 </data>
296 </data>
297 <data>
297 <data>
298 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
298 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
299 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
299 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
300 </data>
300 </data>
301 <data>
301 <data>
302 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
302 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
303 <value type="int">14</value>
303 <value type="int">14</value>
304 </data>
304 </data>
305 </qtcreator>
305 </qtcreator>
@@ -1,81 +1,86
1 #ifndef WF_HANDLER_H_INCLUDED
1 #ifndef WF_HANDLER_H_INCLUDED
2 #define WF_HANDLER_H_INCLUDED
2 #define WF_HANDLER_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6 #include <stdio.h>
6 #include <stdio.h>
7 #include <math.h>
7 #include <math.h>
8
8
9 #include "fsw_params.h"
9 #include "fsw_params.h"
10
10
11 #define pi 3.1415
11 #define pi 3.1415
12
12
13 extern int fdSPW;
13 extern int fdSPW;
14 extern volatile int wf_snap_f0[ ];
14 extern volatile int wf_snap_f0[ ];
15 //
15 //
16 extern volatile int wf_snap_f1[ ];
16 extern volatile int wf_snap_f1[ ];
17 extern volatile int wf_snap_f1_bis[ ];
17 extern volatile int wf_snap_f1_bis[ ];
18 extern volatile int wf_snap_f1_norm[ ];
18 extern volatile int wf_snap_f1_norm[ ];
19 //
19 //
20 extern volatile int wf_snap_f2[ ];
20 extern volatile int wf_snap_f2[ ];
21 extern volatile int wf_snap_f2_bis[ ];
21 extern volatile int wf_snap_f2_bis[ ];
22 extern volatile int wf_snap_f2_norm[ ];
22 extern volatile int wf_snap_f2_norm[ ];
23 //
23 //
24 extern volatile int wf_cont_f3[ ];
24 extern volatile int wf_cont_f3[ ];
25 extern volatile int wf_cont_f3_bis[ ];
25 extern volatile int wf_cont_f3_bis[ ];
26 extern char wf_cont_f3_light[ ];
26 extern char wf_cont_f3_light[ ];
27 extern new_waveform_picker_regs_t *new_waveform_picker_regs;
27 extern new_waveform_picker_regs_t *new_waveform_picker_regs;
28 extern time_management_regs_t *time_management_regs;
28 extern time_management_regs_t *time_management_regs;
29 extern Packet_TM_LFR_HK_t housekeeping_packet;
29 extern Packet_TM_LFR_HK_t housekeeping_packet;
30 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
30 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
31 extern struct param_local_str param_local;
31 extern struct param_local_str param_local;
32
32
33 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
34 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
35 extern unsigned short sequenceCounters_TC_EXE[];
36
33 extern rtems_name misc_name[5];
37 extern rtems_name misc_name[5];
34 extern rtems_name Task_name[20]; /* array of task ids */
38 extern rtems_name Task_name[20]; /* array of task ids */
35 extern rtems_id Task_id[20]; /* array of task ids */
39 extern rtems_id Task_id[20]; /* array of task ids */
36
40
37 extern unsigned char lfrCurrentMode;
41 extern unsigned char lfrCurrentMode;
38
42
39 rtems_isr waveforms_isr( rtems_vector_number vector );
43 rtems_isr waveforms_isr( rtems_vector_number vector );
40 rtems_isr waveforms_simulator_isr( rtems_vector_number vector );
44 rtems_isr waveforms_simulator_isr( rtems_vector_number vector );
41 rtems_task wfrm_task( rtems_task_argument argument );
45 rtems_task wfrm_task( rtems_task_argument argument );
42 rtems_task cwf3_task( rtems_task_argument argument );
46 rtems_task cwf3_task( rtems_task_argument argument );
43 rtems_task cwf2_task( rtems_task_argument argument );
47 rtems_task cwf2_task( rtems_task_argument argument );
44 rtems_task cwf1_task( rtems_task_argument argument );
48 rtems_task cwf1_task( rtems_task_argument argument );
45
49
46 //******************
50 //******************
47 // general functions
51 // general functions
48 void init_waveforms( void );
52 void init_waveforms( void );
49 //
53 //
50 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
54 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
51 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
55 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
52 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
56 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
53 //
57 //
54 void reset_waveforms( void );
58 void reset_waveforms( void );
55 //
59 //
56 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
60 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
57 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
61 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
58 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
62 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
59 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
63 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
60 //
64 //
61 rtems_id get_pkts_queue_id( void );
65 rtems_id get_pkts_queue_id( void );
62
66
63 //**************
67 //**************
64 // wfp registers
68 // wfp registers
65 void set_wfp_data_shaping();
69 void set_wfp_data_shaping();
66 char set_wfp_delta_snapshot();
70 char set_wfp_delta_snapshot();
67 void set_wfp_burst_enable_register( unsigned char mode);
71 void set_wfp_burst_enable_register( unsigned char mode);
68 void reset_wfp_run_burst_enable();
72 void reset_wfp_run_burst_enable();
69 void reset_wfp_status();
73 void reset_wfp_status();
70 void reset_new_waveform_picker_regs();
74 void reset_new_waveform_picker_regs();
71 void reset_new_waveform_picker_regs_alt();
72
75
73 //*****************
76 //*****************
74 // local parameters
77 // local parameters
75 void set_local_sbm1_nb_cwf_max();
78 void set_local_sbm1_nb_cwf_max();
76 void set_local_sbm2_nb_cwf_max();
79 void set_local_sbm2_nb_cwf_max();
77 void set_local_nb_interrupt_f0_MAX();
80 void set_local_nb_interrupt_f0_MAX();
78 void reset_local_sbm1_nb_cwf_sent();
81 void reset_local_sbm1_nb_cwf_sent();
79 void reset_local_sbm2_nb_cwf_sent();
82 void reset_local_sbm2_nb_cwf_sent();
80
83
84 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
85
81 #endif // WF_HANDLER_H_INCLUDED
86 #endif // WF_HANDLER_H_INCLUDED
@@ -1,89 +1,91
1 /** Global variables of the LFR flight software.
1 /** Global variables of the LFR flight software.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * Among global variables, there are:
6 * Among global variables, there are:
7 * - RTEMS names and id.
7 * - RTEMS names and id.
8 * - APB configuration registers.
8 * - APB configuration registers.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
11 * - variable related to LFR modes parameters.
11 * - variable related to LFR modes parameters.
12 * - the global HK packet buffer.
12 * - the global HK packet buffer.
13 * - the global dump parameter buffer.
13 * - the global dump parameter buffer.
14 *
14 *
15 */
15 */
16
16
17 #include <rtems.h>
17 #include <rtems.h>
18 #include <grspw.h>
18 #include <grspw.h>
19
19
20 #include "ccsds_types.h"
20 #include "ccsds_types.h"
21 #include "grlib_regs.h"
21 #include "grlib_regs.h"
22 #include "fsw_params.h"
22 #include "fsw_params.h"
23
23
24 // RTEMS GLOBAL VARIABLES
24 // RTEMS GLOBAL VARIABLES
25 rtems_name misc_name[5];
25 rtems_name misc_name[5];
26 rtems_id misc_id[5];
26 rtems_id misc_id[5];
27 rtems_name Task_name[20]; /* array of task names */
27 rtems_name Task_name[20]; /* array of task names */
28 rtems_id Task_id[20]; /* array of task ids */
28 rtems_id Task_id[20]; /* array of task ids */
29 unsigned int maxCount;
29 unsigned int maxCount;
30 int fdSPW = 0;
30 int fdSPW = 0;
31 int fdUART = 0;
31 int fdUART = 0;
32 unsigned char lfrCurrentMode;
32 unsigned char lfrCurrentMode;
33
33
34 // APB CONFIGURATION REGISTERS
34 // APB CONFIGURATION REGISTERS
35 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
35 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
36 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
36 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
37 #ifdef GSA
37 #ifdef GSA
38 #else
38 #else
39 new_waveform_picker_regs_t *new_waveform_picker_regs = (new_waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER;
39 new_waveform_picker_regs_t *new_waveform_picker_regs = (new_waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER;
40 #endif
40 #endif
41 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
41 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
42
42
43 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes
43 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes
44 volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
44 volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
45 //
45 //
46 volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
46 volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
47 volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
47 volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
48 volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
48 volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
49 //
49 //
50 volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
50 volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
51 volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
51 volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
52 volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
52 volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
53 //
53 //
54 volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
54 volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
55 volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
55 volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ];
56 char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ];
56 char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ];
57
57
58 // SPECTRAL MATRICES GLOBAL VARIABLES
58 // SPECTRAL MATRICES GLOBAL VARIABLES
59 volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ];
59 volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ];
60 volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ];
60 volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ];
61 volatile int spec_mat_f0_a[ SM_HEADER + TOTAL_SIZE_SM ];
61 volatile int spec_mat_f0_a[ SM_HEADER + TOTAL_SIZE_SM ];
62 volatile int spec_mat_f0_b[ SM_HEADER + TOTAL_SIZE_SM ];
62 volatile int spec_mat_f0_b[ SM_HEADER + TOTAL_SIZE_SM ];
63 volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ];
63 volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ];
64 volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ];
64 volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ];
65 volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ];
65 volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ];
66 volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ];
66 volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ];
67 volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ];
67 volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ];
68 volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ];
68 volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ];
69 volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ];
69 volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ];
70 volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ];
70 volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ];
71 //
71 //
72 volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ];
72 volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ];
73 volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ];
73 volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ];
74 //
74 //
75 volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ];
75 volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ];
76 volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ];
76 volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ];
77
77
78 // MODE PARAMETERS
78 // MODE PARAMETERS
79 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
79 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
80 struct param_local_str param_local;
80 struct param_local_str param_local;
81
81
82 // HK PACKETS
82 // HK PACKETS
83 Packet_TM_LFR_HK_t housekeeping_packet;
83 Packet_TM_LFR_HK_t housekeeping_packet;
84 // sequence counters are incremented by APID (PID + CAT) and destination ID
84 // sequence counters are incremented by APID (PID + CAT) and destination ID
85 unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID];
85 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
86 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
87 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
86 spw_stats spacewire_stats;
88 spw_stats spacewire_stats;
87 spw_stats spacewire_stats_backup;
89 spw_stats spacewire_stats_backup;
88
90
89
91
@@ -1,593 +1,582
1 /** This is the RTEMS initialization module.
1 /** This is the RTEMS initialization module.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * This module contains two very different information:
6 * This module contains two very different information:
7 * - specific instructions to configure the compilation of the RTEMS executive
7 * - specific instructions to configure the compilation of the RTEMS executive
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
9 *
9 *
10 */
10 */
11
11
12 //*************************
12 //*************************
13 // GPL reminder to be added
13 // GPL reminder to be added
14 //*************************
14 //*************************
15
15
16 #include <rtems.h>
16 #include <rtems.h>
17
17
18 /* configuration information */
18 /* configuration information */
19
19
20 #define CONFIGURE_INIT
20 #define CONFIGURE_INIT
21
21
22 #include <bsp.h> /* for device driver prototypes */
22 #include <bsp.h> /* for device driver prototypes */
23
23
24 /* configuration information */
24 /* configuration information */
25
25
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
28
28
29 #define CONFIGURE_MAXIMUM_TASKS 20
29 #define CONFIGURE_MAXIMUM_TASKS 20
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
35 #define CONFIGURE_MAXIMUM_DRIVERS 16
35 #define CONFIGURE_MAXIMUM_DRIVERS 16
36 #define CONFIGURE_MAXIMUM_PERIODS 5
36 #define CONFIGURE_MAXIMUM_PERIODS 5
37 #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s)
37 #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s)
38 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 2
38 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 2
39 #ifdef PRINT_STACK_REPORT
39 #ifdef PRINT_STACK_REPORT
40 #define CONFIGURE_STACK_CHECKER_ENABLED
40 #define CONFIGURE_STACK_CHECKER_ENABLED
41 #endif
41 #endif
42
42
43 #include <rtems/confdefs.h>
43 #include <rtems/confdefs.h>
44
44
45 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
45 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
46 #ifdef RTEMS_DRVMGR_STARTUP
46 #ifdef RTEMS_DRVMGR_STARTUP
47 #ifdef LEON3
47 #ifdef LEON3
48 /* Add Timer and UART Driver */
48 /* Add Timer and UART Driver */
49 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
49 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
50 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
50 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
51 #endif
51 #endif
52 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
52 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
53 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
53 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
54 #endif
54 #endif
55 #endif
55 #endif
56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
56 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
57 #include <drvmgr/drvmgr_confdefs.h>
57 #include <drvmgr/drvmgr_confdefs.h>
58 #endif
58 #endif
59
59
60 #include "fsw_init.h"
60 #include "fsw_init.h"
61 #include "fsw_config.c"
61 #include "fsw_config.c"
62
62
63 rtems_task Init( rtems_task_argument ignored )
63 rtems_task Init( rtems_task_argument ignored )
64 {
64 {
65 /** This is the RTEMS INIT taks, it the first task launched by the system.
65 /** This is the RTEMS INIT taks, it the first task launched by the system.
66 *
66 *
67 * @param unused is the starting argument of the RTEMS task
67 * @param unused is the starting argument of the RTEMS task
68 *
68 *
69 * The INIT task create and run all other RTEMS tasks.
69 * The INIT task create and run all other RTEMS tasks.
70 *
70 *
71 */
71 */
72
72
73 rtems_status_code status;
73 rtems_status_code status;
74 rtems_status_code status_spw;
74 rtems_status_code status_spw;
75 rtems_isr_entry old_isr_handler;
75 rtems_isr_entry old_isr_handler;
76
76
77 BOOT_PRINTF("\n\n\n\n\n")
77 BOOT_PRINTF("\n\n\n\n\n")
78 BOOT_PRINTF("***************************\n")
78 BOOT_PRINTF("***************************\n")
79 BOOT_PRINTF("** START Flight Software **\n")
79 BOOT_PRINTF("** START Flight Software **\n")
80 BOOT_PRINTF("***************************\n")
80 BOOT_PRINTF("***************************\n")
81 BOOT_PRINTF("\n\n")
81 BOOT_PRINTF("\n\n")
82
82
83 //send_console_outputs_on_apbuart_port();
83 //send_console_outputs_on_apbuart_port();
84 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
84 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
85
85
86 // waveform picker registers initialization
86 // waveform picker registers initialization
87 reset_wfp_run_burst_enable();
87 reset_wfp_run_burst_enable();
88 reset_wfp_status();
88 reset_wfp_status();
89
89
90 init_parameter_dump();
90 init_parameter_dump();
91 init_local_mode_parameters();
91 init_local_mode_parameters();
92 init_housekeeping_parameters();
92 init_housekeeping_parameters();
93
93
94 updateLFRCurrentMode();
94 updateLFRCurrentMode();
95
95
96 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
96 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
97
97
98 create_names(); // create all names
98 create_names(); // create all names
99
99
100 status = create_message_queues(); // create message queues
100 status = create_message_queues(); // create message queues
101 if (status != RTEMS_SUCCESSFUL)
101 if (status != RTEMS_SUCCESSFUL)
102 {
102 {
103 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
103 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
104 }
104 }
105
105
106 status = create_all_tasks(); // create all tasks
106 status = create_all_tasks(); // create all tasks
107 if (status != RTEMS_SUCCESSFUL)
107 if (status != RTEMS_SUCCESSFUL)
108 {
108 {
109 PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status)
109 PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status)
110 }
110 }
111
111
112 // **************************
112 // **************************
113 // <SPACEWIRE INITIALIZATION>
113 // <SPACEWIRE INITIALIZATION>
114 grspw_timecode_callback = &timecode_irq_handler;
114 grspw_timecode_callback = &timecode_irq_handler;
115
115
116 status_spw = spacewire_open_link(); // (1) open the link
116 status_spw = spacewire_open_link(); // (1) open the link
117 if ( status_spw != RTEMS_SUCCESSFUL )
117 if ( status_spw != RTEMS_SUCCESSFUL )
118 {
118 {
119 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
119 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
120 }
120 }
121
121
122 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
122 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
123 {
123 {
124 status_spw = spacewire_configure_link( fdSPW );
124 status_spw = spacewire_configure_link( fdSPW );
125 if ( status_spw != RTEMS_SUCCESSFUL )
125 if ( status_spw != RTEMS_SUCCESSFUL )
126 {
126 {
127 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
127 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
128 }
128 }
129 }
129 }
130
130
131 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
131 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
132 {
132 {
133 status_spw = spacewire_start_link( fdSPW );
133 status_spw = spacewire_start_link( fdSPW );
134 if ( status_spw != RTEMS_SUCCESSFUL )
134 if ( status_spw != RTEMS_SUCCESSFUL )
135 {
135 {
136 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
136 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
137 }
137 }
138 }
138 }
139 // </SPACEWIRE INITIALIZATION>
139 // </SPACEWIRE INITIALIZATION>
140 // ***************************
140 // ***************************
141
141
142 status = start_all_tasks(); // start all tasks
142 status = start_all_tasks(); // start all tasks
143 if (status != RTEMS_SUCCESSFUL)
143 if (status != RTEMS_SUCCESSFUL)
144 {
144 {
145 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
145 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
146 }
146 }
147
147
148 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
148 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
149 status = start_recv_send_tasks();
149 status = start_recv_send_tasks();
150 if ( status != RTEMS_SUCCESSFUL )
150 if ( status != RTEMS_SUCCESSFUL )
151 {
151 {
152 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
152 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
153 }
153 }
154
154
155 // suspend science tasks. they will be restarted later depending on the mode
155 // suspend science tasks. they will be restarted later depending on the mode
156 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
156 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
157 if (status != RTEMS_SUCCESSFUL)
157 if (status != RTEMS_SUCCESSFUL)
158 {
158 {
159 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
159 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
160 }
160 }
161
161
162 #ifdef GSA
162 #ifdef GSA
163 // mask IRQ lines
163 // mask IRQ lines
164 LEON_Mask_interrupt( IRQ_SM );
164 LEON_Mask_interrupt( IRQ_SM );
165 LEON_Mask_interrupt( IRQ_WF );
165 LEON_Mask_interrupt( IRQ_WF );
166 // Spectral Matrices simulator
166 // Spectral Matrices simulator
167 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
167 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
168 IRQ_SPARC_SM, spectral_matrices_isr );
168 IRQ_SPARC_SM, spectral_matrices_isr );
169 // WaveForms
169 // WaveForms
170 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR,
170 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR,
171 IRQ_SPARC_WF, waveforms_simulator_isr );
171 IRQ_SPARC_WF, waveforms_simulator_isr );
172 #else
172 #else
173 // configure IRQ handling for the waveform picker unit
173 // configure IRQ handling for the waveform picker unit
174 status = rtems_interrupt_catch( waveforms_isr,
174 status = rtems_interrupt_catch( waveforms_isr,
175 IRQ_SPARC_WAVEFORM_PICKER,
175 IRQ_SPARC_WAVEFORM_PICKER,
176 &old_isr_handler) ;
176 &old_isr_handler) ;
177 #endif
177 #endif
178
178
179 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
179 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
180 if ( status_spw != RTEMS_SUCCESSFUL )
180 if ( status_spw != RTEMS_SUCCESSFUL )
181 {
181 {
182 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
182 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
183 if ( status != RTEMS_SUCCESSFUL ) {
183 if ( status != RTEMS_SUCCESSFUL ) {
184 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
184 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
185 }
185 }
186 }
186 }
187
187
188 BOOT_PRINTF("delete INIT\n")
188 BOOT_PRINTF("delete INIT\n")
189
189
190 status = rtems_task_delete(RTEMS_SELF);
190 status = rtems_task_delete(RTEMS_SELF);
191
191
192 }
192 }
193
193
194 void init_local_mode_parameters( void )
194 void init_local_mode_parameters( void )
195 {
195 {
196 /** This function initialize the param_local global variable with default values.
196 /** This function initialize the param_local global variable with default values.
197 *
197 *
198 */
198 */
199
200 unsigned int i;
199 unsigned int i;
201 unsigned int j;
202 unsigned int k;
203
204 // LOCAL PARAMETERS
200 // LOCAL PARAMETERS
205 set_local_sbm1_nb_cwf_max();
201 set_local_sbm1_nb_cwf_max();
206 set_local_sbm2_nb_cwf_max();
202 set_local_sbm2_nb_cwf_max();
207 set_local_nb_interrupt_f0_MAX();
203 set_local_nb_interrupt_f0_MAX();
208
209 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
204 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
210 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
205 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
211 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
206 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
212
213 reset_local_sbm1_nb_cwf_sent();
207 reset_local_sbm1_nb_cwf_sent();
214 reset_local_sbm2_nb_cwf_sent();
208 reset_local_sbm2_nb_cwf_sent();
215
216 // init sequence counters
209 // init sequence counters
217 for (i = 0; i<SEQ_CNT_NB_PID; i++)
210 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
218 {
211 {
219 for(j = 0; j<SEQ_CNT_NB_CAT; j++)
212 sequenceCounters_TC_EXE[i] = 0x00;
220 {
221 for(k = 0; k<SEQ_CNT_NB_DEST_ID; k++)
222 {
223 sequenceCounters[i][j][k] = 0x00;
224 }
225 }
226 }
213 }
214 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
215 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
227 }
216 }
228
217
229 void create_names( void ) // create all names for tasks and queues
218 void create_names( void ) // create all names for tasks and queues
230 {
219 {
231 /** This function creates all RTEMS names used in the software for tasks and queues.
220 /** This function creates all RTEMS names used in the software for tasks and queues.
232 *
221 *
233 * @return RTEMS directive status codes:
222 * @return RTEMS directive status codes:
234 * - RTEMS_SUCCESSFUL - successful completion
223 * - RTEMS_SUCCESSFUL - successful completion
235 *
224 *
236 */
225 */
237
226
238 // task names
227 // task names
239 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
228 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
240 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
229 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
241 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
230 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
242 Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' );
231 Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' );
243 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
232 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
244 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
233 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
245 Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' );
234 Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' );
246 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
235 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
247 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
236 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
248 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
237 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
249 Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' );
238 Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' );
250 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
239 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
251 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
240 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
252 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
241 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
253 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
242 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
254 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
243 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
255
244
256 // rate monotonic period names
245 // rate monotonic period names
257 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
246 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
258
247
259 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
248 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
260 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
249 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
261 }
250 }
262
251
263 int create_all_tasks( void ) // create all tasks which run in the software
252 int create_all_tasks( void ) // create all tasks which run in the software
264 {
253 {
265 /** This function creates all RTEMS tasks used in the software.
254 /** This function creates all RTEMS tasks used in the software.
266 *
255 *
267 * @return RTEMS directive status codes:
256 * @return RTEMS directive status codes:
268 * - RTEMS_SUCCESSFUL - task created successfully
257 * - RTEMS_SUCCESSFUL - task created successfully
269 * - RTEMS_INVALID_ADDRESS - id is NULL
258 * - RTEMS_INVALID_ADDRESS - id is NULL
270 * - RTEMS_INVALID_NAME - invalid task name
259 * - RTEMS_INVALID_NAME - invalid task name
271 * - RTEMS_INVALID_PRIORITY - invalid task priority
260 * - RTEMS_INVALID_PRIORITY - invalid task priority
272 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
261 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
273 * - RTEMS_TOO_MANY - too many tasks created
262 * - RTEMS_TOO_MANY - too many tasks created
274 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
263 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
275 * - RTEMS_TOO_MANY - too many global objects
264 * - RTEMS_TOO_MANY - too many global objects
276 *
265 *
277 */
266 */
278
267
279 rtems_status_code status;
268 rtems_status_code status;
280
269
281 // RECV
270 // RECV
282 status = rtems_task_create(
271 status = rtems_task_create(
283 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
272 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
284 RTEMS_DEFAULT_MODES,
273 RTEMS_DEFAULT_MODES,
285 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
274 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
286 );
275 );
287
276
288 if (status == RTEMS_SUCCESSFUL) // ACTN
277 if (status == RTEMS_SUCCESSFUL) // ACTN
289 {
278 {
290 status = rtems_task_create(
279 status = rtems_task_create(
291 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
280 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
292 RTEMS_DEFAULT_MODES,
281 RTEMS_DEFAULT_MODES,
293 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
282 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
294 );
283 );
295 }
284 }
296 if (status == RTEMS_SUCCESSFUL) // SPIQ
285 if (status == RTEMS_SUCCESSFUL) // SPIQ
297 {
286 {
298 status = rtems_task_create(
287 status = rtems_task_create(
299 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
288 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
300 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
289 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
301 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
290 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
302 );
291 );
303 }
292 }
304 if (status == RTEMS_SUCCESSFUL) // SMIQ
293 if (status == RTEMS_SUCCESSFUL) // SMIQ
305 {
294 {
306 status = rtems_task_create(
295 status = rtems_task_create(
307 Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE,
296 Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE,
308 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
297 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
309 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ]
298 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ]
310 );
299 );
311 }
300 }
312 if (status == RTEMS_SUCCESSFUL) // STAT
301 if (status == RTEMS_SUCCESSFUL) // STAT
313 {
302 {
314 status = rtems_task_create(
303 status = rtems_task_create(
315 Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE,
304 Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE,
316 RTEMS_DEFAULT_MODES,
305 RTEMS_DEFAULT_MODES,
317 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT]
306 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT]
318 );
307 );
319 }
308 }
320 if (status == RTEMS_SUCCESSFUL) // AVF0
309 if (status == RTEMS_SUCCESSFUL) // AVF0
321 {
310 {
322 status = rtems_task_create(
311 status = rtems_task_create(
323 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
312 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
324 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
313 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
325 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
314 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
326 );
315 );
327 }
316 }
328 if (status == RTEMS_SUCCESSFUL) // BPF0
317 if (status == RTEMS_SUCCESSFUL) // BPF0
329 {
318 {
330 status = rtems_task_create(
319 status = rtems_task_create(
331 Task_name[TASKID_BPF0], TASK_PRIORITY_BPF0, RTEMS_MINIMUM_STACK_SIZE,
320 Task_name[TASKID_BPF0], TASK_PRIORITY_BPF0, RTEMS_MINIMUM_STACK_SIZE,
332 RTEMS_DEFAULT_MODES,
321 RTEMS_DEFAULT_MODES,
333 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_BPF0]
322 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_BPF0]
334 );
323 );
335 }
324 }
336 if (status == RTEMS_SUCCESSFUL) // WFRM
325 if (status == RTEMS_SUCCESSFUL) // WFRM
337 {
326 {
338 status = rtems_task_create(
327 status = rtems_task_create(
339 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
328 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
340 RTEMS_DEFAULT_MODES,
329 RTEMS_DEFAULT_MODES,
341 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
330 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
342 );
331 );
343 }
332 }
344 if (status == RTEMS_SUCCESSFUL) // DUMB
333 if (status == RTEMS_SUCCESSFUL) // DUMB
345 {
334 {
346 status = rtems_task_create(
335 status = rtems_task_create(
347 Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE,
336 Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE,
348 RTEMS_DEFAULT_MODES,
337 RTEMS_DEFAULT_MODES,
349 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB]
338 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB]
350 );
339 );
351 }
340 }
352 if (status == RTEMS_SUCCESSFUL) // HOUS
341 if (status == RTEMS_SUCCESSFUL) // HOUS
353 {
342 {
354 status = rtems_task_create(
343 status = rtems_task_create(
355 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
344 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
356 RTEMS_DEFAULT_MODES,
345 RTEMS_DEFAULT_MODES,
357 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
346 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
358 );
347 );
359 }
348 }
360 if (status == RTEMS_SUCCESSFUL) // MATR
349 if (status == RTEMS_SUCCESSFUL) // MATR
361 {
350 {
362 status = rtems_task_create(
351 status = rtems_task_create(
363 Task_name[TASKID_MATR], TASK_PRIORITY_MATR, RTEMS_MINIMUM_STACK_SIZE,
352 Task_name[TASKID_MATR], TASK_PRIORITY_MATR, RTEMS_MINIMUM_STACK_SIZE,
364 RTEMS_DEFAULT_MODES,
353 RTEMS_DEFAULT_MODES,
365 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR]
354 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR]
366 );
355 );
367 }
356 }
368 if (status == RTEMS_SUCCESSFUL) // CWF3
357 if (status == RTEMS_SUCCESSFUL) // CWF3
369 {
358 {
370 status = rtems_task_create(
359 status = rtems_task_create(
371 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
360 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
372 RTEMS_DEFAULT_MODES,
361 RTEMS_DEFAULT_MODES,
373 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF3]
362 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF3]
374 );
363 );
375 }
364 }
376 if (status == RTEMS_SUCCESSFUL) // CWF2
365 if (status == RTEMS_SUCCESSFUL) // CWF2
377 {
366 {
378 status = rtems_task_create(
367 status = rtems_task_create(
379 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
368 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
380 RTEMS_DEFAULT_MODES,
369 RTEMS_DEFAULT_MODES,
381 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF2]
370 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF2]
382 );
371 );
383 }
372 }
384 if (status == RTEMS_SUCCESSFUL) // CWF1
373 if (status == RTEMS_SUCCESSFUL) // CWF1
385 {
374 {
386 status = rtems_task_create(
375 status = rtems_task_create(
387 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
376 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
388 RTEMS_DEFAULT_MODES,
377 RTEMS_DEFAULT_MODES,
389 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF1]
378 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF1]
390 );
379 );
391 }
380 }
392 if (status == RTEMS_SUCCESSFUL) // SEND
381 if (status == RTEMS_SUCCESSFUL) // SEND
393 {
382 {
394 status = rtems_task_create(
383 status = rtems_task_create(
395 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE,
384 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE,
396 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
385 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
397 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND]
386 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND]
398 );
387 );
399 }
388 }
400 if (status == RTEMS_SUCCESSFUL) // WTDG
389 if (status == RTEMS_SUCCESSFUL) // WTDG
401 {
390 {
402 status = rtems_task_create(
391 status = rtems_task_create(
403 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
392 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
404 RTEMS_DEFAULT_MODES,
393 RTEMS_DEFAULT_MODES,
405 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
394 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
406 );
395 );
407 }
396 }
408
397
409 return status;
398 return status;
410 }
399 }
411
400
412 int start_recv_send_tasks( void )
401 int start_recv_send_tasks( void )
413 {
402 {
414 rtems_status_code status;
403 rtems_status_code status;
415
404
416 status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 );
405 status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 );
417 if (status!=RTEMS_SUCCESSFUL) {
406 if (status!=RTEMS_SUCCESSFUL) {
418 BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n")
407 BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n")
419 }
408 }
420
409
421 if (status == RTEMS_SUCCESSFUL) // SEND
410 if (status == RTEMS_SUCCESSFUL) // SEND
422 {
411 {
423 status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 );
412 status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 );
424 if (status!=RTEMS_SUCCESSFUL) {
413 if (status!=RTEMS_SUCCESSFUL) {
425 BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n")
414 BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n")
426 }
415 }
427 }
416 }
428
417
429 return status;
418 return status;
430 }
419 }
431
420
432 int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS
421 int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS
433 {
422 {
434 /** This function starts all RTEMS tasks used in the software.
423 /** This function starts all RTEMS tasks used in the software.
435 *
424 *
436 * @return RTEMS directive status codes:
425 * @return RTEMS directive status codes:
437 * - RTEMS_SUCCESSFUL - ask started successfully
426 * - RTEMS_SUCCESSFUL - ask started successfully
438 * - RTEMS_INVALID_ADDRESS - invalid task entry point
427 * - RTEMS_INVALID_ADDRESS - invalid task entry point
439 * - RTEMS_INVALID_ID - invalid task id
428 * - RTEMS_INVALID_ID - invalid task id
440 * - RTEMS_INCORRECT_STATE - task not in the dormant state
429 * - RTEMS_INCORRECT_STATE - task not in the dormant state
441 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task
430 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task
442 *
431 *
443 */
432 */
444 // starts all the tasks fot eh flight software
433 // starts all the tasks fot eh flight software
445
434
446 rtems_status_code status;
435 rtems_status_code status;
447
436
448 status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 );
437 status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 );
449 if (status!=RTEMS_SUCCESSFUL) {
438 if (status!=RTEMS_SUCCESSFUL) {
450 BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n")
439 BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n")
451 }
440 }
452
441
453 if (status == RTEMS_SUCCESSFUL) // WTDG
442 if (status == RTEMS_SUCCESSFUL) // WTDG
454 {
443 {
455 status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 );
444 status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 );
456 if (status!=RTEMS_SUCCESSFUL) {
445 if (status!=RTEMS_SUCCESSFUL) {
457 BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n")
446 BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n")
458 }
447 }
459 }
448 }
460
449
461 if (status == RTEMS_SUCCESSFUL) // SMIQ
450 if (status == RTEMS_SUCCESSFUL) // SMIQ
462 {
451 {
463 status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 );
452 status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 );
464 if (status!=RTEMS_SUCCESSFUL) {
453 if (status!=RTEMS_SUCCESSFUL) {
465 BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n")
454 BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n")
466 }
455 }
467 }
456 }
468
457
469 if (status == RTEMS_SUCCESSFUL) // ACTN
458 if (status == RTEMS_SUCCESSFUL) // ACTN
470 {
459 {
471 status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 );
460 status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 );
472 if (status!=RTEMS_SUCCESSFUL) {
461 if (status!=RTEMS_SUCCESSFUL) {
473 BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n")
462 BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n")
474 }
463 }
475 }
464 }
476
465
477 if (status == RTEMS_SUCCESSFUL) // STAT
466 if (status == RTEMS_SUCCESSFUL) // STAT
478 {
467 {
479 status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 );
468 status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 );
480 if (status!=RTEMS_SUCCESSFUL) {
469 if (status!=RTEMS_SUCCESSFUL) {
481 BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n")
470 BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n")
482 }
471 }
483 }
472 }
484
473
485 if (status == RTEMS_SUCCESSFUL) // AVF0
474 if (status == RTEMS_SUCCESSFUL) // AVF0
486 {
475 {
487 status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 );
476 status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 );
488 if (status!=RTEMS_SUCCESSFUL) {
477 if (status!=RTEMS_SUCCESSFUL) {
489 BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n")
478 BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n")
490 }
479 }
491 }
480 }
492
481
493 if (status == RTEMS_SUCCESSFUL) // BPF0
482 if (status == RTEMS_SUCCESSFUL) // BPF0
494 {
483 {
495 status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 );
484 status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 );
496 if (status!=RTEMS_SUCCESSFUL) {
485 if (status!=RTEMS_SUCCESSFUL) {
497 BOOT_PRINTF("in INIT *** Error starting TASK_BPF0\n")
486 BOOT_PRINTF("in INIT *** Error starting TASK_BPF0\n")
498 }
487 }
499 }
488 }
500
489
501 if (status == RTEMS_SUCCESSFUL) // WFRM
490 if (status == RTEMS_SUCCESSFUL) // WFRM
502 {
491 {
503 status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 );
492 status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 );
504 if (status!=RTEMS_SUCCESSFUL) {
493 if (status!=RTEMS_SUCCESSFUL) {
505 BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n")
494 BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n")
506 }
495 }
507 }
496 }
508
497
509 if (status == RTEMS_SUCCESSFUL) // DUMB
498 if (status == RTEMS_SUCCESSFUL) // DUMB
510 {
499 {
511 status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 );
500 status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 );
512 if (status!=RTEMS_SUCCESSFUL) {
501 if (status!=RTEMS_SUCCESSFUL) {
513 BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n")
502 BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n")
514 }
503 }
515 }
504 }
516
505
517 if (status == RTEMS_SUCCESSFUL) // HOUS
506 if (status == RTEMS_SUCCESSFUL) // HOUS
518 {
507 {
519 status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 );
508 status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 );
520 if (status!=RTEMS_SUCCESSFUL) {
509 if (status!=RTEMS_SUCCESSFUL) {
521 BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n")
510 BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n")
522 }
511 }
523 }
512 }
524
513
525 if (status == RTEMS_SUCCESSFUL) // MATR
514 if (status == RTEMS_SUCCESSFUL) // MATR
526 {
515 {
527 status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 );
516 status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 );
528 if (status!=RTEMS_SUCCESSFUL) {
517 if (status!=RTEMS_SUCCESSFUL) {
529 BOOT_PRINTF("in INIT *** Error starting TASK_MATR\n")
518 BOOT_PRINTF("in INIT *** Error starting TASK_MATR\n")
530 }
519 }
531 }
520 }
532
521
533 if (status == RTEMS_SUCCESSFUL) // CWF3
522 if (status == RTEMS_SUCCESSFUL) // CWF3
534 {
523 {
535 status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 );
524 status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 );
536 if (status!=RTEMS_SUCCESSFUL) {
525 if (status!=RTEMS_SUCCESSFUL) {
537 BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n")
526 BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n")
538 }
527 }
539 }
528 }
540
529
541 if (status == RTEMS_SUCCESSFUL) // CWF2
530 if (status == RTEMS_SUCCESSFUL) // CWF2
542 {
531 {
543 status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 );
532 status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 );
544 if (status!=RTEMS_SUCCESSFUL) {
533 if (status!=RTEMS_SUCCESSFUL) {
545 BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n")
534 BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n")
546 }
535 }
547 }
536 }
548
537
549 if (status == RTEMS_SUCCESSFUL) // CWF1
538 if (status == RTEMS_SUCCESSFUL) // CWF1
550 {
539 {
551 status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 );
540 status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 );
552 if (status!=RTEMS_SUCCESSFUL) {
541 if (status!=RTEMS_SUCCESSFUL) {
553 BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n")
542 BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n")
554 }
543 }
555 }
544 }
556 return status;
545 return status;
557 }
546 }
558
547
559 rtems_status_code create_message_queues( void ) // create the two message queues used in the software
548 rtems_status_code create_message_queues( void ) // create the two message queues used in the software
560 {
549 {
561 rtems_status_code status_recv;
550 rtems_status_code status_recv;
562 rtems_status_code status_send;
551 rtems_status_code status_send;
563 rtems_status_code ret;
552 rtems_status_code ret;
564 rtems_id queue_id;
553 rtems_id queue_id;
565
554
566 // create the queue for handling valid TCs
555 // create the queue for handling valid TCs
567 status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV],
556 status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV],
568 ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
557 ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
569 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
558 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
570 if ( status_recv != RTEMS_SUCCESSFUL ) {
559 if ( status_recv != RTEMS_SUCCESSFUL ) {
571 PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv)
560 PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv)
572 }
561 }
573
562
574 // create the queue for handling TM packet sending
563 // create the queue for handling TM packet sending
575 status_send = rtems_message_queue_create( misc_name[QUEUE_SEND],
564 status_send = rtems_message_queue_create( misc_name[QUEUE_SEND],
576 ACTION_MSG_PKTS_COUNT, ACTION_MSG_PKTS_MAX_SIZE,
565 ACTION_MSG_PKTS_COUNT, ACTION_MSG_PKTS_MAX_SIZE,
577 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
566 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
578 if ( status_send != RTEMS_SUCCESSFUL ) {
567 if ( status_send != RTEMS_SUCCESSFUL ) {
579 PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send)
568 PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send)
580 }
569 }
581
570
582 if ( status_recv != RTEMS_SUCCESSFUL )
571 if ( status_recv != RTEMS_SUCCESSFUL )
583 {
572 {
584 ret = status_recv;
573 ret = status_recv;
585 }
574 }
586 else
575 else
587 {
576 {
588 ret = status_send;
577 ret = status_send;
589 }
578 }
590
579
591 return ret;
580 return ret;
592 }
581 }
593
582
@@ -1,1177 +1,1225
1 /** Functions and tasks related to waveform packet generation.
1 /** Functions and tasks related to waveform packet generation.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * A group of functions to handle waveforms, in snapshot or continuous format.\n
6 * A group of functions to handle waveforms, in snapshot or continuous format.\n
7 *
7 *
8 */
8 */
9
9
10 #include "wf_handler.h"
10 #include "wf_handler.h"
11
11
12 // SWF
12 // SWF
13 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7];
13 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7];
14 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7];
14 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7];
15 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7];
15 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7];
16 // CWF
16 // CWF
17 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7];
17 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7];
18 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7];
18 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7];
19 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7];
19 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7];
20 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7];
20 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7];
21 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7];
21 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7];
22
22
23 unsigned char doubleSendCWF1 = 0;
23 unsigned char doubleSendCWF1 = 0;
24 unsigned char doubleSendCWF2 = 0;
24 unsigned char doubleSendCWF2 = 0;
25
25
26 rtems_isr waveforms_isr( rtems_vector_number vector )
26 rtems_isr waveforms_isr( rtems_vector_number vector )
27 {
27 {
28 /** This is the interrupt sub routine called by the waveform picker core.
28 /** This is the interrupt sub routine called by the waveform picker core.
29 *
29 *
30 * This ISR launch different actions depending mainly on two pieces of information:
30 * This ISR launch different actions depending mainly on two pieces of information:
31 * 1. the values read in the registers of the waveform picker.
31 * 1. the values read in the registers of the waveform picker.
32 * 2. the current LFR mode.
32 * 2. the current LFR mode.
33 *
33 *
34 */
34 */
35
35
36 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
36 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
37 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err
37 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err
38
38
39 #ifdef GSA
39 #ifdef GSA
40 #else
40 #else
41 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
41 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
42 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
42 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
43 { // in modes other than STANDBY and BURST, send the CWF_F3 data
43 { // in modes other than STANDBY and BURST, send the CWF_F3 data
44 if ((new_waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
44 if ((new_waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
45 // (1) change the receiving buffer for the waveform picker
45 // (1) change the receiving buffer for the waveform picker
46 if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
46 if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
47 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis);
47 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis);
48 }
48 }
49 else {
49 else {
50 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3);
50 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3);
51 }
51 }
52 // (2) send an event for the waveforms transmission
52 // (2) send an event for the waveforms transmission
53 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
53 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
54 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
54 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
55 }
55 }
56 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
56 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
57 }
57 }
58 }
58 }
59 #endif
59 #endif
60
60
61 switch(lfrCurrentMode)
61 switch(lfrCurrentMode)
62 {
62 {
63 //********
63 //********
64 // STANDBY
64 // STANDBY
65 case(LFR_MODE_STANDBY):
65 case(LFR_MODE_STANDBY):
66 break;
66 break;
67
67
68 //******
68 //******
69 // NORMAL
69 // NORMAL
70 case(LFR_MODE_NORMAL):
70 case(LFR_MODE_NORMAL):
71 #ifdef GSA
71 #ifdef GSA
72 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
72 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
73 #else
73 #else
74 if ( (new_waveform_picker_regs->run_burst_enable & 0x7) == 0x0 ){ // if no channel is enable
74 if ( (new_waveform_picker_regs->run_burst_enable & 0x7) == 0x0 ){ // if no channel is enable
75 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
75 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
76 }
76 }
77 else {
77 else {
78 if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
78 if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
79 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable & 0x08;
79 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable & 0x08;
80 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
80 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
81 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
81 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
82 }
82 }
83 // new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0x00;
83 // new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0x00;
84 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
84 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
85 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x07; // [0111] enable f2 f1 f0
85 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x07; // [0111] enable f2 f1 f0
86 }
86 }
87 }
87 }
88 #endif
88 #endif
89 break;
89 break;
90
90
91 //******
91 //******
92 // BURST
92 // BURST
93 case(LFR_MODE_BURST):
93 case(LFR_MODE_BURST):
94 #ifdef GSA
94 #ifdef GSA
95 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
95 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
96 #else
96 #else
97 if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
97 if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
98 // (1) change the receiving buffer for the waveform picker
98 // (1) change the receiving buffer for the waveform picker
99 if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
99 if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
100 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
100 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
101 }
101 }
102 else {
102 else {
103 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
103 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
104 }
104 }
105 // (2) send an event for the waveforms transmission
105 // (2) send an event for the waveforms transmission
106 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
106 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
107 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
107 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
108 }
108 }
109 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
109 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
110 }
110 }
111 #endif
111 #endif
112 break;
112 break;
113
113
114 //*****
114 //*****
115 // SBM1
115 // SBM1
116 case(LFR_MODE_SBM1):
116 case(LFR_MODE_SBM1):
117 #ifdef GSA
117 #ifdef GSA
118 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
118 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
119 #else
119 #else
120 if ((new_waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit
120 if ((new_waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit
121 // (1) change the receiving buffer for the waveform picker
121 // (1) change the receiving buffer for the waveform picker
122 if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) )
122 if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) )
123 {
123 {
124 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_norm);
124 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_norm);
125 }
125 }
126 else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm )
126 else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm )
127 {
127 {
128 doubleSendCWF1 = 1;
128 doubleSendCWF1 = 1;
129 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
129 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
130 }
130 }
131 else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) {
131 else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) {
132 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis);
132 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis);
133 }
133 }
134 else {
134 else {
135 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
135 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
136 }
136 }
137 // (2) send an event for the waveforms transmission
137 // (2) send an event for the waveforms transmission
138 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
138 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
139 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
139 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
140 }
140 }
141 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
141 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
142 }
142 }
143 if ( ( (new_waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit
143 if ( ( (new_waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit
144 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
144 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
145 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
145 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
146 }
146 }
147 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
147 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
148 reset_local_sbm1_nb_cwf_sent();
148 reset_local_sbm1_nb_cwf_sent();
149 }
149 }
150
150
151 #endif
151 #endif
152 break;
152 break;
153
153
154 //*****
154 //*****
155 // SBM2
155 // SBM2
156 case(LFR_MODE_SBM2):
156 case(LFR_MODE_SBM2):
157 #ifdef GSA
157 #ifdef GSA
158 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
158 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
159 #else
159 #else
160 if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
160 if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
161 // (1) change the receiving buffer for the waveform picker
161 // (1) change the receiving buffer for the waveform picker
162 if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) )
162 if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) )
163 {
163 {
164 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_norm);
164 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_norm);
165 }
165 }
166 else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) {
166 else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) {
167 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
167 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
168 doubleSendCWF2 = 1;
168 doubleSendCWF2 = 1;
169 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) {
169 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) {
170 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
170 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
171 }
171 }
172 reset_local_sbm2_nb_cwf_sent();
172 reset_local_sbm2_nb_cwf_sent();
173 }
173 }
174 else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) {
174 else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) {
175 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
175 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
176 }
176 }
177 else {
177 else {
178 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
178 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
179 }
179 }
180 // (2) send an event for the waveforms transmission
180 // (2) send an event for the waveforms transmission
181 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
181 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
182 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
182 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
183 }
183 }
184 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
184 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
185 }
185 }
186 if ( ( (new_waveform_picker_regs->status & 0x03) == 0x03 ) ) { // [0011] f3 f2 f1 f0, f1 and f0 are full
186 if ( ( (new_waveform_picker_regs->status & 0x03) == 0x03 ) ) { // [0011] f3 f2 f1 f0, f1 and f0 are full
187 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
187 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
188 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
188 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
189 }
189 }
190 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
190 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
191 }
191 }
192 #endif
192 #endif
193 break;
193 break;
194
194
195 //********
195 //********
196 // DEFAULT
196 // DEFAULT
197 default:
197 default:
198 break;
198 break;
199 }
199 }
200 }
200 }
201
201
202 rtems_isr waveforms_simulator_isr( rtems_vector_number vector )
202 rtems_isr waveforms_simulator_isr( rtems_vector_number vector )
203 {
203 {
204 /** This is the interrupt sub routine called by the waveform picker simulator.
204 /** This is the interrupt sub routine called by the waveform picker simulator.
205 *
205 *
206 * This ISR is for debug purpose only.
206 * This ISR is for debug purpose only.
207 *
207 *
208 */
208 */
209
209
210 unsigned char lfrMode;
210 unsigned char lfrMode;
211 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
211 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
212
212
213 switch(lfrMode) {
213 switch(lfrMode) {
214 case (LFR_MODE_STANDBY):
214 case (LFR_MODE_STANDBY):
215 break;
215 break;
216 case (LFR_MODE_NORMAL):
216 case (LFR_MODE_NORMAL):
217 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
217 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
218 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 );
218 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 );
219 }
219 }
220 break;
220 break;
221 case (LFR_MODE_BURST):
221 case (LFR_MODE_BURST):
222 break;
222 break;
223 case (LFR_MODE_SBM1):
223 case (LFR_MODE_SBM1):
224 break;
224 break;
225 case (LFR_MODE_SBM2):
225 case (LFR_MODE_SBM2):
226 break;
226 break;
227 }
227 }
228 }
228 }
229
229
230 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
230 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
231 {
231 {
232 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
232 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
233 *
233 *
234 * @param unused is the starting argument of the RTEMS task
234 * @param unused is the starting argument of the RTEMS task
235 *
235 *
236 * The following data packets are sent by this task:
236 * The following data packets are sent by this task:
237 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
237 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
238 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
238 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
239 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
239 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
240 *
240 *
241 */
241 */
242
242
243 rtems_event_set event_out;
243 rtems_event_set event_out;
244 rtems_id queue_id;
244 rtems_id queue_id;
245
245
246 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
246 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
247 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
247 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
248 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
248 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
249
249
250 init_waveforms();
250 init_waveforms();
251
251
252 queue_id = get_pkts_queue_id();
252 queue_id = get_pkts_queue_id();
253
253
254 BOOT_PRINTF("in WFRM ***\n")
254 BOOT_PRINTF("in WFRM ***\n")
255
255
256 while(1){
256 while(1){
257 // wait for an RTEMS_EVENT
257 // wait for an RTEMS_EVENT
258 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
258 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
259 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
259 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
260 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
260 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
261
261
262 if (event_out == RTEMS_EVENT_MODE_NORMAL)
262 if (event_out == RTEMS_EVENT_MODE_NORMAL)
263 {
263 {
264 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
264 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
265 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
265 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
266 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
266 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
267 #ifdef GSA
267 #ifdef GSA
268 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0
268 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0
269 #endif
269 #endif
270 }
270 }
271 else if (event_out == RTEMS_EVENT_MODE_SBM1)
271 else if (event_out == RTEMS_EVENT_MODE_SBM1)
272 {
272 {
273 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
273 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
274 send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
274 send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
275 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
275 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
276 #ifdef GSA
276 #ifdef GSA
277 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0
277 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0
278 #endif
278 #endif
279 }
279 }
280 else if (event_out == RTEMS_EVENT_MODE_SBM2)
280 else if (event_out == RTEMS_EVENT_MODE_SBM2)
281 {
281 {
282 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
282 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
283 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
283 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
284 #ifdef GSA
284 #ifdef GSA
285 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
285 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
286 #endif
286 #endif
287 }
287 }
288 else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM)
288 else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM)
289 {
289 {
290 send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
290 send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
291 }
291 }
292 else
292 else
293 {
293 {
294 PRINTF("in WFRM *** unexpected event")
294 PRINTF("in WFRM *** unexpected event")
295 }
295 }
296
296
297
297
298 #ifdef GSA
298 #ifdef GSA
299 // irq processed, reset the related register of the timer unit
299 // irq processed, reset the related register of the timer unit
300 gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010;
300 gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010;
301 // clear the interruption
301 // clear the interruption
302 LEON_Unmask_interrupt( IRQ_WF );
302 LEON_Unmask_interrupt( IRQ_WF );
303 #endif
303 #endif
304 }
304 }
305 }
305 }
306
306
307 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
307 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
308 {
308 {
309 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
309 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
310 *
310 *
311 * @param unused is the starting argument of the RTEMS task
311 * @param unused is the starting argument of the RTEMS task
312 *
312 *
313 * The following data packet is sent by this task:
313 * The following data packet is sent by this task:
314 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
314 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
315 *
315 *
316 */
316 */
317
317
318 rtems_event_set event_out;
318 rtems_event_set event_out;
319 rtems_id queue_id;
319 rtems_id queue_id;
320
320
321 init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 );
321 init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 );
322 init_header_continuous_wf3_light_table( headerCWF_F3_light );
322 init_header_continuous_wf3_light_table( headerCWF_F3_light );
323
323
324 queue_id = get_pkts_queue_id();
324 queue_id = get_pkts_queue_id();
325
325
326 BOOT_PRINTF("in CWF3 ***\n")
326 BOOT_PRINTF("in CWF3 ***\n")
327
327
328 while(1){
328 while(1){
329 // wait for an RTEMS_EVENT
329 // wait for an RTEMS_EVENT
330 rtems_event_receive( RTEMS_EVENT_0,
330 rtems_event_receive( RTEMS_EVENT_0,
331 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
331 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
332 PRINTF("send CWF F3 \n")
332 PRINTF("send CWF F3 \n")
333 #ifdef GSA
333 #ifdef GSA
334 #else
334 #else
335 if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
335 if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
336 send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id );
336 send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id );
337 }
337 }
338 else {
338 else {
339 send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id );
339 send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id );
340 }
340 }
341 #endif
341 #endif
342 }
342 }
343 }
343 }
344
344
345 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
345 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
346 {
346 {
347 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
347 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
348 *
348 *
349 * @param unused is the starting argument of the RTEMS task
349 * @param unused is the starting argument of the RTEMS task
350 *
350 *
351 * The following data packet is sent by this function:
351 * The following data packet is sent by this function:
352 * - TM_LFR_SCIENCE_BURST_CWF_F2
352 * - TM_LFR_SCIENCE_BURST_CWF_F2
353 * - TM_LFR_SCIENCE_SBM2_CWF_F2
353 * - TM_LFR_SCIENCE_SBM2_CWF_F2
354 *
354 *
355 */
355 */
356
356
357 rtems_event_set event_out;
357 rtems_event_set event_out;
358 rtems_id queue_id;
358 rtems_id queue_id;
359
359
360 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
360 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
361 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
361 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
362
362
363 queue_id = get_pkts_queue_id();
363 queue_id = get_pkts_queue_id();
364
364
365 BOOT_PRINTF("in CWF2 ***\n")
365 BOOT_PRINTF("in CWF2 ***\n")
366
366
367 while(1){
367 while(1){
368 // wait for an RTEMS_EVENT
368 // wait for an RTEMS_EVENT
369 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
369 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
370 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
370 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
371
371
372 if (event_out == RTEMS_EVENT_MODE_BURST)
372 if (event_out == RTEMS_EVENT_MODE_BURST)
373 {
373 {
374 // F2
374 // F2
375 #ifdef GSA
375 #ifdef GSA
376 #else
376 #else
377 if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
377 if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
378 send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
378 send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
379 }
379 }
380 else {
380 else {
381 send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
381 send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
382 }
382 }
383 #endif
383 #endif
384 }
384 }
385
385
386 else if (event_out == RTEMS_EVENT_MODE_SBM2)
386 else if (event_out == RTEMS_EVENT_MODE_SBM2)
387 {
387 {
388 #ifdef GSA
388 #ifdef GSA
389 #else
389 #else
390 if (doubleSendCWF2 == 1)
390 if (doubleSendCWF2 == 1)
391 {
391 {
392 doubleSendCWF2 = 0;
392 doubleSendCWF2 = 0;
393 send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
393 send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
394 }
394 }
395 else if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
395 else if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
396 send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
396 send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
397 }
397 }
398 else {
398 else {
399 send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
399 send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
400 }
400 }
401 param_local.local_sbm2_nb_cwf_sent ++;
401 param_local.local_sbm2_nb_cwf_sent ++;
402 #endif
402 #endif
403 }
403 }
404 else
404 else
405 {
405 {
406 PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode)
406 PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode)
407 }
407 }
408 }
408 }
409 }
409 }
410
410
411 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
411 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
412 {
412 {
413 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
413 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
414 *
414 *
415 * @param unused is the starting argument of the RTEMS task
415 * @param unused is the starting argument of the RTEMS task
416 *
416 *
417 * The following data packet is sent by this function:
417 * The following data packet is sent by this function:
418 * - TM_LFR_SCIENCE_SBM1_CWF_F1
418 * - TM_LFR_SCIENCE_SBM1_CWF_F1
419 *
419 *
420 */
420 */
421
421
422 rtems_event_set event_out;
422 rtems_event_set event_out;
423 rtems_id queue_id;
423 rtems_id queue_id;
424
424
425 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
425 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
426
426
427 queue_id = get_pkts_queue_id();
427 queue_id = get_pkts_queue_id();
428
428
429 BOOT_PRINTF("in CWF1 ***\n")
429 BOOT_PRINTF("in CWF1 ***\n")
430
430
431 while(1){
431 while(1){
432 // wait for an RTEMS_EVENT
432 // wait for an RTEMS_EVENT
433 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
433 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
434 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
434 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
435 if (event_out == RTEMS_EVENT_MODE_SBM1)
435 if (event_out == RTEMS_EVENT_MODE_SBM1)
436 {
436 {
437 #ifdef GSA
437 #ifdef GSA
438 #else
438 #else
439 if (doubleSendCWF1 == 1)
439 if (doubleSendCWF1 == 1)
440 {
440 {
441 doubleSendCWF1 = 0;
441 doubleSendCWF1 = 0;
442 send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
442 send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
443 }
443 }
444 else if (new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) {
444 else if (new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) {
445 send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
445 send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
446 }
446 }
447 else {
447 else {
448 send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
448 send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
449 }
449 }
450 param_local.local_sbm1_nb_cwf_sent ++;
450 param_local.local_sbm1_nb_cwf_sent ++;
451 #endif
451 #endif
452 }
452 }
453 else
453 else
454 {
454 {
455 PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode)
455 PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode)
456 }
456 }
457 }
457 }
458 }
458 }
459
459
460 //******************
460 //******************
461 // general functions
461 // general functions
462 void init_waveforms( void )
462 void init_waveforms( void )
463 {
463 {
464 int i = 0;
464 int i = 0;
465
465
466 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
466 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
467 {
467 {
468 //***
468 //***
469 // F0
469 // F0
470 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
470 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
471 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
471 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
472 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
472 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
473
473
474 //***
474 //***
475 // F1
475 // F1
476 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
476 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
477 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
477 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
478 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
478 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
479
479
480 //***
480 //***
481 // F2
481 // F2
482 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
482 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
483 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
483 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
484 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
484 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
485
485
486 //***
486 //***
487 // F3
487 // F3
488 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
488 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
489 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
489 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
490 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
490 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
491 }
491 }
492 }
492 }
493
493
494 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
494 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
495 {
495 {
496 unsigned char i;
496 unsigned char i;
497
497
498 for (i=0; i<7; i++)
498 for (i=0; i<7; i++)
499 {
499 {
500 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
500 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
501 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
501 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
502 headerSWF[ i ].reserved = DEFAULT_RESERVED;
502 headerSWF[ i ].reserved = DEFAULT_RESERVED;
503 headerSWF[ i ].userApplication = CCSDS_USER_APP;
503 headerSWF[ i ].userApplication = CCSDS_USER_APP;
504 headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
504 headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
505 headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
505 headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
506 if (i == 0)
506 if (i == 0)
507 {
507 {
508 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
508 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
509 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
509 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
510 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
510 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
511 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
511 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
512 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
512 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
513 }
513 }
514 else if (i == 6)
514 else if (i == 6)
515 {
515 {
516 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
516 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
517 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8);
517 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8);
518 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 );
518 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 );
519 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
519 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
520 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
520 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
521 }
521 }
522 else
522 else
523 {
523 {
524 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
524 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
525 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
525 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
526 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
526 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
527 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
527 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
528 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
528 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
529 }
529 }
530 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
530 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
531 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
531 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
532 headerSWF[ i ].pktNr = i+1; // PKT_NR
532 headerSWF[ i ].pktNr = i+1; // PKT_NR
533 // DATA FIELD HEADER
533 // DATA FIELD HEADER
534 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
534 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
535 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
535 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
536 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
536 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
537 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
537 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
538 // AUXILIARY DATA HEADER
538 // AUXILIARY DATA HEADER
539 headerSWF[ i ].sid = sid;
539 headerSWF[ i ].sid = sid;
540 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
540 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
541 headerSWF[ i ].time[0] = 0x00;
541 headerSWF[ i ].time[0] = 0x00;
542 headerSWF[ i ].time[0] = 0x00;
542 headerSWF[ i ].time[0] = 0x00;
543 headerSWF[ i ].time[0] = 0x00;
543 headerSWF[ i ].time[0] = 0x00;
544 headerSWF[ i ].time[0] = 0x00;
544 headerSWF[ i ].time[0] = 0x00;
545 headerSWF[ i ].time[0] = 0x00;
545 headerSWF[ i ].time[0] = 0x00;
546 headerSWF[ i ].time[0] = 0x00;
546 headerSWF[ i ].time[0] = 0x00;
547 }
547 }
548 return LFR_SUCCESSFUL;
548 return LFR_SUCCESSFUL;
549 }
549 }
550
550
551 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
551 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
552 {
552 {
553 unsigned int i;
553 unsigned int i;
554
554
555 for (i=0; i<7; i++)
555 for (i=0; i<7; i++)
556 {
556 {
557 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
557 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
558 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
558 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
559 headerCWF[ i ].reserved = DEFAULT_RESERVED;
559 headerCWF[ i ].reserved = DEFAULT_RESERVED;
560 headerCWF[ i ].userApplication = CCSDS_USER_APP;
560 headerCWF[ i ].userApplication = CCSDS_USER_APP;
561 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
561 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
562 {
562 {
563 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
563 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
564 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
564 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
565 }
565 }
566 else
566 else
567 {
567 {
568 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
568 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
569 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
569 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
570 }
570 }
571 if (i == 0)
571 if (i == 0)
572 {
572 {
573 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
573 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
574 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
574 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
575 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
575 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
576 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
576 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
577 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
577 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
578 }
578 }
579 else if (i == 6)
579 else if (i == 6)
580 {
580 {
581 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
581 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
582 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8);
582 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8);
583 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 );
583 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 );
584 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
584 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
585 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
585 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
586 }
586 }
587 else
587 else
588 {
588 {
589 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
589 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
590 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
590 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
591 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
591 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
592 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
592 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
593 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
593 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
594 }
594 }
595 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
595 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
596 // PKT_CNT
596 // PKT_CNT
597 // PKT_NR
597 // PKT_NR
598 // DATA FIELD HEADER
598 // DATA FIELD HEADER
599 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
599 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
600 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
600 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
601 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
601 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
602 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
602 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
603 // AUXILIARY DATA HEADER
603 // AUXILIARY DATA HEADER
604 headerCWF[ i ].sid = sid;
604 headerCWF[ i ].sid = sid;
605 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
605 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
606 headerCWF[ i ].time[0] = 0x00;
606 headerCWF[ i ].time[0] = 0x00;
607 headerCWF[ i ].time[0] = 0x00;
607 headerCWF[ i ].time[0] = 0x00;
608 headerCWF[ i ].time[0] = 0x00;
608 headerCWF[ i ].time[0] = 0x00;
609 headerCWF[ i ].time[0] = 0x00;
609 headerCWF[ i ].time[0] = 0x00;
610 headerCWF[ i ].time[0] = 0x00;
610 headerCWF[ i ].time[0] = 0x00;
611 headerCWF[ i ].time[0] = 0x00;
611 headerCWF[ i ].time[0] = 0x00;
612 }
612 }
613 return LFR_SUCCESSFUL;
613 return LFR_SUCCESSFUL;
614 }
614 }
615
615
616 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
616 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
617 {
617 {
618 unsigned int i;
618 unsigned int i;
619
619
620 for (i=0; i<7; i++)
620 for (i=0; i<7; i++)
621 {
621 {
622 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
622 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
623 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
623 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
624 headerCWF[ i ].reserved = DEFAULT_RESERVED;
624 headerCWF[ i ].reserved = DEFAULT_RESERVED;
625 headerCWF[ i ].userApplication = CCSDS_USER_APP;
625 headerCWF[ i ].userApplication = CCSDS_USER_APP;
626
626
627 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
627 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
628 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
628 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
629 if (i == 0)
629 if (i == 0)
630 {
630 {
631 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
631 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
632 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
632 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
633 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
633 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
634 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
634 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
635 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
635 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
636 }
636 }
637 else if (i == 6)
637 else if (i == 6)
638 {
638 {
639 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
639 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
640 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8);
640 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8);
641 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 );
641 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 );
642 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
642 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
643 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
643 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
644 }
644 }
645 else
645 else
646 {
646 {
647 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
647 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
648 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
648 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
649 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
649 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
650 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
650 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
651 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
651 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
652 }
652 }
653 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
653 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
654 // DATA FIELD HEADER
654 // DATA FIELD HEADER
655 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
655 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
656 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
656 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
657 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
657 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
658 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
658 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
659 // AUXILIARY DATA HEADER
659 // AUXILIARY DATA HEADER
660 headerCWF[ i ].sid = SID_NORM_CWF_F3;
660 headerCWF[ i ].sid = SID_NORM_CWF_F3;
661 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
661 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
662 headerCWF[ i ].time[0] = 0x00;
662 headerCWF[ i ].time[0] = 0x00;
663 headerCWF[ i ].time[0] = 0x00;
663 headerCWF[ i ].time[0] = 0x00;
664 headerCWF[ i ].time[0] = 0x00;
664 headerCWF[ i ].time[0] = 0x00;
665 headerCWF[ i ].time[0] = 0x00;
665 headerCWF[ i ].time[0] = 0x00;
666 headerCWF[ i ].time[0] = 0x00;
666 headerCWF[ i ].time[0] = 0x00;
667 headerCWF[ i ].time[0] = 0x00;
667 headerCWF[ i ].time[0] = 0x00;
668 }
668 }
669 return LFR_SUCCESSFUL;
669 return LFR_SUCCESSFUL;
670 }
670 }
671
671
672 void reset_waveforms( void )
672 void reset_waveforms( void )
673 {
673 {
674 int i = 0;
674 int i = 0;
675
675
676 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
676 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
677 {
677 {
678 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000;
678 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000;
679 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
679 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
680 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
680 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
681
681
682 //***
682 //***
683 // F1
683 // F1
684 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000;
684 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000;
685 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000;
685 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000;
686 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
686 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
687
687
688 //***
688 //***
689 // F2
689 // F2
690 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000;
690 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000;
691 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
691 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
692 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000;
692 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000;
693
693
694 //***
694 //***
695 // F3
695 // F3
696 /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1
696 /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1
697 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1
697 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1
698 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/
698 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/
699 }
699 }
700 }
700 }
701
701
702 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
702 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
703 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
703 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
704 {
704 {
705 /** This function sends SWF CCSDS packets (F2, F1 or F0).
705 /** This function sends SWF CCSDS packets (F2, F1 or F0).
706 *
706 *
707 * @param waveform points to the buffer containing the data that will be send.
707 * @param waveform points to the buffer containing the data that will be send.
708 * @param sid is the source identifier of the data that will be sent.
708 * @param sid is the source identifier of the data that will be sent.
709 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
709 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
710 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
710 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
711 * contain information to setup the transmission of the data packets.
711 * contain information to setup the transmission of the data packets.
712 *
712 *
713 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
713 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
714 *
714 *
715 */
715 */
716
716
717 unsigned int i;
717 unsigned int i;
718 int ret;
718 int ret;
719 rtems_status_code status;
719 rtems_status_code status;
720 spw_ioctl_pkt_send spw_ioctl_send_SWF;
720 spw_ioctl_pkt_send spw_ioctl_send_SWF;
721
721
722 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
722 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
723 spw_ioctl_send_SWF.options = 0;
723 spw_ioctl_send_SWF.options = 0;
724
724
725 ret = LFR_DEFAULT;
725 ret = LFR_DEFAULT;
726
726
727 for (i=0; i<7; i++) // send waveform
727 for (i=0; i<7; i++) // send waveform
728 {
728 {
729 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
729 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
730 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
730 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
731 // BUILD THE DATA
731 // BUILD THE DATA
732 if (i==6) {
732 if (i==6) {
733 spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK;
733 spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK;
734 }
734 }
735 else {
735 else {
736 spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK;
736 spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK;
737 }
737 }
738 // SET PACKET SEQUENCE COUNTER
739 increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
738 // SET PACKET TIME
740 // SET PACKET TIME
739 headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
741 headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
740 headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
742 headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
741 headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
743 headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
742 headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
744 headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
743 headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
745 headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
744 headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
746 headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
745 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
747 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
746 headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
748 headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
747 headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
749 headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
748 headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
750 headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
749 headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
751 headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
750 headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
752 headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
751 // SEND PACKET
753 // SEND PACKET
752 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
754 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
753 if (status != RTEMS_SUCCESSFUL) {
755 if (status != RTEMS_SUCCESSFUL) {
754 printf("%d-%d, ERR %d\n", sid, i, (int) status);
756 printf("%d-%d, ERR %d\n", sid, i, (int) status);
755 ret = LFR_DEFAULT;
757 ret = LFR_DEFAULT;
756 }
758 }
757 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
759 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
758 }
760 }
759
761
760 return ret;
762 return ret;
761 }
763 }
762
764
763 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
765 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
764 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
766 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
765 {
767 {
766 /** This function sends CWF CCSDS packets (F2, F1 or F0).
768 /** This function sends CWF CCSDS packets (F2, F1 or F0).
767 *
769 *
768 * @param waveform points to the buffer containing the data that will be send.
770 * @param waveform points to the buffer containing the data that will be send.
769 * @param sid is the source identifier of the data that will be sent.
771 * @param sid is the source identifier of the data that will be sent.
770 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
772 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
771 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
773 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
772 * contain information to setup the transmission of the data packets.
774 * contain information to setup the transmission of the data packets.
773 *
775 *
774 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
776 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
775 *
777 *
776 */
778 */
777
779
778 unsigned int i;
780 unsigned int i;
779 int ret;
781 int ret;
780 rtems_status_code status;
782 rtems_status_code status;
781 spw_ioctl_pkt_send spw_ioctl_send_CWF;
783 spw_ioctl_pkt_send spw_ioctl_send_CWF;
782
784
783 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
785 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
784 spw_ioctl_send_CWF.options = 0;
786 spw_ioctl_send_CWF.options = 0;
785
787
786 ret = LFR_DEFAULT;
788 ret = LFR_DEFAULT;
787
789
788 for (i=0; i<7; i++) // send waveform
790 for (i=0; i<7; i++) // send waveform
789 {
791 {
790 int coarseTime = 0x00;
792 int coarseTime = 0x00;
791 int fineTime = 0x00;
793 int fineTime = 0x00;
792 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
794 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
793 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
795 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
794 // BUILD THE DATA
796 // BUILD THE DATA
795 if (i==6) {
797 if (i==6) {
796 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK;
798 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK;
797 }
799 }
798 else {
800 else {
799 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK;
801 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK;
800 }
802 }
803 // SET PACKET SEQUENCE COUNTER
804 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
801 // SET PACKET TIME
805 // SET PACKET TIME
802 coarseTime = time_management_regs->coarse_time;
806 coarseTime = time_management_regs->coarse_time;
803 fineTime = time_management_regs->fine_time;
807 fineTime = time_management_regs->fine_time;
804 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
808 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
805 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
809 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
806 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
810 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
807 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
811 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
808 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
812 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
809 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
813 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
810 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
814 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
811 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
815 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
812 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
816 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
813 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
817 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
814 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
818 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
815 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
819 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
816 // SEND PACKET
820 // SEND PACKET
817 if (sid == SID_NORM_CWF_F3)
821 if (sid == SID_NORM_CWF_F3)
818 {
822 {
819 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
823 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
820 if (status != RTEMS_SUCCESSFUL) {
824 if (status != RTEMS_SUCCESSFUL) {
821 printf("%d-%d, ERR %d\n", sid, i, (int) status);
825 printf("%d-%d, ERR %d\n", sid, i, (int) status);
822 ret = LFR_DEFAULT;
826 ret = LFR_DEFAULT;
823 }
827 }
824 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
828 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
825 }
829 }
826 else
830 else
827 {
831 {
828 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
832 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
829 if (status != RTEMS_SUCCESSFUL) {
833 if (status != RTEMS_SUCCESSFUL) {
830 printf("%d-%d, ERR %d\n", sid, i, (int) status);
834 printf("%d-%d, ERR %d\n", sid, i, (int) status);
831 ret = LFR_DEFAULT;
835 ret = LFR_DEFAULT;
832 }
836 }
833 }
837 }
834 }
838 }
835
839
836 return ret;
840 return ret;
837 }
841 }
838
842
839 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
843 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
840 {
844 {
841 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
845 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
842 *
846 *
843 * @param waveform points to the buffer containing the data that will be send.
847 * @param waveform points to the buffer containing the data that will be send.
844 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
848 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
845 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
849 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
846 * contain information to setup the transmission of the data packets.
850 * contain information to setup the transmission of the data packets.
847 *
851 *
848 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
852 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
849 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
853 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
850 *
854 *
851 */
855 */
852
856
853 unsigned int i;
857 unsigned int i;
854 int ret;
858 int ret;
855 rtems_status_code status;
859 rtems_status_code status;
856 spw_ioctl_pkt_send spw_ioctl_send_CWF;
860 spw_ioctl_pkt_send spw_ioctl_send_CWF;
857 char *sample;
861 char *sample;
858
862
859 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
863 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
860 spw_ioctl_send_CWF.options = 0;
864 spw_ioctl_send_CWF.options = 0;
861
865
862 ret = LFR_DEFAULT;
866 ret = LFR_DEFAULT;
863
867
864 //**********************
868 //**********************
865 // BUILD CWF3_light DATA
869 // BUILD CWF3_light DATA
866 for ( i=0; i< 2048; i++)
870 for ( i=0; i< 2048; i++)
867 {
871 {
868 sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ];
872 sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ];
869 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ];
873 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ];
870 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ];
874 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ];
871 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ];
875 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ];
872 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ];
876 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ];
873 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ];
877 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ];
874 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
878 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
875 }
879 }
876
880
877 //*********************
881 //*********************
878 // SEND CWF3_light DATA
882 // SEND CWF3_light DATA
879
883
880 for (i=0; i<7; i++) // send waveform
884 for (i=0; i<7; i++) // send waveform
881 {
885 {
882 int coarseTime = 0x00;
886 int coarseTime = 0x00;
883 int fineTime = 0x00;
887 int fineTime = 0x00;
884 spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ];
888 spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ];
885 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
889 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
886 // BUILD THE DATA
890 // BUILD THE DATA
887 if ( i == WFRM_INDEX_OF_LAST_PACKET ) {
891 if ( i == WFRM_INDEX_OF_LAST_PACKET ) {
888 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK;
892 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK;
889 }
893 }
890 else {
894 else {
891 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK;
895 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK;
892 }
896 }
897 // SET PACKET SEQUENCE COUNTER
898 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
893 // SET PACKET TIME
899 // SET PACKET TIME
894 coarseTime = time_management_regs->coarse_time;
900 coarseTime = time_management_regs->coarse_time;
895 fineTime = time_management_regs->fine_time;
901 fineTime = time_management_regs->fine_time;
896 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
902 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
897 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
903 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
898 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
904 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
899 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
905 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
900 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
906 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
901 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
907 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
902 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
908 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
903 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
909 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
904 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
910 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
905 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
911 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
906 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
912 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
907 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
913 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
908 // SEND PACKET
914 // SEND PACKET
909 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
915 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
910 if (status != RTEMS_SUCCESSFUL) {
916 if (status != RTEMS_SUCCESSFUL) {
911 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
917 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
912 ret = LFR_DEFAULT;
918 ret = LFR_DEFAULT;
913 }
919 }
914 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
920 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
915 }
921 }
916
922
917 return ret;
923 return ret;
918 }
924 }
919
925
920
926
921 //**************
927 //**************
922 // wfp registers
928 // wfp registers
923 void set_wfp_data_shaping()
929 void set_wfp_data_shaping()
924 {
930 {
925 /** This function sets the data_shaping register of the waveform picker module.
931 /** This function sets the data_shaping register of the waveform picker module.
926 *
932 *
927 * The value is read from one field of the parameter_dump_packet structure:\n
933 * The value is read from one field of the parameter_dump_packet structure:\n
928 * bw_sp0_sp1_r0_r1
934 * bw_sp0_sp1_r0_r1
929 *
935 *
930 */
936 */
931
937
932 unsigned char data_shaping;
938 unsigned char data_shaping;
933
939
934 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
940 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
935 // waveform picker : [R1 R0 SP1 SP0 BW]
941 // waveform picker : [R1 R0 SP1 SP0 BW]
936
942
937 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
943 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
938
944
939 #ifdef GSA
945 #ifdef GSA
940 #else
946 #else
941 new_waveform_picker_regs->data_shaping =
947 new_waveform_picker_regs->data_shaping =
942 ( (data_shaping & 0x10) >> 4 ) // BW
948 ( (data_shaping & 0x10) >> 4 ) // BW
943 + ( (data_shaping & 0x08) >> 2 ) // SP0
949 + ( (data_shaping & 0x08) >> 2 ) // SP0
944 + ( (data_shaping & 0x04) ) // SP1
950 + ( (data_shaping & 0x04) ) // SP1
945 + ( (data_shaping & 0x02) << 2 ) // R0
951 + ( (data_shaping & 0x02) << 2 ) // R0
946 + ( (data_shaping & 0x01) << 4 ); // R1
952 + ( (data_shaping & 0x01) << 4 ); // R1
947 #endif
953 #endif
948 }
954 }
949
955
950 char set_wfp_delta_snapshot()
956 char set_wfp_delta_snapshot()
951 {
957 {
952 /** This function sets the delta_snapshot register of the waveform picker module.
958 /** This function sets the delta_snapshot register of the waveform picker module.
953 *
959 *
954 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
960 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
955 * - sy_lfr_n_swf_p[0]
961 * - sy_lfr_n_swf_p[0]
956 * - sy_lfr_n_swf_p[1]
962 * - sy_lfr_n_swf_p[1]
957 *
963 *
958 */
964 */
959
965
960 char ret;
966 char ret;
961 unsigned int delta_snapshot;
967 unsigned int delta_snapshot;
962 unsigned int aux;
968 unsigned int aux;
963
969
964 aux = 0;
970 aux = 0;
965 ret = LFR_DEFAULT;
971 ret = LFR_DEFAULT;
966
972
967 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
973 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
968 + parameter_dump_packet.sy_lfr_n_swf_p[1];
974 + parameter_dump_packet.sy_lfr_n_swf_p[1];
969
975
970 #ifdef GSA
976 #ifdef GSA
971 #else
977 #else
972 if ( delta_snapshot < MIN_DELTA_SNAPSHOT )
978 if ( delta_snapshot < MIN_DELTA_SNAPSHOT )
973 {
979 {
974 aux = MIN_DELTA_SNAPSHOT;
980 aux = MIN_DELTA_SNAPSHOT;
975 ret = LFR_DEFAULT;
981 ret = LFR_DEFAULT;
976 }
982 }
977 else
983 else
978 {
984 {
979 aux = delta_snapshot ;
985 aux = delta_snapshot ;
980 ret = LFR_SUCCESSFUL;
986 ret = LFR_SUCCESSFUL;
981 }
987 }
982 new_waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes
988 new_waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes
983 #endif
989 #endif
984
990
985 return ret;
991 return ret;
986 }
992 }
987
993
988 void set_wfp_burst_enable_register( unsigned char mode)
994 void set_wfp_burst_enable_register( unsigned char mode)
989 {
995 {
990 /** This function sets the waveform picker burst_enable register depending on the mode.
996 /** This function sets the waveform picker burst_enable register depending on the mode.
991 *
997 *
992 * @param mode is the LFR mode to launch.
998 * @param mode is the LFR mode to launch.
993 *
999 *
994 * The burst bits shall be before the enable bits.
1000 * The burst bits shall be before the enable bits.
995 *
1001 *
996 */
1002 */
997
1003
998 #ifdef GSA
1004 #ifdef GSA
999 #else
1005 #else
1000 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1006 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1001 // the burst bits shall be set first, before the enable bits
1007 // the burst bits shall be set first, before the enable bits
1002 switch(mode) {
1008 switch(mode) {
1003 case(LFR_MODE_NORMAL):
1009 case(LFR_MODE_NORMAL):
1004 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1010 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1005 // new_waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1011 // new_waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1006 new_waveform_picker_regs->run_burst_enable = 0x07; // [0000 0111] enable f2 f1 f0
1012 new_waveform_picker_regs->run_burst_enable = 0x07; // [0000 0111] enable f2 f1 f0
1007 break;
1013 break;
1008 case(LFR_MODE_BURST):
1014 case(LFR_MODE_BURST):
1009 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1015 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1010 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1016 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1011 break;
1017 break;
1012 case(LFR_MODE_SBM1):
1018 case(LFR_MODE_SBM1):
1013 new_waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1019 new_waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1014 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1020 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1015 break;
1021 break;
1016 case(LFR_MODE_SBM2):
1022 case(LFR_MODE_SBM2):
1017 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1023 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1018 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1024 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1019 break;
1025 break;
1020 default:
1026 default:
1021 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1027 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1022 break;
1028 break;
1023 }
1029 }
1024 #endif
1030 #endif
1025 }
1031 }
1026
1032
1027 void reset_wfp_run_burst_enable()
1033 void reset_wfp_run_burst_enable()
1028 {
1034 {
1029 /** This function resets the waveform picker burst_enable register.
1035 /** This function resets the waveform picker burst_enable register.
1030 *
1036 *
1031 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
1037 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
1032 *
1038 *
1033 */
1039 */
1034
1040
1035 #ifdef GSA
1041 #ifdef GSA
1036 #else
1042 #else
1037 new_waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1043 new_waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1038 #endif
1044 #endif
1039 }
1045 }
1040
1046
1041 void reset_wfp_status()
1047 void reset_wfp_status()
1042 {
1048 {
1043 /** This function resets the waveform picker status register.
1049 /** This function resets the waveform picker status register.
1044 *
1050 *
1045 * All status bits are set to 0 [new_err full_err full].
1051 * All status bits are set to 0 [new_err full_err full].
1046 *
1052 *
1047 */
1053 */
1048
1054
1049 #ifdef GSA
1055 #ifdef GSA
1050 #else
1056 #else
1051 new_waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1057 new_waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1052 #endif
1058 #endif
1053 }
1059 }
1054
1060
1055 void reset_new_waveform_picker_regs()
1061 void reset_new_waveform_picker_regs()
1056 {
1062 {
1063 /** This function resets the waveform picker module registers.
1064 *
1065 * The registers affected by this function are located at the following offset addresses:
1066 * - 0x00 data_shaping
1067 * - 0x04 run_burst_enable
1068 * - 0x08 addr_data_f0
1069 * - 0x0C addr_data_f1
1070 * - 0x10 addr_data_f2
1071 * - 0x14 addr_data_f3
1072 * - 0x18 status
1073 * - 0x1C delta_snapshot
1074 * - 0x20 delta_f0
1075 * - 0x24 delta_f0_2
1076 * - 0x28 delta_f1
1077 * - 0x2c delta_f2
1078 * - 0x30 nb_data_by_buffer
1079 * - 0x34 nb_snapshot_param
1080 * - 0x38 start_date
1081 *
1082 */
1083
1057 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1084 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1058 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1085 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1059 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
1086 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
1060 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // 0x0c
1087 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // 0x0c
1061 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // 0x10
1088 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // 0x10
1062 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // 0x14
1089 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // 0x14
1063 new_waveform_picker_regs->status = 0x00; // 0x18
1090 new_waveform_picker_regs->status = 0x00; // 0x18
1064 // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
1091 // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
1065 new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
1092 new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
1066 new_waveform_picker_regs->delta_f0 = 0x3f5; // 0x20 *** 1013
1093 new_waveform_picker_regs->delta_f0 = 0x3f5; // 0x20 *** 1013
1067 new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7
1094 new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7
1068 new_waveform_picker_regs->delta_f1 = 0x3c0; // 0x28 *** 960
1095 new_waveform_picker_regs->delta_f1 = 0x3c0; // 0x28 *** 960
1069 // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240
1096 // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240
1070 new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 2048
1097 new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 2048
1071 new_waveform_picker_regs->nb_data_by_buffer = 0x1802; // 0x30 *** 2048 * 3 + 2
1098 new_waveform_picker_regs->nb_data_by_buffer = 0x1802; // 0x30 *** 2048 * 3 + 2
1072 new_waveform_picker_regs->snapshot_param = 0x7ff; // 0x34 *** 2048 -1
1099 new_waveform_picker_regs->snapshot_param = 0x7ff; // 0x34 *** 2048 -1
1073 new_waveform_picker_regs->start_date = 0x00; // 0x38
1100 new_waveform_picker_regs->start_date = 0x00; // 0x38
1074 }
1101 }
1075
1102
1076 void reset_new_waveform_picker_regs_alt()
1077 {
1078 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1079 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1080 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
1081 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // 0x0c
1082 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // 0x10
1083 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // 0x14
1084 new_waveform_picker_regs->status = 0x00; // 0x18
1085 new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
1086 new_waveform_picker_regs->delta_f0 = 0x19; // 0x20 *** 1013
1087 new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7
1088 new_waveform_picker_regs->delta_f1 = 0x19; // 0x28 *** 960
1089 new_waveform_picker_regs->delta_f2 = 0x400; // 0x2c *** 4 * 256 = 1024
1090 new_waveform_picker_regs->nb_data_by_buffer = 0x32; // 0x30 *** 16 * 3 + 2
1091 new_waveform_picker_regs->snapshot_param = 0xf; // 0x34 *** 16 -1
1092 new_waveform_picker_regs->start_date = 0x00; // 0x38
1093 }
1094
1095 //*****************
1103 //*****************
1096 // local parameters
1104 // local parameters
1097 void set_local_sbm1_nb_cwf_max()
1105 void set_local_sbm1_nb_cwf_max()
1098 {
1106 {
1099 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1107 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1100 *
1108 *
1101 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1109 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1102 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n
1110 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n
1103 * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot)
1111 * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot)
1104 *
1112 *
1105 */
1113 */
1106 param_local.local_sbm1_nb_cwf_max = 2 *
1114 param_local.local_sbm1_nb_cwf_max = 2 *
1107 (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1115 (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1108 + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2
1116 + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2
1109 }
1117 }
1110
1118
1111 void set_local_sbm2_nb_cwf_max()
1119 void set_local_sbm2_nb_cwf_max()
1112 {
1120 {
1113 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1121 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1114 *
1122 *
1115 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1123 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1116 * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n
1124 * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n
1117 * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz)
1125 * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz)
1118 *
1126 *
1119 */
1127 */
1120
1128
1121 param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1129 param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1122 + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8;
1130 + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8;
1123 }
1131 }
1124
1132
1125 void set_local_nb_interrupt_f0_MAX()
1133 void set_local_nb_interrupt_f0_MAX()
1126 {
1134 {
1127 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1135 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1128 *
1136 *
1129 * This parameter is used for the SM validation only.\n
1137 * This parameter is used for the SM validation only.\n
1130 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1138 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1131 * module before launching a basic processing.
1139 * module before launching a basic processing.
1132 *
1140 *
1133 */
1141 */
1134
1142
1135 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1143 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1136 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1144 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1137 }
1145 }
1138
1146
1139 void reset_local_sbm1_nb_cwf_sent()
1147 void reset_local_sbm1_nb_cwf_sent()
1140 {
1148 {
1141 /** This function resets the value of the sbm1_nb_cwf_sent local parameter.
1149 /** This function resets the value of the sbm1_nb_cwf_sent local parameter.
1142 *
1150 *
1143 * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n
1151 * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n
1144 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.
1152 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.
1145 *
1153 *
1146 */
1154 */
1147
1155
1148 param_local.local_sbm1_nb_cwf_sent = 0;
1156 param_local.local_sbm1_nb_cwf_sent = 0;
1149 }
1157 }
1150
1158
1151 void reset_local_sbm2_nb_cwf_sent()
1159 void reset_local_sbm2_nb_cwf_sent()
1152 {
1160 {
1153 /** This function resets the value of the sbm2_nb_cwf_sent local parameter.
1161 /** This function resets the value of the sbm2_nb_cwf_sent local parameter.
1154 *
1162 *
1155 * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n
1163 * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n
1156 * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active.
1164 * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active.
1157 *
1165 *
1158 */
1166 */
1159
1167
1160 param_local.local_sbm2_nb_cwf_sent = 0;
1168 param_local.local_sbm2_nb_cwf_sent = 0;
1161 }
1169 }
1162
1170
1163 rtems_id get_pkts_queue_id( void )
1171 rtems_id get_pkts_queue_id( void )
1164 {
1172 {
1165 rtems_id queue_id;
1173 rtems_id queue_id;
1166 rtems_status_code status;
1174 rtems_status_code status;
1167 rtems_name queue_send_name;
1175 rtems_name queue_send_name;
1168
1176
1169 queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' );
1177 queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' );
1170
1178
1171 status = rtems_message_queue_ident( queue_send_name, 0, &queue_id );
1179 status = rtems_message_queue_ident( queue_send_name, 0, &queue_id );
1172 if (status != RTEMS_SUCCESSFUL)
1180 if (status != RTEMS_SUCCESSFUL)
1173 {
1181 {
1174 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
1182 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
1175 }
1183 }
1176 return queue_id;
1184 return queue_id;
1177 }
1185 }
1186
1187 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1188 {
1189 unsigned short *sequence_cnt;
1190 unsigned short segmentation_grouping_flag;
1191 unsigned short new_packet_sequence_control;
1192
1193 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
1194 || (sid ==SID_NORM_CWF_F3) || (sid ==SID_BURST_CWF_F2) )
1195 {
1196 sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST;
1197 }
1198 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
1199 {
1200 sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2;
1201 }
1202 else
1203 {
1204 sequence_cnt = &sequenceCounters_TC_EXE[ UNKNOWN ];
1205 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
1206 }
1207
1208 segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8;
1209 *sequence_cnt = (*sequence_cnt) & 0x3fff;
1210
1211 new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ;
1212
1213 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
1214 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
1215
1216 // increment the sequence counter for the next packet
1217 if ( *sequence_cnt < SEQ_CNT_MAX)
1218 {
1219 *sequence_cnt = *sequence_cnt + 1;
1220 }
1221 else
1222 {
1223 *sequence_cnt = 0;
1224 }
1225 }
General Comments 0
You need to be logged in to leave comments. Login now