Line data Source code
1 : /*------------------------------------------------------------------------------
2 : -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 : -- This file is a part of the LFR FSW
4 : -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 : --
6 : -- This program is free software; you can redistribute it and/or modify
7 : -- it under the terms of the GNU General Public License as published by
8 : -- the Free Software Foundation; either version 2 of the License, or
9 : -- (at your option) any later version.
10 : --
11 : -- This program is distributed in the hope that it will be useful,
12 : -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : -- GNU General Public License for more details.
15 : --
16 : -- You should have received a copy of the GNU General Public License
17 : -- along with this program; if not, write to the Free Software
18 : -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 : -------------------------------------------------------------------------------*/
20 : /*-- Author : Paul Leroy
21 : -- Contact : Alexis Jeandet
22 : -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 : ----------------------------------------------------------------------------*/
24 :
25 : /** Functions related to data processing.
26 : *
27 : * @file
28 : * @author P. LEROY
29 : *
30 : * These function are related to data processing, i.e. spectral matrices averaging and basic
31 : * parameters computation.
32 : *
33 : */
34 :
35 : #include "avf1_prc1.h"
36 : #include "fsw_compile_warnings.h"
37 : #include "fsw_debug.h"
38 :
39 : typedef struct
40 : {
41 : unsigned int norm_bp1;
42 : unsigned int norm_bp2;
43 : unsigned int norm_asm;
44 : unsigned int burst_sbm_bp1;
45 : unsigned int burst_sbm_bp2;
46 : unsigned int burst_bp1;
47 : unsigned int burst_bp2;
48 : unsigned int sbm2_bp1;
49 : unsigned int sbm2_bp2;
50 : } nb_sm_before_bp_asm_f1;
51 :
52 : DISABLE_MISSING_FIELD_INITIALIZER_WARNING
53 : nb_sm_before_bp_asm_f1 nb_sm_before_f1 = { 0 };
54 :
55 : //***
56 : // F1
57 : ring_node_asm asm_ring_norm_f1[NB_RING_NODES_ASM_NORM_F1] = { { 0 } };
58 : ring_node_asm asm_ring_burst_sbm_f1[NB_RING_NODES_ASM_BURST_SBM_F1] = { { 0 } };
59 : ring_node ring_to_send_asm_f1[NB_RING_NODES_ASM_F1] = { { 0 } };
60 : ENABLE_MISSING_FIELD_INITIALIZER_WARNING
61 :
62 : int buffer_asm_f1[NB_RING_NODES_ASM_F1 * TOTAL_SIZE_SM] = { 0 };
63 :
64 : float asm_f1_patched_norm[TOTAL_SIZE_SM] = { 0 };
65 : float asm_f1_patched_burst_sbm[TOTAL_SIZE_SM] = { 0 };
66 : float asm_f1_reorganized[TOTAL_SIZE_SM] = { 0 };
67 :
68 : float compressed_sm_norm_f1[TOTAL_SIZE_COMPRESSED_ASM_NORM_F1] = { 0 };
69 : float compressed_sm_sbm_f1[TOTAL_SIZE_COMPRESSED_ASM_SBM_F1] = { 0 };
70 :
71 :
72 : //************
73 : // RTEMS TASKS
74 :
75 8 : LFR_NO_RETURN rtems_task avf1_task(rtems_task_argument lfrRequestedMode)
76 : {
77 :
78 : rtems_event_set event_out;
79 : rtems_status_code status;
80 : rtems_id queue_id_prc1;
81 : asm_msg msgForPRC;
82 : ring_node* nodeForAveraging;
83 : ring_node* ring_node_tab[NB_SM_BEFORE_AVF0_F1];
84 : ring_node_asm* current_ring_node_asm_burst_sbm_f1;
85 : ring_node_asm* current_ring_node_asm_norm_f1;
86 :
87 : unsigned int nb_norm_bp1;
88 : unsigned int nb_norm_bp2;
89 : unsigned int nb_norm_asm;
90 : unsigned int nb_sbm_bp1;
91 : unsigned int nb_sbm_bp2;
92 :
93 8 : event_out = EVENT_SETS_NONE_PENDING;
94 8 : queue_id_prc1 = RTEMS_ID_NONE;
95 :
96 8 : nb_norm_bp1 = 0;
97 8 : nb_norm_bp2 = 0;
98 8 : nb_norm_asm = 0;
99 8 : nb_sbm_bp1 = 0;
100 8 : nb_sbm_bp2 = 0;
101 :
102 8 : reset_nb_sm_f1((unsigned char)lfrRequestedMode); // reset the sm counters that drive the BP and
103 : // ASM computations / transmissions
104 8 : ASM_generic_init_ring(asm_ring_norm_f1, NB_RING_NODES_ASM_NORM_F1);
105 8 : ASM_generic_init_ring(asm_ring_burst_sbm_f1, NB_RING_NODES_ASM_BURST_SBM_F1);
106 8 : current_ring_node_asm_norm_f1 = asm_ring_norm_f1;
107 8 : current_ring_node_asm_burst_sbm_f1 = asm_ring_burst_sbm_f1;
108 :
109 : BOOT_PRINTF("in AVF1 *** lfrRequestedMode = %d\n", (int)lfrRequestedMode);
110 :
111 8 : status = get_message_queue_id_prc1(&queue_id_prc1);
112 : DEBUG_CHECK_STATUS(status);
113 8 : if (status != RTEMS_SUCCESSFUL)
114 : {
115 : LFR_PRINTF("in AVF1 *** ERR get_message_queue_id_prc1 %d\n", status);
116 : }
117 :
118 : while (1)
119 : {
120 189 : status = rtems_event_receive(
121 : RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
122 : DEBUG_CHECK_STATUS(status);
123 :
124 : //****************************************
125 : // initialize the mesage for the MATR task
126 182 : msgForPRC.norm = current_ring_node_asm_norm_f1;
127 182 : msgForPRC.burst_sbm = current_ring_node_asm_burst_sbm_f1;
128 182 : msgForPRC.event
129 : = EVENT_SETS_NONE_PENDING; // this composite event will be sent to the PRC1 task
130 : //
131 : //****************************************
132 :
133 182 : nodeForAveraging = getRingNodeForAveraging(1);
134 : DEBUG_CHECK_PTR(nodeForAveraging);
135 1638 : for (int i = NB_SM_BEFORE_AVF0_F1; i > 0; i--)
136 : {
137 1456 : ring_node_tab[i - 1] = nodeForAveraging;
138 1456 : nodeForAveraging = nodeForAveraging->previous;
139 : }
140 :
141 : // compute the average and store it in the averaged_sm_f1 buffer
142 182 : SM_average(current_ring_node_asm_norm_f1->matrix,
143 : current_ring_node_asm_burst_sbm_f1->matrix, ring_node_tab, nb_norm_bp1, nb_sbm_bp1,
144 : &msgForPRC, 1, ASM_F1_INDICE_START,
145 : ASM_F1_KEEP_BINS); // 1 => frequency channel 1
146 :
147 : // update nb_average
148 181 : nb_norm_bp1 = nb_norm_bp1 + NB_SM_BEFORE_AVF0_F1;
149 181 : nb_norm_bp2 = nb_norm_bp2 + NB_SM_BEFORE_AVF0_F1;
150 181 : nb_norm_asm = nb_norm_asm + NB_SM_BEFORE_AVF0_F1;
151 181 : nb_sbm_bp1 = nb_sbm_bp1 + NB_SM_BEFORE_AVF0_F1;
152 181 : nb_sbm_bp2 = nb_sbm_bp2 + NB_SM_BEFORE_AVF0_F1;
153 :
154 181 : if (nb_sbm_bp1 == nb_sm_before_f1.burst_sbm_bp1)
155 : {
156 89 : nb_sbm_bp1 = 0;
157 : // set another ring for the ASM storage
158 89 : current_ring_node_asm_burst_sbm_f1 = current_ring_node_asm_burst_sbm_f1->next;
159 : DEBUG_CHECK_PTR(current_ring_node_asm_burst_sbm_f1);
160 89 : if (lfrCurrentMode == LFR_MODE_BURST)
161 : {
162 22 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_BURST_BP1_F1;
163 : }
164 67 : else if (lfrCurrentMode == LFR_MODE_SBM2)
165 : {
166 22 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_SBM_BP1_F1;
167 : }
168 : }
169 :
170 181 : if (nb_sbm_bp2 == nb_sm_before_f1.burst_sbm_bp2)
171 : {
172 12 : nb_sbm_bp2 = 0;
173 12 : if (lfrCurrentMode == LFR_MODE_BURST)
174 : {
175 3 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_BURST_BP2_F1;
176 : }
177 9 : else if (lfrCurrentMode == LFR_MODE_SBM2)
178 : {
179 3 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_SBM_BP2_F1;
180 : }
181 : }
182 :
183 181 : if (nb_norm_bp1 == nb_sm_before_f1.norm_bp1)
184 : {
185 20 : nb_norm_bp1 = 0;
186 : // set another ring for the ASM storage
187 20 : current_ring_node_asm_norm_f1 = current_ring_node_asm_norm_f1->next;
188 : DEBUG_CHECK_PTR(current_ring_node_asm_norm_f1);
189 30 : if ((lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_SBM1)
190 30 : || (lfrCurrentMode == LFR_MODE_SBM2))
191 : {
192 15 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_NORM_BP1_F1;
193 : }
194 : }
195 :
196 181 : if (nb_norm_bp2 == nb_sm_before_f1.norm_bp2)
197 : {
198 0 : nb_norm_bp2 = 0;
199 0 : if ((lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_SBM1)
200 0 : || (lfrCurrentMode == LFR_MODE_SBM2))
201 : {
202 0 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_NORM_BP2_F1;
203 : }
204 : }
205 :
206 181 : if (nb_norm_asm == nb_sm_before_f1.norm_asm)
207 : {
208 0 : nb_norm_asm = 0;
209 0 : if ((lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_SBM1)
210 0 : || (lfrCurrentMode == LFR_MODE_SBM2))
211 : {
212 0 : msgForPRC.event = msgForPRC.event | RTEMS_EVENT_NORM_ASM_F1;
213 : }
214 : }
215 :
216 : //*************************
217 : // send the message to PRC
218 181 : if (msgForPRC.event != EVENT_SETS_NONE_PENDING)
219 : {
220 54 : status = rtems_message_queue_send(queue_id_prc1, (char*)&msgForPRC, sizeof(asm_msg));
221 : DEBUG_CHECK_STATUS(status);
222 : }
223 :
224 181 : if (status != RTEMS_SUCCESSFUL)
225 : {
226 : LFR_PRINTF("in AVF1 *** Error sending message to PRC1, code %d\n", status);
227 : }
228 : }
229 : }
230 :
231 8 : LFR_NO_RETURN rtems_task prc1_task(rtems_task_argument lfrRequestedMode)
232 : {
233 : char incomingData[MSG_QUEUE_SIZE_SEND]; // incoming data buffer
234 : size_t size; // size of the incoming TC packet
235 : asm_msg* incomingMsg;
236 : //
237 : rtems_id queue_id_send;
238 : rtems_id queue_id_q_p1;
239 : bp_packet_with_spare __attribute__((aligned(4))) packet_norm_bp1;
240 : bp_packet __attribute__((aligned(4))) packet_norm_bp2;
241 : bp_packet __attribute__((aligned(4))) packet_sbm_bp1;
242 : bp_packet __attribute__((aligned(4))) packet_sbm_bp2;
243 : ring_node* current_ring_node_to_send_asm_f1;
244 8 : float nbSMInASMNORM = 0;
245 8 : float nbSMInASMSBM = 0;
246 :
247 8 : size = 0;
248 8 : queue_id_send = RTEMS_ID_NONE;
249 8 : queue_id_q_p1 = RTEMS_ID_NONE;
250 8 : memset(&packet_norm_bp1, 0, sizeof(bp_packet_with_spare));
251 8 : memset(&packet_norm_bp2, 0, sizeof(bp_packet));
252 8 : memset(&packet_sbm_bp1, 0, sizeof(bp_packet));
253 8 : memset(&packet_sbm_bp2, 0, sizeof(bp_packet));
254 :
255 : // init the ring of the averaged spectral matrices which will be transmitted to the DPU
256 8 : init_ring(
257 : ring_to_send_asm_f1, NB_RING_NODES_ASM_F1, (volatile int*)buffer_asm_f1, TOTAL_SIZE_SM);
258 8 : current_ring_node_to_send_asm_f1 = ring_to_send_asm_f1;
259 : DEBUG_CHECK_PTR(current_ring_node_to_send_asm_f1);
260 :
261 : //*************
262 : // NORM headers
263 8 : BP_init_header_with_spare(&packet_norm_bp1, APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP1_F1,
264 : PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1, NB_BINS_COMPRESSED_SM_F1);
265 8 : BP_init_header(&packet_norm_bp2, APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP2_F1,
266 : PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1, NB_BINS_COMPRESSED_SM_F1);
267 :
268 : //***********************
269 : // BURST and SBM2 headers
270 8 : if (lfrRequestedMode == LFR_MODE_BURST)
271 : {
272 2 : BP_init_header(&packet_sbm_bp1, APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP1_F1,
273 : PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1, NB_BINS_COMPRESSED_SM_SBM_F1);
274 2 : BP_init_header(&packet_sbm_bp2, APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP2_F1,
275 : PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1, NB_BINS_COMPRESSED_SM_SBM_F1);
276 : }
277 6 : else if (lfrRequestedMode == LFR_MODE_SBM2)
278 : {
279 2 : BP_init_header(&packet_sbm_bp1, APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP1_F1,
280 : PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1, NB_BINS_COMPRESSED_SM_SBM_F1);
281 2 : BP_init_header(&packet_sbm_bp2, APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP2_F1,
282 : PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1, NB_BINS_COMPRESSED_SM_SBM_F1);
283 : }
284 : else
285 : {
286 : LFR_PRINTF("in PRC1 *** lfrRequestedMode is %d, several headers not initialized\n",
287 : (unsigned int)lfrRequestedMode);
288 : }
289 :
290 8 : DEBUG_CHECK_STATUS(get_message_queue_id_send(&queue_id_send));
291 8 : DEBUG_CHECK_STATUS(get_message_queue_id_prc1(&queue_id_q_p1));
292 :
293 : BOOT_PRINTF("in PRC1 *** lfrRequestedMode = %d\n", (int)lfrRequestedMode);
294 :
295 : while (1)
296 : {
297 : // wait for a message coming from AVF0
298 62 : DEBUG_CHECK_STATUS(rtems_message_queue_receive(
299 : queue_id_q_p1, incomingData, &size, RTEMS_WAIT, RTEMS_NO_TIMEOUT));
300 :
301 54 : incomingMsg = (asm_msg*)incomingData;
302 : DEBUG_CHECK_PTR(incomingMsg);
303 :
304 : //***********
305 : //***********
306 : // BURST SBM2
307 : //***********
308 : //***********
309 54 : if ((incomingMsg->event & RTEMS_EVENT_BURST_BP1_F1)
310 : || (incomingMsg->event & RTEMS_EVENT_SBM_BP1_F1))
311 : {
312 44 : SM_calibrate_and_reorder_f1(incomingMsg->burst_sbm->matrix, asm_f1_patched_burst_sbm);
313 44 : nbSMInASMSBM = (float)incomingMsg->numberOfSMInASMSBM;
314 : // 1) compress the matrix for Basic Parameters calculation
315 44 : ASM_compress_divide_and_mask(asm_f1_patched_burst_sbm, compressed_sm_sbm_f1,
316 : nbSMInASMSBM, NB_BINS_COMPRESSED_SM_SBM_F1, NB_BINS_TO_AVERAGE_ASM_SBM_F1,
317 : ASM_F1_INDICE_START, CHANNELF1);
318 : // 2) compute the BP1 set
319 44 : compute_BP1(compressed_sm_sbm_f1, NB_BINS_COMPRESSED_SM_SBM_F1, packet_sbm_bp1.data);
320 : // 3) send the BP1 set
321 44 : set_time(packet_sbm_bp1.time, (unsigned char*)&incomingMsg->coarseTimeSBM);
322 44 : set_time(packet_sbm_bp1.acquisitionTime, (unsigned char*)&incomingMsg->coarseTimeSBM);
323 44 : packet_sbm_bp1.pa_bia_status_info = pa_bia_status_info;
324 44 : packet_sbm_bp1.sy_lfr_common_parameters
325 44 : = parameter_dump_packet.sy_lfr_common_parameters;
326 44 : BP_send_s1_s2((char*)&packet_sbm_bp1, queue_id_send,
327 : PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA);
328 : // 4) compute the BP2 set if needed
329 44 : if ((incomingMsg->event & RTEMS_EVENT_BURST_BP2_F1)
330 : || (incomingMsg->event & RTEMS_EVENT_SBM_BP2_F1))
331 : {
332 : // 1) compute the BP2 set
333 6 : compute_BP2(
334 : compressed_sm_sbm_f1, NB_BINS_COMPRESSED_SM_SBM_F1, packet_sbm_bp2.data);
335 : // 2) send the BP2 set
336 6 : set_time(packet_sbm_bp2.time, (unsigned char*)&incomingMsg->coarseTimeSBM);
337 6 : set_time(
338 6 : packet_sbm_bp2.acquisitionTime, (unsigned char*)&incomingMsg->coarseTimeSBM);
339 6 : packet_sbm_bp2.pa_bia_status_info = pa_bia_status_info;
340 6 : packet_sbm_bp2.sy_lfr_common_parameters
341 6 : = parameter_dump_packet.sy_lfr_common_parameters;
342 6 : BP_send_s1_s2((char*)&packet_sbm_bp2, queue_id_send,
343 : PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 + PACKET_LENGTH_DELTA);
344 : }
345 : }
346 :
347 : //*****
348 : //*****
349 : // NORM
350 : //*****
351 : //*****
352 54 : if ((incomingMsg->event & RTEMS_EVENT_NORM_BP1_F1)
353 : || (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F1))
354 : {
355 15 : SM_calibrate_and_reorder_f1(incomingMsg->norm->matrix, asm_f1_patched_norm);
356 15 : nbSMInASMNORM = (float)incomingMsg->numberOfSMInASMNORM;
357 : }
358 :
359 54 : if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F1)
360 : {
361 : // 1) compress the matrix for Basic Parameters calculation
362 15 : ASM_compress_divide_and_mask(asm_f1_patched_norm, compressed_sm_norm_f1, nbSMInASMNORM,
363 : NB_BINS_COMPRESSED_SM_F1, NB_BINS_TO_AVERAGE_ASM_F1, ASM_F1_INDICE_START,
364 : CHANNELF1);
365 : // 2) compute the BP1 set
366 15 : compute_BP1(compressed_sm_norm_f1, NB_BINS_COMPRESSED_SM_F1, packet_norm_bp1.data);
367 : // 3) send the BP1 set
368 15 : set_time(packet_norm_bp1.time, (unsigned char*)&incomingMsg->coarseTimeNORM);
369 15 : set_time(packet_norm_bp1.acquisitionTime, (unsigned char*)&incomingMsg->coarseTimeNORM);
370 15 : packet_norm_bp1.pa_bia_status_info = pa_bia_status_info;
371 15 : packet_norm_bp1.sy_lfr_common_parameters
372 15 : = parameter_dump_packet.sy_lfr_common_parameters;
373 15 : BP_send((char*)&packet_norm_bp1, queue_id_send,
374 : PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 + PACKET_LENGTH_DELTA);
375 15 : if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F1)
376 : {
377 : // 1) compute the BP2 set
378 0 : compute_BP2(compressed_sm_norm_f1, NB_BINS_COMPRESSED_SM_F1, packet_norm_bp2.data);
379 : // 2) send the BP2 set
380 0 : set_time(packet_norm_bp2.time, (unsigned char*)&incomingMsg->coarseTimeNORM);
381 0 : set_time(
382 0 : packet_norm_bp2.acquisitionTime, (unsigned char*)&incomingMsg->coarseTimeNORM);
383 0 : packet_norm_bp2.pa_bia_status_info = pa_bia_status_info;
384 0 : packet_norm_bp2.sy_lfr_common_parameters
385 0 : = parameter_dump_packet.sy_lfr_common_parameters;
386 0 : BP_send((char*)&packet_norm_bp2, queue_id_send,
387 : PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 + PACKET_LENGTH_DELTA);
388 : }
389 : }
390 :
391 54 : if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F1)
392 : {
393 : // 1) reorganize the ASM and divide
394 0 : ASM_divide(asm_f1_patched_norm,
395 0 : (float*)current_ring_node_to_send_asm_f1->buffer_address, nbSMInASMNORM,
396 : ASM_F1_INDICE_START, ASM_F1_INDICE_START + ASM_F1_KEEP_BINS);
397 0 : current_ring_node_to_send_asm_f1->coarseTime = incomingMsg->coarseTimeNORM;
398 0 : current_ring_node_to_send_asm_f1->fineTime = incomingMsg->fineTimeNORM;
399 0 : current_ring_node_to_send_asm_f1->packet_id = SID_NORM_ASM_F1;
400 :
401 : // 3) send the spectral matrix packets
402 0 : DEBUG_CHECK_STATUS(rtems_message_queue_send(
403 : queue_id_send, ¤t_ring_node_to_send_asm_f1, sizeof(ring_node*)));
404 :
405 : // change asm ring node
406 0 : current_ring_node_to_send_asm_f1 = current_ring_node_to_send_asm_f1->next;
407 : }
408 :
409 54 : update_queue_max_count(queue_id_q_p1, &hk_lfr_q_p1_fifo_size_max);
410 54 : }
411 : }
412 :
413 : //**********
414 : // FUNCTIONS
415 :
416 8 : void reset_nb_sm_f1(unsigned char lfrMode)
417 : {
418 8 : nb_sm_before_f1.norm_bp1 = parameter_dump_packet.sy_lfr_n_bp_p0 * NB_SM_PER_S_F1;
419 8 : nb_sm_before_f1.norm_bp2 = parameter_dump_packet.sy_lfr_n_bp_p1 * NB_SM_PER_S_F1;
420 16 : nb_sm_before_f1.norm_asm = ((parameter_dump_packet.sy_lfr_n_asm_p[0] * 256)
421 8 : + parameter_dump_packet.sy_lfr_n_asm_p[1])
422 : * NB_SM_PER_S_F1;
423 8 : nb_sm_before_f1.sbm2_bp1 = parameter_dump_packet.sy_lfr_s2_bp_p0 * NB_SM_PER_S_F1;
424 8 : nb_sm_before_f1.sbm2_bp2 = parameter_dump_packet.sy_lfr_s2_bp_p1 * NB_SM_PER_S_F1;
425 8 : nb_sm_before_f1.burst_bp1 = parameter_dump_packet.sy_lfr_b_bp_p0 * NB_SM_PER_S_F1;
426 8 : nb_sm_before_f1.burst_bp2 = parameter_dump_packet.sy_lfr_b_bp_p1 * NB_SM_PER_S_F1;
427 :
428 8 : if (lfrMode == LFR_MODE_SBM2)
429 : {
430 2 : nb_sm_before_f1.burst_sbm_bp1 = nb_sm_before_f1.sbm2_bp1;
431 2 : nb_sm_before_f1.burst_sbm_bp2 = nb_sm_before_f1.sbm2_bp2;
432 : }
433 : else // if (lfrMode == LFR_MODE_BURST) Don't know why default is the same than burst
434 : {
435 6 : nb_sm_before_f1.burst_sbm_bp1 = nb_sm_before_f1.burst_bp1;
436 6 : nb_sm_before_f1.burst_sbm_bp2 = nb_sm_before_f1.burst_bp2;
437 : }
438 8 : }
|