@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: bin/fsw |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: Tu |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 17 09:53:23 2014 | |
|
4 | 4 | # Project: fsw-qt.pro |
|
5 | 5 | # Template: app |
|
6 | 6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
@@ -10,7 +10,7 | |||
|
10 | 10 | |
|
11 | 11 | CC = sparc-rtems-gcc |
|
12 | 12 | CXX = sparc-rtems-g++ |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS | |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS -DBOOT_MESSAGES | |
|
14 | 14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | 15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
16 | 16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../src/basic_parameters |
@@ -1,7 +1,7 | |||
|
1 | 1 | TEMPLATE = app |
|
2 | 2 | # CONFIG += console v8 sim |
|
3 | 3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch |
|
4 | CONFIG += console verbose cpu_usage_report | |
|
4 | CONFIG += console verbose cpu_usage_report boot_messages | |
|
5 | 5 | CONFIG -= qt |
|
6 | 6 | |
|
7 | 7 | include(./sparc.pri) |
@@ -1,10 +1,10 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by QtCreator 3.0.1, 2014-04-1 |
|
|
3 | <!-- Written by QtCreator 3.0.1, 2014-04-17T09:46:14. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
7 |
<value type="int"> |
|
|
7 | <value type="int">0</value> | |
|
8 | 8 | </data> |
|
9 | 9 | <data> |
|
10 | 10 | <variable>ProjectExplorer.Project.EditorSettings</variable> |
@@ -51,147 +51,9 | |||
|
51 | 51 | <data> |
|
52 | 52 | <variable>ProjectExplorer.Project.Target.0</variable> |
|
53 | 53 | <valuemap type="QVariantMap"> |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value> | |
|
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> | |
|
56 |
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ |
|
|
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
|
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
|
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
|
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
|
61 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> | |
|
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
|
63 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
|
64 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
|
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
67 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
|
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
|
69 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> | |
|
70 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
|
71 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
|
72 | </valuemap> | |
|
73 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
|
74 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
|
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
77 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
78 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
|
79 | <value type="QString">-w</value> | |
|
80 | <value type="QString">-r</value> | |
|
81 | </valuelist> | |
|
82 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
|
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
|
84 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
|
85 | </valuemap> | |
|
86 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
|
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
|
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
89 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
|
90 | </valuemap> | |
|
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
|
92 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
|
93 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
|
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
96 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
97 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
|
98 | <value type="QString">-w</value> | |
|
99 | <value type="QString">-r</value> | |
|
100 | </valuelist> | |
|
101 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
|
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
|
103 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
|
104 | </valuemap> | |
|
105 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
|
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
|
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
108 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
|
109 | </valuemap> | |
|
110 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
|
111 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
|
112 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
|
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> | |
|
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
115 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
|
116 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
|
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> | |
|
118 | </valuemap> | |
|
119 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> | |
|
120 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
|
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
|
122 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
|
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> | |
|
124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
|
126 | </valuemap> | |
|
127 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
|
128 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> | |
|
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
|
131 | </valuemap> | |
|
132 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
|
133 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
|
134 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
|
135 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
|
136 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
|
137 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
|
138 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
|
139 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
|
140 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
|
141 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
|
142 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
|
143 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
|
144 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> | |
|
145 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
|
146 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
|
147 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> | |
|
148 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> | |
|
149 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> | |
|
150 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
|
151 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
|
152 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
|
153 | <value type="int">0</value> | |
|
154 | <value type="int">1</value> | |
|
155 | <value type="int">2</value> | |
|
156 | <value type="int">3</value> | |
|
157 | <value type="int">4</value> | |
|
158 | <value type="int">5</value> | |
|
159 | <value type="int">6</value> | |
|
160 | <value type="int">7</value> | |
|
161 | <value type="int">8</value> | |
|
162 | <value type="int">9</value> | |
|
163 | <value type="int">10</value> | |
|
164 | <value type="int">11</value> | |
|
165 | <value type="int">12</value> | |
|
166 | <value type="int">13</value> | |
|
167 | <value type="int">14</value> | |
|
168 | </valuelist> | |
|
169 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
|
170 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
|
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</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> | |
|
174 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
|
175 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
|
176 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
|
177 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
|
178 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
|
179 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
|
180 | <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> | |
|
181 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> | |
|
182 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> | |
|
183 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
|
184 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> | |
|
185 | </valuemap> | |
|
186 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> | |
|
187 | </valuemap> | |
|
188 | </data> | |
|
189 | <data> | |
|
190 | <variable>ProjectExplorer.Project.Target.1</variable> | |
|
191 | <valuemap type="QVariantMap"> | |
|
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> | |
|
194 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value> | |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> | |
|
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> | |
|
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44}</value> | |
|
195 | 57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
196 | 58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
197 | 59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
@@ -326,11 +188,11 | |||
|
326 | 188 | </data> |
|
327 | 189 | <data> |
|
328 | 190 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
329 |
<value type="int"> |
|
|
191 | <value type="int">1</value> | |
|
330 | 192 | </data> |
|
331 | 193 | <data> |
|
332 | 194 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
333 |
<value type="QByteArray">{ |
|
|
195 | <value type="QByteArray">{cdbf9cdc-1e84-406e-889b-c4feef49e75c}</value> | |
|
334 | 196 | </data> |
|
335 | 197 | <data> |
|
336 | 198 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
@@ -26,7 +26,8 int start_all_tasks( void ); | |||
|
26 | 26 | rtems_status_code create_message_queues( void ); |
|
27 | 27 | rtems_status_code get_message_queue_id_send( rtems_id *queue_id ); |
|
28 | 28 | rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ); |
|
29 |
rtems_status_code get_message_queue_id_ |
|
|
29 | rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ); | |
|
30 | rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); | |
|
30 | 31 | // |
|
31 | 32 | int start_recv_send_tasks( void ); |
|
32 | 33 | // |
@@ -19,12 +19,27 typedef struct ring_node | |||
|
19 | 19 | } ring_node; |
|
20 | 20 | |
|
21 | 21 | typedef struct { |
|
22 | // F0 | |
|
22 | 23 | unsigned int f0; |
|
23 | 24 | unsigned int norm_bp1_f0; |
|
24 | 25 | unsigned int norm_bp2_f0; |
|
25 | 26 | unsigned int norm_asm_f0; |
|
26 | 27 | unsigned int sbm_bp1_f0; |
|
27 | 28 | unsigned int sbm_bp2_f0; |
|
29 | // F1 | |
|
30 | unsigned int f1; | |
|
31 | unsigned int norm_bp1_f1; | |
|
32 | unsigned int norm_bp2_f1; | |
|
33 | unsigned int norm_asm_f1; | |
|
34 | unsigned int sbm_bp1_f1; | |
|
35 | unsigned int sbm_bp2_f1; | |
|
36 | // F2 | |
|
37 | unsigned int f2; | |
|
38 | unsigned int norm_bp1_f2; | |
|
39 | unsigned int norm_bp2_f2; | |
|
40 | unsigned int norm_asm_f2; | |
|
41 | unsigned int sbm_bp1_f2; | |
|
42 | unsigned int sbm_bp2_f2; | |
|
28 | 43 | } nb_sm_t; |
|
29 | 44 | |
|
30 | 45 | typedef struct { |
@@ -39,7 +54,31 typedef struct { | |||
|
39 | 54 | unsigned int sbm1_bp2_f0; |
|
40 | 55 | unsigned int sbm2_bp1_f0; |
|
41 | 56 | unsigned int sbm2_bp2_f0; |
|
42 |
} nb_sm_before_bp_ |
|
|
57 | } nb_sm_before_bp_asm_f0; | |
|
58 | ||
|
59 | typedef struct { | |
|
60 | unsigned int norm_bp1_f1; | |
|
61 | unsigned int norm_bp2_f1; | |
|
62 | unsigned int norm_asm_f1; | |
|
63 | unsigned int burst_sbm_bp1_f1; | |
|
64 | unsigned int burst_sbm_bp2_f1; | |
|
65 | unsigned int burst_bp1_f1; | |
|
66 | unsigned int burst_bp2_f1; | |
|
67 | unsigned int sbm2_bp1_f1; | |
|
68 | unsigned int sbm2_bp2_f1; | |
|
69 | } nb_sm_before_bp_asm_f1; | |
|
70 | ||
|
71 | typedef struct { | |
|
72 | unsigned int norm_bp1_f2; | |
|
73 | unsigned int norm_bp2_f2; | |
|
74 | unsigned int norm_asm_f2; | |
|
75 | unsigned int burst_sbm_bp1_f2; | |
|
76 | unsigned int burst_sbm_bp2_f2; | |
|
77 | unsigned int burst_bp1_f2; | |
|
78 | unsigned int burst_bp2_f2; | |
|
79 | unsigned int sbm2_bp1_f2; | |
|
80 | unsigned int sbm2_bp2_f2; | |
|
81 | } nb_sm_before_bp_asm_f2; | |
|
43 | 82 | |
|
44 | 83 | //************************ |
|
45 | 84 | // flight software version |
@@ -87,8 +126,18 typedef struct { | |||
|
87 | 126 | #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6 |
|
88 | 127 | #define RTEMS_EVENT_NORM_BP2_F0 RTEMS_EVENT_7 |
|
89 | 128 | #define RTEMS_EVENT_NORM_ASM_F0 RTEMS_EVENT_8 |
|
90 |
#define RTEMS_EVENT_ |
|
|
91 |
#define RTEMS_EVENT_ |
|
|
129 | #define RTEMS_EVENT_NORM_BP1_F1 RTEMS_EVENT_9 | |
|
130 | #define RTEMS_EVENT_NORM_BP2_F1 RTEMS_EVENT_10 | |
|
131 | #define RTEMS_EVENT_NORM_ASM_F1 RTEMS_EVENT_11 | |
|
132 | #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12 | |
|
133 | #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13 | |
|
134 | #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 | |
|
135 | #define RTEMS_EVENT_BURST_SBM_BP1_F0 RTEMS_EVENT_15 | |
|
136 | #define RTEMS_EVENT_BURST_SBM_BP2_F0 RTEMS_EVENT_16 | |
|
137 | #define RTEMS_EVENT_BURST_SBM_BP1_F1 RTEMS_EVENT_17 | |
|
138 | #define RTEMS_EVENT_BURST_SBM_BP2_F1 RTEMS_EVENT_18 | |
|
139 | #define RTEMS_EVENT_BURST_SBM_BP1_F2 RTEMS_EVENT_19 | |
|
140 | #define RTEMS_EVENT_BURST_SBM_BP2_F2 RTEMS_EVENT_20 | |
|
92 | 141 | |
|
93 | 142 | //**************************** |
|
94 | 143 | // LFR DEFAULT MODE PARAMETERS |
@@ -173,7 +222,7 typedef struct { | |||
|
173 | 222 | #define TASKID_WFRM 8 |
|
174 | 223 | #define TASKID_DUMB 9 |
|
175 | 224 | #define TASKID_HOUS 10 |
|
176 |
#define TASKID_ |
|
|
225 | #define TASKID_PRC0 11 | |
|
177 | 226 | #define TASKID_CWF3 12 |
|
178 | 227 | #define TASKID_CWF2 13 |
|
179 | 228 | #define TASKID_CWF1 14 |
@@ -194,21 +243,24 typedef struct { | |||
|
194 | 243 | #define TASK_PRIORITY_ACTN 50 |
|
195 | 244 | #define TASK_PRIORITY_AVF0 60 |
|
196 | 245 | #define TASK_PRIORITY_BPF0 60 |
|
197 |
#define TASK_PRIORITY_ |
|
|
246 | #define TASK_PRIORITY_PRC0 100 | |
|
198 | 247 | #define TASK_PRIORITY_STAT 200 |
|
199 | 248 | #define TASK_PRIORITY_DUMB 200 |
|
200 | 249 | |
|
201 | 250 | #define MSG_QUEUE_COUNT_RECV 10 |
|
202 |
#define MSG_QUEUE_COUNT_SEND |
|
|
203 |
#define MSG_QUEUE_COUNT_ |
|
|
251 | #define MSG_QUEUE_COUNT_SEND 50 | |
|
252 | #define MSG_QUEUE_COUNT_PRC0 10 | |
|
253 | #define MSG_QUEUE_COUNT_PRC1 10 | |
|
204 | 254 | //#define MSG_QUEUE_SIZE_SEND (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) |
|
205 | #define MSG_QUEUE_SIZE_SEND 810 // 806 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1 | |
|
255 | #define MSG_QUEUE_SIZE_SEND 810 // 806 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1 | |
|
206 | 256 | #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options |
|
207 |
#define MSG_QUEUE_SIZE_ |
|
|
257 | #define MSG_QUEUE_SIZE_PRC0 20 // two pointers and one rtems_event + 2 integers | |
|
258 | #define MSG_QUEUE_SIZE_PRC1 20 // two pointers and one rtems_event + 2 integers | |
|
208 | 259 | |
|
209 | 260 | #define QUEUE_RECV 0 |
|
210 | 261 | #define QUEUE_SEND 1 |
|
211 |
#define QUEUE_ |
|
|
262 | #define QUEUE_PRC0 2 | |
|
263 | #define QUEUE_PRC1 3 | |
|
212 | 264 | |
|
213 | 265 | //******* |
|
214 | 266 | // MACROS |
@@ -63,5 +63,6 | |||
|
63 | 63 | #define NB_SM_BEFORE_SBM2_BP2_F0 480 // 480 matrices at f0 = 5.00 second |
|
64 | 64 | // GENERAL |
|
65 | 65 | #define NB_SM_BEFORE_AVF0 8 |
|
66 | #define NB_SM_BEFORE_AVF1 8 | |
|
66 | 67 | |
|
67 | 68 | #endif // FSW_PARAMS_PROCESSING_H |
@@ -43,15 +43,17 typedef struct bp_packet_with_spare | |||
|
43 | 43 | |
|
44 | 44 | typedef struct asm_msg |
|
45 | 45 | { |
|
46 |
ring_node_asm *norm |
|
|
47 |
ring_node_asm *burst_sbm |
|
|
46 | ring_node_asm *norm; | |
|
47 | ring_node_asm *burst_sbm; | |
|
48 | 48 | rtems_event_set event; |
|
49 | 49 | unsigned int coarseTime; |
|
50 | 50 | unsigned int fineTime; |
|
51 | 51 | } asm_msg; |
|
52 | 52 | |
|
53 | 53 | extern nb_sm_t nb_sm; |
|
54 |
extern nb_sm_before_bp_ |
|
|
54 | extern nb_sm_before_bp_asm_f0 nb_sm_before_f0; | |
|
55 | extern nb_sm_before_bp_asm_f1 nb_sm_before_f1; | |
|
56 | extern nb_sm_before_bp_asm_f2 nb_sm_before_f2; | |
|
55 | 57 | |
|
56 | 58 | extern volatile int sm_f0[ ]; |
|
57 | 59 | extern volatile int sm_f1[ ]; |
@@ -75,7 +77,7 rtems_isr spectral_matrices_isr_simu( rt | |||
|
75 | 77 | // RTEMS TASKS |
|
76 | 78 | rtems_task smiq_task( rtems_task_argument argument ); // added to test the spectral matrix simulator |
|
77 | 79 | rtems_task avf0_task( rtems_task_argument lfrRequestedMode ); |
|
78 |
rtems_task |
|
|
80 | rtems_task prc0_task( rtems_task_argument lfrRequestedMode ); | |
|
79 | 81 | |
|
80 | 82 | //****************** |
|
81 | 83 | // Spectral Matrices |
@@ -115,6 +117,7 void BP_send(char *data, | |||
|
115 | 117 | void reset_spectral_matrix_regs( void ); |
|
116 | 118 | void set_time(unsigned char *time, unsigned char *timeInBuffer ); |
|
117 | 119 | |
|
118 |
extern rtems_status_code get_message_queue_id_ |
|
|
120 | extern rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ); | |
|
121 | extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); | |
|
119 | 122 | |
|
120 | 123 | #endif // FSW_PROCESSING_H_INCLUDED |
@@ -10,7 +10,9 | |||
|
10 | 10 | #include "fsw_misc.h" |
|
11 | 11 | |
|
12 | 12 | extern nb_sm_t nb_sm; |
|
13 |
extern nb_sm_before_bp_ |
|
|
13 | extern nb_sm_before_bp_asm_f0 nb_sm_before_f0; | |
|
14 | extern nb_sm_before_bp_asm_f1 nb_sm_before_f1; | |
|
15 | extern nb_sm_before_bp_asm_f2 nb_sm_before_f2; | |
|
14 | 16 | |
|
15 | 17 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); |
|
16 | 18 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
@@ -49,7 +49,9 char wf_cont_f3_light[ (NB_SAMPL | |||
|
49 | 49 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
50 | 50 | |
|
51 | 51 | nb_sm_t nb_sm; |
|
52 |
nb_sm_before_bp_ |
|
|
52 | nb_sm_before_bp_asm_f0 nb_sm_before_f0; | |
|
53 | nb_sm_before_bp_asm_f1 nb_sm_before_f1; | |
|
54 | nb_sm_before_bp_asm_f2 nb_sm_before_f2; | |
|
53 | 55 | |
|
54 | 56 | // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00 |
|
55 | 57 | volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); |
@@ -35,7 +35,7 | |||
|
35 | 35 | #define CONFIGURE_MAXIMUM_DRIVERS 16 |
|
36 | 36 | #define CONFIGURE_MAXIMUM_PERIODS 5 |
|
37 | 37 | #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s) |
|
38 |
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
|
|
38 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 4 | |
|
39 | 39 | #ifdef PRINT_STACK_REPORT |
|
40 | 40 | #define CONFIGURE_STACK_CHECKER_ENABLED |
|
41 | 41 | #endif |
@@ -86,8 +86,8 rtems_task Init( rtems_task_argument ign | |||
|
86 | 86 | PRINTF("*************************\n") |
|
87 | 87 | PRINTF("** LFR Flight Software **\n") |
|
88 | 88 | PRINTF1("** %d.", SW_VERSION_N1) |
|
89 | PRINTF1("%d.", SW_VERSION_N2) | |
|
90 | PRINTF1("%d.", SW_VERSION_N3) | |
|
89 | PRINTF1("%d." , SW_VERSION_N2) | |
|
90 | PRINTF1("%d." , SW_VERSION_N3) | |
|
91 | 91 | PRINTF1("%d **\n", SW_VERSION_N4) |
|
92 | 92 | PRINTF("*************************\n") |
|
93 | 93 | PRINTF("\n\n") |
@@ -256,7 +256,7 void create_names( void ) // create all | |||
|
256 | 256 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); |
|
257 | 257 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); |
|
258 | 258 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
259 |
Task_name[TASKID_ |
|
|
259 | Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' ); | |
|
260 | 260 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); |
|
261 | 261 | Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' ); |
|
262 | 262 | Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' ); |
@@ -268,7 +268,8 void create_names( void ) // create all | |||
|
268 | 268 | |
|
269 | 269 | misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
270 | 270 | misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
271 |
misc_name[QUEUE_ |
|
|
271 | misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' ); | |
|
272 | misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' ); | |
|
272 | 273 | } |
|
273 | 274 | |
|
274 | 275 | int create_all_tasks( void ) // create all tasks which run in the software |
@@ -351,9 +352,9 int create_all_tasks( void ) // create a | |||
|
351 | 352 | if (status == RTEMS_SUCCESSFUL) // MATR |
|
352 | 353 | { |
|
353 | 354 | status = rtems_task_create( |
|
354 |
Task_name[TASKID_ |
|
|
355 | Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2, | |
|
355 | 356 | RTEMS_DEFAULT_MODES, |
|
356 |
RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ |
|
|
357 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0] | |
|
357 | 358 | ); |
|
358 | 359 | } |
|
359 | 360 | |
@@ -507,11 +508,11 int start_all_tasks( void ) // start all | |||
|
507 | 508 | } |
|
508 | 509 | } |
|
509 | 510 | |
|
510 |
if (status == RTEMS_SUCCESSFUL) // |
|
|
511 | if (status == RTEMS_SUCCESSFUL) // PRC0 | |
|
511 | 512 | { |
|
512 |
status = rtems_task_start( Task_id[TASKID_ |
|
|
513 | status = rtems_task_start( Task_id[TASKID_PRC0], prc0_task, 1 ); | |
|
513 | 514 | if (status!=RTEMS_SUCCESSFUL) { |
|
514 |
BOOT_PRINTF("in INIT *** Error starting TASK_ |
|
|
515 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC0\n") | |
|
515 | 516 | } |
|
516 | 517 | } |
|
517 | 518 | |
@@ -612,15 +613,24 rtems_status_code create_message_queues( | |||
|
612 | 613 | PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send) |
|
613 | 614 | } |
|
614 | 615 | |
|
615 | //************************************************************************ | |
|
616 | // create the queue for handling averaged spectral matrices for processing | |
|
617 |
status_matr = rtems_message_queue_create( misc_name[QUEUE_ |
|
|
618 |
MSG_QUEUE_COUNT_ |
|
|
616 | //***************************************************************************** | |
|
617 | // create the queue for handling averaged spectral matrices for processing @ f0 | |
|
618 | status_matr = rtems_message_queue_create( misc_name[QUEUE_PRC0], | |
|
619 | MSG_QUEUE_COUNT_PRC0, MSG_QUEUE_SIZE_PRC0, | |
|
619 | 620 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
620 | 621 | if ( status_send != RTEMS_SUCCESSFUL ) { |
|
621 |
PRINTF1("in create_message_queues *** ERR creating |
|
|
622 | PRINTF1("in create_message_queues *** ERR creating PR_0 queue, %d\n", status_matr) | |
|
622 | 623 | } |
|
623 | 624 | |
|
625 | //***************************************************************************** | |
|
626 | // create the queue for handling averaged spectral matrices for processing @ f1 | |
|
627 | // status_matr = rtems_message_queue_create( misc_name[QUEUE_PRC1], | |
|
628 | // MSG_QUEUE_COUNT_PRC1, MSG_QUEUE_SIZE_PRC1, | |
|
629 | // RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
|
630 | // if ( status_send != RTEMS_SUCCESSFUL ) { | |
|
631 | // PRINTF1("in create_message_queues *** ERR creating PR_1 queue, %d\n", status_matr) | |
|
632 | // } | |
|
633 | ||
|
624 | 634 | if ( status_recv != RTEMS_SUCCESSFUL ) |
|
625 | 635 | { |
|
626 | 636 | ret = status_recv; |
@@ -661,14 +671,26 rtems_status_code get_message_queue_id_r | |||
|
661 | 671 | return status; |
|
662 | 672 | } |
|
663 | 673 | |
|
664 |
rtems_status_code get_message_queue_id_ |
|
|
674 | rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ) | |
|
665 | 675 | { |
|
666 | 676 | rtems_status_code status; |
|
667 | 677 | rtems_name queue_name; |
|
668 | 678 | |
|
669 |
queue_name = rtems_build_name( 'Q', '_', ' |
|
|
679 | queue_name = rtems_build_name( 'Q', '_', 'P', '0' ); | |
|
670 | 680 | |
|
671 | 681 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
672 | 682 | |
|
673 | 683 | return status; |
|
674 | 684 | } |
|
685 | ||
|
686 | rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ) | |
|
687 | { | |
|
688 | rtems_status_code status; | |
|
689 | rtems_name queue_name; | |
|
690 | ||
|
691 | queue_name = rtems_build_name( 'Q', '_', 'P', '1' ); | |
|
692 | ||
|
693 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
|
694 | ||
|
695 | return status; | |
|
696 | } |
This diff has been collapsed as it changes many lines, (525 lines changed) Show them Hide them | |||
@@ -17,14 +17,17 ring_node_sm sm_ring_f0[ NB_RING_NODES_S | |||
|
17 | 17 | ring_node_sm sm_ring_f1[ NB_RING_NODES_SM_F1 ]; |
|
18 | 18 | ring_node_sm sm_ring_f2[ NB_RING_NODES_SM_F2 ]; |
|
19 | 19 | ring_node_sm *current_ring_node_sm_f0; |
|
20 | ring_node_sm *ring_node_for_averaging_sm_f0; | |
|
21 | 20 | ring_node_sm *current_ring_node_sm_f1; |
|
22 | 21 | ring_node_sm *current_ring_node_sm_f2; |
|
22 | ring_node_sm *ring_node_for_averaging_sm_f0; | |
|
23 | ring_node_sm *ring_node_for_averaging_sm_f1; | |
|
23 | 24 | |
|
24 | 25 | ring_node_asm asm_ring_burst_sbm_f0[ NB_RING_NODES_ASM_BURST_SBM_F0 ]; |
|
25 | 26 | ring_node_asm asm_ring_norm_f0 [ NB_RING_NODES_ASM_BURST_SBM_F0 ]; |
|
26 | 27 | ring_node_asm *current_ring_node_asm_burst_sbm_f0; |
|
28 | ring_node_asm *current_ring_node_asm_burst_sbm_f1; | |
|
27 | 29 | ring_node_asm *current_ring_node_asm_norm_f0; |
|
30 | ring_node_asm *current_ring_node_asm_norm_f1; | |
|
28 | 31 | |
|
29 | 32 | float asm_norm_f0 [ TOTAL_SIZE_SM ]; |
|
30 | 33 | float asm_f0_reorganized [ TOTAL_SIZE_SM ]; |
@@ -43,35 +46,103 void reset_nb_sm_f0( unsigned char lfrMo | |||
|
43 | 46 | nb_sm.sbm_bp1_f0 = 0; |
|
44 | 47 | nb_sm.sbm_bp2_f0 = 0; |
|
45 | 48 | |
|
46 |
nb_sm_before_ |
|
|
47 |
nb_sm_before_ |
|
|
48 |
nb_sm_before_ |
|
|
49 |
nb_sm_before_ |
|
|
50 |
nb_sm_before_ |
|
|
51 |
nb_sm_before_ |
|
|
52 |
nb_sm_before_ |
|
|
53 |
nb_sm_before_ |
|
|
54 |
nb_sm_before_ |
|
|
49 | nb_sm_before_f0.norm_bp1_f0 = parameter_dump_packet.sy_lfr_n_bp_p0 * 96; | |
|
50 | nb_sm_before_f0.norm_bp2_f0 = parameter_dump_packet.sy_lfr_n_bp_p1 * 96; | |
|
51 | nb_sm_before_f0.norm_asm_f0 = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 96; | |
|
52 | nb_sm_before_f0.sbm1_bp1_f0 = parameter_dump_packet.sy_lfr_s1_bp_p0 * 24; | |
|
53 | nb_sm_before_f0.sbm1_bp2_f0 = parameter_dump_packet.sy_lfr_s1_bp_p1 * 96; | |
|
54 | nb_sm_before_f0.sbm2_bp1_f0 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 96; | |
|
55 | nb_sm_before_f0.sbm2_bp2_f0 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 96; | |
|
56 | nb_sm_before_f0.burst_bp1_f0 = parameter_dump_packet.sy_lfr_b_bp_p0 * 96; | |
|
57 | nb_sm_before_f0.burst_bp2_f0 = parameter_dump_packet.sy_lfr_b_bp_p1 * 96; | |
|
55 | 58 | |
|
56 | 59 | if (lfrMode == LFR_MODE_SBM1) |
|
57 | 60 | { |
|
58 |
nb_sm_before_ |
|
|
59 |
nb_sm_before_ |
|
|
61 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm1_bp1_f0; | |
|
62 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm1_bp2_f0; | |
|
60 | 63 | } |
|
61 | 64 | else if (lfrMode == LFR_MODE_SBM2) |
|
62 | 65 | { |
|
63 |
nb_sm_before_ |
|
|
64 |
nb_sm_before_ |
|
|
66 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm2_bp1_f0; | |
|
67 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm2_bp2_f0; | |
|
68 | } | |
|
69 | else if (lfrMode == LFR_MODE_BURST) | |
|
70 | { | |
|
71 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0; | |
|
72 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0; | |
|
73 | } | |
|
74 | else | |
|
75 | { | |
|
76 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0; | |
|
77 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0; | |
|
78 | } | |
|
79 | } | |
|
80 | ||
|
81 | void reset_nb_sm_f1( unsigned char lfrMode ) | |
|
82 | { | |
|
83 | nb_sm.f1 = 0; | |
|
84 | nb_sm.norm_bp1_f1 = 0; | |
|
85 | nb_sm.norm_bp2_f1 = 0; | |
|
86 | nb_sm.norm_asm_f1 = 0; | |
|
87 | nb_sm.sbm_bp1_f1 = 0; | |
|
88 | nb_sm.sbm_bp2_f1 = 0; | |
|
89 | ||
|
90 | nb_sm_before_f1.norm_bp1_f1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 16; | |
|
91 | nb_sm_before_f1.norm_bp2_f1 = parameter_dump_packet.sy_lfr_n_bp_p1 * 16; | |
|
92 | nb_sm_before_f1.norm_asm_f1 = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 16; | |
|
93 | nb_sm_before_f1.sbm2_bp1_f1 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 16; | |
|
94 | nb_sm_before_f1.sbm2_bp2_f1 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 16; | |
|
95 | nb_sm_before_f1.burst_bp1_f1 = parameter_dump_packet.sy_lfr_b_bp_p0 * 16; | |
|
96 | nb_sm_before_f1.burst_bp2_f1 = parameter_dump_packet.sy_lfr_b_bp_p1 * 16; | |
|
97 | ||
|
98 | if (lfrMode == LFR_MODE_SBM2) | |
|
99 | { | |
|
100 | nb_sm_before_f1.burst_sbm_bp1_f1 = nb_sm_before_f1.sbm2_bp1_f1; | |
|
101 | nb_sm_before_f1.burst_sbm_bp2_f1 = nb_sm_before_f1.sbm2_bp2_f1; | |
|
65 | 102 | } |
|
66 | 103 | else if (lfrMode == LFR_MODE_BURST) |
|
67 | 104 | { |
|
68 |
nb_sm_before_ |
|
|
69 |
nb_sm_before_ |
|
|
105 | nb_sm_before_f1.burst_sbm_bp1_f1 = nb_sm_before_f1.burst_bp1_f1; | |
|
106 | nb_sm_before_f1.burst_sbm_bp2_f1 = nb_sm_before_f1.burst_bp2_f1; | |
|
70 | 107 | } |
|
71 | 108 | else |
|
72 | 109 | { |
|
73 |
nb_sm_before_ |
|
|
74 |
nb_sm_before_ |
|
|
110 | nb_sm_before_f1.burst_sbm_bp1_f1 = nb_sm_before_f1.burst_bp1_f1; | |
|
111 | nb_sm_before_f1.burst_sbm_bp2_f1 = nb_sm_before_f1.burst_bp2_f1; | |
|
112 | } | |
|
113 | } | |
|
114 | ||
|
115 | void reset_nb_sm_f2( unsigned char lfrMode ) | |
|
116 | { | |
|
117 | nb_sm.f2 = 0; | |
|
118 | nb_sm.norm_bp1_f2 = 0; | |
|
119 | nb_sm.norm_bp2_f2 = 0; | |
|
120 | nb_sm.norm_asm_f2 = 0; | |
|
121 | nb_sm.sbm_bp1_f2 = 0; | |
|
122 | nb_sm.sbm_bp2_f2 = 0; | |
|
123 | ||
|
124 | nb_sm_before_f2.norm_bp1_f2 = parameter_dump_packet.sy_lfr_n_bp_p0; | |
|
125 | nb_sm_before_f2.norm_bp2_f2 = parameter_dump_packet.sy_lfr_n_bp_p1; | |
|
126 | nb_sm_before_f2.norm_asm_f2 = parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]; | |
|
127 | nb_sm_before_f2.sbm2_bp1_f2 = parameter_dump_packet.sy_lfr_s2_bp_p0; | |
|
128 | nb_sm_before_f2.sbm2_bp2_f2 = parameter_dump_packet.sy_lfr_s2_bp_p1; | |
|
129 | nb_sm_before_f2.burst_bp1_f2 = parameter_dump_packet.sy_lfr_b_bp_p0; | |
|
130 | nb_sm_before_f2.burst_bp2_f2 = parameter_dump_packet.sy_lfr_b_bp_p1; | |
|
131 | ||
|
132 | if (lfrMode == LFR_MODE_SBM2) | |
|
133 | { | |
|
134 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.sbm2_bp1_f2; | |
|
135 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.sbm2_bp2_f2; | |
|
136 | } | |
|
137 | else if (lfrMode == LFR_MODE_BURST) | |
|
138 | { | |
|
139 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.burst_bp1_f2; | |
|
140 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.burst_bp2_f2; | |
|
141 | } | |
|
142 | else | |
|
143 | { | |
|
144 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.burst_bp1_f2; | |
|
145 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.burst_bp2_f2; | |
|
75 | 146 | } |
|
76 | 147 | } |
|
77 | 148 | |
@@ -152,7 +223,7 rtems_task avf0_task( rtems_task_argumen | |||
|
152 | 223 | |
|
153 | 224 | rtems_event_set event_out; |
|
154 | 225 | rtems_status_code status; |
|
155 |
rtems_id queue_id_ |
|
|
226 | rtems_id queue_id_prc0; | |
|
156 | 227 | asm_msg msgForMATR; |
|
157 | 228 | ring_node_sm *ring_node_tab[8]; |
|
158 | 229 | |
@@ -160,10 +231,10 rtems_task avf0_task( rtems_task_argumen | |||
|
160 | 231 | |
|
161 | 232 | BOOT_PRINTF1("in AVFO *** lfrRequestedMode = %d\n", lfrRequestedMode) |
|
162 | 233 | |
|
163 |
status = get_message_queue_id_ |
|
|
234 | status = get_message_queue_id_prc0( &queue_id_prc0 ); | |
|
164 | 235 | if (status != RTEMS_SUCCESSFUL) |
|
165 | 236 | { |
|
166 |
PRINTF1("in MATR *** ERR get_message_queue_id_ |
|
|
237 | PRINTF1("in MATR *** ERR get_message_queue_id_prc0 %d\n", status) | |
|
167 | 238 | } |
|
168 | 239 | |
|
169 | 240 | while(1){ |
@@ -190,13 +261,13 rtems_task avf0_task( rtems_task_argumen | |||
|
190 | 261 | |
|
191 | 262 | //**************************************** |
|
192 | 263 | // initialize the mesage for the MATR task |
|
193 |
msgForMATR.event |
|
|
194 |
msgForMATR.burst_sbm |
|
|
195 |
msgForMATR.norm |
|
|
196 |
msgForMATR.coarseTime |
|
|
197 |
msgForMATR.fineTime |
|
|
264 | msgForMATR.event = 0x00; // this composite event will be sent to the MATR task | |
|
265 | msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f0; | |
|
266 | msgForMATR.norm = current_ring_node_asm_norm_f0; | |
|
267 | msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; | |
|
268 | msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; | |
|
198 | 269 | |
|
199 |
if (nb_sm.sbm_bp1_f0 == nb_sm_before_ |
|
|
270 | if (nb_sm.sbm_bp1_f0 == nb_sm_before_f0.burst_sbm_bp1_f0) | |
|
200 | 271 | { |
|
201 | 272 | nb_sm.sbm_bp1_f0 = 0; |
|
202 | 273 | // set another ring for the ASM storage |
@@ -208,7 +279,7 rtems_task avf0_task( rtems_task_argumen | |||
|
208 | 279 | } |
|
209 | 280 | } |
|
210 | 281 | |
|
211 |
if (nb_sm.sbm_bp2_f0 == nb_sm_before_ |
|
|
282 | if (nb_sm.sbm_bp2_f0 == nb_sm_before_f0.burst_sbm_bp2_f0) | |
|
212 | 283 | { |
|
213 | 284 | nb_sm.sbm_bp2_f0 = 0; |
|
214 | 285 | if ( (lfrCurrentMode == LFR_MODE_BURST) |
@@ -218,18 +289,19 rtems_task avf0_task( rtems_task_argumen | |||
|
218 | 289 | } |
|
219 | 290 | } |
|
220 | 291 | |
|
221 |
if (nb_sm.norm_bp1_f0 == nb_sm_before_ |
|
|
292 | if (nb_sm.norm_bp1_f0 == nb_sm_before_f0.norm_bp1_f0) | |
|
222 | 293 | { |
|
223 | 294 | nb_sm.norm_bp1_f0 = 0; |
|
224 | 295 | // set another ring for the ASM storage |
|
225 | 296 | current_ring_node_asm_norm_f0 = current_ring_node_asm_norm_f0->next; |
|
226 | if (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
297 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
298 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
227 | 299 | { |
|
228 | 300 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; |
|
229 | 301 | } |
|
230 | 302 | } |
|
231 | 303 | |
|
232 |
if (nb_sm.norm_bp2_f0 == nb_sm_before_ |
|
|
304 | if (nb_sm.norm_bp2_f0 == nb_sm_before_f0.norm_bp2_f0) | |
|
233 | 305 | { |
|
234 | 306 | nb_sm.norm_bp2_f0 = 0; |
|
235 | 307 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
@@ -239,7 +311,7 rtems_task avf0_task( rtems_task_argumen | |||
|
239 | 311 | } |
|
240 | 312 | } |
|
241 | 313 | |
|
242 |
if (nb_sm.norm_asm_f0 == nb_sm_before_ |
|
|
314 | if (nb_sm.norm_asm_f0 == nb_sm_before_f0.norm_asm_f0) | |
|
243 | 315 | { |
|
244 | 316 | nb_sm.norm_asm_f0 = 0; |
|
245 | 317 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
@@ -254,7 +326,7 rtems_task avf0_task( rtems_task_argumen | |||
|
254 | 326 | // send the message to MATR |
|
255 | 327 | if (msgForMATR.event != 0x00) |
|
256 | 328 | { |
|
257 |
status = rtems_message_queue_send( queue_id_ |
|
|
329 | status = rtems_message_queue_send( queue_id_prc0, (char *) & msgForMATR, MSG_QUEUE_SIZE_PRC0); | |
|
258 | 330 | } |
|
259 | 331 | |
|
260 | 332 | if (status != RTEMS_SUCCESSFUL) { |
@@ -263,165 +335,280 rtems_task avf0_task( rtems_task_argumen | |||
|
263 | 335 | } |
|
264 | 336 | } |
|
265 | 337 | |
|
266 |
rtems_task |
|
|
338 | rtems_task prc0_task( rtems_task_argument lfrRequestedMode ) | |
|
267 | 339 | { |
|
268 | char incomingData[MSG_QUEUE_SIZE_SEND]; // incoming data buffer | |
|
269 | size_t size; // size of the incoming TC packet | |
|
270 | asm_msg *incomingMsg; | |
|
271 | // | |
|
272 | spw_ioctl_pkt_send spw_ioctl_send_ASM; | |
|
273 | rtems_status_code status; | |
|
274 | rtems_id queue_id; | |
|
275 | rtems_id queue_id_matr; | |
|
276 | Header_TM_LFR_SCIENCE_ASM_t headerASM; | |
|
277 | bp_packet_with_spare current_node_norm_bp1_f0; | |
|
278 | bp_packet current_node_norm_bp2_f0; | |
|
279 | bp_packet current_node_sbm_bp1_f0; | |
|
280 | bp_packet current_node_sbm_bp2_f0; | |
|
340 | // char incomingData[MSG_QUEUE_SIZE_SEND]; // incoming data buffer | |
|
341 | // size_t size; // size of the incoming TC packet | |
|
342 | // asm_msg *incomingMsg; | |
|
343 | // // | |
|
344 | // spw_ioctl_pkt_send spw_ioctl_send_ASM; | |
|
345 | // rtems_status_code status; | |
|
346 | // rtems_id queue_id; | |
|
347 | // rtems_id queue_id_matr; | |
|
348 | // Header_TM_LFR_SCIENCE_ASM_t headerASM; | |
|
349 | // bp_packet_with_spare current_node_norm_bp1_f0; | |
|
350 | // bp_packet current_node_norm_bp2_f0; | |
|
351 | // bp_packet current_node_sbm_bp1_f0; | |
|
352 | // bp_packet current_node_sbm_bp2_f0; | |
|
353 | ||
|
354 | // unsigned long long int localTime; | |
|
355 | ||
|
356 | // ASM_init_header( &headerASM ); | |
|
357 | ||
|
358 | // //************* | |
|
359 | // // NORM headers | |
|
360 | // BP_init_header_with_spare( ¤t_node_norm_bp1_f0.header, | |
|
361 | // APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP1_F0, | |
|
362 | // PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0, NB_BINS_COMPRESSED_SM_F0 ); | |
|
363 | // BP_init_header( ¤t_node_norm_bp2_f0.header, | |
|
364 | // APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP2_F0, | |
|
365 | // PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0, NB_BINS_COMPRESSED_SM_F0); | |
|
281 | 366 | |
|
282 | unsigned long long int localTime; | |
|
283 | ||
|
284 | ASM_init_header( &headerASM ); | |
|
367 | // //**************************** | |
|
368 | // // BURST SBM1 and SBM2 headers | |
|
369 | // if ( (lfrRequestedMode == LFR_MODE_BURST) | |
|
370 | // || (lfrRequestedMode == LFR_MODE_NORMAL) || (lfrRequestedMode == LFR_MODE_STANDBY) ) | |
|
371 | // { | |
|
372 | // BP_init_header( ¤t_node_sbm_bp1_f0.header, | |
|
373 | // APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP1_F0, | |
|
374 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
375 | // BP_init_header( ¤t_node_sbm_bp2_f0.header, | |
|
376 | // APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP2_F0, | |
|
377 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
378 | // } | |
|
379 | // else if ( lfrRequestedMode == LFR_MODE_SBM1 ) | |
|
380 | // { | |
|
381 | // BP_init_header( ¤t_node_sbm_bp1_f0.header, | |
|
382 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP1_F0, | |
|
383 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
384 | // BP_init_header( ¤t_node_sbm_bp2_f0.header, | |
|
385 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP2_F0, | |
|
386 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
387 | // } | |
|
388 | // else if ( lfrRequestedMode == LFR_MODE_SBM2 ) | |
|
389 | // { | |
|
390 | // BP_init_header( ¤t_node_sbm_bp1_f0.header, | |
|
391 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP1_F0, | |
|
392 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
393 | // BP_init_header( ¤t_node_sbm_bp2_f0.header, | |
|
394 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP2_F0, | |
|
395 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
396 | // } | |
|
397 | // else | |
|
398 | // { | |
|
399 | // PRINTF1("ERR *** in MATR *** unexpected lfrRequestedMode passed as argument = %d\n", (unsigned int) lfrRequestedMode) | |
|
400 | // } | |
|
285 | 401 | |
|
286 | //************* | |
|
287 | // NORM headers | |
|
288 | BP_init_header_with_spare( ¤t_node_norm_bp1_f0.header, | |
|
289 | APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP1_F0, | |
|
290 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0, NB_BINS_COMPRESSED_SM_F0 ); | |
|
291 | BP_init_header( ¤t_node_norm_bp2_f0.header, | |
|
292 | APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP2_F0, | |
|
293 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0, NB_BINS_COMPRESSED_SM_F0); | |
|
402 | // status = get_message_queue_id_send( &queue_id ); | |
|
403 | // if (status != RTEMS_SUCCESSFUL) | |
|
404 | // { | |
|
405 | // PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status) | |
|
406 | // } | |
|
407 | // status = get_message_queue_id_prc0( &queue_id_matr); | |
|
408 | // if (status != RTEMS_SUCCESSFUL) | |
|
409 | // { | |
|
410 | // PRINTF1("in MATR *** ERR get_message_queue_id_prc0 %d\n", status) | |
|
411 | // } | |
|
412 | ||
|
413 | // BOOT_PRINTF1("in PRC0 *** lfrRequestedMode = %d\n", lfrRequestedMode) | |
|
414 | ||
|
415 | // while(1){ | |
|
416 | // status = rtems_message_queue_receive( queue_id_matr, incomingData, &size, //************************************ | |
|
417 | // RTEMS_WAIT, RTEMS_NO_TIMEOUT ); // wait for a message coming from AVF0 | |
|
418 | ||
|
419 | // incomingMsg = (asm_msg*) incomingData; | |
|
294 | 420 | |
|
295 | //**************************** | |
|
296 | // BURST SBM1 and SBM2 headers | |
|
297 | if ( (lfrRequestedMode == LFR_MODE_BURST) | |
|
298 | || (lfrRequestedMode == LFR_MODE_NORMAL) || (lfrRequestedMode == LFR_MODE_STANDBY) ) | |
|
299 | { | |
|
300 | BP_init_header( ¤t_node_sbm_bp1_f0.header, | |
|
301 | APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP1_F0, | |
|
302 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
303 | BP_init_header( ¤t_node_sbm_bp2_f0.header, | |
|
304 | APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP2_F0, | |
|
305 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
306 | } | |
|
307 | else if ( lfrRequestedMode == LFR_MODE_SBM1 ) | |
|
421 | // localTime = getTimeAsUnsignedLongLongInt( ); | |
|
422 | // //**************** | |
|
423 | // //**************** | |
|
424 | // // BURST SBM1 SBM2 | |
|
425 | // //**************** | |
|
426 | // //**************** | |
|
427 | // if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 ) | |
|
428 | // { | |
|
429 | // // 1) compress the matrix for Basic Parameters calculation | |
|
430 | // ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm, | |
|
431 | // nb_sm_before_f0.burst_sbm_bp1_f0, | |
|
432 | // NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0, | |
|
433 | // ASM_F0_INDICE_START); | |
|
434 | // // 2) compute the BP1 set | |
|
435 | ||
|
436 | // // 3) send the BP1 set | |
|
437 | // set_time( current_node_sbm_bp1_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
438 | // set_time( current_node_sbm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
439 | // BP_send( (char *) ¤t_node_sbm_bp1_f0.header, queue_id, | |
|
440 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 + PACKET_LENGTH_DELTA); | |
|
441 | // // 4) compute the BP2 set if needed | |
|
442 | // if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F0 ) | |
|
443 | // { | |
|
444 | // // 1) compute the BP2 set | |
|
445 | ||
|
446 | // // 2) send the BP2 set | |
|
447 | // set_time( current_node_sbm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
448 | // set_time( current_node_sbm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
449 | // BP_send( (char *) ¤t_node_sbm_bp2_f0.header, queue_id, | |
|
450 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 + PACKET_LENGTH_DELTA); | |
|
451 | // } | |
|
452 | // } | |
|
453 | ||
|
454 | // //***** | |
|
455 | // //***** | |
|
456 | // // NORM | |
|
457 | // //***** | |
|
458 | // //***** | |
|
459 | // if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F0) | |
|
460 | // { | |
|
461 | // // 1) compress the matrix for Basic Parameters calculation | |
|
462 | // ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0, | |
|
463 | // nb_sm_before_f0.norm_bp1_f0, | |
|
464 | // NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0, | |
|
465 | // ASM_F0_INDICE_START ); | |
|
466 | // // 2) compute the BP1 set | |
|
467 | ||
|
468 | // // 3) send the BP1 set | |
|
469 | // set_time( current_node_norm_bp1_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
470 | // set_time( current_node_norm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
471 | // BP_send( (char *) ¤t_node_norm_bp1_f0.header, queue_id, | |
|
472 | // PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 + PACKET_LENGTH_DELTA); | |
|
473 | // if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F0) | |
|
474 | // { | |
|
475 | // // 1) compute the BP2 set | |
|
476 | ||
|
477 | // // 2) send the BP2 set | |
|
478 | // set_time( current_node_norm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
479 | // set_time( current_node_norm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
480 | // BP_send( (char *) ¤t_node_norm_bp2_f0.header, queue_id, | |
|
481 | // PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 + PACKET_LENGTH_DELTA); | |
|
482 | // } | |
|
483 | // } | |
|
484 | ||
|
485 | // if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F0) | |
|
486 | // { | |
|
487 | // // 1) reorganize the ASM and divide | |
|
488 | // ASM_reorganize_and_divide( incomingMsg->norm->matrix, asm_f0_reorganized, NB_SM_BEFORE_NORM_BP1_F0 ); | |
|
489 | // // 2) convert the float array in a char array | |
|
490 | // ASM_convert( asm_f0_reorganized, asm_f0_char); | |
|
491 | // // 3) send the spectral matrix packets | |
|
492 | // set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime ); | |
|
493 | // set_time( headerASM.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
|
494 | // ASM_send( &headerASM, asm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); | |
|
495 | // } | |
|
496 | ||
|
497 | // } | |
|
498 | } | |
|
499 | ||
|
500 | rtems_task avf1_task( rtems_task_argument lfrRequestedMode ) | |
|
501 | { | |
|
502 | int i; | |
|
503 | ||
|
504 | rtems_event_set event_out; | |
|
505 | rtems_status_code status; | |
|
506 | rtems_id queue_id_prc1; | |
|
507 | asm_msg msgForMATR; | |
|
508 | ring_node_sm *ring_node_tab[8]; | |
|
509 | ||
|
510 | reset_nb_sm_f1( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions | |
|
511 | ||
|
512 | BOOT_PRINTF1("in AVF1 *** lfrRequestedMode = %d\n", lfrRequestedMode) | |
|
513 | ||
|
514 | status = get_message_queue_id_prc1( &queue_id_prc1 ); | |
|
515 | if (status != RTEMS_SUCCESSFUL) | |
|
308 | 516 | { |
|
309 | BP_init_header( ¤t_node_sbm_bp1_f0.header, | |
|
310 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP1_F0, | |
|
311 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
312 | BP_init_header( ¤t_node_sbm_bp2_f0.header, | |
|
313 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP2_F0, | |
|
314 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
315 | } | |
|
316 | else if ( lfrRequestedMode == LFR_MODE_SBM2 ) | |
|
317 | { | |
|
318 | BP_init_header( ¤t_node_sbm_bp1_f0.header, | |
|
319 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP1_F0, | |
|
320 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
321 | BP_init_header( ¤t_node_sbm_bp2_f0.header, | |
|
322 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP2_F0, | |
|
323 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
|
324 | } | |
|
325 | else | |
|
326 | { | |
|
327 | PRINTF1("ERR *** in MATR *** unexpected lfrRequestedMode passed as argument = %d\n", (unsigned int) lfrRequestedMode) | |
|
517 | PRINTF1("in MATR *** ERR get_message_queue_id_prc0 %d\n", status) | |
|
328 | 518 | } |
|
329 | 519 | |
|
330 | status = get_message_queue_id_send( &queue_id ); | |
|
331 | if (status != RTEMS_SUCCESSFUL) | |
|
332 | { | |
|
333 | PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status) | |
|
334 | } | |
|
335 | status = get_message_queue_id_matr( &queue_id_matr); | |
|
336 | if (status != RTEMS_SUCCESSFUL) | |
|
337 | { | |
|
338 | PRINTF1("in MATR *** ERR get_message_queue_id_matr %d\n", status) | |
|
339 | } | |
|
520 | while(1){ | |
|
521 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 | |
|
522 | ring_node_tab[NB_SM_BEFORE_AVF1-1] = ring_node_for_averaging_sm_f1; | |
|
523 | for ( i = 2; i < (NB_SM_BEFORE_AVF1+1); i++ ) | |
|
524 | { | |
|
525 | ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous; | |
|
526 | ring_node_tab[NB_SM_BEFORE_AVF1-i] = ring_node_for_averaging_sm_f0; | |
|
527 | } | |
|
340 | 528 | |
|
341 | BOOT_PRINTF1("in MATR *** lfrRequestedMode = %d\n", lfrRequestedMode) | |
|
342 | ||
|
343 | while(1){ | |
|
344 | status = rtems_message_queue_receive( queue_id_matr, incomingData, &size, //************************************ | |
|
345 | RTEMS_WAIT, RTEMS_NO_TIMEOUT ); // wait for a message coming from AVF0 | |
|
346 | ||
|
347 | incomingMsg = (asm_msg*) incomingData; | |
|
529 | // compute the average and store it in the averaged_sm_f1 buffer | |
|
530 | SM_average( current_ring_node_asm_norm_f1->matrix, | |
|
531 | current_ring_node_asm_burst_sbm_f1->matrix, | |
|
532 | ring_node_tab, | |
|
533 | nb_sm.norm_bp1_f1, nb_sm.sbm_bp1_f1 ); | |
|
348 | 534 | |
|
349 | localTime = getTimeAsUnsignedLongLongInt( ); | |
|
350 | //**************** | |
|
351 | //**************** | |
|
352 | // BURST SBM1 SBM2 | |
|
353 | //**************** | |
|
354 | //**************** | |
|
355 | if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 ) | |
|
356 | { | |
|
357 | // 1) compress the matrix for Basic Parameters calculation | |
|
358 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbmf0->matrix, compressed_sm_sbm, | |
|
359 | nb_sm_before_bp.burst_sbm_bp1_f0, | |
|
360 | NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0, | |
|
361 | ASM_F0_INDICE_START); | |
|
362 | // 2) compute the BP1 set | |
|
535 | // update nb_average | |
|
536 | nb_sm.norm_bp1_f1 = nb_sm.norm_bp1_f1 + NB_SM_BEFORE_AVF1; | |
|
537 | nb_sm.norm_bp2_f1 = nb_sm.norm_bp2_f1 + NB_SM_BEFORE_AVF1; | |
|
538 | nb_sm.norm_asm_f1 = nb_sm.norm_asm_f1 + NB_SM_BEFORE_AVF1; | |
|
539 | nb_sm.sbm_bp1_f1 = nb_sm.sbm_bp1_f1 + NB_SM_BEFORE_AVF1; | |
|
540 | nb_sm.sbm_bp2_f1 = nb_sm.sbm_bp2_f1 + NB_SM_BEFORE_AVF1; | |
|
363 | 541 | |
|
364 | // 3) send the BP1 set | |
|
365 | set_time( current_node_sbm_bp1_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
366 | set_time( current_node_sbm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
367 | BP_send( (char *) ¤t_node_sbm_bp1_f0.header, queue_id, | |
|
368 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 + PACKET_LENGTH_DELTA); | |
|
369 | // 4) compute the BP2 set if needed | |
|
370 | if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F0 ) | |
|
542 | //**************************************** | |
|
543 | // initialize the mesage for the MATR task | |
|
544 | msgForMATR.event = 0x00; // this composite event will be sent to the MATR task | |
|
545 | msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f1; | |
|
546 | msgForMATR.norm = current_ring_node_asm_norm_f1; | |
|
547 | msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; | |
|
548 | msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; | |
|
549 | ||
|
550 | if (nb_sm.sbm_bp1_f1 == nb_sm_before_f1.burst_sbm_bp1_f1) | |
|
551 | { | |
|
552 | nb_sm.sbm_bp1_f0 = 0; | |
|
553 | // set another ring for the ASM storage | |
|
554 | current_ring_node_asm_burst_sbm_f0 = current_ring_node_asm_burst_sbm_f0->next; | |
|
555 | if ( (lfrCurrentMode == LFR_MODE_BURST) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
371 | 556 | { |
|
372 | // 1) compute the BP2 set | |
|
373 | ||
|
374 | // 2) send the BP2 set | |
|
375 | set_time( current_node_sbm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
376 | set_time( current_node_sbm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
377 | BP_send( (char *) ¤t_node_sbm_bp2_f0.header, queue_id, | |
|
378 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 + PACKET_LENGTH_DELTA); | |
|
557 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP1_F1; | |
|
379 | 558 | } |
|
380 | 559 | } |
|
381 | 560 | |
|
382 | //***** | |
|
383 | //***** | |
|
384 | // NORM | |
|
385 | //***** | |
|
386 | //***** | |
|
387 | if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F0) | |
|
561 | if (nb_sm.sbm_bp2_f1 == nb_sm_before_f1.burst_sbm_bp2_f1) | |
|
388 | 562 | { |
|
389 | // 1) compress the matrix for Basic Parameters calculation | |
|
390 | ASM_compress_reorganize_and_divide( incomingMsg->norm_f0->matrix, compressed_sm_norm_f0, | |
|
391 | nb_sm_before_bp.norm_bp1_f0, | |
|
392 | NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0, | |
|
393 | ASM_F0_INDICE_START ); | |
|
394 | // 2) compute the BP1 set | |
|
563 | nb_sm.sbm_bp2_f0 = 0; | |
|
564 | if ( (lfrCurrentMode == LFR_MODE_BURST) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
565 | { | |
|
566 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP2_F1; | |
|
567 | } | |
|
568 | } | |
|
395 | 569 | |
|
396 | // 3) send the BP1 set | |
|
397 | set_time( current_node_norm_bp1_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
398 | set_time( current_node_norm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
399 | BP_send( (char *) ¤t_node_norm_bp1_f0.header, queue_id, | |
|
400 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 + PACKET_LENGTH_DELTA); | |
|
401 | if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F0) | |
|
570 | if (nb_sm.norm_bp1_f1 == nb_sm_before_f1.norm_bp1_f1) | |
|
571 | { | |
|
572 | nb_sm.norm_bp1_f0 = 0; | |
|
573 | // set another ring for the ASM storage | |
|
574 | current_ring_node_asm_norm_f0 = current_ring_node_asm_norm_f0->next; | |
|
575 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
576 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
402 | 577 | { |
|
403 | // 1) compute the BP2 set | |
|
404 | ||
|
405 | // 2) send the BP2 set | |
|
406 | set_time( current_node_norm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
|
407 | set_time( current_node_norm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
|
408 | BP_send( (char *) ¤t_node_norm_bp2_f0.header, queue_id, | |
|
409 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 + PACKET_LENGTH_DELTA); | |
|
578 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; | |
|
410 | 579 | } |
|
411 | 580 | } |
|
412 | 581 | |
|
413 | if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F0) | |
|
582 | if (nb_sm.norm_bp2_f1 == nb_sm_before_f1.norm_bp2_f1) | |
|
414 | 583 | { |
|
415 | // 1) reorganize the ASM and divide | |
|
416 | ASM_reorganize_and_divide( incomingMsg->norm_f0->matrix, asm_f0_reorganized, NB_SM_BEFORE_NORM_BP1_F0 ); | |
|
417 | // 2) convert the float array in a char array | |
|
418 | ASM_convert( asm_f0_reorganized, asm_f0_char); | |
|
419 | // 3) send the spectral matrix packets | |
|
420 | set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime ); | |
|
421 | set_time( headerASM.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
|
422 | ASM_send( &headerASM, asm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); | |
|
584 | nb_sm.norm_bp2_f0 = 0; | |
|
585 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
586 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
587 | { | |
|
588 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F1; | |
|
589 | } | |
|
423 | 590 | } |
|
424 | 591 | |
|
592 | if (nb_sm.norm_asm_f1 == nb_sm_before_f1.norm_asm_f1) | |
|
593 | { | |
|
594 | nb_sm.norm_asm_f0 = 0; | |
|
595 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
596 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
|
597 | { | |
|
598 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F1; | |
|
599 | } | |
|
600 | } | |
|
601 | ||
|
602 | //************************* | |
|
603 | // send the message to MATR | |
|
604 | if (msgForMATR.event != 0x00) | |
|
605 | { | |
|
606 | status = rtems_message_queue_send( queue_id_prc1, (char *) & msgForMATR, MSG_QUEUE_SIZE_PRC1); | |
|
607 | } | |
|
608 | ||
|
609 | if (status != RTEMS_SUCCESSFUL) { | |
|
610 | printf("in AVF1 *** Error sending message to PRC1, code %d\n", status); | |
|
611 | } | |
|
425 | 612 | } |
|
426 | 613 | } |
|
427 | 614 |
@@ -610,7 +610,7 int restart_science_tasks(unsigned char | |||
|
610 | 610 | PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5]) |
|
611 | 611 | } |
|
612 | 612 | |
|
613 |
status[6] = rtems_task_restart( Task_id[TASKID_ |
|
|
613 | status[6] = rtems_task_restart( Task_id[TASKID_PRC0], lfrRequestedMode ); | |
|
614 | 614 | if (status[6] != RTEMS_SUCCESSFUL) |
|
615 | 615 | { |
|
616 | 616 | PRINTF1("in restart_science_task *** 6 ERR %d\n", status[6]) |
General Comments 0
You need to be logged in to leave comments.
Login now