@@ -1,339 +1,339 | |||||
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 3.0.0, 2014-02-1 |
|
3 | <!-- Written by QtCreator 3.0.0, 2014-02-14T07:07:03. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> | |
7 | <value type="int">1</value> |
|
7 | <value type="int">1</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="QByteArray" key="CurrentPreferences">CppGlobal</value> |
|
18 | <value type="QByteArray" 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="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> |
|
24 | <value type="QByteArray" 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">UTF-8</value> |
|
28 | <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</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</value> |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value> | |
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> |
|
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> | |
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</value> |
|
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</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">0</value> |
|
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
61 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> |
|
61 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> | |
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
63 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
63 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
64 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
64 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
67 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
67 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
69 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> |
|
69 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> | |
70 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
70 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
71 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
71 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
72 | </valuemap> |
|
72 | </valuemap> | |
73 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
73 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
74 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
74 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
77 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
77 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
78 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
78 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
79 | <value type="QString">-w</value> |
|
79 | <value type="QString">-w</value> | |
80 | <value type="QString">-r</value> |
|
80 | <value type="QString">-r</value> | |
81 | </valuelist> |
|
81 | </valuelist> | |
82 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
82 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
84 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
84 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
85 | </valuemap> |
|
85 | </valuemap> | |
86 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
86 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
89 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
89 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
90 | </valuemap> |
|
90 | </valuemap> | |
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
92 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
92 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
93 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
93 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
96 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
96 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
97 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
97 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
98 | <value type="QString">-w</value> |
|
98 | <value type="QString">-w</value> | |
99 | <value type="QString">-r</value> |
|
99 | <value type="QString">-r</value> | |
100 | </valuelist> |
|
100 | </valuelist> | |
101 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
101 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
103 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
103 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
104 | </valuemap> |
|
104 | </valuemap> | |
105 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
105 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
108 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
108 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
109 | </valuemap> |
|
109 | </valuemap> | |
110 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
110 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
111 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
111 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
112 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
112 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> | |
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
115 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
115 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
116 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
116 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> | |
118 | </valuemap> |
|
118 | </valuemap> | |
119 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> |
|
119 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> | |
120 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|
120 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
122 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
122 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</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">ProjectExplorer.BuildSteps.Deploy</value> |
|
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
126 | </valuemap> |
|
126 | </valuemap> | |
127 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
127 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
128 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> |
|
128 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> | |
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
131 | </valuemap> |
|
131 | </valuemap> | |
132 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
132 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
133 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|
133 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
134 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
134 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
135 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
135 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
136 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
136 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
137 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
137 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
138 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
138 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
139 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
139 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
140 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
140 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
141 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
141 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
142 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
142 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
143 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
143 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
144 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> |
|
144 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> | |
145 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
145 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
146 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
146 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
147 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> |
|
147 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> | |
148 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> |
|
148 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> | |
149 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> |
|
149 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> | |
150 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
150 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
151 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
151 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
152 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
152 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
153 | <value type="int">0</value> |
|
153 | <value type="int">0</value> | |
154 | <value type="int">1</value> |
|
154 | <value type="int">1</value> | |
155 | <value type="int">2</value> |
|
155 | <value type="int">2</value> | |
156 | <value type="int">3</value> |
|
156 | <value type="int">3</value> | |
157 | <value type="int">4</value> |
|
157 | <value type="int">4</value> | |
158 | <value type="int">5</value> |
|
158 | <value type="int">5</value> | |
159 | <value type="int">6</value> |
|
159 | <value type="int">6</value> | |
160 | <value type="int">7</value> |
|
160 | <value type="int">7</value> | |
161 | <value type="int">8</value> |
|
161 | <value type="int">8</value> | |
162 | <value type="int">9</value> |
|
162 | <value type="int">9</value> | |
163 | <value type="int">10</value> |
|
163 | <value type="int">10</value> | |
164 | <value type="int">11</value> |
|
164 | <value type="int">11</value> | |
165 | <value type="int">12</value> |
|
165 | <value type="int">12</value> | |
166 | <value type="int">13</value> |
|
166 | <value type="int">13</value> | |
167 | <value type="int">14</value> |
|
167 | <value type="int">14</value> | |
168 | </valuelist> |
|
168 | </valuelist> | |
169 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|
169 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
170 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
170 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</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.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> |
|
173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> | |
174 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
174 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
175 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
175 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
176 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
176 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
177 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
177 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
178 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
178 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
179 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
179 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
180 | <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> |
|
180 | <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> | |
181 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> |
|
181 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> | |
182 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
182 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> | |
183 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
183 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
184 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
184 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> | |
185 | </valuemap> |
|
185 | </valuemap> | |
186 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|
186 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> | |
187 | </valuemap> |
|
187 | </valuemap> | |
188 | </data> |
|
188 | </data> | |
189 | <data> |
|
189 | <data> | |
190 | <variable>ProjectExplorer.Project.Target.1</variable> |
|
190 | <variable>ProjectExplorer.Project.Target.1</variable> | |
191 | <valuemap type="QVariantMap"> |
|
191 | <valuemap type="QVariantMap"> | |
192 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> |
|
192 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> | |
193 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> |
|
193 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> | |
194 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value> |
|
194 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value> | |
195 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
195 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
196 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
196 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
197 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|
197 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
198 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
198 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
199 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> |
|
199 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> | |
200 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
200 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
201 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
201 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
202 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
202 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
203 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
203 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
204 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
204 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
205 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
205 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
206 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
206 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
207 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> |
|
207 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> | |
208 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
208 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
209 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
209 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
210 | </valuemap> |
|
210 | </valuemap> | |
211 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
211 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
212 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
212 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
213 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
213 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
214 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
214 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
215 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
215 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
216 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
216 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
217 | <value type="QString">-w</value> |
|
217 | <value type="QString">-w</value> | |
218 | <value type="QString">-r</value> |
|
218 | <value type="QString">-r</value> | |
219 | </valuelist> |
|
219 | </valuelist> | |
220 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
220 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
221 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
221 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
222 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
222 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
223 | </valuemap> |
|
223 | </valuemap> | |
224 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
224 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
225 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
225 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
226 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
226 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
227 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
227 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
228 | </valuemap> |
|
228 | </valuemap> | |
229 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
229 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
230 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
230 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
231 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
231 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
232 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
232 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
233 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
233 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
234 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
234 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
235 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
235 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
236 | <value type="QString">-w</value> |
|
236 | <value type="QString">-w</value> | |
237 | <value type="QString">-r</value> |
|
237 | <value type="QString">-r</value> | |
238 | </valuelist> |
|
238 | </valuelist> | |
239 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
239 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
240 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
240 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
241 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
241 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
242 | </valuemap> |
|
242 | </valuemap> | |
243 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
243 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
244 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
244 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
245 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
245 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
246 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
246 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
247 | </valuemap> |
|
247 | </valuemap> | |
248 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
248 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
249 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
249 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
250 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
250 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
251 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|
251 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> | |
252 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
252 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
253 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
253 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
254 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
254 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
255 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|
255 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> | |
256 | </valuemap> |
|
256 | </valuemap> | |
257 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> |
|
257 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> | |
258 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|
258 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
259 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
259 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
260 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
260 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
261 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
261 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> | |
262 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
262 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
263 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|
263 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
264 | </valuemap> |
|
264 | </valuemap> | |
265 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
265 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
266 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> |
|
266 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> | |
267 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
267 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
268 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|
268 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
269 | </valuemap> |
|
269 | </valuemap> | |
270 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
270 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
271 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|
271 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
272 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
272 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
273 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
273 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
274 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
274 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
275 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
275 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
276 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
276 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
277 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
277 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
278 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
278 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
279 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
279 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
280 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
280 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
281 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
281 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
282 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> |
|
282 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> | |
283 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
283 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
284 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
284 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
285 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> |
|
285 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> | |
286 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> |
|
286 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> | |
287 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> |
|
287 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> | |
288 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
288 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
289 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
289 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
290 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
290 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
291 | <value type="int">0</value> |
|
291 | <value type="int">0</value> | |
292 | <value type="int">1</value> |
|
292 | <value type="int">1</value> | |
293 | <value type="int">2</value> |
|
293 | <value type="int">2</value> | |
294 | <value type="int">3</value> |
|
294 | <value type="int">3</value> | |
295 | <value type="int">4</value> |
|
295 | <value type="int">4</value> | |
296 | <value type="int">5</value> |
|
296 | <value type="int">5</value> | |
297 | <value type="int">6</value> |
|
297 | <value type="int">6</value> | |
298 | <value type="int">7</value> |
|
298 | <value type="int">7</value> | |
299 | <value type="int">8</value> |
|
299 | <value type="int">8</value> | |
300 | <value type="int">9</value> |
|
300 | <value type="int">9</value> | |
301 | <value type="int">10</value> |
|
301 | <value type="int">10</value> | |
302 | <value type="int">11</value> |
|
302 | <value type="int">11</value> | |
303 | <value type="int">12</value> |
|
303 | <value type="int">12</value> | |
304 | <value type="int">13</value> |
|
304 | <value type="int">13</value> | |
305 | <value type="int">14</value> |
|
305 | <value type="int">14</value> | |
306 | </valuelist> |
|
306 | </valuelist> | |
307 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|
307 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
308 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
308 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
309 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
309 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> | |
310 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
310 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
311 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> |
|
311 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> | |
312 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
312 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
313 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
313 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
314 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
314 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
315 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
315 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
316 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
316 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
317 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
317 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
318 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
318 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> | |
319 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> |
|
319 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> | |
320 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
320 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> | |
321 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
321 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
322 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
322 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> | |
323 | </valuemap> |
|
323 | </valuemap> | |
324 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|
324 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> | |
325 | </valuemap> |
|
325 | </valuemap> | |
326 | </data> |
|
326 | </data> | |
327 | <data> |
|
327 | <data> | |
328 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
328 | <variable>ProjectExplorer.Project.TargetCount</variable> | |
329 | <value type="int">2</value> |
|
329 | <value type="int">2</value> | |
330 | </data> |
|
330 | </data> | |
331 | <data> |
|
331 | <data> | |
332 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
332 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> | |
333 | <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> |
|
333 | <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> | |
334 | </data> |
|
334 | </data> | |
335 | <data> |
|
335 | <data> | |
336 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
336 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> | |
337 | <value type="int">15</value> |
|
337 | <value type="int">15</value> | |
338 | </data> |
|
338 | </data> | |
339 | </qtcreator> |
|
339 | </qtcreator> |
@@ -1,230 +1,230 | |||||
1 | #ifndef FSW_PARAMS_H_INCLUDED |
|
1 | #ifndef FSW_PARAMS_H_INCLUDED | |
2 | #define FSW_PARAMS_H_INCLUDED |
|
2 | #define FSW_PARAMS_H_INCLUDED | |
3 |
|
3 | |||
4 | #include "grlib_regs.h" |
|
4 | #include "grlib_regs.h" | |
5 | #include "fsw_params_processing.h" |
|
5 | #include "fsw_params_processing.h" | |
6 | #include "tm_byte_positions.h" |
|
6 | #include "tm_byte_positions.h" | |
7 | #include "ccsds_types.h" |
|
7 | #include "ccsds_types.h" | |
8 |
|
8 | |||
9 | #define GRSPW_DEVICE_NAME "/dev/grspw0" |
|
9 | #define GRSPW_DEVICE_NAME "/dev/grspw0" | |
10 | #define UART_DEVICE_NAME "/dev/console" |
|
10 | #define UART_DEVICE_NAME "/dev/console" | |
11 |
|
11 | |||
12 | typedef struct ring_node |
|
12 | typedef struct ring_node | |
13 | { |
|
13 | { | |
14 | struct ring_node *previous; |
|
14 | struct ring_node *previous; | |
15 | int buffer_address; |
|
15 | int buffer_address; | |
16 | struct ring_node *next; |
|
16 | struct ring_node *next; | |
17 | unsigned int status; |
|
17 | unsigned int status; | |
18 | } ring_node; |
|
18 | } ring_node; | |
19 |
|
19 | |||
20 | typedef struct ring_node_sm |
|
20 | typedef struct ring_node_sm | |
21 | { |
|
21 | { | |
22 | struct ring_node *previous; |
|
22 | struct ring_node *previous; | |
23 | volatile int *buffer_address; |
|
23 | volatile int *buffer_address; | |
24 | struct ring_node *next; |
|
24 | struct ring_node *next; | |
25 | unsigned int status; |
|
25 | unsigned int status; | |
26 | } ring_node_sm; |
|
26 | } ring_node_sm; | |
27 |
|
27 | |||
28 | //************************ |
|
28 | //************************ | |
29 | // flight software version |
|
29 | // flight software version | |
30 | // this parameters is handled by the Qt project options |
|
30 | // this parameters is handled by the Qt project options | |
31 |
|
31 | |||
32 | //#define NB_SAMPLES_PER_SNAPSHOT 2048 |
|
32 | //#define NB_SAMPLES_PER_SNAPSHOT 2048 | |
33 | #define NB_SAMPLES_PER_SNAPSHOT 2352 // 336 * 7 = 2352 |
|
33 | #define NB_SAMPLES_PER_SNAPSHOT 2352 // 336 * 7 = 2352 | |
34 | #define TIME_OFFSET 2 |
|
34 | #define TIME_OFFSET 2 | |
35 | #define TIME_OFFSET_IN_BYTES 8 |
|
35 | #define TIME_OFFSET_IN_BYTES 8 | |
36 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
|
36 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 | |
37 | #define NB_BYTES_SWF_BLK (2 * 6) |
|
37 | #define NB_BYTES_SWF_BLK (2 * 6) | |
38 | #define NB_WORDS_SWF_BLK 3 |
|
38 | #define NB_WORDS_SWF_BLK 3 | |
39 | #define NB_BYTES_CWF3_LIGHT_BLK 6 |
|
39 | #define NB_BYTES_CWF3_LIGHT_BLK 6 | |
40 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 |
|
40 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 | |
41 | #define NB_RING_NODES_F0 3 // AT LEAST 3 |
|
41 | #define NB_RING_NODES_F0 3 // AT LEAST 3 | |
42 | #define NB_RING_NODES_F1 5 // AT LEAST 3 |
|
42 | #define NB_RING_NODES_F1 5 // AT LEAST 3 | |
43 | #define NB_RING_NODES_F2 5 // AT LEAST 3 |
|
43 | #define NB_RING_NODES_F2 5 // AT LEAST 3 | |
44 |
#define NB_RING_NODES_ASM_F0 12 |
|
44 | #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3 | |
45 | #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3 |
|
45 | #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3 | |
46 | #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3 |
|
46 | #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3 | |
47 |
|
47 | |||
48 | //********** |
|
48 | //********** | |
49 | // LFR MODES |
|
49 | // LFR MODES | |
50 | #define LFR_MODE_STANDBY 0 |
|
50 | #define LFR_MODE_STANDBY 0 | |
51 | #define LFR_MODE_NORMAL 1 |
|
51 | #define LFR_MODE_NORMAL 1 | |
52 | #define LFR_MODE_BURST 2 |
|
52 | #define LFR_MODE_BURST 2 | |
53 | #define LFR_MODE_SBM1 3 |
|
53 | #define LFR_MODE_SBM1 3 | |
54 | #define LFR_MODE_SBM2 4 |
|
54 | #define LFR_MODE_SBM2 4 | |
55 | #define LFR_MODE_NORMAL_CWF_F3 5 |
|
55 | #define LFR_MODE_NORMAL_CWF_F3 5 | |
56 |
|
56 | |||
57 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 |
|
57 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 | |
58 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 |
|
58 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 | |
59 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 |
|
59 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 | |
60 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 |
|
60 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 | |
61 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 |
|
61 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 | |
62 | #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5 |
|
62 | #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5 | |
63 | #define RTEMS_EVENT_MODE_NORMAL_SWF_F0 RTEMS_EVENT_6 |
|
63 | #define RTEMS_EVENT_MODE_NORMAL_SWF_F0 RTEMS_EVENT_6 | |
64 | #define RTEMS_EVENT_MODE_NORMAL_SWF_F1 RTEMS_EVENT_7 |
|
64 | #define RTEMS_EVENT_MODE_NORMAL_SWF_F1 RTEMS_EVENT_7 | |
65 | #define RTEMS_EVENT_MODE_NORMAL_SWF_F2 RTEMS_EVENT_8 |
|
65 | #define RTEMS_EVENT_MODE_NORMAL_SWF_F2 RTEMS_EVENT_8 | |
66 |
|
66 | |||
67 | //**************************** |
|
67 | //**************************** | |
68 | // LFR DEFAULT MODE PARAMETERS |
|
68 | // LFR DEFAULT MODE PARAMETERS | |
69 | // COMMON |
|
69 | // COMMON | |
70 | #define DEFAULT_SY_LFR_COMMON0 0x00 |
|
70 | #define DEFAULT_SY_LFR_COMMON0 0x00 | |
71 | #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0 |
|
71 | #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0 | |
72 | // NORM |
|
72 | // NORM | |
73 | #define SY_LFR_N_SWF_L 2048 // nb sample |
|
73 | #define SY_LFR_N_SWF_L 2048 // nb sample | |
74 |
#define SY_LFR_N_SWF_P |
|
74 | #define SY_LFR_N_SWF_P 300 // sec | |
75 | #define SY_LFR_N_ASM_P 3600 // sec |
|
75 | #define SY_LFR_N_ASM_P 3600 // sec | |
76 | #define SY_LFR_N_BP_P0 4 // sec |
|
76 | #define SY_LFR_N_BP_P0 4 // sec | |
77 | #define SY_LFR_N_BP_P1 20 // sec |
|
77 | #define SY_LFR_N_BP_P1 20 // sec | |
78 | #define MIN_DELTA_SNAPSHOT 16 // sec |
|
78 | #define MIN_DELTA_SNAPSHOT 16 // sec | |
79 | // BURST |
|
79 | // BURST | |
80 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec |
|
80 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec | |
81 | #define DEFAULT_SY_LFR_B_BP_P1 5 // sec |
|
81 | #define DEFAULT_SY_LFR_B_BP_P1 5 // sec | |
82 | // SBM1 |
|
82 | // SBM1 | |
83 | #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec |
|
83 | #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec | |
84 | #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec |
|
84 | #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec | |
85 | // SBM2 |
|
85 | // SBM2 | |
86 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec |
|
86 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec | |
87 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec |
|
87 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec | |
88 | // ADDITIONAL PARAMETERS |
|
88 | // ADDITIONAL PARAMETERS | |
89 | #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms |
|
89 | #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms | |
90 | #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s |
|
90 | #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s | |
91 | // STATUS WORD |
|
91 | // STATUS WORD | |
92 | #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits |
|
92 | #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits | |
93 | #define DEFAULT_STATUS_WORD_BYTE1 0x00 |
|
93 | #define DEFAULT_STATUS_WORD_BYTE1 0x00 | |
94 | // |
|
94 | // | |
95 | #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s |
|
95 | #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s | |
96 | #define SY_LFR_DPU_CONNECT_ATTEMPT 3 |
|
96 | #define SY_LFR_DPU_CONNECT_ATTEMPT 3 | |
97 | //**************************** |
|
97 | //**************************** | |
98 |
|
98 | |||
99 | //***************************** |
|
99 | //***************************** | |
100 | // APB REGISTERS BASE ADDRESSES |
|
100 | // APB REGISTERS BASE ADDRESSES | |
101 | #define REGS_ADDR_APBUART 0x80000100 |
|
101 | #define REGS_ADDR_APBUART 0x80000100 | |
102 | #define REGS_ADDR_GPTIMER 0x80000300 |
|
102 | #define REGS_ADDR_GPTIMER 0x80000300 | |
103 | #define REGS_ADDR_GRSPW 0x80000500 |
|
103 | #define REGS_ADDR_GRSPW 0x80000500 | |
104 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 |
|
104 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 | |
105 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 |
|
105 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 | |
106 |
|
106 | |||
107 | #ifdef GSA |
|
107 | #ifdef GSA | |
108 | #else |
|
108 | #else | |
109 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 |
|
109 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 | |
110 | #endif |
|
110 | #endif | |
111 |
|
111 | |||
112 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff |
|
112 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff | |
113 | #define APBUART_CTRL_REG_MASK_TE 0x00000002 |
|
113 | #define APBUART_CTRL_REG_MASK_TE 0x00000002 | |
114 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) |
|
114 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) | |
115 |
|
115 | |||
116 | //********** |
|
116 | //********** | |
117 | // IRQ LINES |
|
117 | // IRQ LINES | |
118 | #define IRQ_SM 9 |
|
118 | #define IRQ_SM 9 | |
119 | #define IRQ_SPARC_SM 0x19 // see sparcv8.pdf p.76 for interrupt levels |
|
119 | #define IRQ_SPARC_SM 0x19 // see sparcv8.pdf p.76 for interrupt levels | |
120 | #define IRQ_WF 10 |
|
120 | #define IRQ_WF 10 | |
121 | #define IRQ_SPARC_WF 0x1a // see sparcv8.pdf p.76 for interrupt levels |
|
121 | #define IRQ_SPARC_WF 0x1a // see sparcv8.pdf p.76 for interrupt levels | |
122 | #define IRQ_TIME1 12 |
|
122 | #define IRQ_TIME1 12 | |
123 | #define IRQ_SPARC_TIME1 0x1c // see sparcv8.pdf p.76 for interrupt levels |
|
123 | #define IRQ_SPARC_TIME1 0x1c // see sparcv8.pdf p.76 for interrupt levels | |
124 | #define IRQ_TIME2 13 |
|
124 | #define IRQ_TIME2 13 | |
125 | #define IRQ_SPARC_TIME2 0x1d // see sparcv8.pdf p.76 for interrupt levels |
|
125 | #define IRQ_SPARC_TIME2 0x1d // see sparcv8.pdf p.76 for interrupt levels | |
126 | #define IRQ_WAVEFORM_PICKER 14 |
|
126 | #define IRQ_WAVEFORM_PICKER 14 | |
127 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels |
|
127 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels | |
128 | #define IRQ_SPECTRAL_MATRIX 6 |
|
128 | #define IRQ_SPECTRAL_MATRIX 6 | |
129 | #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels |
|
129 | #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels | |
130 |
|
130 | |||
131 | //***** |
|
131 | //***** | |
132 | // TIME |
|
132 | // TIME | |
133 | #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms |
|
133 | #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms | |
134 | #define CLKDIV_WF_SIMULATOR (10000000 - 1) // 10 000 000 * 1 us = 10 s |
|
134 | #define CLKDIV_WF_SIMULATOR (10000000 - 1) // 10 000 000 * 1 us = 10 s | |
135 | #define TIMER_SM_SIMULATOR 1 |
|
135 | #define TIMER_SM_SIMULATOR 1 | |
136 | #define TIMER_WF_SIMULATOR 2 |
|
136 | #define TIMER_WF_SIMULATOR 2 | |
137 | #define HK_PERIOD 100 // 100 * 10ms => 1sec |
|
137 | #define HK_PERIOD 100 // 100 * 10ms => 1sec | |
138 |
|
138 | |||
139 | //********** |
|
139 | //********** | |
140 | // LPP CODES |
|
140 | // LPP CODES | |
141 | #define LFR_SUCCESSFUL 0 |
|
141 | #define LFR_SUCCESSFUL 0 | |
142 | #define LFR_DEFAULT 1 |
|
142 | #define LFR_DEFAULT 1 | |
143 |
|
143 | |||
144 | //****** |
|
144 | //****** | |
145 | // RTEMS |
|
145 | // RTEMS | |
146 | #define TASKID_RECV 1 |
|
146 | #define TASKID_RECV 1 | |
147 | #define TASKID_ACTN 2 |
|
147 | #define TASKID_ACTN 2 | |
148 | #define TASKID_SPIQ 3 |
|
148 | #define TASKID_SPIQ 3 | |
149 | #define TASKID_SMIQ 4 |
|
149 | #define TASKID_SMIQ 4 | |
150 | #define TASKID_STAT 5 |
|
150 | #define TASKID_STAT 5 | |
151 | #define TASKID_AVF0 6 |
|
151 | #define TASKID_AVF0 6 | |
152 | #define TASKID_BPF0 7 |
|
152 | #define TASKID_BPF0 7 | |
153 | #define TASKID_WFRM 8 |
|
153 | #define TASKID_WFRM 8 | |
154 | #define TASKID_DUMB 9 |
|
154 | #define TASKID_DUMB 9 | |
155 | #define TASKID_HOUS 10 |
|
155 | #define TASKID_HOUS 10 | |
156 | #define TASKID_MATR 11 |
|
156 | #define TASKID_MATR 11 | |
157 | #define TASKID_CWF3 12 |
|
157 | #define TASKID_CWF3 12 | |
158 | #define TASKID_CWF2 13 |
|
158 | #define TASKID_CWF2 13 | |
159 | #define TASKID_CWF1 14 |
|
159 | #define TASKID_CWF1 14 | |
160 | #define TASKID_SEND 15 |
|
160 | #define TASKID_SEND 15 | |
161 | #define TASKID_WTDG 16 |
|
161 | #define TASKID_WTDG 16 | |
162 |
|
162 | |||
163 | #define TASK_PRIORITY_SPIQ 5 |
|
163 | #define TASK_PRIORITY_SPIQ 5 | |
164 | #define TASK_PRIORITY_SMIQ 10 |
|
164 | #define TASK_PRIORITY_SMIQ 10 | |
165 | #define TASK_PRIORITY_WTDG 20 |
|
165 | #define TASK_PRIORITY_WTDG 20 | |
166 | #define TASK_PRIORITY_HOUS 30 |
|
166 | #define TASK_PRIORITY_HOUS 30 | |
167 | #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together |
|
167 | #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together | |
168 | #define TASK_PRIORITY_CWF2 35 // |
|
168 | #define TASK_PRIORITY_CWF2 35 // | |
169 | #define TASK_PRIORITY_WFRM 40 |
|
169 | #define TASK_PRIORITY_WFRM 40 | |
170 | #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1 |
|
170 | #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1 | |
171 | #define TASK_PRIORITY_SEND 45 |
|
171 | #define TASK_PRIORITY_SEND 45 | |
172 | #define TASK_PRIORITY_RECV 50 |
|
172 | #define TASK_PRIORITY_RECV 50 | |
173 | #define TASK_PRIORITY_ACTN 50 |
|
173 | #define TASK_PRIORITY_ACTN 50 | |
174 | #define TASK_PRIORITY_AVF0 60 |
|
174 | #define TASK_PRIORITY_AVF0 60 | |
175 | #define TASK_PRIORITY_BPF0 60 |
|
175 | #define TASK_PRIORITY_BPF0 60 | |
176 | #define TASK_PRIORITY_MATR 100 |
|
176 | #define TASK_PRIORITY_MATR 100 | |
177 | #define TASK_PRIORITY_STAT 200 |
|
177 | #define TASK_PRIORITY_STAT 200 | |
178 | #define TASK_PRIORITY_DUMB 200 |
|
178 | #define TASK_PRIORITY_DUMB 200 | |
179 |
|
179 | |||
180 | #define ACTION_MSG_QUEUE_COUNT 10 |
|
180 | #define ACTION_MSG_QUEUE_COUNT 10 | |
181 | #define ACTION_MSG_PKTS_COUNT 50 |
|
181 | #define ACTION_MSG_PKTS_COUNT 50 | |
182 | #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) |
|
182 | #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) | |
183 | #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options |
|
183 | #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options | |
184 |
|
184 | |||
185 | #define QUEUE_RECV 0 |
|
185 | #define QUEUE_RECV 0 | |
186 | #define QUEUE_SEND 1 |
|
186 | #define QUEUE_SEND 1 | |
187 |
|
187 | |||
188 | //******* |
|
188 | //******* | |
189 | // MACROS |
|
189 | // MACROS | |
190 | #ifdef PRINT_MESSAGES_ON_CONSOLE |
|
190 | #ifdef PRINT_MESSAGES_ON_CONSOLE | |
191 | #define PRINTF(x) printf(x); |
|
191 | #define PRINTF(x) printf(x); | |
192 | #define PRINTF1(x,y) printf(x,y); |
|
192 | #define PRINTF1(x,y) printf(x,y); | |
193 | #define PRINTF2(x,y,z) printf(x,y,z); |
|
193 | #define PRINTF2(x,y,z) printf(x,y,z); | |
194 | #else |
|
194 | #else | |
195 | #define PRINTF(x) ; |
|
195 | #define PRINTF(x) ; | |
196 | #define PRINTF1(x,y) ; |
|
196 | #define PRINTF1(x,y) ; | |
197 | #define PRINTF2(x,y,z) ; |
|
197 | #define PRINTF2(x,y,z) ; | |
198 | #endif |
|
198 | #endif | |
199 |
|
199 | |||
200 | #ifdef BOOT_MESSAGES |
|
200 | #ifdef BOOT_MESSAGES | |
201 | #define BOOT_PRINTF(x) printf(x); |
|
201 | #define BOOT_PRINTF(x) printf(x); | |
202 | #define BOOT_PRINTF1(x,y) printf(x,y); |
|
202 | #define BOOT_PRINTF1(x,y) printf(x,y); | |
203 | #define BOOT_PRINTF2(x,y,z) printf(x,y,z); |
|
203 | #define BOOT_PRINTF2(x,y,z) printf(x,y,z); | |
204 | #else |
|
204 | #else | |
205 | #define BOOT_PRINTF(x) ; |
|
205 | #define BOOT_PRINTF(x) ; | |
206 | #define BOOT_PRINTF1(x,y) ; |
|
206 | #define BOOT_PRINTF1(x,y) ; | |
207 | #define BOOT_PRINTF2(x,y,z) ; |
|
207 | #define BOOT_PRINTF2(x,y,z) ; | |
208 | #endif |
|
208 | #endif | |
209 |
|
209 | |||
210 | #ifdef DEBUG_MESSAGES |
|
210 | #ifdef DEBUG_MESSAGES | |
211 | #define DEBUG_PRINTF(x) printf(x); |
|
211 | #define DEBUG_PRINTF(x) printf(x); | |
212 | #define DEBUG_PRINTF1(x,y) printf(x,y); |
|
212 | #define DEBUG_PRINTF1(x,y) printf(x,y); | |
213 | #define DEBUG_PRINTF2(x,y,z) printf(x,y,z); |
|
213 | #define DEBUG_PRINTF2(x,y,z) printf(x,y,z); | |
214 | #else |
|
214 | #else | |
215 | #define DEBUG_PRINTF(x) ; |
|
215 | #define DEBUG_PRINTF(x) ; | |
216 | #define DEBUG_PRINTF1(x,y) ; |
|
216 | #define DEBUG_PRINTF1(x,y) ; | |
217 | #define DEBUG_PRINTF2(x,y,z) ; |
|
217 | #define DEBUG_PRINTF2(x,y,z) ; | |
218 | #endif |
|
218 | #endif | |
219 |
|
219 | |||
220 | #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period |
|
220 | #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period | |
221 |
|
221 | |||
222 | struct param_local_str{ |
|
222 | struct param_local_str{ | |
223 | unsigned int local_sbm1_nb_cwf_sent; |
|
223 | unsigned int local_sbm1_nb_cwf_sent; | |
224 | unsigned int local_sbm1_nb_cwf_max; |
|
224 | unsigned int local_sbm1_nb_cwf_max; | |
225 | unsigned int local_sbm2_nb_cwf_sent; |
|
225 | unsigned int local_sbm2_nb_cwf_sent; | |
226 | unsigned int local_sbm2_nb_cwf_max; |
|
226 | unsigned int local_sbm2_nb_cwf_max; | |
227 | unsigned int local_nb_interrupt_f0_MAX; |
|
227 | unsigned int local_nb_interrupt_f0_MAX; | |
228 | }; |
|
228 | }; | |
229 |
|
229 | |||
230 | #endif // FSW_PARAMS_H_INCLUDED |
|
230 | #endif // FSW_PARAMS_H_INCLUDED |
@@ -1,92 +1,93 | |||||
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 | #include "fsw_spacewire.h" |
|
10 | #include "fsw_spacewire.h" | |
11 | #include "fsw_misc.h" |
|
11 | #include "fsw_misc.h" | |
12 |
|
12 | |||
13 | #define pi 3.1415 |
|
13 | #define pi 3.1415 | |
14 |
|
14 | |||
15 | extern int fdSPW; |
|
15 | extern int fdSPW; | |
16 |
|
16 | |||
17 | //***************** |
|
17 | //***************** | |
18 | // waveform buffers |
|
18 | // waveform buffers | |
19 | // F0 |
|
19 | // F0 | |
20 | //extern volatile int wf_snap_f0[ ]; |
|
20 | //extern volatile int wf_snap_f0[ ]; | |
21 | // F1 F2 |
|
21 | // F1 F2 | |
22 | extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ]; |
|
22 | extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ]; | |
23 | extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ]; |
|
23 | extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ]; | |
24 | extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ]; |
|
24 | extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 46 ]; | |
25 | // F3 |
|
25 | // F3 | |
26 | extern volatile int wf_cont_f3_a[ ]; |
|
26 | extern volatile int wf_cont_f3_a[ ]; | |
27 | extern volatile int wf_cont_f3_b[ ]; |
|
27 | extern volatile int wf_cont_f3_b[ ]; | |
28 | extern char wf_cont_f3_light[ ]; |
|
28 | extern char wf_cont_f3_light[ ]; | |
29 |
|
29 | |||
30 | #ifdef VHDL_DEV |
|
30 | #ifdef VHDL_DEV | |
31 | extern waveform_picker_regs_new_t *waveform_picker_regs; |
|
31 | extern waveform_picker_regs_new_t *waveform_picker_regs; | |
32 | #else |
|
32 | #else | |
33 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
33 | extern waveform_picker_regs_t *waveform_picker_regs; | |
34 | #endif |
|
34 | #endif | |
35 | extern time_management_regs_t *time_management_regs; |
|
35 | extern time_management_regs_t *time_management_regs; | |
36 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
36 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |
37 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
37 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
38 | extern struct param_local_str param_local; |
|
38 | extern struct param_local_str param_local; | |
39 |
|
39 | |||
40 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
40 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
41 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
41 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |
42 |
|
42 | |||
43 | extern rtems_id Task_id[20]; /* array of task ids */ |
|
43 | extern rtems_id Task_id[20]; /* array of task ids */ | |
44 |
|
44 | |||
45 | extern unsigned char lfrCurrentMode; |
|
45 | extern unsigned char lfrCurrentMode; | |
46 |
|
46 | |||
47 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
47 | rtems_isr waveforms_isr( rtems_vector_number vector ); | |
48 | rtems_isr waveforms_isr_alt( rtems_vector_number vector ); |
|
48 | rtems_isr waveforms_isr_alt( rtems_vector_number vector ); | |
49 | rtems_task wfrm_task( rtems_task_argument argument ); |
|
49 | rtems_task wfrm_task( rtems_task_argument argument ); | |
50 | rtems_task cwf3_task( rtems_task_argument argument ); |
|
50 | rtems_task cwf3_task( rtems_task_argument argument ); | |
51 | rtems_task cwf2_task( rtems_task_argument argument ); |
|
51 | rtems_task cwf2_task( rtems_task_argument argument ); | |
52 | rtems_task cwf1_task( rtems_task_argument argument ); |
|
52 | rtems_task cwf1_task( rtems_task_argument argument ); | |
53 |
|
53 | |||
54 | //****************** |
|
54 | //****************** | |
55 | // general functions |
|
55 | // general functions | |
56 | void init_waveforms( void ); |
|
56 | void init_waveforms( void ); | |
57 | void init_waveform_rings( void ); |
|
57 | void init_waveform_rings( void ); | |
58 | void reset_current_ring_nodes( void ); |
|
58 | void reset_current_ring_nodes( void ); | |
59 | // |
|
59 | // | |
60 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); |
|
60 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); | |
61 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); |
|
61 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); | |
62 | int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); |
|
62 | int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); | |
63 | // |
|
63 | // | |
64 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ); |
|
64 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ); | |
65 | int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
65 | int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
66 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
66 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
67 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
67 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
68 | // |
|
68 | // | |
69 | void compute_acquisition_time(unsigned int *coarseTime, unsigned int *fineTime, unsigned int sid, unsigned char pa_lfr_pkt_nr ); |
|
69 | void compute_acquisition_time(unsigned int *coarseTime, unsigned int *fineTime, unsigned int sid, unsigned char pa_lfr_pkt_nr ); | |
70 | // |
|
70 | // | |
71 | rtems_id get_pkts_queue_id( void ); |
|
71 | rtems_id get_pkts_queue_id( void ); | |
72 |
|
72 | |||
73 | //************** |
|
73 | //************** | |
74 | // wfp registers |
|
74 | // wfp registers | |
75 | void set_wfp_data_shaping(); |
|
75 | // RESET | |
76 | char set_wfp_delta_snapshot(); |
|
76 | void reset_wfp_burst_enable( void ); | |
|
77 | void reset_wfp_status(void); | |||
|
78 | void reset_waveform_picker_regs( void ); | |||
|
79 | // SET | |||
|
80 | void set_wfp_data_shaping(void); | |||
77 | void set_wfp_burst_enable_register( unsigned char mode ); |
|
81 | void set_wfp_burst_enable_register( unsigned char mode ); | |
78 | void reset_wfp_burst_enable(); |
|
82 | void set_wfp_delta_snapshot( void ); | |
79 |
void |
|
83 | void set_wfp_delta_f0_f0_2( void ); | |
80 | void reset_waveform_picker_regs_vhdl_dev(); |
|
84 | void set_wfp_delta_f1( void ); | |
81 | void reset_waveform_picker_regs_vhdl_dev_debug(); |
|
85 | void set_wfp_delta_f2( void ); | |
82 | void reset_waveform_picker_regs_vhdl_dev_debug_64(); |
|
|||
83 | void reset_waveform_picker_regs(); |
|
|||
84 | void reset_new_waveform_picker_regs(); |
|
|||
85 |
|
86 | |||
86 | //***************** |
|
87 | //***************** | |
87 | // local parameters |
|
88 | // local parameters | |
88 | void set_local_nb_interrupt_f0_MAX( void ); |
|
89 | void set_local_nb_interrupt_f0_MAX( void ); | |
89 |
|
90 | |||
90 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); |
|
91 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); | |
91 |
|
92 | |||
92 | #endif // WF_HANDLER_H_INCLUDED |
|
93 | #endif // WF_HANDLER_H_INCLUDED |
@@ -1,837 +1,837 | |||||
1 | /** Functions and tasks related to TeleCommand handling. |
|
1 | /** Functions and tasks related to TeleCommand handling. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * A group of functions to handle TeleCommands:\n |
|
6 | * A group of functions to handle TeleCommands:\n | |
7 | * action launching\n |
|
7 | * action launching\n | |
8 | * TC parsing\n |
|
8 | * TC parsing\n | |
9 | * ... |
|
9 | * ... | |
10 | * |
|
10 | * | |
11 | */ |
|
11 | */ | |
12 |
|
12 | |||
13 | #include "tc_handler.h" |
|
13 | #include "tc_handler.h" | |
14 |
|
14 | |||
15 | //*********** |
|
15 | //*********** | |
16 | // RTEMS TASK |
|
16 | // RTEMS TASK | |
17 |
|
17 | |||
18 | rtems_task actn_task( rtems_task_argument unused ) |
|
18 | rtems_task actn_task( rtems_task_argument unused ) | |
19 | { |
|
19 | { | |
20 | /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands. |
|
20 | /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands. | |
21 | * |
|
21 | * | |
22 | * @param unused is the starting argument of the RTEMS task |
|
22 | * @param unused is the starting argument of the RTEMS task | |
23 | * |
|
23 | * | |
24 | * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending |
|
24 | * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending | |
25 | * on the incoming TeleCommand. |
|
25 | * on the incoming TeleCommand. | |
26 | * |
|
26 | * | |
27 | */ |
|
27 | */ | |
28 |
|
28 | |||
29 | int result; |
|
29 | int result; | |
30 | rtems_status_code status; // RTEMS status code |
|
30 | rtems_status_code status; // RTEMS status code | |
31 | ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task |
|
31 | ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task | |
32 | size_t size; // size of the incoming TC packet |
|
32 | size_t size; // size of the incoming TC packet | |
33 | unsigned char subtype; // subtype of the current TC packet |
|
33 | unsigned char subtype; // subtype of the current TC packet | |
34 | unsigned char time[6]; |
|
34 | unsigned char time[6]; | |
35 | rtems_id queue_rcv_id; |
|
35 | rtems_id queue_rcv_id; | |
36 | rtems_id queue_snd_id; |
|
36 | rtems_id queue_snd_id; | |
37 |
|
37 | |||
38 | status = get_message_queue_id_recv( &queue_rcv_id ); |
|
38 | status = get_message_queue_id_recv( &queue_rcv_id ); | |
39 | if (status != RTEMS_SUCCESSFUL) |
|
39 | if (status != RTEMS_SUCCESSFUL) | |
40 | { |
|
40 | { | |
41 | PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status) |
|
41 | PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status) | |
42 | } |
|
42 | } | |
43 |
|
43 | |||
44 | status = get_message_queue_id_send( &queue_snd_id ); |
|
44 | status = get_message_queue_id_send( &queue_snd_id ); | |
45 | if (status != RTEMS_SUCCESSFUL) |
|
45 | if (status != RTEMS_SUCCESSFUL) | |
46 | { |
|
46 | { | |
47 | PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status) |
|
47 | PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status) | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | result = LFR_SUCCESSFUL; |
|
50 | result = LFR_SUCCESSFUL; | |
51 | subtype = 0; // subtype of the current TC packet |
|
51 | subtype = 0; // subtype of the current TC packet | |
52 |
|
52 | |||
53 | BOOT_PRINTF("in ACTN *** \n") |
|
53 | BOOT_PRINTF("in ACTN *** \n") | |
54 |
|
54 | |||
55 | while(1) |
|
55 | while(1) | |
56 | { |
|
56 | { | |
57 | status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size, |
|
57 | status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size, | |
58 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); |
|
58 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); | |
59 | getTime( time ); // set time to the current time |
|
59 | getTime( time ); // set time to the current time | |
60 | if (status!=RTEMS_SUCCESSFUL) |
|
60 | if (status!=RTEMS_SUCCESSFUL) | |
61 | { |
|
61 | { | |
62 | PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status) |
|
62 | PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status) | |
63 | } |
|
63 | } | |
64 | else |
|
64 | else | |
65 | { |
|
65 | { | |
66 | subtype = TC.serviceSubType; |
|
66 | subtype = TC.serviceSubType; | |
67 | switch(subtype) |
|
67 | switch(subtype) | |
68 | { |
|
68 | { | |
69 | case TC_SUBTYPE_RESET: |
|
69 | case TC_SUBTYPE_RESET: | |
70 | result = action_reset( &TC, queue_snd_id, time ); |
|
70 | result = action_reset( &TC, queue_snd_id, time ); | |
71 | close_action( &TC, result, queue_snd_id, time ); |
|
71 | close_action( &TC, result, queue_snd_id, time ); | |
72 | break; |
|
72 | break; | |
73 | // |
|
73 | // | |
74 | case TC_SUBTYPE_LOAD_COMM: |
|
74 | case TC_SUBTYPE_LOAD_COMM: | |
75 | result = action_load_common_par( &TC ); |
|
75 | result = action_load_common_par( &TC ); | |
76 | close_action( &TC, result, queue_snd_id, time ); |
|
76 | close_action( &TC, result, queue_snd_id, time ); | |
77 | break; |
|
77 | break; | |
78 | // |
|
78 | // | |
79 | case TC_SUBTYPE_LOAD_NORM: |
|
79 | case TC_SUBTYPE_LOAD_NORM: | |
80 | result = action_load_normal_par( &TC, queue_snd_id, time ); |
|
80 | result = action_load_normal_par( &TC, queue_snd_id, time ); | |
81 | close_action( &TC, result, queue_snd_id, time ); |
|
81 | close_action( &TC, result, queue_snd_id, time ); | |
82 | break; |
|
82 | break; | |
83 | // |
|
83 | // | |
84 | case TC_SUBTYPE_LOAD_BURST: |
|
84 | case TC_SUBTYPE_LOAD_BURST: | |
85 | result = action_load_burst_par( &TC, queue_snd_id, time ); |
|
85 | result = action_load_burst_par( &TC, queue_snd_id, time ); | |
86 | close_action( &TC, result, queue_snd_id, time ); |
|
86 | close_action( &TC, result, queue_snd_id, time ); | |
87 | break; |
|
87 | break; | |
88 | // |
|
88 | // | |
89 | case TC_SUBTYPE_LOAD_SBM1: |
|
89 | case TC_SUBTYPE_LOAD_SBM1: | |
90 | result = action_load_sbm1_par( &TC, queue_snd_id, time ); |
|
90 | result = action_load_sbm1_par( &TC, queue_snd_id, time ); | |
91 | close_action( &TC, result, queue_snd_id, time ); |
|
91 | close_action( &TC, result, queue_snd_id, time ); | |
92 | break; |
|
92 | break; | |
93 | // |
|
93 | // | |
94 | case TC_SUBTYPE_LOAD_SBM2: |
|
94 | case TC_SUBTYPE_LOAD_SBM2: | |
95 | result = action_load_sbm2_par( &TC, queue_snd_id, time ); |
|
95 | result = action_load_sbm2_par( &TC, queue_snd_id, time ); | |
96 | close_action( &TC, result, queue_snd_id, time ); |
|
96 | close_action( &TC, result, queue_snd_id, time ); | |
97 | break; |
|
97 | break; | |
98 | // |
|
98 | // | |
99 | case TC_SUBTYPE_DUMP: |
|
99 | case TC_SUBTYPE_DUMP: | |
100 | result = action_dump_par( queue_snd_id ); |
|
100 | result = action_dump_par( queue_snd_id ); | |
101 | close_action( &TC, result, queue_snd_id, time ); |
|
101 | close_action( &TC, result, queue_snd_id, time ); | |
102 | break; |
|
102 | break; | |
103 | // |
|
103 | // | |
104 | case TC_SUBTYPE_ENTER: |
|
104 | case TC_SUBTYPE_ENTER: | |
105 | result = action_enter_mode( &TC, queue_snd_id, time ); |
|
105 | result = action_enter_mode( &TC, queue_snd_id, time ); | |
106 | close_action( &TC, result, queue_snd_id, time ); |
|
106 | close_action( &TC, result, queue_snd_id, time ); | |
107 | break; |
|
107 | break; | |
108 | // |
|
108 | // | |
109 | case TC_SUBTYPE_UPDT_INFO: |
|
109 | case TC_SUBTYPE_UPDT_INFO: | |
110 | result = action_update_info( &TC, queue_snd_id ); |
|
110 | result = action_update_info( &TC, queue_snd_id ); | |
111 | close_action( &TC, result, queue_snd_id, time ); |
|
111 | close_action( &TC, result, queue_snd_id, time ); | |
112 | break; |
|
112 | break; | |
113 | // |
|
113 | // | |
114 | case TC_SUBTYPE_EN_CAL: |
|
114 | case TC_SUBTYPE_EN_CAL: | |
115 | result = action_enable_calibration( &TC, queue_snd_id, time ); |
|
115 | result = action_enable_calibration( &TC, queue_snd_id, time ); | |
116 | close_action( &TC, result, queue_snd_id, time ); |
|
116 | close_action( &TC, result, queue_snd_id, time ); | |
117 | break; |
|
117 | break; | |
118 | // |
|
118 | // | |
119 | case TC_SUBTYPE_DIS_CAL: |
|
119 | case TC_SUBTYPE_DIS_CAL: | |
120 | result = action_disable_calibration( &TC, queue_snd_id, time ); |
|
120 | result = action_disable_calibration( &TC, queue_snd_id, time ); | |
121 | close_action( &TC, result, queue_snd_id, time ); |
|
121 | close_action( &TC, result, queue_snd_id, time ); | |
122 | break; |
|
122 | break; | |
123 | // |
|
123 | // | |
124 | case TC_SUBTYPE_UPDT_TIME: |
|
124 | case TC_SUBTYPE_UPDT_TIME: | |
125 | result = action_update_time( &TC ); |
|
125 | result = action_update_time( &TC ); | |
126 | close_action( &TC, result, queue_snd_id, time ); |
|
126 | close_action( &TC, result, queue_snd_id, time ); | |
127 | break; |
|
127 | break; | |
128 | // |
|
128 | // | |
129 | default: |
|
129 | default: | |
130 | break; |
|
130 | break; | |
131 | } |
|
131 | } | |
132 | } |
|
132 | } | |
133 | } |
|
133 | } | |
134 | } |
|
134 | } | |
135 |
|
135 | |||
136 | //*********** |
|
136 | //*********** | |
137 | // TC ACTIONS |
|
137 | // TC ACTIONS | |
138 |
|
138 | |||
139 | int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
139 | int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
140 | { |
|
140 | { | |
141 | /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received. |
|
141 | /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received. | |
142 | * |
|
142 | * | |
143 | * @param TC points to the TeleCommand packet that is being processed |
|
143 | * @param TC points to the TeleCommand packet that is being processed | |
144 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
144 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
145 | * |
|
145 | * | |
146 | */ |
|
146 | */ | |
147 |
|
147 | |||
148 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
148 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); | |
149 | return LFR_DEFAULT; |
|
149 | return LFR_DEFAULT; | |
150 | } |
|
150 | } | |
151 |
|
151 | |||
152 | int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
152 | int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
153 | { |
|
153 | { | |
154 | /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received. |
|
154 | /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received. | |
155 | * |
|
155 | * | |
156 | * @param TC points to the TeleCommand packet that is being processed |
|
156 | * @param TC points to the TeleCommand packet that is being processed | |
157 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
157 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
158 | * |
|
158 | * | |
159 | */ |
|
159 | */ | |
160 |
|
160 | |||
161 | rtems_status_code status; |
|
161 | rtems_status_code status; | |
162 | unsigned char requestedMode; |
|
162 | unsigned char requestedMode; | |
163 |
|
163 | |||
164 | requestedMode = TC->dataAndCRC[1]; |
|
164 | requestedMode = TC->dataAndCRC[1]; | |
165 |
|
165 | |||
166 | if ( (requestedMode != LFR_MODE_STANDBY) |
|
166 | if ( (requestedMode != LFR_MODE_STANDBY) | |
167 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) |
|
167 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) | |
168 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) |
|
168 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) | |
169 | { |
|
169 | { | |
170 | status = RTEMS_UNSATISFIED; |
|
170 | status = RTEMS_UNSATISFIED; | |
171 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode, time ); |
|
171 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode, time ); | |
172 | } |
|
172 | } | |
173 | else |
|
173 | else | |
174 | { |
|
174 | { | |
175 | printf("in action_enter_mode *** enter mode %d\n", requestedMode); |
|
175 | printf("in action_enter_mode *** enter mode %d\n", requestedMode); | |
176 |
|
176 | |||
177 | #ifdef PRINT_TASK_STATISTICS |
|
177 | #ifdef PRINT_TASK_STATISTICS | |
178 | if (requestedMode != LFR_MODE_STANDBY) |
|
178 | if (requestedMode != LFR_MODE_STANDBY) | |
179 | { |
|
179 | { | |
180 | rtems_cpu_usage_reset(); |
|
180 | rtems_cpu_usage_reset(); | |
181 | maxCount = 0; |
|
181 | maxCount = 0; | |
182 | } |
|
182 | } | |
183 | #endif |
|
183 | #endif | |
184 |
|
184 | |||
185 | status = transition_validation(requestedMode); |
|
185 | status = transition_validation(requestedMode); | |
186 |
|
186 | |||
187 | if ( status == LFR_SUCCESSFUL ) { |
|
187 | if ( status == LFR_SUCCESSFUL ) { | |
188 | if ( lfrCurrentMode != LFR_MODE_STANDBY) |
|
188 | if ( lfrCurrentMode != LFR_MODE_STANDBY) | |
189 | { |
|
189 | { | |
190 | status = stop_current_mode(); |
|
190 | status = stop_current_mode(); | |
191 | } |
|
191 | } | |
192 | if (status != RTEMS_SUCCESSFUL) |
|
192 | if (status != RTEMS_SUCCESSFUL) | |
193 | { |
|
193 | { | |
194 | PRINTF("ERR *** in action_enter *** stop_current_mode\n") |
|
194 | PRINTF("ERR *** in action_enter *** stop_current_mode\n") | |
195 | } |
|
195 | } | |
196 | status = enter_mode( requestedMode ); |
|
196 | status = enter_mode( requestedMode ); | |
197 | } |
|
197 | } | |
198 | else |
|
198 | else | |
199 | { |
|
199 | { | |
200 | PRINTF("ERR *** in action_enter *** transition rejected\n") |
|
200 | PRINTF("ERR *** in action_enter *** transition rejected\n") | |
201 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
201 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
202 | } |
|
202 | } | |
203 | } |
|
203 | } | |
204 |
|
204 | |||
205 | return status; |
|
205 | return status; | |
206 | } |
|
206 | } | |
207 |
|
207 | |||
208 | int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) |
|
208 | int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) | |
209 | { |
|
209 | { | |
210 | /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received. |
|
210 | /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received. | |
211 | * |
|
211 | * | |
212 | * @param TC points to the TeleCommand packet that is being processed |
|
212 | * @param TC points to the TeleCommand packet that is being processed | |
213 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
213 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
214 | * |
|
214 | * | |
215 | * @return LFR directive status code: |
|
215 | * @return LFR directive status code: | |
216 | * - LFR_DEFAULT |
|
216 | * - LFR_DEFAULT | |
217 | * - LFR_SUCCESSFUL |
|
217 | * - LFR_SUCCESSFUL | |
218 | * |
|
218 | * | |
219 | */ |
|
219 | */ | |
220 |
|
220 | |||
221 | unsigned int val; |
|
221 | unsigned int val; | |
222 | int result; |
|
222 | int result; | |
223 |
|
223 | |||
224 | result = LFR_SUCCESSFUL; |
|
224 | result = LFR_SUCCESSFUL; | |
225 |
|
225 | |||
226 | val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256 |
|
226 | val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256 | |
227 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; |
|
227 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; | |
228 | val++; |
|
228 | val++; | |
229 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8); |
|
229 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8); | |
230 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); |
|
230 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); | |
231 |
|
231 | |||
232 | return result; |
|
232 | return result; | |
233 | } |
|
233 | } | |
234 |
|
234 | |||
235 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
235 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
236 | { |
|
236 | { | |
237 | /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received. |
|
237 | /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received. | |
238 | * |
|
238 | * | |
239 | * @param TC points to the TeleCommand packet that is being processed |
|
239 | * @param TC points to the TeleCommand packet that is being processed | |
240 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
240 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
241 | * |
|
241 | * | |
242 | */ |
|
242 | */ | |
243 |
|
243 | |||
244 | int result; |
|
244 | int result; | |
245 | unsigned char lfrMode; |
|
245 | unsigned char lfrMode; | |
246 |
|
246 | |||
247 | result = LFR_DEFAULT; |
|
247 | result = LFR_DEFAULT; | |
248 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
248 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
249 |
|
249 | |||
250 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { |
|
250 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { | |
251 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
251 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
252 | result = LFR_DEFAULT; |
|
252 | result = LFR_DEFAULT; | |
253 | } |
|
253 | } | |
254 | else { |
|
254 | else { | |
255 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
255 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); | |
256 | result = LFR_DEFAULT; |
|
256 | result = LFR_DEFAULT; | |
257 | } |
|
257 | } | |
258 | return result; |
|
258 | return result; | |
259 | } |
|
259 | } | |
260 |
|
260 | |||
261 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
261 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
262 | { |
|
262 | { | |
263 | /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received. |
|
263 | /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received. | |
264 | * |
|
264 | * | |
265 | * @param TC points to the TeleCommand packet that is being processed |
|
265 | * @param TC points to the TeleCommand packet that is being processed | |
266 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
266 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
267 | * |
|
267 | * | |
268 | */ |
|
268 | */ | |
269 |
|
269 | |||
270 | int result; |
|
270 | int result; | |
271 | unsigned char lfrMode; |
|
271 | unsigned char lfrMode; | |
272 |
|
272 | |||
273 | result = LFR_DEFAULT; |
|
273 | result = LFR_DEFAULT; | |
274 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
274 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
275 |
|
275 | |||
276 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { |
|
276 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { | |
277 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
277 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
278 | result = LFR_DEFAULT; |
|
278 | result = LFR_DEFAULT; | |
279 | } |
|
279 | } | |
280 | else { |
|
280 | else { | |
281 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
281 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); | |
282 | result = LFR_DEFAULT; |
|
282 | result = LFR_DEFAULT; | |
283 | } |
|
283 | } | |
284 | return result; |
|
284 | return result; | |
285 | } |
|
285 | } | |
286 |
|
286 | |||
287 | int action_update_time(ccsdsTelecommandPacket_t *TC) |
|
287 | int action_update_time(ccsdsTelecommandPacket_t *TC) | |
288 | { |
|
288 | { | |
289 | /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received. |
|
289 | /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received. | |
290 | * |
|
290 | * | |
291 | * @param TC points to the TeleCommand packet that is being processed |
|
291 | * @param TC points to the TeleCommand packet that is being processed | |
292 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
292 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
293 | * |
|
293 | * | |
294 | * @return LFR_SUCCESSFUL |
|
294 | * @return LFR_SUCCESSFUL | |
295 | * |
|
295 | * | |
296 | */ |
|
296 | */ | |
297 |
|
297 | |||
298 | unsigned int val; |
|
298 | unsigned int val; | |
299 |
|
299 | |||
300 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) |
|
300 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) | |
301 | + (TC->dataAndCRC[1] << 16) |
|
301 | + (TC->dataAndCRC[1] << 16) | |
302 | + (TC->dataAndCRC[2] << 8) |
|
302 | + (TC->dataAndCRC[2] << 8) | |
303 | + TC->dataAndCRC[3]; |
|
303 | + TC->dataAndCRC[3]; | |
304 | val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256 |
|
304 | val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256 | |
305 | + housekeeping_packet.hk_lfr_update_time_tc_cnt[1]; |
|
305 | + housekeeping_packet.hk_lfr_update_time_tc_cnt[1]; | |
306 | val++; |
|
306 | val++; | |
307 | housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8); |
|
307 | housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8); | |
308 | housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val); |
|
308 | housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val); | |
309 | time_management_regs->ctrl = time_management_regs->ctrl | 1; |
|
309 | time_management_regs->ctrl = time_management_regs->ctrl | 1; | |
310 |
|
310 | |||
311 | return LFR_SUCCESSFUL; |
|
311 | return LFR_SUCCESSFUL; | |
312 | } |
|
312 | } | |
313 |
|
313 | |||
314 | //******************* |
|
314 | //******************* | |
315 | // ENTERING THE MODES |
|
315 | // ENTERING THE MODES | |
316 |
|
316 | |||
317 | int transition_validation(unsigned char requestedMode) |
|
317 | int transition_validation(unsigned char requestedMode) | |
318 | { |
|
318 | { | |
319 | /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE. |
|
319 | /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE. | |
320 | * |
|
320 | * | |
321 | * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE |
|
321 | * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE | |
322 | * |
|
322 | * | |
323 | * @return LFR directive status codes: |
|
323 | * @return LFR directive status codes: | |
324 | * - LFR_SUCCESSFUL - the transition is authorized |
|
324 | * - LFR_SUCCESSFUL - the transition is authorized | |
325 | * - LFR_DEFAULT - the transition is not authorized |
|
325 | * - LFR_DEFAULT - the transition is not authorized | |
326 | * |
|
326 | * | |
327 | */ |
|
327 | */ | |
328 |
|
328 | |||
329 | int status; |
|
329 | int status; | |
330 |
|
330 | |||
331 | switch (requestedMode) |
|
331 | switch (requestedMode) | |
332 | { |
|
332 | { | |
333 | case LFR_MODE_STANDBY: |
|
333 | case LFR_MODE_STANDBY: | |
334 | if ( lfrCurrentMode == LFR_MODE_STANDBY ) { |
|
334 | if ( lfrCurrentMode == LFR_MODE_STANDBY ) { | |
335 | status = LFR_DEFAULT; |
|
335 | status = LFR_DEFAULT; | |
336 | } |
|
336 | } | |
337 | else |
|
337 | else | |
338 | { |
|
338 | { | |
339 | status = LFR_SUCCESSFUL; |
|
339 | status = LFR_SUCCESSFUL; | |
340 | } |
|
340 | } | |
341 | break; |
|
341 | break; | |
342 | case LFR_MODE_NORMAL: |
|
342 | case LFR_MODE_NORMAL: | |
343 | if ( lfrCurrentMode == LFR_MODE_NORMAL ) { |
|
343 | if ( lfrCurrentMode == LFR_MODE_NORMAL ) { | |
344 | status = LFR_DEFAULT; |
|
344 | status = LFR_DEFAULT; | |
345 | } |
|
345 | } | |
346 | else { |
|
346 | else { | |
347 | status = LFR_SUCCESSFUL; |
|
347 | status = LFR_SUCCESSFUL; | |
348 | } |
|
348 | } | |
349 | break; |
|
349 | break; | |
350 | case LFR_MODE_BURST: |
|
350 | case LFR_MODE_BURST: | |
351 | if ( lfrCurrentMode == LFR_MODE_BURST ) { |
|
351 | if ( lfrCurrentMode == LFR_MODE_BURST ) { | |
352 | status = LFR_DEFAULT; |
|
352 | status = LFR_DEFAULT; | |
353 | } |
|
353 | } | |
354 | else { |
|
354 | else { | |
355 | status = LFR_SUCCESSFUL; |
|
355 | status = LFR_SUCCESSFUL; | |
356 | } |
|
356 | } | |
357 | break; |
|
357 | break; | |
358 | case LFR_MODE_SBM1: |
|
358 | case LFR_MODE_SBM1: | |
359 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { |
|
359 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { | |
360 | status = LFR_DEFAULT; |
|
360 | status = LFR_DEFAULT; | |
361 | } |
|
361 | } | |
362 | else { |
|
362 | else { | |
363 | status = LFR_SUCCESSFUL; |
|
363 | status = LFR_SUCCESSFUL; | |
364 | } |
|
364 | } | |
365 | break; |
|
365 | break; | |
366 | case LFR_MODE_SBM2: |
|
366 | case LFR_MODE_SBM2: | |
367 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { |
|
367 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { | |
368 | status = LFR_DEFAULT; |
|
368 | status = LFR_DEFAULT; | |
369 | } |
|
369 | } | |
370 | else { |
|
370 | else { | |
371 | status = LFR_SUCCESSFUL; |
|
371 | status = LFR_SUCCESSFUL; | |
372 | } |
|
372 | } | |
373 | break; |
|
373 | break; | |
374 | default: |
|
374 | default: | |
375 | status = LFR_DEFAULT; |
|
375 | status = LFR_DEFAULT; | |
376 | break; |
|
376 | break; | |
377 | } |
|
377 | } | |
378 |
|
378 | |||
379 | return status; |
|
379 | return status; | |
380 | } |
|
380 | } | |
381 |
|
381 | |||
382 | int stop_current_mode() |
|
382 | int stop_current_mode() | |
383 | { |
|
383 | { | |
384 | /** This function stops the current mode by masking interrupt lines and suspending science tasks. |
|
384 | /** This function stops the current mode by masking interrupt lines and suspending science tasks. | |
385 | * |
|
385 | * | |
386 | * @return RTEMS directive status codes: |
|
386 | * @return RTEMS directive status codes: | |
387 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
387 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
388 | * - RTEMS_INVALID_ID - task id invalid |
|
388 | * - RTEMS_INVALID_ID - task id invalid | |
389 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
389 | * - RTEMS_ALREADY_SUSPENDED - task already suspended | |
390 | * |
|
390 | * | |
391 | */ |
|
391 | */ | |
392 |
|
392 | |||
393 | rtems_status_code status; |
|
393 | rtems_status_code status; | |
394 |
|
394 | |||
395 | status = RTEMS_SUCCESSFUL; |
|
395 | status = RTEMS_SUCCESSFUL; | |
396 |
|
396 | |||
397 | // mask interruptions |
|
397 | // mask interruptions | |
398 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt |
|
398 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt | |
399 | //LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt |
|
399 | //LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt | |
400 | LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrix interrupt simulator |
|
400 | LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrix interrupt simulator | |
401 | // reset registers |
|
401 | // reset registers | |
402 | reset_wfp_burst_enable(); // reset burst and enable bits |
|
402 | reset_wfp_burst_enable(); // reset burst and enable bits | |
403 | reset_wfp_status(); // reset all the status bits |
|
403 | reset_wfp_status(); // reset all the status bits | |
404 | // clear interruptions |
|
404 | // clear interruptions | |
405 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt |
|
405 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt | |
406 | //LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt |
|
406 | //LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt | |
407 | LEON_Clear_interrupt( IRQ_SM ); // clear spectral matrix interrupt simulator |
|
407 | LEON_Clear_interrupt( IRQ_SM ); // clear spectral matrix interrupt simulator | |
408 | //********************** |
|
408 | //********************** | |
409 | // suspend several tasks |
|
409 | // suspend several tasks | |
410 | if (lfrCurrentMode != LFR_MODE_STANDBY) { |
|
410 | if (lfrCurrentMode != LFR_MODE_STANDBY) { | |
411 | status = suspend_science_tasks(); |
|
411 | status = suspend_science_tasks(); | |
412 | } |
|
412 | } | |
413 |
|
413 | |||
414 | if (status != RTEMS_SUCCESSFUL) |
|
414 | if (status != RTEMS_SUCCESSFUL) | |
415 | { |
|
415 | { | |
416 | PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
416 | PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status) | |
417 | } |
|
417 | } | |
418 |
|
418 | |||
419 | return status; |
|
419 | return status; | |
420 | } |
|
420 | } | |
421 |
|
421 | |||
422 | int enter_mode(unsigned char mode ) |
|
422 | int enter_mode(unsigned char mode ) | |
423 | { |
|
423 | { | |
424 | /** This function is launched after a mode transition validation. |
|
424 | /** This function is launched after a mode transition validation. | |
425 | * |
|
425 | * | |
426 | * @param mode is the mode in which LFR will be put. |
|
426 | * @param mode is the mode in which LFR will be put. | |
427 | * |
|
427 | * | |
428 | * @return RTEMS directive status codes: |
|
428 | * @return RTEMS directive status codes: | |
429 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
429 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
430 | * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully |
|
430 | * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully | |
431 | * |
|
431 | * | |
432 | */ |
|
432 | */ | |
433 |
|
433 | |||
434 | rtems_status_code status; |
|
434 | rtems_status_code status; | |
435 |
|
435 | |||
436 | status = RTEMS_UNSATISFIED; |
|
436 | status = RTEMS_UNSATISFIED; | |
437 |
|
437 | |||
438 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d); |
|
438 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d); | |
439 | updateLFRCurrentMode(); |
|
439 | updateLFRCurrentMode(); | |
440 |
|
440 | |||
441 | switch(mode){ |
|
441 | switch(mode){ | |
442 | case LFR_MODE_STANDBY: |
|
442 | case LFR_MODE_STANDBY: | |
443 | status = enter_standby_mode( ); |
|
443 | status = enter_standby_mode( ); | |
444 | break; |
|
444 | break; | |
445 | case LFR_MODE_NORMAL: |
|
445 | case LFR_MODE_NORMAL: | |
446 | status = enter_normal_mode( ); |
|
446 | status = enter_normal_mode( ); | |
447 | break; |
|
447 | break; | |
448 | case LFR_MODE_BURST: |
|
448 | case LFR_MODE_BURST: | |
449 | status = enter_burst_mode( ); |
|
449 | status = enter_burst_mode( ); | |
450 | break; |
|
450 | break; | |
451 | case LFR_MODE_SBM1: |
|
451 | case LFR_MODE_SBM1: | |
452 | status = enter_sbm1_mode( ); |
|
452 | status = enter_sbm1_mode( ); | |
453 | break; |
|
453 | break; | |
454 | case LFR_MODE_SBM2: |
|
454 | case LFR_MODE_SBM2: | |
455 | status = enter_sbm2_mode( ); |
|
455 | status = enter_sbm2_mode( ); | |
456 | break; |
|
456 | break; | |
457 | default: |
|
457 | default: | |
458 | status = RTEMS_UNSATISFIED; |
|
458 | status = RTEMS_UNSATISFIED; | |
459 | } |
|
459 | } | |
460 |
|
460 | |||
461 | if (status != RTEMS_SUCCESSFUL) |
|
461 | if (status != RTEMS_SUCCESSFUL) | |
462 | { |
|
462 | { | |
463 | PRINTF("in enter_mode *** ERR\n") |
|
463 | PRINTF("in enter_mode *** ERR\n") | |
464 | status = RTEMS_UNSATISFIED; |
|
464 | status = RTEMS_UNSATISFIED; | |
465 | } |
|
465 | } | |
466 |
|
466 | |||
467 | return status; |
|
467 | return status; | |
468 | } |
|
468 | } | |
469 |
|
469 | |||
470 | int enter_standby_mode() |
|
470 | int enter_standby_mode() | |
471 | { |
|
471 | { | |
472 | /** This function is used to enter the STANDBY mode. |
|
472 | /** This function is used to enter the STANDBY mode. | |
473 | * |
|
473 | * | |
474 | * @return RTEMS directive status codes: |
|
474 | * @return RTEMS directive status codes: | |
475 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
475 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
476 | * |
|
476 | * | |
477 | */ |
|
477 | */ | |
478 |
|
478 | |||
479 | PRINTF1("maxCount = %d\n", maxCount) |
|
479 | PRINTF1("maxCount = %d\n", maxCount) | |
480 |
|
480 | |||
481 | #ifdef PRINT_TASK_STATISTICS |
|
481 | #ifdef PRINT_TASK_STATISTICS | |
482 | rtems_cpu_usage_report(); |
|
482 | rtems_cpu_usage_report(); | |
483 | #endif |
|
483 | #endif | |
484 |
|
484 | |||
485 | #ifdef PRINT_STACK_REPORT |
|
485 | #ifdef PRINT_STACK_REPORT | |
486 | rtems_stack_checker_report_usage(); |
|
486 | rtems_stack_checker_report_usage(); | |
487 | #endif |
|
487 | #endif | |
488 |
|
488 | |||
489 | return LFR_SUCCESSFUL; |
|
489 | return LFR_SUCCESSFUL; | |
490 | } |
|
490 | } | |
491 |
|
491 | |||
492 | int enter_normal_mode() |
|
492 | int enter_normal_mode() | |
493 | { |
|
493 | { | |
494 | rtems_status_code status; |
|
494 | rtems_status_code status; | |
495 |
|
495 | |||
496 | status = restart_science_tasks(); |
|
496 | status = restart_science_tasks(); | |
497 |
|
497 | |||
498 | launch_waveform_picker( LFR_MODE_NORMAL ); |
|
498 | launch_waveform_picker( LFR_MODE_NORMAL ); | |
499 | // launch_spectral_matrix( LFR_MODE_NORMAL ); |
|
499 | // launch_spectral_matrix( LFR_MODE_NORMAL ); | |
500 |
|
500 | |||
501 | return status; |
|
501 | return status; | |
502 | } |
|
502 | } | |
503 |
|
503 | |||
504 | int enter_burst_mode() |
|
504 | int enter_burst_mode() | |
505 | { |
|
505 | { | |
506 | /** This function is used to enter the STANDBY mode. |
|
506 | /** This function is used to enter the STANDBY mode. | |
507 | * |
|
507 | * | |
508 | * @return RTEMS directive status codes: |
|
508 | * @return RTEMS directive status codes: | |
509 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
509 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
510 | * - RTEMS_INVALID_ID - task id invalid |
|
510 | * - RTEMS_INVALID_ID - task id invalid | |
511 | * - RTEMS_INCORRECT_STATE - task never started |
|
511 | * - RTEMS_INCORRECT_STATE - task never started | |
512 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
512 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
513 | * |
|
513 | * | |
514 | */ |
|
514 | */ | |
515 |
|
515 | |||
516 | rtems_status_code status; |
|
516 | rtems_status_code status; | |
517 |
|
517 | |||
518 | status = restart_science_tasks(); |
|
518 | status = restart_science_tasks(); | |
519 |
|
519 | |||
520 | launch_waveform_picker( LFR_MODE_BURST ); |
|
520 | launch_waveform_picker( LFR_MODE_BURST ); | |
521 |
|
521 | |||
522 | return status; |
|
522 | return status; | |
523 | } |
|
523 | } | |
524 |
|
524 | |||
525 | int enter_sbm1_mode() |
|
525 | int enter_sbm1_mode() | |
526 | { |
|
526 | { | |
527 | /** This function is used to enter the SBM1 mode. |
|
527 | /** This function is used to enter the SBM1 mode. | |
528 | * |
|
528 | * | |
529 | * @return RTEMS directive status codes: |
|
529 | * @return RTEMS directive status codes: | |
530 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
530 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
531 | * - RTEMS_INVALID_ID - task id invalid |
|
531 | * - RTEMS_INVALID_ID - task id invalid | |
532 | * - RTEMS_INCORRECT_STATE - task never started |
|
532 | * - RTEMS_INCORRECT_STATE - task never started | |
533 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
533 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
534 | * |
|
534 | * | |
535 | */ |
|
535 | */ | |
536 |
|
536 | |||
537 | rtems_status_code status; |
|
537 | rtems_status_code status; | |
538 |
|
538 | |||
539 | status = restart_science_tasks(); |
|
539 | status = restart_science_tasks(); | |
540 |
|
540 | |||
541 | launch_waveform_picker( LFR_MODE_SBM1 ); |
|
541 | launch_waveform_picker( LFR_MODE_SBM1 ); | |
542 |
|
542 | |||
543 | return status; |
|
543 | return status; | |
544 | } |
|
544 | } | |
545 |
|
545 | |||
546 | int enter_sbm2_mode() |
|
546 | int enter_sbm2_mode() | |
547 | { |
|
547 | { | |
548 | /** This function is used to enter the SBM2 mode. |
|
548 | /** This function is used to enter the SBM2 mode. | |
549 | * |
|
549 | * | |
550 | * @return RTEMS directive status codes: |
|
550 | * @return RTEMS directive status codes: | |
551 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
551 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
552 | * - RTEMS_INVALID_ID - task id invalid |
|
552 | * - RTEMS_INVALID_ID - task id invalid | |
553 | * - RTEMS_INCORRECT_STATE - task never started |
|
553 | * - RTEMS_INCORRECT_STATE - task never started | |
554 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
554 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
555 | * |
|
555 | * | |
556 | */ |
|
556 | */ | |
557 |
|
557 | |||
558 | rtems_status_code status; |
|
558 | rtems_status_code status; | |
559 |
|
559 | |||
560 | status = restart_science_tasks(); |
|
560 | status = restart_science_tasks(); | |
561 |
|
561 | |||
562 | launch_waveform_picker( LFR_MODE_SBM2 ); |
|
562 | launch_waveform_picker( LFR_MODE_SBM2 ); | |
563 |
|
563 | |||
564 | return status; |
|
564 | return status; | |
565 | } |
|
565 | } | |
566 |
|
566 | |||
567 | int restart_science_tasks() |
|
567 | int restart_science_tasks() | |
568 | { |
|
568 | { | |
569 | /** This function is used to restart all science tasks. |
|
569 | /** This function is used to restart all science tasks. | |
570 | * |
|
570 | * | |
571 | * @return RTEMS directive status codes: |
|
571 | * @return RTEMS directive status codes: | |
572 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
572 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
573 | * - RTEMS_INVALID_ID - task id invalid |
|
573 | * - RTEMS_INVALID_ID - task id invalid | |
574 | * - RTEMS_INCORRECT_STATE - task never started |
|
574 | * - RTEMS_INCORRECT_STATE - task never started | |
575 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
575 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
576 | * |
|
576 | * | |
577 | * Science tasks are AVF0, BPF0, WFRM, CWF3, CW2, CWF1 |
|
577 | * Science tasks are AVF0, BPF0, WFRM, CWF3, CW2, CWF1 | |
578 | * |
|
578 | * | |
579 | */ |
|
579 | */ | |
580 |
|
580 | |||
581 | rtems_status_code status[6]; |
|
581 | rtems_status_code status[6]; | |
582 | rtems_status_code ret; |
|
582 | rtems_status_code ret; | |
583 |
|
583 | |||
584 | ret = RTEMS_SUCCESSFUL; |
|
584 | ret = RTEMS_SUCCESSFUL; | |
585 |
|
585 | |||
586 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 ); |
|
586 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 ); | |
587 | if (status[0] != RTEMS_SUCCESSFUL) |
|
587 | if (status[0] != RTEMS_SUCCESSFUL) | |
588 | { |
|
588 | { | |
589 | PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0]) |
|
589 | PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0]) | |
590 | } |
|
590 | } | |
591 |
|
591 | |||
592 | status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 ); |
|
592 | status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 ); | |
593 | if (status[1] != RTEMS_SUCCESSFUL) |
|
593 | if (status[1] != RTEMS_SUCCESSFUL) | |
594 | { |
|
594 | { | |
595 | PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1]) |
|
595 | PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1]) | |
596 | } |
|
596 | } | |
597 |
|
597 | |||
598 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); |
|
598 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); | |
599 | if (status[2] != RTEMS_SUCCESSFUL) |
|
599 | if (status[2] != RTEMS_SUCCESSFUL) | |
600 | { |
|
600 | { | |
601 | PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2]) |
|
601 | PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2]) | |
602 | } |
|
602 | } | |
603 |
|
603 | |||
604 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); |
|
604 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); | |
605 | if (status[3] != RTEMS_SUCCESSFUL) |
|
605 | if (status[3] != RTEMS_SUCCESSFUL) | |
606 | { |
|
606 | { | |
607 | PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3]) |
|
607 | PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3]) | |
608 | } |
|
608 | } | |
609 |
|
609 | |||
610 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); |
|
610 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); | |
611 | if (status[4] != RTEMS_SUCCESSFUL) |
|
611 | if (status[4] != RTEMS_SUCCESSFUL) | |
612 | { |
|
612 | { | |
613 | PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4]) |
|
613 | PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4]) | |
614 | } |
|
614 | } | |
615 |
|
615 | |||
616 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); |
|
616 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); | |
617 | if (status[5] != RTEMS_SUCCESSFUL) |
|
617 | if (status[5] != RTEMS_SUCCESSFUL) | |
618 | { |
|
618 | { | |
619 | PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5]) |
|
619 | PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5]) | |
620 | } |
|
620 | } | |
621 |
|
621 | |||
622 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || |
|
622 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || | |
623 | (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) ) |
|
623 | (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) ) | |
624 | { |
|
624 | { | |
625 | ret = RTEMS_UNSATISFIED; |
|
625 | ret = RTEMS_UNSATISFIED; | |
626 | } |
|
626 | } | |
627 |
|
627 | |||
628 | return ret; |
|
628 | return ret; | |
629 | } |
|
629 | } | |
630 |
|
630 | |||
631 | int suspend_science_tasks() |
|
631 | int suspend_science_tasks() | |
632 | { |
|
632 | { | |
633 | /** This function suspends the science tasks. |
|
633 | /** This function suspends the science tasks. | |
634 | * |
|
634 | * | |
635 | * @return RTEMS directive status codes: |
|
635 | * @return RTEMS directive status codes: | |
636 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
636 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
637 | * - RTEMS_INVALID_ID - task id invalid |
|
637 | * - RTEMS_INVALID_ID - task id invalid | |
638 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
638 | * - RTEMS_ALREADY_SUSPENDED - task already suspended | |
639 | * |
|
639 | * | |
640 | */ |
|
640 | */ | |
641 |
|
641 | |||
642 | rtems_status_code status; |
|
642 | rtems_status_code status; | |
643 |
|
643 | |||
644 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); |
|
644 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); | |
645 | if (status != RTEMS_SUCCESSFUL) |
|
645 | if (status != RTEMS_SUCCESSFUL) | |
646 | { |
|
646 | { | |
647 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) |
|
647 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) | |
648 | } |
|
648 | } | |
649 |
|
649 | |||
650 | if (status == RTEMS_SUCCESSFUL) // suspend BPF0 |
|
650 | if (status == RTEMS_SUCCESSFUL) // suspend BPF0 | |
651 | { |
|
651 | { | |
652 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); |
|
652 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); | |
653 | if (status != RTEMS_SUCCESSFUL) |
|
653 | if (status != RTEMS_SUCCESSFUL) | |
654 | { |
|
654 | { | |
655 | PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status) |
|
655 | PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status) | |
656 | } |
|
656 | } | |
657 | } |
|
657 | } | |
658 |
|
658 | |||
659 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM |
|
659 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM | |
660 | { |
|
660 | { | |
661 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); |
|
661 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); | |
662 | if (status != RTEMS_SUCCESSFUL) |
|
662 | if (status != RTEMS_SUCCESSFUL) | |
663 | { |
|
663 | { | |
664 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) |
|
664 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) | |
665 | } |
|
665 | } | |
666 | } |
|
666 | } | |
667 |
|
667 | |||
668 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 |
|
668 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 | |
669 | { |
|
669 | { | |
670 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); |
|
670 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); | |
671 | if (status != RTEMS_SUCCESSFUL) |
|
671 | if (status != RTEMS_SUCCESSFUL) | |
672 | { |
|
672 | { | |
673 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) |
|
673 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) | |
674 | } |
|
674 | } | |
675 | } |
|
675 | } | |
676 |
|
676 | |||
677 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 |
|
677 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 | |
678 | { |
|
678 | { | |
679 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); |
|
679 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); | |
680 | if (status != RTEMS_SUCCESSFUL) |
|
680 | if (status != RTEMS_SUCCESSFUL) | |
681 | { |
|
681 | { | |
682 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) |
|
682 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) | |
683 | } |
|
683 | } | |
684 | } |
|
684 | } | |
685 |
|
685 | |||
686 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 |
|
686 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 | |
687 | { |
|
687 | { | |
688 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); |
|
688 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); | |
689 | if (status != RTEMS_SUCCESSFUL) |
|
689 | if (status != RTEMS_SUCCESSFUL) | |
690 | { |
|
690 | { | |
691 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) |
|
691 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) | |
692 | } |
|
692 | } | |
693 | } |
|
693 | } | |
694 |
|
694 | |||
695 | return status; |
|
695 | return status; | |
696 | } |
|
696 | } | |
697 |
|
697 | |||
698 | void launch_waveform_picker( unsigned char mode ) |
|
698 | void launch_waveform_picker( unsigned char mode ) | |
699 | { |
|
699 | { | |
700 | int startDate; |
|
700 | int startDate; | |
701 |
|
701 | |||
702 | reset_current_ring_nodes(); |
|
702 | reset_current_ring_nodes(); | |
703 |
reset_waveform_picker_regs |
|
703 | reset_waveform_picker_regs(); | |
704 | set_wfp_burst_enable_register( mode ); |
|
704 | set_wfp_burst_enable_register( mode ); | |
705 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
705 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
706 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
706 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
707 | startDate = time_management_regs->coarse_time + 2; |
|
707 | startDate = time_management_regs->coarse_time + 2; | |
708 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] |
|
708 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] | |
709 | waveform_picker_regs->start_date = startDate; |
|
709 | waveform_picker_regs->start_date = startDate; | |
710 | } |
|
710 | } | |
711 |
|
711 | |||
712 | void launch_spectral_matrix( unsigned char mode ) |
|
712 | void launch_spectral_matrix( unsigned char mode ) | |
713 | { |
|
713 | { | |
714 | reset_current_sm_ring_nodes(); |
|
714 | reset_current_sm_ring_nodes(); | |
715 | reset_spectral_matrix_regs(); |
|
715 | reset_spectral_matrix_regs(); | |
716 | // Spectral Matrices simulator |
|
716 | // Spectral Matrices simulator | |
717 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
717 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); | |
718 | set_local_nb_interrupt_f0_MAX(); |
|
718 | set_local_nb_interrupt_f0_MAX(); | |
719 | LEON_Clear_interrupt( IRQ_SM ); |
|
719 | LEON_Clear_interrupt( IRQ_SM ); | |
720 | LEON_Unmask_interrupt( IRQ_SM ); |
|
720 | LEON_Unmask_interrupt( IRQ_SM ); | |
721 | } |
|
721 | } | |
722 |
|
722 | |||
723 | //**************** |
|
723 | //**************** | |
724 | // CLOSING ACTIONS |
|
724 | // CLOSING ACTIONS | |
725 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time) |
|
725 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time) | |
726 | { |
|
726 | { | |
727 | /** This function is used to update the HK packets statistics after a successful TC execution. |
|
727 | /** This function is used to update the HK packets statistics after a successful TC execution. | |
728 | * |
|
728 | * | |
729 | * @param TC points to the TC being processed |
|
729 | * @param TC points to the TC being processed | |
730 | * @param time is the time used to date the TC execution |
|
730 | * @param time is the time used to date the TC execution | |
731 | * |
|
731 | * | |
732 | */ |
|
732 | */ | |
733 |
|
733 | |||
734 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; |
|
734 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; | |
735 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; |
|
735 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; | |
736 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; |
|
736 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; | |
737 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; |
|
737 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; | |
738 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; |
|
738 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; | |
739 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; |
|
739 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; | |
740 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0]; |
|
740 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0]; | |
741 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1]; |
|
741 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1]; | |
742 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2]; |
|
742 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2]; | |
743 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3]; |
|
743 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3]; | |
744 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4]; |
|
744 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4]; | |
745 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5]; |
|
745 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5]; | |
746 | } |
|
746 | } | |
747 |
|
747 | |||
748 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time) |
|
748 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time) | |
749 | { |
|
749 | { | |
750 | /** This function is used to update the HK packets statistics after a TC rejection. |
|
750 | /** This function is used to update the HK packets statistics after a TC rejection. | |
751 | * |
|
751 | * | |
752 | * @param TC points to the TC being processed |
|
752 | * @param TC points to the TC being processed | |
753 | * @param time is the time used to date the TC rejection |
|
753 | * @param time is the time used to date the TC rejection | |
754 | * |
|
754 | * | |
755 | */ |
|
755 | */ | |
756 |
|
756 | |||
757 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; |
|
757 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; | |
758 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; |
|
758 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; | |
759 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; |
|
759 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; | |
760 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; |
|
760 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; | |
761 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; |
|
761 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; | |
762 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; |
|
762 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; | |
763 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0]; |
|
763 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0]; | |
764 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1]; |
|
764 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1]; | |
765 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2]; |
|
765 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2]; | |
766 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3]; |
|
766 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3]; | |
767 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4]; |
|
767 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4]; | |
768 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5]; |
|
768 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5]; | |
769 | } |
|
769 | } | |
770 |
|
770 | |||
771 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time) |
|
771 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time) | |
772 | { |
|
772 | { | |
773 | /** This function is the last step of the TC execution workflow. |
|
773 | /** This function is the last step of the TC execution workflow. | |
774 | * |
|
774 | * | |
775 | * @param TC points to the TC being processed |
|
775 | * @param TC points to the TC being processed | |
776 | * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT) |
|
776 | * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT) | |
777 | * @param queue_id is the id of the RTEMS message queue used to send TM packets |
|
777 | * @param queue_id is the id of the RTEMS message queue used to send TM packets | |
778 | * @param time is the time used to date the TC execution |
|
778 | * @param time is the time used to date the TC execution | |
779 | * |
|
779 | * | |
780 | */ |
|
780 | */ | |
781 |
|
781 | |||
782 | unsigned int val = 0; |
|
782 | unsigned int val = 0; | |
783 |
|
783 | |||
784 | if (result == LFR_SUCCESSFUL) |
|
784 | if (result == LFR_SUCCESSFUL) | |
785 | { |
|
785 | { | |
786 | if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) |
|
786 | if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) | |
787 | && |
|
787 | && | |
788 | !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) |
|
788 | !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) | |
789 | ) |
|
789 | ) | |
790 | { |
|
790 | { | |
791 | send_tm_lfr_tc_exe_success( TC, queue_id, time ); |
|
791 | send_tm_lfr_tc_exe_success( TC, queue_id, time ); | |
792 | } |
|
792 | } | |
793 | update_last_TC_exe( TC, time ); |
|
793 | update_last_TC_exe( TC, time ); | |
794 | val = housekeeping_packet.hk_lfr_exe_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_exe_tc_cnt[1]; |
|
794 | val = housekeeping_packet.hk_lfr_exe_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_exe_tc_cnt[1]; | |
795 | val++; |
|
795 | val++; | |
796 | housekeeping_packet.hk_lfr_exe_tc_cnt[0] = (unsigned char) (val >> 8); |
|
796 | housekeeping_packet.hk_lfr_exe_tc_cnt[0] = (unsigned char) (val >> 8); | |
797 | housekeeping_packet.hk_lfr_exe_tc_cnt[1] = (unsigned char) (val); |
|
797 | housekeeping_packet.hk_lfr_exe_tc_cnt[1] = (unsigned char) (val); | |
798 | } |
|
798 | } | |
799 | else |
|
799 | else | |
800 | { |
|
800 | { | |
801 | update_last_TC_rej( TC, time ); |
|
801 | update_last_TC_rej( TC, time ); | |
802 | val = housekeeping_packet.hk_lfr_rej_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_rej_tc_cnt[1]; |
|
802 | val = housekeeping_packet.hk_lfr_rej_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_rej_tc_cnt[1]; | |
803 | val++; |
|
803 | val++; | |
804 | housekeeping_packet.hk_lfr_rej_tc_cnt[0] = (unsigned char) (val >> 8); |
|
804 | housekeeping_packet.hk_lfr_rej_tc_cnt[0] = (unsigned char) (val >> 8); | |
805 | housekeeping_packet.hk_lfr_rej_tc_cnt[1] = (unsigned char) (val); |
|
805 | housekeeping_packet.hk_lfr_rej_tc_cnt[1] = (unsigned char) (val); | |
806 | } |
|
806 | } | |
807 | } |
|
807 | } | |
808 |
|
808 | |||
809 | //*************************** |
|
809 | //*************************** | |
810 | // Interrupt Service Routines |
|
810 | // Interrupt Service Routines | |
811 | rtems_isr commutation_isr1( rtems_vector_number vector ) |
|
811 | rtems_isr commutation_isr1( rtems_vector_number vector ) | |
812 | { |
|
812 | { | |
813 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
813 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
814 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); |
|
814 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); | |
815 | } |
|
815 | } | |
816 | } |
|
816 | } | |
817 |
|
817 | |||
818 | rtems_isr commutation_isr2( rtems_vector_number vector ) |
|
818 | rtems_isr commutation_isr2( rtems_vector_number vector ) | |
819 | { |
|
819 | { | |
820 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
820 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
821 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); |
|
821 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); | |
822 | } |
|
822 | } | |
823 | } |
|
823 | } | |
824 |
|
824 | |||
825 | //**************** |
|
825 | //**************** | |
826 | // OTHER FUNCTIONS |
|
826 | // OTHER FUNCTIONS | |
827 | void updateLFRCurrentMode() |
|
827 | void updateLFRCurrentMode() | |
828 | { |
|
828 | { | |
829 | /** This function updates the value of the global variable lfrCurrentMode. |
|
829 | /** This function updates the value of the global variable lfrCurrentMode. | |
830 | * |
|
830 | * | |
831 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. |
|
831 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. | |
832 | * |
|
832 | * | |
833 | */ |
|
833 | */ | |
834 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure |
|
834 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure | |
835 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
835 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
836 | } |
|
836 | } | |
837 |
|
837 |
@@ -1,484 +1,482 | |||||
1 | /** Functions to load and dump parameters in the LFR registers. |
|
1 | /** Functions to load and dump parameters in the LFR registers. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * A group of functions to handle TC related to parameter loading and dumping.\n |
|
6 | * A group of functions to handle TC related to parameter loading and dumping.\n | |
7 | * TC_LFR_LOAD_COMMON_PAR\n |
|
7 | * TC_LFR_LOAD_COMMON_PAR\n | |
8 | * TC_LFR_LOAD_NORMAL_PAR\n |
|
8 | * TC_LFR_LOAD_NORMAL_PAR\n | |
9 | * TC_LFR_LOAD_BURST_PAR\n |
|
9 | * TC_LFR_LOAD_BURST_PAR\n | |
10 | * TC_LFR_LOAD_SBM1_PAR\n |
|
10 | * TC_LFR_LOAD_SBM1_PAR\n | |
11 | * TC_LFR_LOAD_SBM2_PAR\n |
|
11 | * TC_LFR_LOAD_SBM2_PAR\n | |
12 | * |
|
12 | * | |
13 | */ |
|
13 | */ | |
14 |
|
14 | |||
15 | #include "tc_load_dump_parameters.h" |
|
15 | #include "tc_load_dump_parameters.h" | |
16 |
|
16 | |||
17 | int action_load_common_par(ccsdsTelecommandPacket_t *TC) |
|
17 | int action_load_common_par(ccsdsTelecommandPacket_t *TC) | |
18 | { |
|
18 | { | |
19 | /** This function updates the LFR registers with the incoming common parameters. |
|
19 | /** This function updates the LFR registers with the incoming common parameters. | |
20 | * |
|
20 | * | |
21 | * @param TC points to the TeleCommand packet that is being processed |
|
21 | * @param TC points to the TeleCommand packet that is being processed | |
22 | * |
|
22 | * | |
23 | * |
|
23 | * | |
24 | */ |
|
24 | */ | |
25 |
|
25 | |||
26 | parameter_dump_packet.unused0 = TC->dataAndCRC[0]; |
|
26 | parameter_dump_packet.unused0 = TC->dataAndCRC[0]; | |
27 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = TC->dataAndCRC[1]; |
|
27 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = TC->dataAndCRC[1]; | |
28 | set_wfp_data_shaping(parameter_dump_packet.bw_sp0_sp1_r0_r1); |
|
28 | set_wfp_data_shaping( ); | |
29 | return LFR_SUCCESSFUL; |
|
29 | return LFR_SUCCESSFUL; | |
30 | } |
|
30 | } | |
31 |
|
31 | |||
32 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
32 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
33 | { |
|
33 | { | |
34 | /** This function updates the LFR registers with the incoming normal parameters. |
|
34 | /** This function updates the LFR registers with the incoming normal parameters. | |
35 | * |
|
35 | * | |
36 | * @param TC points to the TeleCommand packet that is being processed |
|
36 | * @param TC points to the TeleCommand packet that is being processed | |
37 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
37 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
38 | * |
|
38 | * | |
39 | */ |
|
39 | */ | |
40 |
|
40 | |||
41 | int result; |
|
41 | int result; | |
42 | int flag; |
|
42 | int flag; | |
43 | rtems_status_code status; |
|
43 | rtems_status_code status; | |
44 |
|
44 | |||
45 | flag = LFR_SUCCESSFUL; |
|
45 | flag = LFR_SUCCESSFUL; | |
46 |
|
46 | |||
47 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) || |
|
47 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) || | |
48 | (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) { |
|
48 | (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) { | |
49 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
49 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
50 | flag = LFR_DEFAULT; |
|
50 | flag = LFR_DEFAULT; | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
53 | //*************** |
|
53 | //*************** | |
54 | // sy_lfr_n_swf_l |
|
54 | // sy_lfr_n_swf_l | |
55 | if (flag == LFR_SUCCESSFUL) |
|
55 | if (flag == LFR_SUCCESSFUL) | |
56 | { |
|
56 | { | |
57 | result = set_sy_lfr_n_swf_l( TC, queue_id, time ); |
|
57 | result = set_sy_lfr_n_swf_l( TC, queue_id, time ); | |
58 | if (result != LFR_SUCCESSFUL) |
|
58 | if (result != LFR_SUCCESSFUL) | |
59 | { |
|
59 | { | |
60 | flag = LFR_DEFAULT; |
|
60 | flag = LFR_DEFAULT; | |
61 | } |
|
61 | } | |
62 | } |
|
62 | } | |
63 |
|
63 | |||
64 | //*************** |
|
64 | //*************** | |
65 | // sy_lfr_n_swf_p |
|
65 | // sy_lfr_n_swf_p | |
66 | if (flag == LFR_SUCCESSFUL) |
|
66 | if (flag == LFR_SUCCESSFUL) | |
67 | { |
|
67 | { | |
68 | result = set_sy_lfr_n_swf_p( TC, queue_id, time ); |
|
68 | result = set_sy_lfr_n_swf_p( TC, queue_id, time ); | |
69 | if (result != LFR_SUCCESSFUL) |
|
69 | if (result != LFR_SUCCESSFUL) | |
70 | { |
|
70 | { | |
71 | flag = LFR_DEFAULT; |
|
71 | flag = LFR_DEFAULT; | |
72 | } |
|
72 | } | |
73 | } |
|
73 | } | |
74 |
|
74 | |||
75 | //*************** |
|
75 | //*************** | |
76 | // SY_LFR_N_ASM_P |
|
76 | // SY_LFR_N_ASM_P | |
77 | if (flag == LFR_SUCCESSFUL) |
|
77 | if (flag == LFR_SUCCESSFUL) | |
78 | { |
|
78 | { | |
79 | result = set_sy_lfr_n_asm_p( TC, queue_id ); |
|
79 | result = set_sy_lfr_n_asm_p( TC, queue_id ); | |
80 | if (result != LFR_SUCCESSFUL) |
|
80 | if (result != LFR_SUCCESSFUL) | |
81 | { |
|
81 | { | |
82 | flag = LFR_DEFAULT; |
|
82 | flag = LFR_DEFAULT; | |
83 | } |
|
83 | } | |
84 | } |
|
84 | } | |
85 |
|
85 | |||
86 | //*************** |
|
86 | //*************** | |
87 | // SY_LFR_N_BP_P0 |
|
87 | // SY_LFR_N_BP_P0 | |
88 | if (flag == LFR_SUCCESSFUL) |
|
88 | if (flag == LFR_SUCCESSFUL) | |
89 | { |
|
89 | { | |
90 | result = set_sy_lfr_n_bp_p0( TC, queue_id ); |
|
90 | result = set_sy_lfr_n_bp_p0( TC, queue_id ); | |
91 | if (result != LFR_SUCCESSFUL) |
|
91 | if (result != LFR_SUCCESSFUL) | |
92 | { |
|
92 | { | |
93 | flag = LFR_DEFAULT; |
|
93 | flag = LFR_DEFAULT; | |
94 | } |
|
94 | } | |
95 | } |
|
95 | } | |
96 |
|
96 | |||
97 | //*************** |
|
97 | //*************** | |
98 | // sy_lfr_n_bp_p1 |
|
98 | // sy_lfr_n_bp_p1 | |
99 | if (flag == LFR_SUCCESSFUL) |
|
99 | if (flag == LFR_SUCCESSFUL) | |
100 | { |
|
100 | { | |
101 | result = set_sy_lfr_n_bp_p1( TC, queue_id ); |
|
101 | result = set_sy_lfr_n_bp_p1( TC, queue_id ); | |
102 | if (result != LFR_SUCCESSFUL) |
|
102 | if (result != LFR_SUCCESSFUL) | |
103 | { |
|
103 | { | |
104 | flag = LFR_DEFAULT; |
|
104 | flag = LFR_DEFAULT; | |
105 | } |
|
105 | } | |
106 | } |
|
106 | } | |
107 |
|
107 | |||
108 | //********************* |
|
108 | //********************* | |
109 | // sy_lfr_n_cwf_long_f3 |
|
109 | // sy_lfr_n_cwf_long_f3 | |
110 | if (flag == LFR_SUCCESSFUL) |
|
110 | if (flag == LFR_SUCCESSFUL) | |
111 | { |
|
111 | { | |
112 | result = set_sy_lfr_n_cwf_long_f3( TC, queue_id ); |
|
112 | result = set_sy_lfr_n_cwf_long_f3( TC, queue_id ); | |
113 | if (result != LFR_SUCCESSFUL) |
|
113 | if (result != LFR_SUCCESSFUL) | |
114 | { |
|
114 | { | |
115 | flag = LFR_DEFAULT; |
|
115 | flag = LFR_DEFAULT; | |
116 | } |
|
116 | } | |
117 | } |
|
117 | } | |
118 |
|
118 | |||
119 | return flag; |
|
119 | return flag; | |
120 | } |
|
120 | } | |
121 |
|
121 | |||
122 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
122 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
123 | { |
|
123 | { | |
124 | /** This function updates the LFR registers with the incoming burst parameters. |
|
124 | /** This function updates the LFR registers with the incoming burst parameters. | |
125 | * |
|
125 | * | |
126 | * @param TC points to the TeleCommand packet that is being processed |
|
126 | * @param TC points to the TeleCommand packet that is being processed | |
127 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
127 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
128 | * |
|
128 | * | |
129 | */ |
|
129 | */ | |
130 |
|
130 | |||
131 | int result; |
|
131 | int result; | |
132 | unsigned char lfrMode; |
|
132 | unsigned char lfrMode; | |
133 | rtems_status_code status; |
|
133 | rtems_status_code status; | |
134 |
|
134 | |||
135 | result = LFR_DEFAULT; |
|
135 | result = LFR_DEFAULT; | |
136 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
136 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
137 |
|
137 | |||
138 | if ( lfrMode == LFR_MODE_BURST ) { |
|
138 | if ( lfrMode == LFR_MODE_BURST ) { | |
139 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
139 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
140 | result = LFR_DEFAULT; |
|
140 | result = LFR_DEFAULT; | |
141 | } |
|
141 | } | |
142 | else { |
|
142 | else { | |
143 | parameter_dump_packet.sy_lfr_b_bp_p0 = TC->dataAndCRC[0]; |
|
143 | parameter_dump_packet.sy_lfr_b_bp_p0 = TC->dataAndCRC[0]; | |
144 | parameter_dump_packet.sy_lfr_b_bp_p1 = TC->dataAndCRC[1]; |
|
144 | parameter_dump_packet.sy_lfr_b_bp_p1 = TC->dataAndCRC[1]; | |
145 |
|
145 | |||
146 | result = LFR_SUCCESSFUL; |
|
146 | result = LFR_SUCCESSFUL; | |
147 | } |
|
147 | } | |
148 |
|
148 | |||
149 | return result; |
|
149 | return result; | |
150 | } |
|
150 | } | |
151 |
|
151 | |||
152 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
152 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
153 | { |
|
153 | { | |
154 | /** This function updates the LFR registers with the incoming sbm1 parameters. |
|
154 | /** This function updates the LFR registers with the incoming sbm1 parameters. | |
155 | * |
|
155 | * | |
156 | * @param TC points to the TeleCommand packet that is being processed |
|
156 | * @param TC points to the TeleCommand packet that is being processed | |
157 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
157 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
158 | * |
|
158 | * | |
159 | */ |
|
159 | */ | |
160 | int result; |
|
160 | int result; | |
161 | unsigned char lfrMode; |
|
161 | unsigned char lfrMode; | |
162 | rtems_status_code status; |
|
162 | rtems_status_code status; | |
163 |
|
163 | |||
164 | result = LFR_DEFAULT; |
|
164 | result = LFR_DEFAULT; | |
165 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
165 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
166 |
|
166 | |||
167 | if ( (lfrMode == LFR_MODE_SBM1) || (lfrMode == LFR_MODE_SBM2) ) { |
|
167 | if ( (lfrMode == LFR_MODE_SBM1) || (lfrMode == LFR_MODE_SBM2) ) { | |
168 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
168 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
169 | result = LFR_DEFAULT; |
|
169 | result = LFR_DEFAULT; | |
170 | } |
|
170 | } | |
171 | else { |
|
171 | else { | |
172 | parameter_dump_packet.sy_lfr_s1_bp_p0 = TC->dataAndCRC[0]; |
|
172 | parameter_dump_packet.sy_lfr_s1_bp_p0 = TC->dataAndCRC[0]; | |
173 | parameter_dump_packet.sy_lfr_s1_bp_p1 = TC->dataAndCRC[1]; |
|
173 | parameter_dump_packet.sy_lfr_s1_bp_p1 = TC->dataAndCRC[1]; | |
174 |
|
174 | |||
175 | result = LFR_SUCCESSFUL; |
|
175 | result = LFR_SUCCESSFUL; | |
176 | } |
|
176 | } | |
177 |
|
177 | |||
178 | return result; |
|
178 | return result; | |
179 | } |
|
179 | } | |
180 |
|
180 | |||
181 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
181 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
182 | { |
|
182 | { | |
183 | /** This function updates the LFR registers with the incoming sbm2 parameters. |
|
183 | /** This function updates the LFR registers with the incoming sbm2 parameters. | |
184 | * |
|
184 | * | |
185 | * @param TC points to the TeleCommand packet that is being processed |
|
185 | * @param TC points to the TeleCommand packet that is being processed | |
186 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
186 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
187 | * |
|
187 | * | |
188 | */ |
|
188 | */ | |
189 |
|
189 | |||
190 | int result; |
|
190 | int result; | |
191 | unsigned char lfrMode; |
|
191 | unsigned char lfrMode; | |
192 | rtems_status_code status; |
|
192 | rtems_status_code status; | |
193 |
|
193 | |||
194 | result = LFR_DEFAULT; |
|
194 | result = LFR_DEFAULT; | |
195 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
195 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
196 |
|
196 | |||
197 | if ( (lfrMode == LFR_MODE_SBM2) || (lfrMode == LFR_MODE_SBM2) ) { |
|
197 | if ( (lfrMode == LFR_MODE_SBM2) || (lfrMode == LFR_MODE_SBM2) ) { | |
198 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
198 | status = send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); | |
199 | result = LFR_DEFAULT; |
|
199 | result = LFR_DEFAULT; | |
200 | } |
|
200 | } | |
201 | else { |
|
201 | else { | |
202 | parameter_dump_packet.sy_lfr_s2_bp_p0 = TC->dataAndCRC[0]; |
|
202 | parameter_dump_packet.sy_lfr_s2_bp_p0 = TC->dataAndCRC[0]; | |
203 | parameter_dump_packet.sy_lfr_s2_bp_p1 = TC->dataAndCRC[1]; |
|
203 | parameter_dump_packet.sy_lfr_s2_bp_p1 = TC->dataAndCRC[1]; | |
204 |
|
204 | |||
205 | result = LFR_SUCCESSFUL; |
|
205 | result = LFR_SUCCESSFUL; | |
206 | } |
|
206 | } | |
207 |
|
207 | |||
208 | return result; |
|
208 | return result; | |
209 | } |
|
209 | } | |
210 |
|
210 | |||
211 | int action_dump_par( rtems_id queue_id ) |
|
211 | int action_dump_par( rtems_id queue_id ) | |
212 | { |
|
212 | { | |
213 | /** This function dumps the LFR parameters by sending the appropriate TM packet to the dedicated RTEMS message queue. |
|
213 | /** This function dumps the LFR parameters by sending the appropriate TM packet to the dedicated RTEMS message queue. | |
214 | * |
|
214 | * | |
215 | * @param queue_id is the id of the queue which handles TM related to this execution step. |
|
215 | * @param queue_id is the id of the queue which handles TM related to this execution step. | |
216 | * |
|
216 | * | |
217 | * @return RTEMS directive status codes: |
|
217 | * @return RTEMS directive status codes: | |
218 | * - RTEMS_SUCCESSFUL - message sent successfully |
|
218 | * - RTEMS_SUCCESSFUL - message sent successfully | |
219 | * - RTEMS_INVALID_ID - invalid queue id |
|
219 | * - RTEMS_INVALID_ID - invalid queue id | |
220 | * - RTEMS_INVALID_SIZE - invalid message size |
|
220 | * - RTEMS_INVALID_SIZE - invalid message size | |
221 | * - RTEMS_INVALID_ADDRESS - buffer is NULL |
|
221 | * - RTEMS_INVALID_ADDRESS - buffer is NULL | |
222 | * - RTEMS_UNSATISFIED - out of message buffers |
|
222 | * - RTEMS_UNSATISFIED - out of message buffers | |
223 | * - RTEMS_TOO_MANY - queue s limit has been reached |
|
223 | * - RTEMS_TOO_MANY - queue s limit has been reached | |
224 | * |
|
224 | * | |
225 | */ |
|
225 | */ | |
226 |
|
226 | |||
227 | int status; |
|
227 | int status; | |
228 |
|
228 | |||
229 | // UPDATE TIME |
|
229 | // UPDATE TIME | |
230 | increment_seq_counter( parameter_dump_packet.packetSequenceControl ); |
|
230 | increment_seq_counter( parameter_dump_packet.packetSequenceControl ); | |
231 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
231 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
232 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
232 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
233 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
233 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
234 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
234 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
235 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
235 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
236 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
236 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); | |
237 | // SEND DATA |
|
237 | // SEND DATA | |
238 | status = rtems_message_queue_send( queue_id, ¶meter_dump_packet, |
|
238 | status = rtems_message_queue_send( queue_id, ¶meter_dump_packet, | |
239 | PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); |
|
239 | PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); | |
240 | if (status != RTEMS_SUCCESSFUL) { |
|
240 | if (status != RTEMS_SUCCESSFUL) { | |
241 | PRINTF1("in action_dump *** ERR sending packet, code %d", status) |
|
241 | PRINTF1("in action_dump *** ERR sending packet, code %d", status) | |
242 | } |
|
242 | } | |
243 |
|
243 | |||
244 | return status; |
|
244 | return status; | |
245 | } |
|
245 | } | |
246 |
|
246 | |||
247 | //*********************** |
|
247 | //*********************** | |
248 | // NORMAL MODE PARAMETERS |
|
248 | // NORMAL MODE PARAMETERS | |
249 |
|
249 | |||
250 | int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ) |
|
250 | int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ) | |
251 | { |
|
251 | { | |
252 | /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l). |
|
252 | /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l). | |
253 | * |
|
253 | * | |
254 | * @param TC points to the TeleCommand packet that is being processed |
|
254 | * @param TC points to the TeleCommand packet that is being processed | |
255 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
255 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
256 | * |
|
256 | * | |
257 | */ |
|
257 | */ | |
258 |
|
258 | |||
259 | unsigned int tmp; |
|
259 | unsigned int tmp; | |
260 | int result; |
|
260 | int result; | |
261 | unsigned char msb; |
|
261 | unsigned char msb; | |
262 | unsigned char lsb; |
|
262 | unsigned char lsb; | |
263 | rtems_status_code status; |
|
263 | rtems_status_code status; | |
264 |
|
264 | |||
265 | msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_L ]; |
|
265 | msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_L ]; | |
266 | lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_L+1 ]; |
|
266 | lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_L+1 ]; | |
267 |
|
267 | |||
268 | tmp = ( unsigned int ) floor( |
|
268 | tmp = ( unsigned int ) floor( | |
269 | ( ( msb*256 ) + lsb ) / 16 |
|
269 | ( ( msb*256 ) + lsb ) / 16 | |
270 | ) * 16; |
|
270 | ) * 16; | |
271 |
|
271 | |||
272 | if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16 |
|
272 | if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16 | |
273 | { // 2048 is the maximum limit due to the size of the buffers |
|
273 | { // 2048 is the maximum limit due to the size of the buffers | |
274 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_L+10, lsb, time ); |
|
274 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_L+10, lsb, time ); | |
275 | result = WRONG_APP_DATA; |
|
275 | result = WRONG_APP_DATA; | |
276 | } |
|
276 | } | |
277 | else if (tmp != 2048) |
|
277 | else if (tmp != 2048) | |
278 | { |
|
278 | { | |
279 | status = send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
279 | status = send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); | |
280 | result = FUNCT_NOT_IMPL; |
|
280 | result = FUNCT_NOT_IMPL; | |
281 | } |
|
281 | } | |
282 | else |
|
282 | else | |
283 | { |
|
283 | { | |
284 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (tmp >> 8); |
|
284 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (tmp >> 8); | |
285 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (tmp ); |
|
285 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (tmp ); | |
286 | result = LFR_SUCCESSFUL; |
|
286 | result = LFR_SUCCESSFUL; | |
287 | } |
|
287 | } | |
288 |
|
288 | |||
289 | return result; |
|
289 | return result; | |
290 | } |
|
290 | } | |
291 |
|
291 | |||
292 | int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time) |
|
292 | int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time) | |
293 | { |
|
293 | { | |
294 | /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p). |
|
294 | /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p). | |
295 | * |
|
295 | * | |
296 | * @param TC points to the TeleCommand packet that is being processed |
|
296 | * @param TC points to the TeleCommand packet that is being processed | |
297 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
297 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
298 | * |
|
298 | * | |
299 | */ |
|
299 | */ | |
300 |
|
300 | |||
301 | unsigned int tmp; |
|
301 | unsigned int tmp; | |
302 | int result; |
|
302 | int result; | |
303 | unsigned char msb; |
|
303 | unsigned char msb; | |
304 | unsigned char lsb; |
|
304 | unsigned char lsb; | |
305 | rtems_status_code status; |
|
305 | rtems_status_code status; | |
306 |
|
306 | |||
307 | msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_P ]; |
|
307 | msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_P ]; | |
308 | lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_P+1 ]; |
|
308 | lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_SWF_P+1 ]; | |
309 |
|
309 | |||
310 | tmp = ( unsigned int ) floor( |
|
310 | tmp = msb * 256 + lsb; | |
311 | ( ( msb*256 ) + lsb ) / 8 |
|
|||
312 | ) * 8; |
|
|||
313 |
|
311 | |||
314 |
if ( |
|
312 | if ( tmp < 16 ) | |
315 | { |
|
313 | { | |
316 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_P+10, lsb, time ); |
|
314 | status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_P+10, lsb, time ); | |
317 | result = WRONG_APP_DATA; |
|
315 | result = WRONG_APP_DATA; | |
318 | } |
|
316 | } | |
319 | else |
|
317 | else | |
320 | { |
|
318 | { | |
321 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (tmp >> 8); |
|
319 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (tmp >> 8); | |
322 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (tmp ); |
|
320 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (tmp ); | |
323 | result = LFR_SUCCESSFUL; |
|
321 | result = LFR_SUCCESSFUL; | |
324 | } |
|
322 | } | |
325 |
|
323 | |||
326 | return result; |
|
324 | return result; | |
327 | } |
|
325 | } | |
328 |
|
326 | |||
329 | int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
327 | int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
330 | { |
|
328 | { | |
331 | /** This function sets the time between two full spectral matrices transmission, in s (SY_LFR_N_ASM_P). |
|
329 | /** This function sets the time between two full spectral matrices transmission, in s (SY_LFR_N_ASM_P). | |
332 | * |
|
330 | * | |
333 | * @param TC points to the TeleCommand packet that is being processed |
|
331 | * @param TC points to the TeleCommand packet that is being processed | |
334 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
332 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
335 | * |
|
333 | * | |
336 | */ |
|
334 | */ | |
337 |
|
335 | |||
338 | int result; |
|
336 | int result; | |
339 | unsigned char msb; |
|
337 | unsigned char msb; | |
340 | unsigned char lsb; |
|
338 | unsigned char lsb; | |
341 |
|
339 | |||
342 | msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_ASM_P ]; |
|
340 | msb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_ASM_P ]; | |
343 | lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_ASM_P+1 ]; |
|
341 | lsb = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_ASM_P+1 ]; | |
344 |
|
342 | |||
345 | parameter_dump_packet.sy_lfr_n_asm_p[0] = msb; |
|
343 | parameter_dump_packet.sy_lfr_n_asm_p[0] = msb; | |
346 | parameter_dump_packet.sy_lfr_n_asm_p[1] = lsb; |
|
344 | parameter_dump_packet.sy_lfr_n_asm_p[1] = lsb; | |
347 | result = LFR_SUCCESSFUL; |
|
345 | result = LFR_SUCCESSFUL; | |
348 |
|
346 | |||
349 | return result; |
|
347 | return result; | |
350 | } |
|
348 | } | |
351 |
|
349 | |||
352 | int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) |
|
350 | int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
353 | { |
|
351 | { | |
354 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_N_BP_P0). |
|
352 | /** This function sets the time between two basic parameter sets, in s (SY_LFR_N_BP_P0). | |
355 | * |
|
353 | * | |
356 | * @param TC points to the TeleCommand packet that is being processed |
|
354 | * @param TC points to the TeleCommand packet that is being processed | |
357 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
355 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
358 | * |
|
356 | * | |
359 | */ |
|
357 | */ | |
360 |
|
358 | |||
361 | int status; |
|
359 | int status; | |
362 |
|
360 | |||
363 | status = LFR_SUCCESSFUL; |
|
361 | status = LFR_SUCCESSFUL; | |
364 |
|
362 | |||
365 | parameter_dump_packet.sy_lfr_n_bp_p0 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_BP_P0 ]; |
|
363 | parameter_dump_packet.sy_lfr_n_bp_p0 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_BP_P0 ]; | |
366 |
|
364 | |||
367 | return status; |
|
365 | return status; | |
368 | } |
|
366 | } | |
369 |
|
367 | |||
370 | int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) |
|
368 | int set_sy_lfr_n_bp_p1(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) | |
371 | { |
|
369 | { | |
372 | /** This function sets the time between two basic parameter sets (autocorrelation + crosscorrelation), in s (sy_lfr_n_bp_p1). |
|
370 | /** This function sets the time between two basic parameter sets (autocorrelation + crosscorrelation), in s (sy_lfr_n_bp_p1). | |
373 | * |
|
371 | * | |
374 | * @param TC points to the TeleCommand packet that is being processed |
|
372 | * @param TC points to the TeleCommand packet that is being processed | |
375 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
373 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
376 | * |
|
374 | * | |
377 | */ |
|
375 | */ | |
378 |
|
376 | |||
379 | int status; |
|
377 | int status; | |
380 |
|
378 | |||
381 | status = LFR_SUCCESSFUL; |
|
379 | status = LFR_SUCCESSFUL; | |
382 |
|
380 | |||
383 | parameter_dump_packet.sy_lfr_n_bp_p1 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_BP_P1 ]; |
|
381 | parameter_dump_packet.sy_lfr_n_bp_p1 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_BP_P1 ]; | |
384 |
|
382 | |||
385 | return status; |
|
383 | return status; | |
386 | } |
|
384 | } | |
387 |
|
385 | |||
388 | int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) |
|
386 | int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) | |
389 | { |
|
387 | { | |
390 | /** This function allows to switch from CWF_F3 packets to CWF_LONG_F3 packets. |
|
388 | /** This function allows to switch from CWF_F3 packets to CWF_LONG_F3 packets. | |
391 | * |
|
389 | * | |
392 | * @param TC points to the TeleCommand packet that is being processed |
|
390 | * @param TC points to the TeleCommand packet that is being processed | |
393 | * @param queue_id is the id of the queue which handles TM related to this execution step |
|
391 | * @param queue_id is the id of the queue which handles TM related to this execution step | |
394 | * |
|
392 | * | |
395 | */ |
|
393 | */ | |
396 |
|
394 | |||
397 | int status; |
|
395 | int status; | |
398 |
|
396 | |||
399 | status = LFR_SUCCESSFUL; |
|
397 | status = LFR_SUCCESSFUL; | |
400 |
|
398 | |||
401 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_CWF_LONG_F3 ]; |
|
399 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = TC->dataAndCRC[ BYTE_POS_SY_LFR_N_CWF_LONG_F3 ]; | |
402 |
|
400 | |||
403 | return status; |
|
401 | return status; | |
404 | } |
|
402 | } | |
405 |
|
403 | |||
406 | //********************** |
|
404 | //********************** | |
407 | // BURST MODE PARAMETERS |
|
405 | // BURST MODE PARAMETERS | |
408 |
|
406 | |||
409 | //********************* |
|
407 | //********************* | |
410 | // SBM1 MODE PARAMETERS |
|
408 | // SBM1 MODE PARAMETERS | |
411 |
|
409 | |||
412 | //********************* |
|
410 | //********************* | |
413 | // SBM2 MODE PARAMETERS |
|
411 | // SBM2 MODE PARAMETERS | |
414 |
|
412 | |||
415 | //********** |
|
413 | //********** | |
416 | // init dump |
|
414 | // init dump | |
417 |
|
415 | |||
418 | void init_parameter_dump( void ) |
|
416 | void init_parameter_dump( void ) | |
419 | { |
|
417 | { | |
420 | /** This function initialize the parameter_dump_packet global variable with default values. |
|
418 | /** This function initialize the parameter_dump_packet global variable with default values. | |
421 | * |
|
419 | * | |
422 | */ |
|
420 | */ | |
423 |
|
421 | |||
424 | parameter_dump_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
422 | parameter_dump_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
425 | parameter_dump_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
423 | parameter_dump_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
426 | parameter_dump_packet.reserved = CCSDS_RESERVED; |
|
424 | parameter_dump_packet.reserved = CCSDS_RESERVED; | |
427 | parameter_dump_packet.userApplication = CCSDS_USER_APP; |
|
425 | parameter_dump_packet.userApplication = CCSDS_USER_APP; | |
428 | parameter_dump_packet.packetID[0] = (unsigned char) (TM_PACKET_ID_PARAMETER_DUMP >> 8); |
|
426 | parameter_dump_packet.packetID[0] = (unsigned char) (TM_PACKET_ID_PARAMETER_DUMP >> 8); | |
429 | parameter_dump_packet.packetID[1] = (unsigned char) TM_PACKET_ID_PARAMETER_DUMP; |
|
427 | parameter_dump_packet.packetID[1] = (unsigned char) TM_PACKET_ID_PARAMETER_DUMP; | |
430 | parameter_dump_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
428 | parameter_dump_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
431 | parameter_dump_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
429 | parameter_dump_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
432 | parameter_dump_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_PARAMETER_DUMP >> 8); |
|
430 | parameter_dump_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_PARAMETER_DUMP >> 8); | |
433 | parameter_dump_packet.packetLength[1] = (unsigned char) PACKET_LENGTH_PARAMETER_DUMP; |
|
431 | parameter_dump_packet.packetLength[1] = (unsigned char) PACKET_LENGTH_PARAMETER_DUMP; | |
434 | // DATA FIELD HEADER |
|
432 | // DATA FIELD HEADER | |
435 | parameter_dump_packet.spare1_pusVersion_spare2 = SPARE1_PUSVERSION_SPARE2; |
|
433 | parameter_dump_packet.spare1_pusVersion_spare2 = SPARE1_PUSVERSION_SPARE2; | |
436 | parameter_dump_packet.serviceType = TM_TYPE_PARAMETER_DUMP; |
|
434 | parameter_dump_packet.serviceType = TM_TYPE_PARAMETER_DUMP; | |
437 | parameter_dump_packet.serviceSubType = TM_SUBTYPE_PARAMETER_DUMP; |
|
435 | parameter_dump_packet.serviceSubType = TM_SUBTYPE_PARAMETER_DUMP; | |
438 | parameter_dump_packet.destinationID = TM_DESTINATION_ID_GROUND; |
|
436 | parameter_dump_packet.destinationID = TM_DESTINATION_ID_GROUND; | |
439 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
437 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
440 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
438 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
441 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
439 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
442 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
440 | parameter_dump_packet.time[3] = (unsigned char) (time_management_regs->coarse_time); | |
443 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
441 | parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
444 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); |
|
442 | parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time); | |
445 | parameter_dump_packet.sid = SID_PARAMETER_DUMP; |
|
443 | parameter_dump_packet.sid = SID_PARAMETER_DUMP; | |
446 |
|
444 | |||
447 | //****************** |
|
445 | //****************** | |
448 | // COMMON PARAMETERS |
|
446 | // COMMON PARAMETERS | |
449 | parameter_dump_packet.unused0 = DEFAULT_SY_LFR_COMMON0; |
|
447 | parameter_dump_packet.unused0 = DEFAULT_SY_LFR_COMMON0; | |
450 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = DEFAULT_SY_LFR_COMMON1; |
|
448 | parameter_dump_packet.bw_sp0_sp1_r0_r1 = DEFAULT_SY_LFR_COMMON1; | |
451 |
|
449 | |||
452 | //****************** |
|
450 | //****************** | |
453 | // NORMAL PARAMETERS |
|
451 | // NORMAL PARAMETERS | |
454 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (SY_LFR_N_SWF_L >> 8); |
|
452 | parameter_dump_packet.sy_lfr_n_swf_l[0] = (unsigned char) (SY_LFR_N_SWF_L >> 8); | |
455 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (SY_LFR_N_SWF_L ); |
|
453 | parameter_dump_packet.sy_lfr_n_swf_l[1] = (unsigned char) (SY_LFR_N_SWF_L ); | |
456 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (SY_LFR_N_SWF_P >> 8); |
|
454 | parameter_dump_packet.sy_lfr_n_swf_p[0] = (unsigned char) (SY_LFR_N_SWF_P >> 8); | |
457 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (SY_LFR_N_SWF_P ); |
|
455 | parameter_dump_packet.sy_lfr_n_swf_p[1] = (unsigned char) (SY_LFR_N_SWF_P ); | |
458 | parameter_dump_packet.sy_lfr_n_asm_p[0] = (unsigned char) (SY_LFR_N_ASM_P >> 8); |
|
456 | parameter_dump_packet.sy_lfr_n_asm_p[0] = (unsigned char) (SY_LFR_N_ASM_P >> 8); | |
459 | parameter_dump_packet.sy_lfr_n_asm_p[1] = (unsigned char) (SY_LFR_N_ASM_P ); |
|
457 | parameter_dump_packet.sy_lfr_n_asm_p[1] = (unsigned char) (SY_LFR_N_ASM_P ); | |
460 | parameter_dump_packet.sy_lfr_n_bp_p0 = (unsigned char) SY_LFR_N_BP_P0; |
|
458 | parameter_dump_packet.sy_lfr_n_bp_p0 = (unsigned char) SY_LFR_N_BP_P0; | |
461 | parameter_dump_packet.sy_lfr_n_bp_p1 = (unsigned char) SY_LFR_N_BP_P1; |
|
459 | parameter_dump_packet.sy_lfr_n_bp_p1 = (unsigned char) SY_LFR_N_BP_P1; | |
462 |
|
460 | |||
463 | //***************** |
|
461 | //***************** | |
464 | // BURST PARAMETERS |
|
462 | // BURST PARAMETERS | |
465 | parameter_dump_packet.sy_lfr_b_bp_p0 = (unsigned char) DEFAULT_SY_LFR_B_BP_P0; |
|
463 | parameter_dump_packet.sy_lfr_b_bp_p0 = (unsigned char) DEFAULT_SY_LFR_B_BP_P0; | |
466 | parameter_dump_packet.sy_lfr_b_bp_p1 = (unsigned char) DEFAULT_SY_LFR_B_BP_P1; |
|
464 | parameter_dump_packet.sy_lfr_b_bp_p1 = (unsigned char) DEFAULT_SY_LFR_B_BP_P1; | |
467 |
|
465 | |||
468 | //**************** |
|
466 | //**************** | |
469 | // SBM1 PARAMETERS |
|
467 | // SBM1 PARAMETERS | |
470 | parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; // min value is 0.25 s for the period |
|
468 | parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; // min value is 0.25 s for the period | |
471 | parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P1; |
|
469 | parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P1; | |
472 |
|
470 | |||
473 | //**************** |
|
471 | //**************** | |
474 | // SBM2 PARAMETERS |
|
472 | // SBM2 PARAMETERS | |
475 | parameter_dump_packet.sy_lfr_s2_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P0; |
|
473 | parameter_dump_packet.sy_lfr_s2_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P0; | |
476 | parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P1; |
|
474 | parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P1; | |
477 | } |
|
475 | } | |
478 |
|
476 | |||
479 |
|
477 | |||
480 |
|
478 | |||
481 |
|
479 | |||
482 |
|
480 | |||
483 |
|
481 | |||
484 |
|
482 |
@@ -1,1519 +1,1350 | |||||
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 | //***************** |
|
12 | //***************** | |
13 | // waveform headers |
|
13 | // waveform headers | |
14 | // SWF |
|
14 | // SWF | |
15 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7]; |
|
15 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7]; | |
16 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7]; |
|
16 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7]; | |
17 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7]; |
|
17 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7]; | |
18 | // CWF |
|
18 | // CWF | |
19 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7]; |
|
19 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7]; | |
20 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7]; |
|
20 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7]; | |
21 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7]; |
|
21 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7]; | |
22 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7]; |
|
22 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7]; | |
23 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7]; |
|
23 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7]; | |
24 |
|
24 | |||
25 | //************** |
|
25 | //************** | |
26 | // waveform ring |
|
26 | // waveform ring | |
27 | ring_node waveform_ring_f0[NB_RING_NODES_F0]; |
|
27 | ring_node waveform_ring_f0[NB_RING_NODES_F0]; | |
28 | ring_node waveform_ring_f1[NB_RING_NODES_F1]; |
|
28 | ring_node waveform_ring_f1[NB_RING_NODES_F1]; | |
29 | ring_node waveform_ring_f2[NB_RING_NODES_F2]; |
|
29 | ring_node waveform_ring_f2[NB_RING_NODES_F2]; | |
30 | ring_node *current_ring_node_f0; |
|
30 | ring_node *current_ring_node_f0; | |
31 | ring_node *ring_node_to_send_swf_f0; |
|
31 | ring_node *ring_node_to_send_swf_f0; | |
32 | ring_node *current_ring_node_f1; |
|
32 | ring_node *current_ring_node_f1; | |
33 | ring_node *ring_node_to_send_swf_f1; |
|
33 | ring_node *ring_node_to_send_swf_f1; | |
34 | ring_node *ring_node_to_send_cwf_f1; |
|
34 | ring_node *ring_node_to_send_cwf_f1; | |
35 | ring_node *current_ring_node_f2; |
|
35 | ring_node *current_ring_node_f2; | |
36 | ring_node *ring_node_to_send_swf_f2; |
|
36 | ring_node *ring_node_to_send_swf_f2; | |
37 | ring_node *ring_node_to_send_cwf_f2; |
|
37 | ring_node *ring_node_to_send_cwf_f2; | |
38 |
|
38 | |||
39 | rtems_isr waveforms_isr( rtems_vector_number vector ) |
|
39 | rtems_isr waveforms_isr( rtems_vector_number vector ) | |
40 | { |
|
40 | { | |
41 | /** This is the interrupt sub routine called by the waveform picker core. |
|
41 | /** This is the interrupt sub routine called by the waveform picker core. | |
42 | * |
|
42 | * | |
43 | * This ISR launch different actions depending mainly on two pieces of information: |
|
43 | * This ISR launch different actions depending mainly on two pieces of information: | |
44 | * 1. the values read in the registers of the waveform picker. |
|
44 | * 1. the values read in the registers of the waveform picker. | |
45 | * 2. the current LFR mode. |
|
45 | * 2. the current LFR mode. | |
46 | * |
|
46 | * | |
47 | */ |
|
47 | */ | |
48 |
|
48 | |||
49 | static unsigned char nb_swf = 0; |
|
49 | static unsigned char nb_swf = 0; | |
50 |
|
50 | |||
51 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
51 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
52 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
52 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
53 | { // in modes other than STANDBY and BURST, send the CWF_F3 data |
|
53 | { // in modes other than STANDBY and BURST, send the CWF_F3 data | |
54 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full |
|
54 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full | |
55 | // (1) change the receiving buffer for the waveform picker |
|
55 | // (1) change the receiving buffer for the waveform picker | |
56 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { |
|
56 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { | |
57 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b); |
|
57 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b); | |
58 | } |
|
58 | } | |
59 | else { |
|
59 | else { | |
60 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); |
|
60 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); | |
61 | } |
|
61 | } | |
62 | // (2) send an event for the waveforms transmission |
|
62 | // (2) send an event for the waveforms transmission | |
63 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
63 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
64 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
64 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
65 | } |
|
65 | } | |
66 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] |
|
66 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] | |
67 | } |
|
67 | } | |
68 | } |
|
68 | } | |
69 |
|
69 | |||
70 | switch(lfrCurrentMode) |
|
70 | switch(lfrCurrentMode) | |
71 | { |
|
71 | { | |
72 | //******** |
|
72 | //******** | |
73 | // STANDBY |
|
73 | // STANDBY | |
74 | case(LFR_MODE_STANDBY): |
|
74 | case(LFR_MODE_STANDBY): | |
75 | break; |
|
75 | break; | |
76 |
|
76 | |||
77 | //****** |
|
77 | //****** | |
78 | // NORMAL |
|
78 | // NORMAL | |
79 | case(LFR_MODE_NORMAL): |
|
79 | case(LFR_MODE_NORMAL): | |
80 | if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits |
|
80 | if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits | |
81 | { |
|
81 | { | |
82 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
82 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
83 | } |
|
83 | } | |
84 | if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits |
|
84 | if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits | |
85 | { |
|
85 | { | |
86 | // change F0 ring node |
|
86 | // change F0 ring node | |
87 | ring_node_to_send_swf_f0 = current_ring_node_f0; |
|
87 | ring_node_to_send_swf_f0 = current_ring_node_f0; | |
88 | current_ring_node_f0 = current_ring_node_f0->next; |
|
88 | current_ring_node_f0 = current_ring_node_f0->next; | |
89 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; |
|
89 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; | |
90 | // change F1 ring node |
|
90 | // change F1 ring node | |
91 | ring_node_to_send_swf_f1 = current_ring_node_f1; |
|
91 | ring_node_to_send_swf_f1 = current_ring_node_f1; | |
92 | current_ring_node_f1 = current_ring_node_f1->next; |
|
92 | current_ring_node_f1 = current_ring_node_f1->next; | |
93 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; |
|
93 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
94 | // change F2 ring node |
|
94 | // change F2 ring node | |
95 | ring_node_to_send_swf_f2 = current_ring_node_f2; |
|
95 | ring_node_to_send_swf_f2 = current_ring_node_f2; | |
96 | current_ring_node_f2 = current_ring_node_f2->next; |
|
96 | current_ring_node_f2 = current_ring_node_f2->next; | |
97 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
97 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
98 | // |
|
98 | // | |
99 | if (nb_swf < 2) |
|
99 | // if (nb_swf < 2) | |
100 |
|
|
100 | if (true) | |
101 | { |
|
101 | { | |
102 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
102 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
103 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
103 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
104 | } |
|
104 | } | |
105 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000] |
|
105 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000] | |
106 | nb_swf = nb_swf + 1; |
|
106 | nb_swf = nb_swf + 1; | |
107 | } |
|
107 | } | |
108 | else |
|
108 | else | |
109 | { |
|
109 | { | |
110 | reset_wfp_burst_enable(); |
|
110 | reset_wfp_burst_enable(); | |
111 | nb_swf = 0; |
|
111 | nb_swf = 0; | |
112 | } |
|
112 | } | |
113 |
|
113 | |||
114 | } |
|
114 | } | |
115 |
|
115 | |||
116 | break; |
|
116 | break; | |
117 |
|
117 | |||
118 | //****** |
|
118 | //****** | |
119 | // BURST |
|
119 | // BURST | |
120 | case(LFR_MODE_BURST): |
|
120 | case(LFR_MODE_BURST): | |
121 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit |
|
121 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
122 | // (1) change the receiving buffer for the waveform picker |
|
122 | // (1) change the receiving buffer for the waveform picker | |
123 | ring_node_to_send_cwf_f2 = current_ring_node_f2; |
|
123 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
124 | current_ring_node_f2 = current_ring_node_f2->next; |
|
124 | current_ring_node_f2 = current_ring_node_f2->next; | |
125 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
125 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
126 | // (2) send an event for the waveforms transmission |
|
126 | // (2) send an event for the waveforms transmission | |
127 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { |
|
127 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { | |
128 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
128 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
129 | } |
|
129 | } | |
130 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 |
|
130 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |
131 | } |
|
131 | } | |
132 | break; |
|
132 | break; | |
133 |
|
133 | |||
134 | //***** |
|
134 | //***** | |
135 | // SBM1 |
|
135 | // SBM1 | |
136 | case(LFR_MODE_SBM1): |
|
136 | case(LFR_MODE_SBM1): | |
137 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit |
|
137 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |
138 | // (1) change the receiving buffer for the waveform picker |
|
138 | // (1) change the receiving buffer for the waveform picker | |
139 | ring_node_to_send_cwf_f1 = current_ring_node_f1; |
|
139 | ring_node_to_send_cwf_f1 = current_ring_node_f1; | |
140 | current_ring_node_f1 = current_ring_node_f1->next; |
|
140 | current_ring_node_f1 = current_ring_node_f1->next; | |
141 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; |
|
141 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
142 | // (2) send an event for the waveforms transmission |
|
142 | // (2) send an event for the waveforms transmission | |
143 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { |
|
143 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { | |
144 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
144 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
145 | } |
|
145 | } | |
146 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 |
|
146 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 | |
147 | } |
|
147 | } | |
148 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit |
|
148 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |
149 | ring_node_to_send_swf_f1 = current_ring_node_f1->previous; |
|
149 | ring_node_to_send_swf_f1 = current_ring_node_f1->previous; | |
150 | } |
|
150 | } | |
151 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit |
|
151 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit | |
152 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
152 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
153 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
153 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
154 | } |
|
154 | } | |
155 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 |
|
155 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 | |
156 | } |
|
156 | } | |
157 | break; |
|
157 | break; | |
158 |
|
158 | |||
159 | //***** |
|
159 | //***** | |
160 | // SBM2 |
|
160 | // SBM2 | |
161 | case(LFR_MODE_SBM2): |
|
161 | case(LFR_MODE_SBM2): | |
162 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit |
|
162 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
163 | // (1) change the receiving buffer for the waveform picker |
|
163 | // (1) change the receiving buffer for the waveform picker | |
164 | ring_node_to_send_cwf_f2 = current_ring_node_f2; |
|
164 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
165 | current_ring_node_f2 = current_ring_node_f2->next; |
|
165 | current_ring_node_f2 = current_ring_node_f2->next; | |
166 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
166 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
167 | // (2) send an event for the waveforms transmission |
|
167 | // (2) send an event for the waveforms transmission | |
168 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { |
|
168 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
169 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
169 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
170 | } |
|
170 | } | |
171 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 |
|
171 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |
172 | } |
|
172 | } | |
173 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit |
|
173 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |
174 | ring_node_to_send_swf_f2 = current_ring_node_f2->previous; |
|
174 | ring_node_to_send_swf_f2 = current_ring_node_f2->previous; | |
175 | } |
|
175 | } | |
176 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit |
|
176 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |
177 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
177 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
178 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
178 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
179 | } |
|
179 | } | |
180 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 |
|
180 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
181 | } |
|
181 | } | |
182 | break; |
|
182 | break; | |
183 |
|
183 | |||
184 | //******** |
|
184 | //******** | |
185 | // DEFAULT |
|
185 | // DEFAULT | |
186 | default: |
|
186 | default: | |
187 | break; |
|
187 | break; | |
188 | } |
|
188 | } | |
189 | } |
|
189 | } | |
190 |
|
190 | |||
191 | rtems_isr waveforms_isr_alt( rtems_vector_number vector ) |
|
191 | rtems_isr waveforms_isr_alt( rtems_vector_number vector ) | |
192 | { |
|
192 | { | |
193 | /** This is the interrupt sub routine called by the waveform picker core. |
|
193 | /** This is the interrupt sub routine called by the waveform picker core. | |
194 | * |
|
194 | * | |
195 | * This ISR launch different actions depending mainly on two pieces of information: |
|
195 | * This ISR launch different actions depending mainly on two pieces of information: | |
196 | * 1. the values read in the registers of the waveform picker. |
|
196 | * 1. the values read in the registers of the waveform picker. | |
197 | * 2. the current LFR mode. |
|
197 | * 2. the current LFR mode. | |
198 | * |
|
198 | * | |
199 | */ |
|
199 | */ | |
200 |
|
200 | |||
201 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
201 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
202 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
202 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
203 | { // in modes other than STANDBY and BURST, send the CWF_F3 data |
|
203 | { // in modes other than STANDBY and BURST, send the CWF_F3 data | |
204 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full |
|
204 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full | |
205 | // (1) change the receiving buffer for the waveform picker |
|
205 | // (1) change the receiving buffer for the waveform picker | |
206 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { |
|
206 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { | |
207 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b); |
|
207 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b); | |
208 | } |
|
208 | } | |
209 | else { |
|
209 | else { | |
210 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); |
|
210 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); | |
211 | } |
|
211 | } | |
212 | // (2) send an event for the waveforms transmission |
|
212 | // (2) send an event for the waveforms transmission | |
213 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
213 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
214 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
214 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
215 | } |
|
215 | } | |
216 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] |
|
216 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] | |
217 | } |
|
217 | } | |
218 | } |
|
218 | } | |
219 |
|
219 | |||
220 | switch(lfrCurrentMode) |
|
220 | switch(lfrCurrentMode) | |
221 | { |
|
221 | { | |
222 | //******** |
|
222 | //******** | |
223 | // STANDBY |
|
223 | // STANDBY | |
224 | case(LFR_MODE_STANDBY): |
|
224 | case(LFR_MODE_STANDBY): | |
225 | break; |
|
225 | break; | |
226 |
|
226 | |||
227 | //****** |
|
227 | //****** | |
228 | // NORMAL |
|
228 | // NORMAL | |
229 | case(LFR_MODE_NORMAL): |
|
229 | case(LFR_MODE_NORMAL): | |
230 | if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits |
|
230 | if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits | |
231 | { |
|
231 | { | |
232 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
232 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
233 | } |
|
233 | } | |
234 | if ( (waveform_picker_regs->status & 0x01) == 0x01) // [0001] check the f0 full bit |
|
234 | if ( (waveform_picker_regs->status & 0x01) == 0x01) // [0001] check the f0 full bit | |
235 | { |
|
235 | { | |
236 | // change F0 ring node |
|
236 | // change F0 ring node | |
237 | ring_node_to_send_swf_f0 = current_ring_node_f0; |
|
237 | ring_node_to_send_swf_f0 = current_ring_node_f0; | |
238 | current_ring_node_f0 = current_ring_node_f0->next; |
|
238 | current_ring_node_f0 = current_ring_node_f0->next; | |
239 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; |
|
239 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; | |
240 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1110 1110 1110] |
|
240 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1110 1110 1110] | |
241 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F0 ) != RTEMS_SUCCESSFUL) { |
|
241 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F0 ) != RTEMS_SUCCESSFUL) { | |
242 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
242 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
243 | } |
|
243 | } | |
244 | } |
|
244 | } | |
245 | if ( (waveform_picker_regs->status & 0x02) == 0x02) // [0010] check the f1 full bit |
|
245 | if ( (waveform_picker_regs->status & 0x02) == 0x02) // [0010] check the f1 full bit | |
246 | { |
|
246 | { | |
247 | // change F1 ring node |
|
247 | // change F1 ring node | |
248 | ring_node_to_send_swf_f1 = current_ring_node_f1; |
|
248 | ring_node_to_send_swf_f1 = current_ring_node_f1; | |
249 | current_ring_node_f1 = current_ring_node_f1->next; |
|
249 | current_ring_node_f1 = current_ring_node_f1->next; | |
250 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; |
|
250 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
251 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1101 1101 1101] |
|
251 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1101 1101 1101] | |
252 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F1 ) != RTEMS_SUCCESSFUL) { |
|
252 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F1 ) != RTEMS_SUCCESSFUL) { | |
253 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
253 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
254 | } |
|
254 | } | |
255 | } |
|
255 | } | |
256 | if ( (waveform_picker_regs->status & 0x04) == 0x04) // [0100] check the f2 full bit |
|
256 | if ( (waveform_picker_regs->status & 0x04) == 0x04) // [0100] check the f2 full bit | |
257 | { |
|
257 | { | |
258 | // change F2 ring node |
|
258 | // change F2 ring node | |
259 | ring_node_to_send_swf_f2 = current_ring_node_f2; |
|
259 | ring_node_to_send_swf_f2 = current_ring_node_f2; | |
260 | current_ring_node_f2 = current_ring_node_f2->next; |
|
260 | current_ring_node_f2 = current_ring_node_f2->next; | |
261 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
261 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
262 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1011 1011 1011] |
|
262 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1011 1011 1011] | |
263 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F2 ) != RTEMS_SUCCESSFUL) { |
|
263 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F2 ) != RTEMS_SUCCESSFUL) { | |
264 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
264 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
265 | } |
|
265 | } | |
266 | } |
|
266 | } | |
267 | break; |
|
267 | break; | |
268 |
|
268 | |||
269 | //****** |
|
269 | //****** | |
270 | // BURST |
|
270 | // BURST | |
271 | case(LFR_MODE_BURST): |
|
271 | case(LFR_MODE_BURST): | |
272 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit |
|
272 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
273 | // (1) change the receiving buffer for the waveform picker |
|
273 | // (1) change the receiving buffer for the waveform picker | |
274 | ring_node_to_send_cwf_f2 = current_ring_node_f2; |
|
274 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
275 | current_ring_node_f2 = current_ring_node_f2->next; |
|
275 | current_ring_node_f2 = current_ring_node_f2->next; | |
276 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
276 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
277 | // (2) send an event for the waveforms transmission |
|
277 | // (2) send an event for the waveforms transmission | |
278 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { |
|
278 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { | |
279 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
279 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
280 | } |
|
280 | } | |
281 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 |
|
281 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |
282 | } |
|
282 | } | |
283 | break; |
|
283 | break; | |
284 |
|
284 | |||
285 | //***** |
|
285 | //***** | |
286 | // SBM1 |
|
286 | // SBM1 | |
287 | case(LFR_MODE_SBM1): |
|
287 | case(LFR_MODE_SBM1): | |
288 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit |
|
288 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |
289 | // (1) change the receiving buffer for the waveform picker |
|
289 | // (1) change the receiving buffer for the waveform picker | |
290 | ring_node_to_send_cwf_f1 = current_ring_node_f1; |
|
290 | ring_node_to_send_cwf_f1 = current_ring_node_f1; | |
291 | current_ring_node_f1 = current_ring_node_f1->next; |
|
291 | current_ring_node_f1 = current_ring_node_f1->next; | |
292 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; |
|
292 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
293 | // (2) send an event for the waveforms transmission |
|
293 | // (2) send an event for the waveforms transmission | |
294 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { |
|
294 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { | |
295 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
295 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
296 | } |
|
296 | } | |
297 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 |
|
297 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 | |
298 | } |
|
298 | } | |
299 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit |
|
299 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |
300 | ring_node_to_send_swf_f1 = current_ring_node_f1->previous; |
|
300 | ring_node_to_send_swf_f1 = current_ring_node_f1->previous; | |
301 | } |
|
301 | } | |
302 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit |
|
302 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit | |
303 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
303 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
304 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
304 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
305 | } |
|
305 | } | |
306 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 |
|
306 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 | |
307 | } |
|
307 | } | |
308 | break; |
|
308 | break; | |
309 |
|
309 | |||
310 | //***** |
|
310 | //***** | |
311 | // SBM2 |
|
311 | // SBM2 | |
312 | case(LFR_MODE_SBM2): |
|
312 | case(LFR_MODE_SBM2): | |
313 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit |
|
313 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
314 | // (1) change the receiving buffer for the waveform picker |
|
314 | // (1) change the receiving buffer for the waveform picker | |
315 | ring_node_to_send_cwf_f2 = current_ring_node_f2; |
|
315 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
316 | current_ring_node_f2 = current_ring_node_f2->next; |
|
316 | current_ring_node_f2 = current_ring_node_f2->next; | |
317 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
317 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
318 | // (2) send an event for the waveforms transmission |
|
318 | // (2) send an event for the waveforms transmission | |
319 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { |
|
319 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
320 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
320 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
321 | } |
|
321 | } | |
322 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 |
|
322 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |
323 | } |
|
323 | } | |
324 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit |
|
324 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |
325 | ring_node_to_send_swf_f2 = current_ring_node_f2->previous; |
|
325 | ring_node_to_send_swf_f2 = current_ring_node_f2->previous; | |
326 | } |
|
326 | } | |
327 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit |
|
327 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |
328 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
328 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
329 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
329 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
330 | } |
|
330 | } | |
331 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 |
|
331 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
332 | } |
|
332 | } | |
333 | break; |
|
333 | break; | |
334 |
|
334 | |||
335 | //******** |
|
335 | //******** | |
336 | // DEFAULT |
|
336 | // DEFAULT | |
337 | default: |
|
337 | default: | |
338 | break; |
|
338 | break; | |
339 | } |
|
339 | } | |
340 | } |
|
340 | } | |
341 |
|
341 | |||
342 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
342 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
343 | { |
|
343 | { | |
344 | /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode. |
|
344 | /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode. | |
345 | * |
|
345 | * | |
346 | * @param unused is the starting argument of the RTEMS task |
|
346 | * @param unused is the starting argument of the RTEMS task | |
347 | * |
|
347 | * | |
348 | * The following data packets are sent by this task: |
|
348 | * The following data packets are sent by this task: | |
349 | * - TM_LFR_SCIENCE_NORMAL_SWF_F0 |
|
349 | * - TM_LFR_SCIENCE_NORMAL_SWF_F0 | |
350 | * - TM_LFR_SCIENCE_NORMAL_SWF_F1 |
|
350 | * - TM_LFR_SCIENCE_NORMAL_SWF_F1 | |
351 | * - TM_LFR_SCIENCE_NORMAL_SWF_F2 |
|
351 | * - TM_LFR_SCIENCE_NORMAL_SWF_F2 | |
352 | * |
|
352 | * | |
353 | */ |
|
353 | */ | |
354 |
|
354 | |||
355 | rtems_event_set event_out; |
|
355 | rtems_event_set event_out; | |
356 | rtems_id queue_id; |
|
356 | rtems_id queue_id; | |
357 | rtems_status_code status; |
|
357 | rtems_status_code status; | |
358 |
|
358 | |||
359 | init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); |
|
359 | init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); | |
360 | init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); |
|
360 | init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); | |
361 | init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 ); |
|
361 | init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 ); | |
362 |
|
362 | |||
363 | init_waveforms(); |
|
363 | init_waveforms(); | |
364 |
|
364 | |||
365 | status = get_message_queue_id_send( &queue_id ); |
|
365 | status = get_message_queue_id_send( &queue_id ); | |
366 | if (status != RTEMS_SUCCESSFUL) |
|
366 | if (status != RTEMS_SUCCESSFUL) | |
367 | { |
|
367 | { | |
368 | PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status) |
|
368 | PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status) | |
369 | } |
|
369 | } | |
370 |
|
370 | |||
371 | BOOT_PRINTF("in WFRM ***\n") |
|
371 | BOOT_PRINTF("in WFRM ***\n") | |
372 |
|
372 | |||
373 | while(1){ |
|
373 | while(1){ | |
374 | // wait for an RTEMS_EVENT |
|
374 | // wait for an RTEMS_EVENT | |
375 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1 |
|
375 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1 | |
376 | | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM |
|
376 | | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM | |
377 | | RTEMS_EVENT_MODE_NORMAL_SWF_F0 |
|
377 | | RTEMS_EVENT_MODE_NORMAL_SWF_F0 | |
378 | | RTEMS_EVENT_MODE_NORMAL_SWF_F1 |
|
378 | | RTEMS_EVENT_MODE_NORMAL_SWF_F1 | |
379 | | RTEMS_EVENT_MODE_NORMAL_SWF_F2, |
|
379 | | RTEMS_EVENT_MODE_NORMAL_SWF_F2, | |
380 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
380 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
381 | if (event_out == RTEMS_EVENT_MODE_NORMAL) |
|
381 | if (event_out == RTEMS_EVENT_MODE_NORMAL) | |
382 | { |
|
382 | { | |
383 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); |
|
383 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
384 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); |
|
384 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
385 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); |
|
385 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
386 | } |
|
386 | } | |
387 | if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F0) == RTEMS_EVENT_MODE_NORMAL_SWF_F0) |
|
387 | if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F0) == RTEMS_EVENT_MODE_NORMAL_SWF_F0) | |
388 | { |
|
388 | { | |
389 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); |
|
389 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
390 | } |
|
390 | } | |
391 | if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F1) == RTEMS_EVENT_MODE_NORMAL_SWF_F1) |
|
391 | if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F1) == RTEMS_EVENT_MODE_NORMAL_SWF_F1) | |
392 | { |
|
392 | { | |
393 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); |
|
393 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
394 | } |
|
394 | } | |
395 | if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F2) == RTEMS_EVENT_MODE_NORMAL_SWF_F2) |
|
395 | if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F2) == RTEMS_EVENT_MODE_NORMAL_SWF_F2) | |
396 | { |
|
396 | { | |
397 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); |
|
397 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
398 | } |
|
398 | } | |
399 | } |
|
399 | } | |
400 | } |
|
400 | } | |
401 |
|
401 | |||
402 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
402 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
403 | { |
|
403 | { | |
404 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3. |
|
404 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3. | |
405 | * |
|
405 | * | |
406 | * @param unused is the starting argument of the RTEMS task |
|
406 | * @param unused is the starting argument of the RTEMS task | |
407 | * |
|
407 | * | |
408 | * The following data packet is sent by this task: |
|
408 | * The following data packet is sent by this task: | |
409 | * - TM_LFR_SCIENCE_NORMAL_CWF_F3 |
|
409 | * - TM_LFR_SCIENCE_NORMAL_CWF_F3 | |
410 | * |
|
410 | * | |
411 | */ |
|
411 | */ | |
412 |
|
412 | |||
413 | rtems_event_set event_out; |
|
413 | rtems_event_set event_out; | |
414 | rtems_id queue_id; |
|
414 | rtems_id queue_id; | |
415 | rtems_status_code status; |
|
415 | rtems_status_code status; | |
416 |
|
416 | |||
417 | init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 ); |
|
417 | init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 ); | |
418 | init_header_continuous_cwf3_light_table( headerCWF_F3_light ); |
|
418 | init_header_continuous_cwf3_light_table( headerCWF_F3_light ); | |
419 |
|
419 | |||
420 | status = get_message_queue_id_send( &queue_id ); |
|
420 | status = get_message_queue_id_send( &queue_id ); | |
421 | if (status != RTEMS_SUCCESSFUL) |
|
421 | if (status != RTEMS_SUCCESSFUL) | |
422 | { |
|
422 | { | |
423 | PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status) |
|
423 | PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status) | |
424 | } |
|
424 | } | |
425 |
|
425 | |||
426 | BOOT_PRINTF("in CWF3 ***\n") |
|
426 | BOOT_PRINTF("in CWF3 ***\n") | |
427 |
|
427 | |||
428 | while(1){ |
|
428 | while(1){ | |
429 | // wait for an RTEMS_EVENT |
|
429 | // wait for an RTEMS_EVENT | |
430 | rtems_event_receive( RTEMS_EVENT_0, |
|
430 | rtems_event_receive( RTEMS_EVENT_0, | |
431 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
431 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
432 | PRINTF("send CWF F3 \n") |
|
432 | PRINTF("send CWF F3 \n") | |
433 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { |
|
433 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { | |
434 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) |
|
434 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
435 | { |
|
435 | { | |
436 | send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); |
|
436 | send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
437 | } |
|
437 | } | |
438 | else |
|
438 | else | |
439 | { |
|
439 | { | |
440 | send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id ); |
|
440 | send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id ); | |
441 | } |
|
441 | } | |
442 | } |
|
442 | } | |
443 | else |
|
443 | else | |
444 | { |
|
444 | { | |
445 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x00) |
|
445 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x00) | |
446 | { |
|
446 | { | |
447 | send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); |
|
447 | send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
448 | } |
|
448 | } | |
449 | else |
|
449 | else | |
450 | { |
|
450 | { | |
451 | send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id ); |
|
451 | send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id ); | |
452 | } |
|
452 | } | |
453 |
|
453 | |||
454 | } |
|
454 | } | |
455 | } |
|
455 | } | |
456 | } |
|
456 | } | |
457 |
|
457 | |||
458 | rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2 |
|
458 | rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2 | |
459 | { |
|
459 | { | |
460 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2. |
|
460 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2. | |
461 | * |
|
461 | * | |
462 | * @param unused is the starting argument of the RTEMS task |
|
462 | * @param unused is the starting argument of the RTEMS task | |
463 | * |
|
463 | * | |
464 | * The following data packet is sent by this function: |
|
464 | * The following data packet is sent by this function: | |
465 | * - TM_LFR_SCIENCE_BURST_CWF_F2 |
|
465 | * - TM_LFR_SCIENCE_BURST_CWF_F2 | |
466 | * - TM_LFR_SCIENCE_SBM2_CWF_F2 |
|
466 | * - TM_LFR_SCIENCE_SBM2_CWF_F2 | |
467 | * |
|
467 | * | |
468 | */ |
|
468 | */ | |
469 |
|
469 | |||
470 | rtems_event_set event_out; |
|
470 | rtems_event_set event_out; | |
471 | rtems_id queue_id; |
|
471 | rtems_id queue_id; | |
472 | rtems_status_code status; |
|
472 | rtems_status_code status; | |
473 |
|
473 | |||
474 | init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); |
|
474 | init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); | |
475 | init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); |
|
475 | init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); | |
476 |
|
476 | |||
477 | status = get_message_queue_id_send( &queue_id ); |
|
477 | status = get_message_queue_id_send( &queue_id ); | |
478 | if (status != RTEMS_SUCCESSFUL) |
|
478 | if (status != RTEMS_SUCCESSFUL) | |
479 | { |
|
479 | { | |
480 | PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status) |
|
480 | PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status) | |
481 | } |
|
481 | } | |
482 |
|
482 | |||
483 | BOOT_PRINTF("in CWF2 ***\n") |
|
483 | BOOT_PRINTF("in CWF2 ***\n") | |
484 |
|
484 | |||
485 | while(1){ |
|
485 | while(1){ | |
486 | // wait for an RTEMS_EVENT |
|
486 | // wait for an RTEMS_EVENT | |
487 | rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2, |
|
487 | rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2, | |
488 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
488 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
489 | if (event_out == RTEMS_EVENT_MODE_BURST) |
|
489 | if (event_out == RTEMS_EVENT_MODE_BURST) | |
490 | { |
|
490 | { | |
491 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); |
|
491 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
492 | } |
|
492 | } | |
493 | if (event_out == RTEMS_EVENT_MODE_SBM2) |
|
493 | if (event_out == RTEMS_EVENT_MODE_SBM2) | |
494 | { |
|
494 | { | |
495 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); |
|
495 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
496 | } |
|
496 | } | |
497 | } |
|
497 | } | |
498 | } |
|
498 | } | |
499 |
|
499 | |||
500 | rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1 |
|
500 | rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1 | |
501 | { |
|
501 | { | |
502 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1. |
|
502 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1. | |
503 | * |
|
503 | * | |
504 | * @param unused is the starting argument of the RTEMS task |
|
504 | * @param unused is the starting argument of the RTEMS task | |
505 | * |
|
505 | * | |
506 | * The following data packet is sent by this function: |
|
506 | * The following data packet is sent by this function: | |
507 | * - TM_LFR_SCIENCE_SBM1_CWF_F1 |
|
507 | * - TM_LFR_SCIENCE_SBM1_CWF_F1 | |
508 | * |
|
508 | * | |
509 | */ |
|
509 | */ | |
510 |
|
510 | |||
511 | rtems_event_set event_out; |
|
511 | rtems_event_set event_out; | |
512 | rtems_id queue_id; |
|
512 | rtems_id queue_id; | |
513 | rtems_status_code status; |
|
513 | rtems_status_code status; | |
514 |
|
514 | |||
515 | init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); |
|
515 | init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); | |
516 |
|
516 | |||
517 | status = get_message_queue_id_send( &queue_id ); |
|
517 | status = get_message_queue_id_send( &queue_id ); | |
518 | if (status != RTEMS_SUCCESSFUL) |
|
518 | if (status != RTEMS_SUCCESSFUL) | |
519 | { |
|
519 | { | |
520 | PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status) |
|
520 | PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status) | |
521 | } |
|
521 | } | |
522 |
|
522 | |||
523 | BOOT_PRINTF("in CWF1 ***\n") |
|
523 | BOOT_PRINTF("in CWF1 ***\n") | |
524 |
|
524 | |||
525 | while(1){ |
|
525 | while(1){ | |
526 | // wait for an RTEMS_EVENT |
|
526 | // wait for an RTEMS_EVENT | |
527 | rtems_event_receive( RTEMS_EVENT_MODE_SBM1, |
|
527 | rtems_event_receive( RTEMS_EVENT_MODE_SBM1, | |
528 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
528 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
529 | send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); |
|
529 | send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
530 | } |
|
530 | } | |
531 | } |
|
531 | } | |
532 |
|
532 | |||
533 | //****************** |
|
533 | //****************** | |
534 | // general functions |
|
534 | // general functions | |
535 | void init_waveforms( void ) |
|
535 | void init_waveforms( void ) | |
536 | { |
|
536 | { | |
537 | int i = 0; |
|
537 | int i = 0; | |
538 |
|
538 | |||
539 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
539 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
540 | { |
|
540 | { | |
541 | //*** |
|
541 | //*** | |
542 | // F0 |
|
542 | // F0 | |
543 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // |
|
543 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // | |
544 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // |
|
544 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // | |
545 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // |
|
545 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // | |
546 |
|
546 | |||
547 | //*** |
|
547 | //*** | |
548 | // F1 |
|
548 | // F1 | |
549 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; |
|
549 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; | |
550 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; |
|
550 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; | |
551 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; |
|
551 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
552 |
|
552 | |||
553 | //*** |
|
553 | //*** | |
554 | // F2 |
|
554 | // F2 | |
555 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333; |
|
555 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333; | |
556 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; |
|
556 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; | |
557 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; |
|
557 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
558 |
|
558 | |||
559 | //*** |
|
559 | //*** | |
560 | // F3 |
|
560 | // F3 | |
561 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; |
|
561 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; | |
562 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; |
|
562 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; | |
563 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; |
|
563 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; | |
564 | } |
|
564 | } | |
565 | } |
|
565 | } | |
566 |
|
566 | |||
567 | void init_waveform_rings( void ) |
|
567 | void init_waveform_rings( void ) | |
568 | { |
|
568 | { | |
569 | unsigned char i; |
|
569 | unsigned char i; | |
570 |
|
570 | |||
571 | // F0 RING |
|
571 | // F0 RING | |
572 | waveform_ring_f0[0].next = (ring_node*) &waveform_ring_f0[1]; |
|
572 | waveform_ring_f0[0].next = (ring_node*) &waveform_ring_f0[1]; | |
573 | waveform_ring_f0[0].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-1]; |
|
573 | waveform_ring_f0[0].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-1]; | |
574 | waveform_ring_f0[0].buffer_address = (int) &wf_snap_f0[0][0]; |
|
574 | waveform_ring_f0[0].buffer_address = (int) &wf_snap_f0[0][0]; | |
575 |
|
575 | |||
576 | waveform_ring_f0[NB_RING_NODES_F0-1].next = (ring_node*) &waveform_ring_f0[0]; |
|
576 | waveform_ring_f0[NB_RING_NODES_F0-1].next = (ring_node*) &waveform_ring_f0[0]; | |
577 | waveform_ring_f0[NB_RING_NODES_F0-1].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-2]; |
|
577 | waveform_ring_f0[NB_RING_NODES_F0-1].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-2]; | |
578 | waveform_ring_f0[NB_RING_NODES_F0-1].buffer_address = (int) &wf_snap_f0[NB_RING_NODES_F0-1][0]; |
|
578 | waveform_ring_f0[NB_RING_NODES_F0-1].buffer_address = (int) &wf_snap_f0[NB_RING_NODES_F0-1][0]; | |
579 |
|
579 | |||
580 | for(i=1; i<NB_RING_NODES_F0-1; i++) |
|
580 | for(i=1; i<NB_RING_NODES_F0-1; i++) | |
581 | { |
|
581 | { | |
582 | waveform_ring_f0[i].next = (ring_node*) &waveform_ring_f0[i+1]; |
|
582 | waveform_ring_f0[i].next = (ring_node*) &waveform_ring_f0[i+1]; | |
583 | waveform_ring_f0[i].previous = (ring_node*) &waveform_ring_f0[i-1]; |
|
583 | waveform_ring_f0[i].previous = (ring_node*) &waveform_ring_f0[i-1]; | |
584 | waveform_ring_f0[i].buffer_address = (int) &wf_snap_f0[i][0]; |
|
584 | waveform_ring_f0[i].buffer_address = (int) &wf_snap_f0[i][0]; | |
585 | } |
|
585 | } | |
586 |
|
586 | |||
587 | // F1 RING |
|
587 | // F1 RING | |
588 | waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1]; |
|
588 | waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1]; | |
589 | waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1]; |
|
589 | waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1]; | |
590 | waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0]; |
|
590 | waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0]; | |
591 |
|
591 | |||
592 | waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0]; |
|
592 | waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0]; | |
593 | waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2]; |
|
593 | waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2]; | |
594 | waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0]; |
|
594 | waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0]; | |
595 |
|
595 | |||
596 | for(i=1; i<NB_RING_NODES_F1-1; i++) |
|
596 | for(i=1; i<NB_RING_NODES_F1-1; i++) | |
597 | { |
|
597 | { | |
598 | waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1]; |
|
598 | waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1]; | |
599 | waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1]; |
|
599 | waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1]; | |
600 | waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0]; |
|
600 | waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0]; | |
601 | } |
|
601 | } | |
602 |
|
602 | |||
603 | // F2 RING |
|
603 | // F2 RING | |
604 | waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1]; |
|
604 | waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1]; | |
605 | waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1]; |
|
605 | waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1]; | |
606 | waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0]; |
|
606 | waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0]; | |
607 |
|
607 | |||
608 | waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0]; |
|
608 | waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0]; | |
609 | waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2]; |
|
609 | waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2]; | |
610 | waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0]; |
|
610 | waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0]; | |
611 |
|
611 | |||
612 | for(i=1; i<NB_RING_NODES_F2-1; i++) |
|
612 | for(i=1; i<NB_RING_NODES_F2-1; i++) | |
613 | { |
|
613 | { | |
614 | waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1]; |
|
614 | waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1]; | |
615 | waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1]; |
|
615 | waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1]; | |
616 | waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0]; |
|
616 | waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0]; | |
617 | } |
|
617 | } | |
618 |
|
618 | |||
619 | DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0) |
|
619 | DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0) | |
620 | DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1) |
|
620 | DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1) | |
621 | DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2) |
|
621 | DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2) | |
622 |
|
622 | |||
623 | } |
|
623 | } | |
624 |
|
624 | |||
625 | void reset_current_ring_nodes( void ) |
|
625 | void reset_current_ring_nodes( void ) | |
626 | { |
|
626 | { | |
627 | current_ring_node_f0 = waveform_ring_f0; |
|
627 | current_ring_node_f0 = waveform_ring_f0; | |
628 | ring_node_to_send_swf_f0 = waveform_ring_f0; |
|
628 | ring_node_to_send_swf_f0 = waveform_ring_f0; | |
629 |
|
629 | |||
630 | current_ring_node_f1 = waveform_ring_f1; |
|
630 | current_ring_node_f1 = waveform_ring_f1; | |
631 | ring_node_to_send_cwf_f1 = waveform_ring_f1; |
|
631 | ring_node_to_send_cwf_f1 = waveform_ring_f1; | |
632 | ring_node_to_send_swf_f1 = waveform_ring_f1; |
|
632 | ring_node_to_send_swf_f1 = waveform_ring_f1; | |
633 |
|
633 | |||
634 | current_ring_node_f2 = waveform_ring_f2; |
|
634 | current_ring_node_f2 = waveform_ring_f2; | |
635 | ring_node_to_send_cwf_f2 = waveform_ring_f2; |
|
635 | ring_node_to_send_cwf_f2 = waveform_ring_f2; | |
636 | ring_node_to_send_swf_f2 = waveform_ring_f2; |
|
636 | ring_node_to_send_swf_f2 = waveform_ring_f2; | |
637 | } |
|
637 | } | |
638 |
|
638 | |||
639 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) |
|
639 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) | |
640 | { |
|
640 | { | |
641 | unsigned char i; |
|
641 | unsigned char i; | |
642 |
|
642 | |||
643 | for (i=0; i<7; i++) |
|
643 | for (i=0; i<7; i++) | |
644 | { |
|
644 | { | |
645 | headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
645 | headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
646 | headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
646 | headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
647 | headerSWF[ i ].reserved = DEFAULT_RESERVED; |
|
647 | headerSWF[ i ].reserved = DEFAULT_RESERVED; | |
648 | headerSWF[ i ].userApplication = CCSDS_USER_APP; |
|
648 | headerSWF[ i ].userApplication = CCSDS_USER_APP; | |
649 | headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
649 | headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
650 | headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
650 | headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
651 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
651 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
652 | if (i == 6) |
|
652 | if (i == 6) | |
653 | { |
|
653 | { | |
654 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8); |
|
654 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8); | |
655 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 ); |
|
655 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 ); | |
656 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8); |
|
656 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8); | |
657 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 ); |
|
657 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 ); | |
658 | } |
|
658 | } | |
659 | else |
|
659 | else | |
660 | { |
|
660 | { | |
661 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8); |
|
661 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8); | |
662 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 ); |
|
662 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 ); | |
663 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8); |
|
663 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8); | |
664 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 ); |
|
664 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 ); | |
665 | } |
|
665 | } | |
666 | headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
666 | headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
667 | headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT |
|
667 | headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT | |
668 | headerSWF[ i ].pktNr = i+1; // PKT_NR |
|
668 | headerSWF[ i ].pktNr = i+1; // PKT_NR | |
669 | // DATA FIELD HEADER |
|
669 | // DATA FIELD HEADER | |
670 | headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
670 | headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
671 | headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
671 | headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
672 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
672 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
673 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
673 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
674 | // AUXILIARY DATA HEADER |
|
674 | // AUXILIARY DATA HEADER | |
675 | headerSWF[ i ].time[0] = 0x00; |
|
675 | headerSWF[ i ].time[0] = 0x00; | |
676 | headerSWF[ i ].time[0] = 0x00; |
|
676 | headerSWF[ i ].time[0] = 0x00; | |
677 | headerSWF[ i ].time[0] = 0x00; |
|
677 | headerSWF[ i ].time[0] = 0x00; | |
678 | headerSWF[ i ].time[0] = 0x00; |
|
678 | headerSWF[ i ].time[0] = 0x00; | |
679 | headerSWF[ i ].time[0] = 0x00; |
|
679 | headerSWF[ i ].time[0] = 0x00; | |
680 | headerSWF[ i ].time[0] = 0x00; |
|
680 | headerSWF[ i ].time[0] = 0x00; | |
681 | headerSWF[ i ].sid = sid; |
|
681 | headerSWF[ i ].sid = sid; | |
682 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
682 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; | |
683 | } |
|
683 | } | |
684 | return LFR_SUCCESSFUL; |
|
684 | return LFR_SUCCESSFUL; | |
685 | } |
|
685 | } | |
686 |
|
686 | |||
687 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) |
|
687 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) | |
688 | { |
|
688 | { | |
689 | unsigned int i; |
|
689 | unsigned int i; | |
690 |
|
690 | |||
691 | for (i=0; i<7; i++) |
|
691 | for (i=0; i<7; i++) | |
692 | { |
|
692 | { | |
693 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
693 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
694 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
694 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
695 | headerCWF[ i ].reserved = DEFAULT_RESERVED; |
|
695 | headerCWF[ i ].reserved = DEFAULT_RESERVED; | |
696 | headerCWF[ i ].userApplication = CCSDS_USER_APP; |
|
696 | headerCWF[ i ].userApplication = CCSDS_USER_APP; | |
697 | if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) ) |
|
697 | if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) ) | |
698 | { |
|
698 | { | |
699 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8); |
|
699 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8); | |
700 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2); |
|
700 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2); | |
701 | } |
|
701 | } | |
702 | else |
|
702 | else | |
703 | { |
|
703 | { | |
704 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
704 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
705 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
705 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
706 | } |
|
706 | } | |
707 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
707 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
708 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8); |
|
708 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8); | |
709 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 ); |
|
709 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 ); | |
710 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8); |
|
710 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8); | |
711 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF ); |
|
711 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF ); | |
712 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
712 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
713 | // DATA FIELD HEADER |
|
713 | // DATA FIELD HEADER | |
714 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
714 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
715 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
715 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
716 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
716 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
717 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
717 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
718 | // AUXILIARY DATA HEADER |
|
718 | // AUXILIARY DATA HEADER | |
719 | headerCWF[ i ].sid = sid; |
|
719 | headerCWF[ i ].sid = sid; | |
720 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
720 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; | |
721 | headerCWF[ i ].time[0] = 0x00; |
|
721 | headerCWF[ i ].time[0] = 0x00; | |
722 | headerCWF[ i ].time[0] = 0x00; |
|
722 | headerCWF[ i ].time[0] = 0x00; | |
723 | headerCWF[ i ].time[0] = 0x00; |
|
723 | headerCWF[ i ].time[0] = 0x00; | |
724 | headerCWF[ i ].time[0] = 0x00; |
|
724 | headerCWF[ i ].time[0] = 0x00; | |
725 | headerCWF[ i ].time[0] = 0x00; |
|
725 | headerCWF[ i ].time[0] = 0x00; | |
726 | headerCWF[ i ].time[0] = 0x00; |
|
726 | headerCWF[ i ].time[0] = 0x00; | |
727 | } |
|
727 | } | |
728 | return LFR_SUCCESSFUL; |
|
728 | return LFR_SUCCESSFUL; | |
729 | } |
|
729 | } | |
730 |
|
730 | |||
731 | int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) |
|
731 | int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) | |
732 | { |
|
732 | { | |
733 | unsigned int i; |
|
733 | unsigned int i; | |
734 |
|
734 | |||
735 | for (i=0; i<7; i++) |
|
735 | for (i=0; i<7; i++) | |
736 | { |
|
736 | { | |
737 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
737 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
738 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
738 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
739 | headerCWF[ i ].reserved = DEFAULT_RESERVED; |
|
739 | headerCWF[ i ].reserved = DEFAULT_RESERVED; | |
740 | headerCWF[ i ].userApplication = CCSDS_USER_APP; |
|
740 | headerCWF[ i ].userApplication = CCSDS_USER_APP; | |
741 |
|
741 | |||
742 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
742 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
743 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
743 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
744 |
|
744 | |||
745 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
745 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
746 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8); |
|
746 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8); | |
747 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 ); |
|
747 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 ); | |
748 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8); |
|
748 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8); | |
749 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 ); |
|
749 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 ); | |
750 |
|
750 | |||
751 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
751 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
752 | // DATA FIELD HEADER |
|
752 | // DATA FIELD HEADER | |
753 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
753 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
754 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
754 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
755 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
755 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
756 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
756 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
757 | // AUXILIARY DATA HEADER |
|
757 | // AUXILIARY DATA HEADER | |
758 | headerCWF[ i ].sid = SID_NORM_CWF_F3; |
|
758 | headerCWF[ i ].sid = SID_NORM_CWF_F3; | |
759 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
759 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; | |
760 | headerCWF[ i ].time[0] = 0x00; |
|
760 | headerCWF[ i ].time[0] = 0x00; | |
761 | headerCWF[ i ].time[0] = 0x00; |
|
761 | headerCWF[ i ].time[0] = 0x00; | |
762 | headerCWF[ i ].time[0] = 0x00; |
|
762 | headerCWF[ i ].time[0] = 0x00; | |
763 | headerCWF[ i ].time[0] = 0x00; |
|
763 | headerCWF[ i ].time[0] = 0x00; | |
764 | headerCWF[ i ].time[0] = 0x00; |
|
764 | headerCWF[ i ].time[0] = 0x00; | |
765 | headerCWF[ i ].time[0] = 0x00; |
|
765 | headerCWF[ i ].time[0] = 0x00; | |
766 | } |
|
766 | } | |
767 | return LFR_SUCCESSFUL; |
|
767 | return LFR_SUCCESSFUL; | |
768 | } |
|
768 | } | |
769 |
|
769 | |||
770 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, |
|
770 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, | |
771 | Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ) |
|
771 | Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ) | |
772 | { |
|
772 | { | |
773 | /** This function sends SWF CCSDS packets (F2, F1 or F0). |
|
773 | /** This function sends SWF CCSDS packets (F2, F1 or F0). | |
774 | * |
|
774 | * | |
775 | * @param waveform points to the buffer containing the data that will be send. |
|
775 | * @param waveform points to the buffer containing the data that will be send. | |
776 | * @param sid is the source identifier of the data that will be sent. |
|
776 | * @param sid is the source identifier of the data that will be sent. | |
777 | * @param headerSWF points to a table of headers that have been prepared for the data transmission. |
|
777 | * @param headerSWF points to a table of headers that have been prepared for the data transmission. | |
778 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
778 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures | |
779 | * contain information to setup the transmission of the data packets. |
|
779 | * contain information to setup the transmission of the data packets. | |
780 | * |
|
780 | * | |
781 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. |
|
781 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. | |
782 | * |
|
782 | * | |
783 | */ |
|
783 | */ | |
784 |
|
784 | |||
785 | unsigned int i; |
|
785 | unsigned int i; | |
786 | int ret; |
|
786 | int ret; | |
787 | unsigned int coarseTime; |
|
787 | unsigned int coarseTime; | |
788 | unsigned int fineTime; |
|
788 | unsigned int fineTime; | |
789 | rtems_status_code status; |
|
789 | rtems_status_code status; | |
790 | spw_ioctl_pkt_send spw_ioctl_send_SWF; |
|
790 | spw_ioctl_pkt_send spw_ioctl_send_SWF; | |
791 |
|
791 | |||
792 | spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header |
|
792 | spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header | |
793 | spw_ioctl_send_SWF.options = 0; |
|
793 | spw_ioctl_send_SWF.options = 0; | |
794 |
|
794 | |||
795 | ret = LFR_DEFAULT; |
|
795 | ret = LFR_DEFAULT; | |
796 |
|
796 | |||
797 | PRINTF1("sid = %d, ", sid) |
|
797 | PRINTF1("sid = %d, ", sid) | |
798 | PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1]) |
|
798 | PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1]) | |
799 |
|
799 | |||
800 | for (i=0; i<7; i++) // send waveform |
|
800 | for (i=0; i<7; i++) // send waveform | |
801 | { |
|
801 | { | |
802 | #ifdef VHDL_DEV |
|
802 | #ifdef VHDL_DEV | |
803 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET]; |
|
803 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET]; | |
804 | #else |
|
804 | #else | |
805 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) ]; |
|
805 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) ]; | |
806 | #endif |
|
806 | #endif | |
807 | spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ]; |
|
807 | spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ]; | |
808 | // BUILD THE DATA |
|
808 | // BUILD THE DATA | |
809 | if (i==6) { |
|
809 | if (i==6) { | |
810 | spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK; |
|
810 | spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK; | |
811 | } |
|
811 | } | |
812 | else { |
|
812 | else { | |
813 | spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK; |
|
813 | spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK; | |
814 | } |
|
814 | } | |
815 | // SET PACKET SEQUENCE COUNTER |
|
815 | // SET PACKET SEQUENCE COUNTER | |
816 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); |
|
816 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); | |
817 | // SET PACKET TIME |
|
817 | // SET PACKET TIME | |
818 | #ifdef VHDL_DEV |
|
818 | #ifdef VHDL_DEV | |
819 | coarseTime = waveform[0]; |
|
819 | coarseTime = waveform[0]; | |
820 | fineTime = waveform[1]; |
|
820 | fineTime = waveform[1]; | |
821 | compute_acquisition_time( &coarseTime, &fineTime, sid, i); |
|
821 | compute_acquisition_time( &coarseTime, &fineTime, sid, i); | |
822 |
|
822 | |||
823 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime >> 24 ); |
|
823 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime >> 24 ); | |
824 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime >> 16 ); |
|
824 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime >> 16 ); | |
825 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime >> 8 ); |
|
825 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime >> 8 ); | |
826 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime ); |
|
826 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime ); | |
827 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime >> 8 ); |
|
827 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime >> 8 ); | |
828 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime ); |
|
828 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime ); | |
829 | #else |
|
829 | #else | |
830 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
830 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
831 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
831 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
832 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
832 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
833 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); |
|
833 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); | |
834 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
834 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
835 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); |
|
835 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); | |
836 | #endif |
|
836 | #endif | |
837 | headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
837 | headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
838 | headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
838 | headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
839 | headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
839 | headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
840 | headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
840 | headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); | |
841 | headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
841 | headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
842 | headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); |
|
842 | headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); | |
843 | // SEND PACKET |
|
843 | // SEND PACKET | |
844 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE); |
|
844 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE); | |
845 | if (status != RTEMS_SUCCESSFUL) { |
|
845 | if (status != RTEMS_SUCCESSFUL) { | |
846 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
846 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
847 | ret = LFR_DEFAULT; |
|
847 | ret = LFR_DEFAULT; | |
848 | } |
|
848 | } | |
849 | // rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds |
|
849 | // rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds | |
850 | } |
|
850 | } | |
851 |
|
851 | |||
852 | return ret; |
|
852 | return ret; | |
853 | } |
|
853 | } | |
854 |
|
854 | |||
855 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, |
|
855 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, | |
856 | Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) |
|
856 | Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) | |
857 | { |
|
857 | { | |
858 | /** This function sends CWF CCSDS packets (F2, F1 or F0). |
|
858 | /** This function sends CWF CCSDS packets (F2, F1 or F0). | |
859 | * |
|
859 | * | |
860 | * @param waveform points to the buffer containing the data that will be send. |
|
860 | * @param waveform points to the buffer containing the data that will be send. | |
861 | * @param sid is the source identifier of the data that will be sent. |
|
861 | * @param sid is the source identifier of the data that will be sent. | |
862 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. |
|
862 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. | |
863 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
863 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures | |
864 | * contain information to setup the transmission of the data packets. |
|
864 | * contain information to setup the transmission of the data packets. | |
865 | * |
|
865 | * | |
866 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. |
|
866 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. | |
867 | * |
|
867 | * | |
868 | */ |
|
868 | */ | |
869 |
|
869 | |||
870 | unsigned int i; |
|
870 | unsigned int i; | |
871 | int ret; |
|
871 | int ret; | |
872 | unsigned char *coarseTimePtr; |
|
872 | unsigned char *coarseTimePtr; | |
873 | unsigned char *fineTimePtr; |
|
873 | unsigned char *fineTimePtr; | |
874 | rtems_status_code status; |
|
874 | rtems_status_code status; | |
875 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
875 | spw_ioctl_pkt_send spw_ioctl_send_CWF; | |
876 |
|
876 | |||
877 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header |
|
877 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header | |
878 | spw_ioctl_send_CWF.options = 0; |
|
878 | spw_ioctl_send_CWF.options = 0; | |
879 |
|
879 | |||
880 | ret = LFR_DEFAULT; |
|
880 | ret = LFR_DEFAULT; | |
881 |
|
881 | |||
882 | for (i=0; i<7; i++) // send waveform |
|
882 | for (i=0; i<7; i++) // send waveform | |
883 | { |
|
883 | { | |
884 | int coarseTime = 0x00; |
|
884 | int coarseTime = 0x00; | |
885 | int fineTime = 0x00; |
|
885 | int fineTime = 0x00; | |
886 | #ifdef VHDL_DEV |
|
886 | #ifdef VHDL_DEV | |
887 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET]; |
|
887 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET]; | |
888 | #else |
|
888 | #else | |
889 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) ]; |
|
889 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) ]; | |
890 | #endif |
|
890 | #endif | |
891 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
891 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; | |
892 | // BUILD THE DATA |
|
892 | // BUILD THE DATA | |
893 | spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK; |
|
893 | spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK; | |
894 | // SET PACKET SEQUENCE COUNTER |
|
894 | // SET PACKET SEQUENCE COUNTER | |
895 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); |
|
895 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); | |
896 | // SET PACKET TIME |
|
896 | // SET PACKET TIME | |
897 | #ifdef VHDL_DEV |
|
897 | #ifdef VHDL_DEV | |
898 | coarseTimePtr = (unsigned char *) &waveform; |
|
898 | coarseTimePtr = (unsigned char *) &waveform; | |
899 | fineTimePtr = (unsigned char *) &waveform[1]; |
|
899 | fineTimePtr = (unsigned char *) &waveform[1]; | |
900 | headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2]; |
|
900 | headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2]; | |
901 | headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3]; |
|
901 | headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3]; | |
902 | headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0]; |
|
902 | headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0]; | |
903 | headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1]; |
|
903 | headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1]; | |
904 | headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0]; |
|
904 | headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0]; | |
905 | headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1]; |
|
905 | headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1]; | |
906 | #else |
|
906 | #else | |
907 | coarseTime = time_management_regs->coarse_time; |
|
907 | coarseTime = time_management_regs->coarse_time; | |
908 | fineTime = time_management_regs->fine_time; |
|
908 | fineTime = time_management_regs->fine_time; | |
909 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); |
|
909 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
910 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); |
|
910 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
911 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); |
|
911 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
912 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); |
|
912 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
913 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); |
|
913 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
914 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); |
|
914 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
915 | #endif |
|
915 | #endif | |
916 |
|
916 | |||
917 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); |
|
917 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
918 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); |
|
918 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
919 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); |
|
919 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
920 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); |
|
920 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
921 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); |
|
921 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
922 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); |
|
922 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
923 | // SEND PACKET |
|
923 | // SEND PACKET | |
924 | if (sid == SID_NORM_CWF_LONG_F3) |
|
924 | if (sid == SID_NORM_CWF_LONG_F3) | |
925 | { |
|
925 | { | |
926 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
926 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
927 | if (status != RTEMS_SUCCESSFUL) { |
|
927 | if (status != RTEMS_SUCCESSFUL) { | |
928 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
928 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
929 | ret = LFR_DEFAULT; |
|
929 | ret = LFR_DEFAULT; | |
930 | } |
|
930 | } | |
931 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); |
|
931 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); | |
932 | } |
|
932 | } | |
933 | else |
|
933 | else | |
934 | { |
|
934 | { | |
935 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
935 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
936 | if (status != RTEMS_SUCCESSFUL) { |
|
936 | if (status != RTEMS_SUCCESSFUL) { | |
937 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
937 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
938 | ret = LFR_DEFAULT; |
|
938 | ret = LFR_DEFAULT; | |
939 | } |
|
939 | } | |
940 | } |
|
940 | } | |
941 | } |
|
941 | } | |
942 |
|
942 | |||
943 | return ret; |
|
943 | return ret; | |
944 | } |
|
944 | } | |
945 |
|
945 | |||
946 | int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) |
|
946 | int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) | |
947 | { |
|
947 | { | |
948 | /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data. |
|
948 | /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data. | |
949 | * |
|
949 | * | |
950 | * @param waveform points to the buffer containing the data that will be send. |
|
950 | * @param waveform points to the buffer containing the data that will be send. | |
951 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. |
|
951 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. | |
952 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
952 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures | |
953 | * contain information to setup the transmission of the data packets. |
|
953 | * contain information to setup the transmission of the data packets. | |
954 | * |
|
954 | * | |
955 | * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer |
|
955 | * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer | |
956 | * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks. |
|
956 | * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks. | |
957 | * |
|
957 | * | |
958 | */ |
|
958 | */ | |
959 |
|
959 | |||
960 | unsigned int i; |
|
960 | unsigned int i; | |
961 | int ret; |
|
961 | int ret; | |
962 | unsigned char *coarseTimePtr; |
|
962 | unsigned char *coarseTimePtr; | |
963 | unsigned char *fineTimePtr; |
|
963 | unsigned char *fineTimePtr; | |
964 | rtems_status_code status; |
|
964 | rtems_status_code status; | |
965 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
965 | spw_ioctl_pkt_send spw_ioctl_send_CWF; | |
966 | char *sample; |
|
966 | char *sample; | |
967 |
|
967 | |||
968 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header |
|
968 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header | |
969 | spw_ioctl_send_CWF.options = 0; |
|
969 | spw_ioctl_send_CWF.options = 0; | |
970 |
|
970 | |||
971 | ret = LFR_DEFAULT; |
|
971 | ret = LFR_DEFAULT; | |
972 |
|
972 | |||
973 | //********************** |
|
973 | //********************** | |
974 | // BUILD CWF3_light DATA |
|
974 | // BUILD CWF3_light DATA | |
975 | for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
975 | for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
976 | { |
|
976 | { | |
977 | #ifdef VHDL_DEV |
|
977 | #ifdef VHDL_DEV | |
978 | sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ]; |
|
978 | sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ]; | |
979 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ]; |
|
979 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ]; | |
980 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ]; |
|
980 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ]; | |
981 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ]; |
|
981 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ]; | |
982 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ]; |
|
982 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ]; | |
983 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ]; |
|
983 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ]; | |
984 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ]; |
|
984 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ]; | |
985 | #else |
|
985 | #else | |
986 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; |
|
986 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; | |
987 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; |
|
987 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; | |
988 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; |
|
988 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; | |
989 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; |
|
989 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; | |
990 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; |
|
990 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; | |
991 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; |
|
991 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; | |
992 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; |
|
992 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; | |
993 | #endif |
|
993 | #endif | |
994 | } |
|
994 | } | |
995 |
|
995 | |||
996 | //********************* |
|
996 | //********************* | |
997 | // SEND CWF3_light DATA |
|
997 | // SEND CWF3_light DATA | |
998 |
|
998 | |||
999 | for (i=0; i<7; i++) // send waveform |
|
999 | for (i=0; i<7; i++) // send waveform | |
1000 | { |
|
1000 | { | |
1001 | int coarseTime = 0x00; |
|
1001 | int coarseTime = 0x00; | |
1002 | int fineTime = 0x00; |
|
1002 | int fineTime = 0x00; | |
1003 |
|
1003 | |||
1004 | #ifdef VHDL_DEV |
|
1004 | #ifdef VHDL_DEV | |
1005 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES]; |
|
1005 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES]; | |
1006 | #else |
|
1006 | #else | |
1007 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) ]; |
|
1007 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) ]; | |
1008 | #endif |
|
1008 | #endif | |
1009 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
1009 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; | |
1010 | // BUILD THE DATA |
|
1010 | // BUILD THE DATA | |
1011 | spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK; |
|
1011 | spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK; | |
1012 | // SET PACKET SEQUENCE COUNTER |
|
1012 | // SET PACKET SEQUENCE COUNTER | |
1013 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); |
|
1013 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); | |
1014 | // SET PACKET TIME |
|
1014 | // SET PACKET TIME | |
1015 | #ifdef VHDL_DEV |
|
1015 | #ifdef VHDL_DEV | |
1016 | coarseTimePtr = (unsigned char *) &waveform; |
|
1016 | coarseTimePtr = (unsigned char *) &waveform; | |
1017 | fineTimePtr = (unsigned char *) &waveform[1]; |
|
1017 | fineTimePtr = (unsigned char *) &waveform[1]; | |
1018 | headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2]; |
|
1018 | headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2]; | |
1019 | headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3]; |
|
1019 | headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3]; | |
1020 | headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0]; |
|
1020 | headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0]; | |
1021 | headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1]; |
|
1021 | headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1]; | |
1022 | headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0]; |
|
1022 | headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0]; | |
1023 | headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1]; |
|
1023 | headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1]; | |
1024 | #else |
|
1024 | #else | |
1025 | coarseTime = time_management_regs->coarse_time; |
|
1025 | coarseTime = time_management_regs->coarse_time; | |
1026 | fineTime = time_management_regs->fine_time; |
|
1026 | fineTime = time_management_regs->fine_time; | |
1027 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); |
|
1027 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
1028 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); |
|
1028 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
1029 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); |
|
1029 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
1030 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); |
|
1030 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
1031 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); |
|
1031 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
1032 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); |
|
1032 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
1033 | #endif |
|
1033 | #endif | |
1034 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); |
|
1034 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
1035 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); |
|
1035 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
1036 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); |
|
1036 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
1037 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); |
|
1037 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
1038 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); |
|
1038 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
1039 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); |
|
1039 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
1040 | // SEND PACKET |
|
1040 | // SEND PACKET | |
1041 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
1041 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
1042 | if (status != RTEMS_SUCCESSFUL) { |
|
1042 | if (status != RTEMS_SUCCESSFUL) { | |
1043 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); |
|
1043 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); | |
1044 | ret = LFR_DEFAULT; |
|
1044 | ret = LFR_DEFAULT; | |
1045 | } |
|
1045 | } | |
1046 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); |
|
1046 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); | |
1047 | } |
|
1047 | } | |
1048 |
|
1048 | |||
1049 | return ret; |
|
1049 | return ret; | |
1050 | } |
|
1050 | } | |
1051 |
|
1051 | |||
1052 | void compute_acquisition_time( unsigned int *coarseTime, unsigned int *fineTime, unsigned int sid, unsigned char pa_lfr_pkt_nr ) |
|
1052 | void compute_acquisition_time( unsigned int *coarseTime, unsigned int *fineTime, unsigned int sid, unsigned char pa_lfr_pkt_nr ) | |
1053 | { |
|
1053 | { | |
1054 | unsigned long long int acquisitionTimeAsLong; |
|
1054 | unsigned long long int acquisitionTimeAsLong; | |
1055 | unsigned char acquisitionTime[6]; |
|
1055 | unsigned char acquisitionTime[6]; | |
1056 | float deltaT = 0.; |
|
1056 | float deltaT = 0.; | |
1057 |
|
1057 | |||
1058 | acquisitionTime[0] = (unsigned char) ( *coarseTime >> 8 ); |
|
1058 | acquisitionTime[0] = (unsigned char) ( *coarseTime >> 8 ); | |
1059 | acquisitionTime[1] = (unsigned char) ( *coarseTime ); |
|
1059 | acquisitionTime[1] = (unsigned char) ( *coarseTime ); | |
1060 | acquisitionTime[2] = (unsigned char) ( *coarseTime >> 24 ); |
|
1060 | acquisitionTime[2] = (unsigned char) ( *coarseTime >> 24 ); | |
1061 | acquisitionTime[3] = (unsigned char) ( *coarseTime >> 16 ); |
|
1061 | acquisitionTime[3] = (unsigned char) ( *coarseTime >> 16 ); | |
1062 | acquisitionTime[4] = (unsigned char) ( *fineTime >> 24 ); |
|
1062 | acquisitionTime[4] = (unsigned char) ( *fineTime >> 24 ); | |
1063 | acquisitionTime[5] = (unsigned char) ( *fineTime >> 16 ); |
|
1063 | acquisitionTime[5] = (unsigned char) ( *fineTime >> 16 ); | |
1064 |
|
1064 | |||
1065 | acquisitionTimeAsLong = ( (unsigned long long int) acquisitionTime[0] << 40 ) |
|
1065 | acquisitionTimeAsLong = ( (unsigned long long int) acquisitionTime[0] << 40 ) | |
1066 | + ( (unsigned long long int) acquisitionTime[1] << 32 ) |
|
1066 | + ( (unsigned long long int) acquisitionTime[1] << 32 ) | |
1067 | + ( acquisitionTime[2] << 24 ) |
|
1067 | + ( acquisitionTime[2] << 24 ) | |
1068 | + ( acquisitionTime[3] << 16 ) |
|
1068 | + ( acquisitionTime[3] << 16 ) | |
1069 | + ( acquisitionTime[4] << 8 ) |
|
1069 | + ( acquisitionTime[4] << 8 ) | |
1070 | + ( acquisitionTime[5] ); |
|
1070 | + ( acquisitionTime[5] ); | |
1071 |
|
1071 | |||
1072 | switch( sid ) |
|
1072 | switch( sid ) | |
1073 | { |
|
1073 | { | |
1074 | case SID_NORM_SWF_F0: |
|
1074 | case SID_NORM_SWF_F0: | |
1075 | deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ; |
|
1075 | deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ; | |
1076 | break; |
|
1076 | break; | |
1077 |
|
1077 | |||
1078 | case SID_NORM_SWF_F1: |
|
1078 | case SID_NORM_SWF_F1: | |
1079 | deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ; |
|
1079 | deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ; | |
1080 | break; |
|
1080 | break; | |
1081 |
|
1081 | |||
1082 | case SID_NORM_SWF_F2: |
|
1082 | case SID_NORM_SWF_F2: | |
1083 | deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ; |
|
1083 | deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ; | |
1084 | break; |
|
1084 | break; | |
1085 |
|
1085 | |||
1086 | default: |
|
1086 | default: | |
1087 | deltaT = 0.; |
|
1087 | deltaT = 0.; | |
1088 | break; |
|
1088 | break; | |
1089 | } |
|
1089 | } | |
1090 |
|
1090 | |||
1091 | acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT; |
|
1091 | acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT; | |
1092 |
|
1092 | |||
1093 | *coarseTime = (unsigned int) (acquisitionTimeAsLong >> 16); |
|
1093 | *coarseTime = (unsigned int) (acquisitionTimeAsLong >> 16); | |
1094 | *fineTime = (unsigned int) (acquisitionTimeAsLong & 0xffff); |
|
1094 | *fineTime = (unsigned int) (acquisitionTimeAsLong & 0xffff); | |
1095 | } |
|
1095 | } | |
1096 |
|
1096 | |||
1097 | //************** |
|
1097 | //************** | |
1098 | // wfp registers |
|
1098 | // wfp registers | |
1099 | void set_wfp_data_shaping() |
|
1099 | void reset_wfp_burst_enable(void) | |
|
1100 | { | |||
|
1101 | /** This function resets the waveform picker burst_enable register. | |||
|
1102 | * | |||
|
1103 | * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0. | |||
|
1104 | * | |||
|
1105 | */ | |||
|
1106 | ||||
|
1107 | #ifdef VHDL_DEV | |||
|
1108 | waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |||
|
1109 | #else | |||
|
1110 | waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |||
|
1111 | #endif | |||
|
1112 | } | |||
|
1113 | ||||
|
1114 | void reset_wfp_status( void ) | |||
|
1115 | { | |||
|
1116 | /** This function resets the waveform picker status register. | |||
|
1117 | * | |||
|
1118 | * All status bits are set to 0 [new_err full_err full]. | |||
|
1119 | * | |||
|
1120 | */ | |||
|
1121 | ||||
|
1122 | #ifdef GSA | |||
|
1123 | #else | |||
|
1124 | waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |||
|
1125 | #endif | |||
|
1126 | } | |||
|
1127 | ||||
|
1128 | void reset_waveform_picker_regs(void) | |||
|
1129 | { | |||
|
1130 | /** This function resets the waveform picker module registers. | |||
|
1131 | * | |||
|
1132 | * The registers affected by this function are located at the following offset addresses: | |||
|
1133 | * - 0x00 data_shaping | |||
|
1134 | * - 0x04 run_burst_enable | |||
|
1135 | * - 0x08 addr_data_f0 | |||
|
1136 | * - 0x0C addr_data_f1 | |||
|
1137 | * - 0x10 addr_data_f2 | |||
|
1138 | * - 0x14 addr_data_f3 | |||
|
1139 | * - 0x18 status | |||
|
1140 | * - 0x1C delta_snapshot | |||
|
1141 | * - 0x20 delta_f0 | |||
|
1142 | * - 0x24 delta_f0_2 | |||
|
1143 | * - 0x28 delta_f1 | |||
|
1144 | * - 0x2c delta_f2 | |||
|
1145 | * - 0x30 nb_data_by_buffer | |||
|
1146 | * - 0x34 nb_snapshot_param | |||
|
1147 | * - 0x38 start_date | |||
|
1148 | * - 0x3c nb_word_in_buffer | |||
|
1149 | * | |||
|
1150 | */ | |||
|
1151 | ||||
|
1152 | waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW | |||
|
1153 | waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] | |||
|
1154 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08 | |||
|
1155 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c | |||
|
1156 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10 | |||
|
1157 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14 | |||
|
1158 | waveform_picker_regs->status = 0x00; // 0x18 | |||
|
1159 | // | |||
|
1160 | set_wfp_delta_snapshot(); // 0x1c | |||
|
1161 | set_wfp_delta_f0_f0_2(); // 0x20, 0x24 | |||
|
1162 | set_wfp_delta_f1(); // 0x28 | |||
|
1163 | set_wfp_delta_f2(); // 0x2c | |||
|
1164 | DEBUG_PRINTF1("delta_snapshot %x\n", waveform_picker_regs->delta_snapshot) | |||
|
1165 | DEBUG_PRINTF1("delta_f0 %x\n", waveform_picker_regs->delta_f0) | |||
|
1166 | DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2) | |||
|
1167 | DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1) | |||
|
1168 | DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2) | |||
|
1169 | // 2352 = 7 * 336 | |||
|
1170 | waveform_picker_regs->nb_data_by_buffer = 0x92f; // 0x30 *** 2352 - 1 => nb samples -1 | |||
|
1171 | waveform_picker_regs->snapshot_param = 0x930; // 0x34 *** 2352 => nb samples | |||
|
1172 | waveform_picker_regs->start_date = 0x00; // 0x38 | |||
|
1173 | waveform_picker_regs->nb_word_in_buffer = 0x1b92; // 0x3c *** 2352 * 3 + 2 = 7058 | |||
|
1174 | } | |||
|
1175 | ||||
|
1176 | void set_wfp_data_shaping( void ) | |||
1100 | { |
|
1177 | { | |
1101 | /** This function sets the data_shaping register of the waveform picker module. |
|
1178 | /** This function sets the data_shaping register of the waveform picker module. | |
1102 | * |
|
1179 | * | |
1103 | * The value is read from one field of the parameter_dump_packet structure:\n |
|
1180 | * The value is read from one field of the parameter_dump_packet structure:\n | |
1104 | * bw_sp0_sp1_r0_r1 |
|
1181 | * bw_sp0_sp1_r0_r1 | |
1105 | * |
|
1182 | * | |
1106 | */ |
|
1183 | */ | |
1107 |
|
1184 | |||
1108 | unsigned char data_shaping; |
|
1185 | unsigned char data_shaping; | |
1109 |
|
1186 | |||
1110 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register |
|
1187 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register | |
1111 | // waveform picker : [R1 R0 SP1 SP0 BW] |
|
1188 | // waveform picker : [R1 R0 SP1 SP0 BW] | |
1112 |
|
1189 | |||
1113 | data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1; |
|
1190 | data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1; | |
1114 |
|
1191 | |||
1115 | #ifdef GSA |
|
|||
1116 | #else |
|
|||
1117 | waveform_picker_regs->data_shaping = |
|
1192 | waveform_picker_regs->data_shaping = | |
1118 | ( (data_shaping & 0x10) >> 4 ) // BW |
|
1193 | ( (data_shaping & 0x10) >> 4 ) // BW | |
1119 | + ( (data_shaping & 0x08) >> 2 ) // SP0 |
|
1194 | + ( (data_shaping & 0x08) >> 2 ) // SP0 | |
1120 | + ( (data_shaping & 0x04) ) // SP1 |
|
1195 | + ( (data_shaping & 0x04) ) // SP1 | |
1121 | + ( (data_shaping & 0x02) << 2 ) // R0 |
|
1196 | + ( (data_shaping & 0x02) << 2 ) // R0 | |
1122 | + ( (data_shaping & 0x01) << 4 ); // R1 |
|
1197 | + ( (data_shaping & 0x01) << 4 ); // R1 | |
1123 | #endif |
|
|||
1124 | } |
|
1198 | } | |
1125 |
|
1199 | |||
1126 | char set_wfp_delta_snapshot() |
|
|||
1127 | { |
|
|||
1128 | /** This function sets the delta_snapshot register of the waveform picker module. |
|
|||
1129 | * |
|
|||
1130 | * The value is read from two (unsigned char) of the parameter_dump_packet structure: |
|
|||
1131 | * - sy_lfr_n_swf_p[0] |
|
|||
1132 | * - sy_lfr_n_swf_p[1] |
|
|||
1133 | * |
|
|||
1134 | */ |
|
|||
1135 |
|
||||
1136 | char ret; |
|
|||
1137 | unsigned int delta_snapshot; |
|
|||
1138 | unsigned int aux; |
|
|||
1139 |
|
||||
1140 | aux = 0; |
|
|||
1141 | ret = LFR_DEFAULT; |
|
|||
1142 |
|
||||
1143 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 |
|
|||
1144 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; |
|
|||
1145 |
|
||||
1146 | #ifdef GSA |
|
|||
1147 | #else |
|
|||
1148 | if ( delta_snapshot < MIN_DELTA_SNAPSHOT ) |
|
|||
1149 | { |
|
|||
1150 | aux = MIN_DELTA_SNAPSHOT; |
|
|||
1151 | ret = LFR_DEFAULT; |
|
|||
1152 | } |
|
|||
1153 | else |
|
|||
1154 | { |
|
|||
1155 | aux = delta_snapshot ; |
|
|||
1156 | ret = LFR_SUCCESSFUL; |
|
|||
1157 | } |
|
|||
1158 | waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes |
|
|||
1159 | #endif |
|
|||
1160 |
|
||||
1161 | return ret; |
|
|||
1162 | } |
|
|||
1163 |
|
||||
1164 | #ifdef VHDL_DEV |
|
|||
1165 | void set_wfp_burst_enable_register( unsigned char mode ) |
|
1200 | void set_wfp_burst_enable_register( unsigned char mode ) | |
1166 | { |
|
1201 | { | |
1167 | /** This function sets the waveform picker burst_enable register depending on the mode. |
|
1202 | /** This function sets the waveform picker burst_enable register depending on the mode. | |
1168 | * |
|
1203 | * | |
1169 | * @param mode is the LFR mode to launch. |
|
1204 | * @param mode is the LFR mode to launch. | |
1170 | * |
|
1205 | * | |
1171 | * The burst bits shall be before the enable bits. |
|
1206 | * The burst bits shall be before the enable bits. | |
1172 | * |
|
1207 | * | |
1173 | */ |
|
1208 | */ | |
1174 |
|
1209 | |||
1175 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
1210 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
1176 | // the burst bits shall be set first, before the enable bits |
|
1211 | // the burst bits shall be set first, before the enable bits | |
1177 | switch(mode) { |
|
1212 | switch(mode) { | |
1178 | case(LFR_MODE_NORMAL): |
|
1213 | case(LFR_MODE_NORMAL): | |
1179 | waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable |
|
1214 | waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable | |
1180 | waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0 |
|
1215 | waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0 | |
1181 | break; |
|
1216 | break; | |
1182 | case(LFR_MODE_BURST): |
|
1217 | case(LFR_MODE_BURST): | |
1183 | waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1218 | waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled | |
1184 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2 |
|
1219 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2 | |
1185 | break; |
|
1220 | break; | |
1186 | case(LFR_MODE_SBM1): |
|
1221 | case(LFR_MODE_SBM1): | |
1187 | waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled |
|
1222 | waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled | |
1188 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
1223 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 | |
1189 | break; |
|
1224 | break; | |
1190 | case(LFR_MODE_SBM2): |
|
1225 | case(LFR_MODE_SBM2): | |
1191 | waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1226 | waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled | |
1192 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
1227 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 | |
1193 | break; |
|
1228 | break; | |
1194 | default: |
|
1229 | default: | |
1195 | waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled |
|
1230 | waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled | |
1196 | break; |
|
1231 | break; | |
1197 | } |
|
1232 | } | |
1198 | } |
|
1233 | } | |
1199 | #else |
|
1234 | ||
1200 | void set_wfp_burst_enable_register( unsigned char mode ) |
|
1235 | void set_wfp_delta_snapshot( void ) | |
1201 | { |
|
1236 | { | |
1202 | /** This function sets the waveform picker burst_enable register depending on the mode. |
|
1237 | /** This function sets the delta_snapshot register of the waveform picker module. | |
1203 | * |
|
|||
1204 | * @param mode is the LFR mode to launch. |
|
|||
1205 | * |
|
|||
1206 | * The burst bits shall be before the enable bits. |
|
|||
1207 | * |
|
1238 | * | |
1208 | */ |
|
1239 | * The value is read from two (unsigned char) of the parameter_dump_packet structure: | |
1209 |
|
1240 | * - sy_lfr_n_swf_p[0] | ||
1210 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
1241 | * - sy_lfr_n_swf_p[1] | |
1211 | // the burst bits shall be set first, before the enable bits |
|
|||
1212 | switch(mode) { |
|
|||
1213 | case(LFR_MODE_NORMAL): |
|
|||
1214 | waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enable |
|
|||
1215 | waveform_picker_regs->burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0 |
|
|||
1216 | break; |
|
|||
1217 | case(LFR_MODE_BURST): |
|
|||
1218 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
|||
1219 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; // [0100] enable f2 |
|
|||
1220 | break; |
|
|||
1221 | case(LFR_MODE_SBM1): |
|
|||
1222 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] f1 burst enabled |
|
|||
1223 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
|||
1224 | break; |
|
|||
1225 | case(LFR_MODE_SBM2): |
|
|||
1226 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
|||
1227 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
|||
1228 | break; |
|
|||
1229 | default: |
|
|||
1230 | waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled |
|
|||
1231 | break; |
|
|||
1232 | } |
|
|||
1233 | } |
|
|||
1234 | #endif |
|
|||
1235 |
|
||||
1236 | void reset_wfp_burst_enable() |
|
|||
1237 | { |
|
|||
1238 | /** This function resets the waveform picker burst_enable register. |
|
|||
1239 | * |
|
|||
1240 | * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0. |
|
|||
1241 | * |
|
|||
1242 | */ |
|
|||
1243 |
|
||||
1244 | #ifdef VHDL_DEV |
|
|||
1245 | waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
|||
1246 | #else |
|
|||
1247 | waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
|||
1248 | #endif |
|
|||
1249 | } |
|
|||
1250 |
|
||||
1251 | void reset_wfp_status() |
|
|||
1252 | { |
|
|||
1253 | /** This function resets the waveform picker status register. |
|
|||
1254 | * |
|
|||
1255 | * All status bits are set to 0 [new_err full_err full]. |
|
|||
1256 | * |
|
1242 | * | |
1257 | */ |
|
1243 | */ | |
1258 |
|
1244 | |||
1259 | #ifdef GSA |
|
1245 | unsigned int delta_snapshot; | |
1260 | #else |
|
1246 | unsigned int delta_snapshot_in_T2; | |
1261 | waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
|||
1262 | #endif |
|
|||
1263 | } |
|
|||
1264 |
|
1247 | |||
1265 | void reset_waveform_picker_regs_vhdl_dev() |
|
1248 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 | |
1266 | { |
|
1249 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; | |
1267 | /** This function resets the waveform picker module registers. |
|
1250 | ||
1268 | * |
|
1251 | delta_snapshot_in_T2 = delta_snapshot * 256; | |
1269 | * The registers affected by this function are located at the following offset addresses: |
|
1252 | waveform_picker_regs->delta_snapshot = delta_snapshot_in_T2; // max 4 bytes | |
1270 | * - 0x00 data_shaping |
|
|||
1271 | * - 0x04 run_burst_enable |
|
|||
1272 | * - 0x08 addr_data_f0 |
|
|||
1273 | * - 0x0C addr_data_f1 |
|
|||
1274 | * - 0x10 addr_data_f2 |
|
|||
1275 | * - 0x14 addr_data_f3 |
|
|||
1276 | * - 0x18 status |
|
|||
1277 | * - 0x1C delta_snapshot |
|
|||
1278 | * - 0x20 delta_f0 |
|
|||
1279 | * - 0x24 delta_f0_2 |
|
|||
1280 | * - 0x28 delta_f1 |
|
|||
1281 | * - 0x2c delta_f2 |
|
|||
1282 | * - 0x30 nb_data_by_buffer |
|
|||
1283 | * - 0x34 nb_snapshot_param |
|
|||
1284 | * - 0x38 start_date |
|
|||
1285 | * - 0x3c nb_word_in_buffer |
|
|||
1286 | * |
|
|||
1287 | */ |
|
|||
1288 | waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW |
|
|||
1289 | waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] |
|
|||
1290 | //waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08 |
|
|||
1291 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08 |
|
|||
1292 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c |
|
|||
1293 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10 |
|
|||
1294 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14 |
|
|||
1295 | waveform_picker_regs->status = 0x00; // 0x18 |
|
|||
1296 | // |
|
|||
1297 | waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c *** 4096 = 16 * 256 |
|
|||
1298 | waveform_picker_regs->delta_f0 = 0xc0b; // 0x20 *** 3083 = 4096 - 1013 |
|
|||
1299 | waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
|||
1300 | waveform_picker_regs->delta_f1 = 0xc40; // 0x28 *** 3136 = 4096 - 960 |
|
|||
1301 | waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 3072 = 12 * 256 |
|
|||
1302 | // |
|
|||
1303 | // waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c *** 4096 = 16 * 256 |
|
|||
1304 | // waveform_picker_regs->delta_f0 = 0x1; // 0x20 *** |
|
|||
1305 | // waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
|||
1306 | // waveform_picker_regs->delta_f1 = 0x1; // 0x28 *** |
|
|||
1307 | // waveform_picker_regs->delta_f2 = 0x1; // 0x2c *** |
|
|||
1308 | // |
|
|||
1309 | // waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c *** 4096 = 16 * 256 |
|
|||
1310 | // waveform_picker_regs->delta_f0 = 0x0fff; // 0x20 *** |
|
|||
1311 | // waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
|||
1312 | // waveform_picker_regs->delta_f1 = 0x0fff; // 0x28 *** |
|
|||
1313 | // waveform_picker_regs->delta_f2 = 0x1; // 0x2c *** |
|
|||
1314 | // 2048 |
|
|||
1315 | // waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1 => nb samples -1 |
|
|||
1316 | // waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048 => nb samples |
|
|||
1317 | // waveform_picker_regs->start_date = 0x00; // 0x38 |
|
|||
1318 | // waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146 |
|
|||
1319 | // 2352 = 7 * 336 |
|
|||
1320 | // waveform_picker_regs->nb_data_by_buffer = 0x92f; // 0x30 *** 2352 - 1 => nb samples -1 |
|
|||
1321 | // waveform_picker_regs->snapshot_param = 0x930; // 0x34 *** 2352 => nb samples |
|
|||
1322 | // waveform_picker_regs->start_date = 0x00; // 0x38 |
|
|||
1323 | // waveform_picker_regs->nb_word_in_buffer = 0x1b92; // 0x3c *** 2352 * 3 + 2 = 7058 |
|
|||
1324 | // 128 |
|
|||
1325 | waveform_picker_regs->nb_data_by_buffer = 0x7f; // 0x30 *** 128 - 1 => nb samples -1 |
|
|||
1326 | waveform_picker_regs->snapshot_param = 0x80; // 0x34 *** 128 => nb samples |
|
|||
1327 | waveform_picker_regs->start_date = 0x00; // 0x38 |
|
|||
1328 | waveform_picker_regs->nb_word_in_buffer = 0x182; // 0x3c *** 128 * 3 + 2 = 386 |
|
|||
1329 | } |
|
1253 | } | |
1330 |
|
1254 | |||
1331 | void reset_waveform_picker_regs_vhdl_dev_debug() |
|
1255 | void set_wfp_delta_f0_f0_2( void ) | |
1332 | { |
|
1256 | { | |
1333 | /** This function resets the waveform picker module registers. |
|
1257 | unsigned int delta_snapshot; | |
1334 | * |
|
1258 | unsigned int nb_samples_per_snapshot; | |
1335 | * The registers affected by this function are located at the following offset addresses: |
|
1259 | float delta_f0_in_float; | |
1336 | * - 0x00 data_shaping |
|
1260 | ||
1337 | * - 0x04 run_burst_enable |
|
1261 | delta_snapshot = waveform_picker_regs->delta_snapshot; | |
1338 | * - 0x08 addr_data_f0 |
|
1262 | nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1]; | |
1339 | * - 0x0C addr_data_f1 |
|
1263 | delta_f0_in_float =nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 24576.) * 256.; | |
1340 | * - 0x10 addr_data_f2 |
|
1264 | ||
1341 | * - 0x14 addr_data_f3 |
|
1265 | waveform_picker_regs->delta_f0 = delta_snapshot - floor( delta_f0_in_float ); | |
1342 | * - 0x18 status |
|
1266 | waveform_picker_regs->delta_f0_2 = 0x7; // max 7 bits | |
1343 | * - 0x1C delta_snapshot |
|
|||
1344 | * - 0x20 delta_f0 |
|
|||
1345 | * - 0x24 delta_f0_2 |
|
|||
1346 | * - 0x28 delta_f1 |
|
|||
1347 | * - 0x2c delta_f2 |
|
|||
1348 | * - 0x30 nb_data_by_buffer |
|
|||
1349 | * - 0x34 nb_snapshot_param |
|
|||
1350 | * - 0x38 start_date |
|
|||
1351 | * - 0x3c nb_word_in_buffer |
|
|||
1352 | * |
|
|||
1353 | */ |
|
|||
1354 | waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW |
|
|||
1355 | waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] |
|
|||
1356 | //waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08 |
|
|||
1357 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08 |
|
|||
1358 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c |
|
|||
1359 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10 |
|
|||
1360 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14 |
|
|||
1361 | waveform_picker_regs->status = 0x00; // 0x18 |
|
|||
1362 | // |
|
|||
1363 | waveform_picker_regs->delta_snapshot = 0x100; // 0x1c *** 256 |
|
|||
1364 | waveform_picker_regs->delta_f0 = 0xc1; // 0x20 *** 256 - 63 |
|
|||
1365 | waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
|||
1366 | waveform_picker_regs->delta_f1 = 0xc4; // 0x28 *** 256 - 60 |
|
|||
1367 | waveform_picker_regs->delta_f2 = 0xc0; // 0x2c *** 192 |
|
|||
1368 | // 128 |
|
|||
1369 | waveform_picker_regs->nb_data_by_buffer = 0x7f; // 0x30 *** 128 - 1 => nb samples -1 |
|
|||
1370 | waveform_picker_regs->snapshot_param = 0x80; // 0x34 *** 128 => nb samples |
|
|||
1371 | waveform_picker_regs->start_date = 0x00; // 0x38 |
|
|||
1372 | waveform_picker_regs->nb_word_in_buffer = 0x182; // 0x3c *** 128 * 3 + 2 = 386 |
|
|||
1373 | } |
|
1267 | } | |
1374 |
|
1268 | |||
1375 | void reset_waveform_picker_regs_vhdl_dev_debug_64() |
|
1269 | void set_wfp_delta_f1( void ) | |
1376 | { |
|
1270 | { | |
1377 | /** This function resets the waveform picker module registers. |
|
1271 | unsigned int delta_snapshot; | |
1378 | * |
|
1272 | unsigned int nb_samples_per_snapshot; | |
1379 | * The registers affected by this function are located at the following offset addresses: |
|
1273 | float delta_f1_in_float; | |
1380 | * - 0x00 data_shaping |
|
1274 | ||
1381 | * - 0x04 run_burst_enable |
|
1275 | delta_snapshot = waveform_picker_regs->delta_snapshot; | |
1382 | * - 0x08 addr_data_f0 |
|
1276 | nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1]; | |
1383 | * - 0x0C addr_data_f1 |
|
1277 | delta_f1_in_float = nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 4096.) * 256.; | |
1384 | * - 0x10 addr_data_f2 |
|
1278 | ||
1385 | * - 0x14 addr_data_f3 |
|
1279 | waveform_picker_regs->delta_f1 = delta_snapshot - floor( delta_f1_in_float ); | |
1386 | * - 0x18 status |
|
|||
1387 | * - 0x1C delta_snapshot |
|
|||
1388 | * - 0x20 delta_f0 |
|
|||
1389 | * - 0x24 delta_f0_2 |
|
|||
1390 | * - 0x28 delta_f1 |
|
|||
1391 | * - 0x2c delta_f2 |
|
|||
1392 | * - 0x30 nb_data_by_buffer |
|
|||
1393 | * - 0x34 nb_snapshot_param |
|
|||
1394 | * - 0x38 start_date |
|
|||
1395 | * - 0x3c nb_word_in_buffer |
|
|||
1396 | * |
|
|||
1397 | */ |
|
|||
1398 | waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW |
|
|||
1399 | waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] |
|
|||
1400 | //waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08 |
|
|||
1401 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08 |
|
|||
1402 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c |
|
|||
1403 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10 |
|
|||
1404 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14 |
|
|||
1405 | waveform_picker_regs->status = 0x00; // 0x18 |
|
|||
1406 | // |
|
|||
1407 | waveform_picker_regs->delta_snapshot = 0x80; // 0x1c *** 128 |
|
|||
1408 | waveform_picker_regs->delta_f0 = 0x60; // 0x20 *** 128 - 32 = 96 |
|
|||
1409 | waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
|||
1410 | waveform_picker_regs->delta_f1 = 0x62; // 0x28 *** 128 - 30 = 90 |
|
|||
1411 | waveform_picker_regs->delta_f2 = 0x60; // 0x2c *** 192 |
|
|||
1412 | // 128 |
|
|||
1413 | waveform_picker_regs->nb_data_by_buffer = 0x3f; // 0x30 *** 64 - 1 => nb samples -1 |
|
|||
1414 | waveform_picker_regs->snapshot_param = 0x40; // 0x34 *** 64 => nb samples |
|
|||
1415 | waveform_picker_regs->start_date = 0x00; // 0x38 |
|
|||
1416 | waveform_picker_regs->nb_word_in_buffer = 0xc2; // 0x3c *** 64 * 3 + 2 = 194 |
|
|||
1417 | } |
|
1280 | } | |
1418 |
|
1281 | |||
1419 | void reset_waveform_picker_regs() |
|
1282 | void set_wfp_delta_f2() | |
1420 | { |
|
1283 | { | |
1421 | /** This function resets the waveform picker module registers. |
|
1284 | unsigned int delta_snapshot; | |
1422 | * |
|
1285 | unsigned int nb_samples_per_snapshot; | |
1423 | * The registers affected by this function are located at the following offset addresses: |
|
|||
1424 | * - 0x00 data_shaping |
|
|||
1425 | * - 0x04 burst_enable |
|
|||
1426 | * - 0x08 addr_data_f0 |
|
|||
1427 | * - 0x0C addr_data_f1 |
|
|||
1428 | * - 0x10 addr_data_f2 |
|
|||
1429 | * - 0x14 addr_data_f3 |
|
|||
1430 | * - 0x18 status |
|
|||
1431 | * - 0x1C delta_snapshot |
|
|||
1432 | * - 0x20 delta_f2_f1 |
|
|||
1433 | * - 0x24 delta_f2_f0 |
|
|||
1434 | * - 0x28 nb_burst |
|
|||
1435 | * - 0x2C nb_snapshot |
|
|||
1436 | * |
|
|||
1437 | */ |
|
|||
1438 |
|
1286 | |||
1439 | #ifdef VHDL_DEV |
|
1287 | delta_snapshot = waveform_picker_regs->delta_snapshot; | |
1440 | #else |
|
1288 | nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1]; | |
1441 | reset_wfp_burst_enable(); |
|
1289 | ||
1442 | reset_wfp_status(); |
|
1290 | waveform_picker_regs->delta_f2 = delta_snapshot - nb_samples_per_snapshot / 2; | |
1443 | // set buffer addresses |
|
|||
1444 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); |
|
|||
1445 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; |
|
|||
1446 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; |
|
|||
1447 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); |
|
|||
1448 | // set other parameters |
|
|||
1449 | set_wfp_data_shaping(); |
|
|||
1450 | set_wfp_delta_snapshot(); // time in seconds between two snapshots |
|
|||
1451 | waveform_picker_regs->delta_f2_f1 = 0xffff; // 0x16800 => 92160 (max 4 bytes) |
|
|||
1452 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // 97 280 (max 5 bytes) |
|
|||
1453 | // waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) |
|
|||
1454 | // // 3 * 2048 / 16 = 384 |
|
|||
1455 | // waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 |
|
|||
1456 | waveform_picker_regs->nb_burst_available = 0x1b9; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) |
|
|||
1457 | // 3 * 2352 / 16 = 441 |
|
|||
1458 | waveform_picker_regs->nb_snapshot_param = 0x944; // max 3 octets, 2372 - 1 |
|
|||
1459 | #endif |
|
|||
1460 | } |
|
1291 | } | |
1461 |
|
1292 | |||
1462 | //***************** |
|
1293 | //***************** | |
1463 | // local parameters |
|
1294 | // local parameters | |
1464 | void set_local_nb_interrupt_f0_MAX( void ) |
|
1295 | void set_local_nb_interrupt_f0_MAX( void ) | |
1465 | { |
|
1296 | { | |
1466 | /** This function sets the value of the nb_interrupt_f0_MAX local parameter. |
|
1297 | /** This function sets the value of the nb_interrupt_f0_MAX local parameter. | |
1467 | * |
|
1298 | * | |
1468 | * This parameter is used for the SM validation only.\n |
|
1299 | * This parameter is used for the SM validation only.\n | |
1469 | * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices |
|
1300 | * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices | |
1470 | * module before launching a basic processing. |
|
1301 | * module before launching a basic processing. | |
1471 | * |
|
1302 | * | |
1472 | */ |
|
1303 | */ | |
1473 |
|
1304 | |||
1474 | param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 |
|
1305 | param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 | |
1475 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; |
|
1306 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; | |
1476 | } |
|
1307 | } | |
1477 |
|
1308 | |||
1478 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) |
|
1309 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) | |
1479 | { |
|
1310 | { | |
1480 | unsigned short *sequence_cnt; |
|
1311 | unsigned short *sequence_cnt; | |
1481 | unsigned short segmentation_grouping_flag; |
|
1312 | unsigned short segmentation_grouping_flag; | |
1482 | unsigned short new_packet_sequence_control; |
|
1313 | unsigned short new_packet_sequence_control; | |
1483 |
|
1314 | |||
1484 | if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2) |
|
1315 | if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2) | |
1485 | || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) ) |
|
1316 | || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) ) | |
1486 | { |
|
1317 | { | |
1487 | sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST; |
|
1318 | sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST; | |
1488 | } |
|
1319 | } | |
1489 | else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) ) |
|
1320 | else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) ) | |
1490 | { |
|
1321 | { | |
1491 | sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2; |
|
1322 | sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2; | |
1492 | } |
|
1323 | } | |
1493 | else |
|
1324 | else | |
1494 | { |
|
1325 | { | |
1495 | sequence_cnt = NULL; |
|
1326 | sequence_cnt = NULL; | |
1496 | PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid) |
|
1327 | PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid) | |
1497 | } |
|
1328 | } | |
1498 |
|
1329 | |||
1499 | if (sequence_cnt != NULL) |
|
1330 | if (sequence_cnt != NULL) | |
1500 | { |
|
1331 | { | |
1501 | segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8; |
|
1332 | segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8; | |
1502 | *sequence_cnt = (*sequence_cnt) & 0x3fff; |
|
1333 | *sequence_cnt = (*sequence_cnt) & 0x3fff; | |
1503 |
|
1334 | |||
1504 | new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ; |
|
1335 | new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ; | |
1505 |
|
1336 | |||
1506 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); |
|
1337 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |
1507 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); |
|
1338 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |
1508 |
|
1339 | |||
1509 | // increment the sequence counter for the next packet |
|
1340 | // increment the sequence counter for the next packet | |
1510 | if ( *sequence_cnt < SEQ_CNT_MAX) |
|
1341 | if ( *sequence_cnt < SEQ_CNT_MAX) | |
1511 | { |
|
1342 | { | |
1512 | *sequence_cnt = *sequence_cnt + 1; |
|
1343 | *sequence_cnt = *sequence_cnt + 1; | |
1513 | } |
|
1344 | } | |
1514 | else |
|
1345 | else | |
1515 | { |
|
1346 | { | |
1516 | *sequence_cnt = 0; |
|
1347 | *sequence_cnt = 0; | |
1517 | } |
|
1348 | } | |
1518 | } |
|
1349 | } | |
1519 | } |
|
1350 | } |
General Comments 0
You need to be logged in to leave comments.
Login now