@@ -1,6 +1,6 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.6) on: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.6) on: Mon Jun 16 09:16:01 2014 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
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 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 |
DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4= |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=10 -DPRINT_MESSAGES_ON_CONSOLE | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/LFR_basic-parameters |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/LFR_basic-parameters |
@@ -11,7 +11,7 SWVERSION=-1-0 | |||||
11 | DEFINES += SW_VERSION_N1=1 # major |
|
11 | DEFINES += SW_VERSION_N1=1 # major | |
12 | DEFINES += SW_VERSION_N2=0 # minor |
|
12 | DEFINES += SW_VERSION_N2=0 # minor | |
13 | DEFINES += SW_VERSION_N3=0 # patch |
|
13 | DEFINES += SW_VERSION_N3=0 # patch | |
14 |
DEFINES += SW_VERSION_N4= |
|
14 | DEFINES += SW_VERSION_N4=10 # internal | |
15 |
|
15 | |||
16 | contains( CONFIG, debug_tch ) { |
|
16 | contains( CONFIG, debug_tch ) { | |
17 | DEFINES += DEBUG_TCH |
|
17 | DEFINES += DEBUG_TCH |
@@ -1,6 +1,6 | |||||
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.1, 2014-06-1 |
|
3 | <!-- Written by QtCreator 3.0.1, 2014-06-16T07:35:26. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -33,7 +33,7 rtems_task hous_task( rtems_task_argumen | |||||
33 | rtems_task dumb_task( rtems_task_argument unused ); |
|
33 | rtems_task dumb_task( rtems_task_argument unused ); | |
34 |
|
34 | |||
35 | void init_housekeeping_parameters( void ); |
|
35 | void init_housekeeping_parameters( void ); | |
36 |
void increment_seq_counter( |
|
36 | void increment_seq_counter(unsigned short *packetSequenceControl); | |
37 | void getTime( unsigned char *time); |
|
37 | void getTime( unsigned char *time); | |
38 | unsigned long long int getTimeAsUnsignedLongLongInt( ); |
|
38 | unsigned long long int getTimeAsUnsignedLongLongInt( ); | |
39 | void send_dumb_hk( void ); |
|
39 | void send_dumb_hk( void ); | |
@@ -44,5 +44,6 extern int sched_yield( void ); | |||||
44 | extern int rtems_cpu_usage_reset(); |
|
44 | extern int rtems_cpu_usage_reset(); | |
45 | extern ring_node *current_ring_node_f3; |
|
45 | extern ring_node *current_ring_node_f3; | |
46 | extern ring_node *ring_node_to_send_cwf_f3; |
|
46 | extern ring_node *ring_node_to_send_cwf_f3; | |
|
47 | extern unsigned short sequenceCounterHK; | |||
47 |
|
48 | |||
48 | #endif // FSW_MISC_H_INCLUDED |
|
49 | #endif // FSW_MISC_H_INCLUDED |
@@ -71,10 +71,14 typedef struct ring_node | |||||
71 | #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12 |
|
71 | #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12 | |
72 | #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13 |
|
72 | #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13 | |
73 | #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 // ASM only in NORM mode |
|
73 | #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 // ASM only in NORM mode | |
74 |
#define RTEMS_EVENT_ |
|
74 | #define RTEMS_EVENT_SBM_BP1_F0 RTEMS_EVENT_15 | |
75 |
#define RTEMS_EVENT_ |
|
75 | #define RTEMS_EVENT_SBM_BP2_F0 RTEMS_EVENT_16 | |
76 |
#define RTEMS_EVENT_ |
|
76 | #define RTEMS_EVENT_SBM_BP1_F1 RTEMS_EVENT_17 | |
77 |
#define RTEMS_EVENT_ |
|
77 | #define RTEMS_EVENT_SBM_BP2_F1 RTEMS_EVENT_18 | |
|
78 | #define RTEMS_EVENT_BURST_BP1_F0 RTEMS_EVENT_19 | |||
|
79 | #define RTEMS_EVENT_BURST_BP2_F0 RTEMS_EVENT_20 | |||
|
80 | #define RTEMS_EVENT_BURST_BP1_F1 RTEMS_EVENT_21 | |||
|
81 | #define RTEMS_EVENT_BURST_BP2_F1 RTEMS_EVENT_22 | |||
78 |
|
82 | |||
79 | //**************************** |
|
83 | //**************************** | |
80 | // LFR DEFAULT MODE PARAMETERS |
|
84 | // LFR DEFAULT MODE PARAMETERS |
@@ -101,6 +101,7 void set_time(unsigned char *time, unsig | |||||
101 | unsigned long long int get_acquisition_time( unsigned char *timePtr ); |
|
101 | unsigned long long int get_acquisition_time( unsigned char *timePtr ); | |
102 | void close_matrix_actions(unsigned int *nb_sm, unsigned int nb_sm_before_avf, rtems_id task_id, |
|
102 | void close_matrix_actions(unsigned int *nb_sm, unsigned int nb_sm_before_avf, rtems_id task_id, | |
103 | ring_node_sm *node_for_averaging, ring_node_sm *ringNode); |
|
103 | ring_node_sm *node_for_averaging, ring_node_sm *ringNode); | |
|
104 | unsigned char getSID( rtems_event_set event ); | |||
104 |
|
105 | |||
105 | extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); |
|
106 | extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); | |
106 | extern rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id ); |
|
107 | extern rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id ); |
@@ -9,6 +9,8 | |||||
9 | #include "tm_lfr_tc_exe.h" |
|
9 | #include "tm_lfr_tc_exe.h" | |
10 | #include "fsw_misc.h" |
|
10 | #include "fsw_misc.h" | |
11 |
|
11 | |||
|
12 | extern unsigned short sequenceCounterParameterDump; | |||
|
13 | ||||
12 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); |
|
14 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); | |
13 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
15 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
14 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
16 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
@@ -67,6 +67,8 Packet_TM_LFR_HK_t housekeeping_packet; | |||||
67 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
67 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
68 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
68 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |
69 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; |
|
69 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; | |
|
70 | unsigned short sequenceCounterHK; | |||
|
71 | unsigned short sequenceCounterParameterDump; | |||
70 | spw_stats spacewire_stats; |
|
72 | spw_stats spacewire_stats; | |
71 | spw_stats spacewire_stats_backup; |
|
73 | spw_stats spacewire_stats_backup; | |
72 |
|
74 |
@@ -241,6 +241,8 void init_local_mode_parameters( void ) | |||||
241 | } |
|
241 | } | |
242 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; |
|
242 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; | |
243 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; |
|
243 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; | |
|
244 | sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |||
|
245 | sequenceCounterParameterDump = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |||
244 | } |
|
246 | } | |
245 |
|
247 | |||
246 | void reset_local_time( void ) |
|
248 | void reset_local_time( void ) |
@@ -211,7 +211,10 rtems_task hous_task(rtems_task_argument | |||||
211 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 ); |
|
211 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 ); | |
212 | } |
|
212 | } | |
213 | else { |
|
213 | else { | |
214 |
|
|
214 | housekeeping_packet.packetSequenceControl[0] = (unsigned char) sequenceCounterHK >> 8; | |
|
215 | housekeeping_packet.packetSequenceControl[1] = (unsigned char) sequenceCounterHK; | |||
|
216 | increment_seq_counter( &sequenceCounterHK ); | |||
|
217 | ||||
215 | housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
218 | housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
216 | housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
219 | housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
217 | housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
220 | housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
@@ -324,7 +327,7 void init_housekeeping_parameters( void | |||||
324 | housekeeping_packet.lfr_fpga_version[2] = parameters[3]; // n3 |
|
327 | housekeeping_packet.lfr_fpga_version[2] = parameters[3]; // n3 | |
325 | } |
|
328 | } | |
326 |
|
329 | |||
327 | void increment_seq_counter( unsigned char *packet_sequence_control) |
|
330 | void increment_seq_counter_old( unsigned char *packet_sequence_control) | |
328 | { |
|
331 | { | |
329 | /** This function increment the sequence counter psased in argument. |
|
332 | /** This function increment the sequence counter psased in argument. | |
330 | * |
|
333 | * | |
@@ -357,6 +360,32 void increment_seq_counter( unsigned cha | |||||
357 | } |
|
360 | } | |
358 | } |
|
361 | } | |
359 |
|
362 | |||
|
363 | void increment_seq_counter( unsigned short *packetSequenceControl ) | |||
|
364 | { | |||
|
365 | /** This function increment the sequence counter psased in argument. | |||
|
366 | * | |||
|
367 | * The increment does not affect the grouping flag. In case of an overflow, the counter is reset to 0. | |||
|
368 | * | |||
|
369 | */ | |||
|
370 | ||||
|
371 | unsigned short sequence_cnt; | |||
|
372 | unsigned short segmentation_grouping_flag; | |||
|
373 | ||||
|
374 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; // keep bits 7 downto 6 | |||
|
375 | sequence_cnt = (*packetSequenceControl) & 0x3fff; // [0011 1111 1111 1111] | |||
|
376 | ||||
|
377 | if ( sequence_cnt < SEQ_CNT_MAX) | |||
|
378 | { | |||
|
379 | sequence_cnt = sequence_cnt + 1; | |||
|
380 | } | |||
|
381 | else | |||
|
382 | { | |||
|
383 | sequence_cnt = 0; | |||
|
384 | } | |||
|
385 | ||||
|
386 | *packetSequenceControl = segmentation_grouping_flag | sequence_cnt ; | |||
|
387 | } | |||
|
388 | ||||
360 | void getTime( unsigned char *time) |
|
389 | void getTime( unsigned char *time) | |
361 | { |
|
390 | { | |
362 | /** This function write the current local time in the time buffer passed in argument. |
|
391 | /** This function write the current local time in the time buffer passed in argument. |
@@ -102,20 +102,26 rtems_task avf0_task( rtems_task_argumen | |||||
102 | nb_sbm_bp1 = 0; |
|
102 | nb_sbm_bp1 = 0; | |
103 | // set another ring for the ASM storage |
|
103 | // set another ring for the ASM storage | |
104 | current_ring_node_asm_burst_sbm_f0 = current_ring_node_asm_burst_sbm_f0->next; |
|
104 | current_ring_node_asm_burst_sbm_f0 = current_ring_node_asm_burst_sbm_f0->next; | |
105 |
if ( |
|
105 | if ( lfrCurrentMode == LFR_MODE_BURST ) | |
106 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
|||
107 | { |
|
106 | { | |
108 |
msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_ |
|
107 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_BP1_F0; | |
|
108 | } | |||
|
109 | else if ( (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |||
|
110 | { | |||
|
111 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_SBM_BP1_F0; | |||
109 | } |
|
112 | } | |
110 | } |
|
113 | } | |
111 |
|
114 | |||
112 | if (nb_sbm_bp2 == nb_sm_before_f0.burst_sbm_bp2) |
|
115 | if (nb_sbm_bp2 == nb_sm_before_f0.burst_sbm_bp2) | |
113 | { |
|
116 | { | |
114 | nb_sbm_bp2 = 0; |
|
117 | nb_sbm_bp2 = 0; | |
115 |
if ( |
|
118 | if ( lfrCurrentMode == LFR_MODE_BURST ) | |
116 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
|||
117 | { |
|
119 | { | |
118 |
msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_ |
|
120 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_BP2_F0; | |
|
121 | } | |||
|
122 | else if ( (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |||
|
123 | { | |||
|
124 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_SBM_BP2_F0; | |||
119 | } |
|
125 | } | |
120 | } |
|
126 | } | |
121 |
|
127 | |||
@@ -171,6 +177,7 rtems_task prc0_task( rtems_task_argumen | |||||
171 | size_t size; // size of the incoming TC packet |
|
177 | size_t size; // size of the incoming TC packet | |
172 | asm_msg *incomingMsg; |
|
178 | asm_msg *incomingMsg; | |
173 | // |
|
179 | // | |
|
180 | unsigned char sid; | |||
174 | spw_ioctl_pkt_send spw_ioctl_send_ASM; |
|
181 | spw_ioctl_pkt_send spw_ioctl_send_ASM; | |
175 | rtems_status_code status; |
|
182 | rtems_status_code status; | |
176 | rtems_id queue_id; |
|
183 | rtems_id queue_id; | |
@@ -254,8 +261,9 rtems_task prc0_task( rtems_task_argumen | |||||
254 | // BURST SBM1 SBM2 |
|
261 | // BURST SBM1 SBM2 | |
255 | //**************** |
|
262 | //**************** | |
256 | //**************** |
|
263 | //**************** | |
257 | if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 ) |
|
264 | if ( (incomingMsg->event & RTEMS_EVENT_BURST_BP1_F0 ) || (incomingMsg->event & RTEMS_EVENT_SBM_BP1_F0 ) ) | |
258 | { |
|
265 | { | |
|
266 | sid = getSID( incomingMsg->event ); | |||
259 | // 1) compress the matrix for Basic Parameters calculation |
|
267 | // 1) compress the matrix for Basic Parameters calculation | |
260 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f0, |
|
268 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f0, | |
261 | nb_sm_before_f0.burst_sbm_bp1, |
|
269 | nb_sm_before_f0.burst_sbm_bp1, | |
@@ -268,9 +276,9 rtems_task prc0_task( rtems_task_argumen | |||||
268 | set_time( packet_sbm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); |
|
276 | set_time( packet_sbm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
269 | BP_send( (char *) &packet_sbm_bp1_f0, queue_id, |
|
277 | BP_send( (char *) &packet_sbm_bp1_f0, queue_id, | |
270 |
|
|
278 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 + PACKET_LENGTH_DELTA, | |
271 |
|
|
279 | sid); | |
272 | // 4) compute the BP2 set if needed |
|
280 | // 4) compute the BP2 set if needed | |
273 | if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F0 ) |
|
281 | if ( (incomingMsg->event & RTEMS_EVENT_BURST_BP2_F0) || (incomingMsg->event & RTEMS_EVENT_SBM_BP2_F0) ) | |
274 | { |
|
282 | { | |
275 | // 1) compute the BP2 set |
|
283 | // 1) compute the BP2 set | |
276 |
|
284 | |||
@@ -279,7 +287,7 rtems_task prc0_task( rtems_task_argumen | |||||
279 | set_time( packet_sbm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); |
|
287 | set_time( packet_sbm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
280 | BP_send( (char *) &packet_sbm_bp2_f0, queue_id, |
|
288 | BP_send( (char *) &packet_sbm_bp2_f0, queue_id, | |
281 |
|
|
289 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 + PACKET_LENGTH_DELTA, | |
282 |
|
|
290 | sid); | |
283 | } |
|
291 | } | |
284 | } |
|
292 | } | |
285 |
|
293 |
@@ -99,18 +99,26 rtems_task avf1_task( rtems_task_argumen | |||||
99 | nb_sbm_bp1 = 0; |
|
99 | nb_sbm_bp1 = 0; | |
100 | // set another ring for the ASM storage |
|
100 | // set another ring for the ASM storage | |
101 | current_ring_node_asm_burst_sbm_f1 = current_ring_node_asm_burst_sbm_f1->next; |
|
101 | current_ring_node_asm_burst_sbm_f1 = current_ring_node_asm_burst_sbm_f1->next; | |
102 |
if ( |
|
102 | if ( lfrCurrentMode == LFR_MODE_BURST ) | |
103 | { |
|
103 | { | |
104 |
msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_ |
|
104 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_BP1_F1; | |
|
105 | } | |||
|
106 | else if ( lfrCurrentMode == LFR_MODE_SBM2 ) | |||
|
107 | { | |||
|
108 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_SBM_BP1_F1; | |||
105 | } |
|
109 | } | |
106 | } |
|
110 | } | |
107 |
|
111 | |||
108 | if (nb_sbm_bp2 == nb_sm_before_f1.burst_sbm_bp2) |
|
112 | if (nb_sbm_bp2 == nb_sm_before_f1.burst_sbm_bp2) | |
109 | { |
|
113 | { | |
110 | nb_sbm_bp2 = 0; |
|
114 | nb_sbm_bp2 = 0; | |
111 |
if ( |
|
115 | if ( lfrCurrentMode == LFR_MODE_BURST ) | |
112 | { |
|
116 | { | |
113 |
msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_ |
|
117 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_BP2_F1; | |
|
118 | } | |||
|
119 | else if ( lfrCurrentMode == LFR_MODE_SBM2 ) | |||
|
120 | { | |||
|
121 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_SBM_BP2_F1; | |||
114 | } |
|
122 | } | |
115 | } |
|
123 | } | |
116 |
|
124 | |||
@@ -165,6 +173,7 rtems_task prc1_task( rtems_task_argumen | |||||
165 | size_t size; // size of the incoming TC packet |
|
173 | size_t size; // size of the incoming TC packet | |
166 | asm_msg *incomingMsg; |
|
174 | asm_msg *incomingMsg; | |
167 | // |
|
175 | // | |
|
176 | unsigned char sid; | |||
168 | spw_ioctl_pkt_send spw_ioctl_send_ASM; |
|
177 | spw_ioctl_pkt_send spw_ioctl_send_ASM; | |
169 | rtems_status_code status; |
|
178 | rtems_status_code status; | |
170 | rtems_id queue_id_send; |
|
179 | rtems_id queue_id_send; | |
@@ -238,8 +247,9 rtems_task prc1_task( rtems_task_argumen | |||||
238 | // BURST SBM2 |
|
247 | // BURST SBM2 | |
239 | //*********** |
|
248 | //*********** | |
240 | //*********** |
|
249 | //*********** | |
241 | if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F1 ) |
|
250 | if ( (incomingMsg->event & RTEMS_EVENT_BURST_BP1_F1) || (incomingMsg->event & RTEMS_EVENT_SBM_BP1_F1) ) | |
242 | { |
|
251 | { | |
|
252 | sid = getSID( incomingMsg->event ); | |||
243 | // 1) compress the matrix for Basic Parameters calculation |
|
253 | // 1) compress the matrix for Basic Parameters calculation | |
244 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f1, |
|
254 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f1, | |
245 | nb_sm_before_f1.burst_sbm_bp1, |
|
255 | nb_sm_before_f1.burst_sbm_bp1, | |
@@ -252,9 +262,9 rtems_task prc1_task( rtems_task_argumen | |||||
252 | set_time( packet_sbm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); |
|
262 | set_time( packet_sbm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
253 | BP_send( (char *) &packet_sbm_bp1, queue_id_send, |
|
263 | BP_send( (char *) &packet_sbm_bp1, queue_id_send, | |
254 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA, |
|
264 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA, | |
255 |
|
|
265 | sid ); | |
256 | // 4) compute the BP2 set if needed |
|
266 | // 4) compute the BP2 set if needed | |
257 | if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F1 ) |
|
267 | if ( (incomingMsg->event & RTEMS_EVENT_BURST_BP2_F1) || (incomingMsg->event & RTEMS_EVENT_SBM_BP2_F1) ) | |
258 | { |
|
268 | { | |
259 | // 1) compute the BP2 set |
|
269 | // 1) compute the BP2 set | |
260 |
|
270 | |||
@@ -263,7 +273,7 rtems_task prc1_task( rtems_task_argumen | |||||
263 | set_time( packet_sbm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); |
|
273 | set_time( packet_sbm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
264 | BP_send( (char *) &packet_sbm_bp2, queue_id_send, |
|
274 | BP_send( (char *) &packet_sbm_bp2, queue_id_send, | |
265 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 + PACKET_LENGTH_DELTA, |
|
275 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 + PACKET_LENGTH_DELTA, | |
266 |
|
|
276 | sid ); | |
267 | } |
|
277 | } | |
268 | } |
|
278 | } | |
269 |
|
279 |
@@ -63,19 +63,19 void spectral_matrices_isr_f0( void ) | |||||
63 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; |
|
63 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; | |
64 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; |
|
64 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; | |
65 | } |
|
65 | } | |
66 |
spectral_matrix_regs->status = |
|
66 | spectral_matrix_regs->status = 0x03; // [0011] | |
67 | break; |
|
67 | break; | |
68 | case 1: |
|
68 | case 1: | |
69 | close_matrix_actions( &nb_sm_f0, NB_SM_BEFORE_AVF0, Task_id[TASKID_AVF0], ring_node_for_averaging_sm_f0, current_ring_node_sm_f0->previous); |
|
69 | close_matrix_actions( &nb_sm_f0, NB_SM_BEFORE_AVF0, Task_id[TASKID_AVF0], ring_node_for_averaging_sm_f0, current_ring_node_sm_f0->previous); | |
70 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; |
|
70 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; | |
71 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; |
|
71 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; | |
72 |
spectral_matrix_regs->status = |
|
72 | spectral_matrix_regs->status = 0x01; // [0001] | |
73 | break; |
|
73 | break; | |
74 | case 2: |
|
74 | case 2: | |
75 | close_matrix_actions( &nb_sm_f0, NB_SM_BEFORE_AVF0, Task_id[TASKID_AVF0], ring_node_for_averaging_sm_f0, current_ring_node_sm_f0->previous); |
|
75 | close_matrix_actions( &nb_sm_f0, NB_SM_BEFORE_AVF0, Task_id[TASKID_AVF0], ring_node_for_averaging_sm_f0, current_ring_node_sm_f0->previous); | |
76 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; |
|
76 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; | |
77 | spectral_matrix_regs->f0_1_address = current_ring_node_sm_f0->buffer_address; |
|
77 | spectral_matrix_regs->f0_1_address = current_ring_node_sm_f0->buffer_address; | |
78 |
spectral_matrix_regs->status = |
|
78 | spectral_matrix_regs->status = 0x02; // [0010] | |
79 | break; |
|
79 | break; | |
80 | } |
|
80 | } | |
81 | } |
|
81 | } | |
@@ -113,19 +113,19 void spectral_matrices_isr_f1( void ) | |||||
113 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; |
|
113 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; | |
114 | spectral_matrix_regs->f1_0_address = current_ring_node_sm_f1->buffer_address; |
|
114 | spectral_matrix_regs->f1_0_address = current_ring_node_sm_f1->buffer_address; | |
115 | } |
|
115 | } | |
116 |
spectral_matrix_regs->status = |
|
116 | spectral_matrix_regs->status = 0x0c; // [1100] | |
117 | break; |
|
117 | break; | |
118 | case 1: |
|
118 | case 1: | |
119 | close_matrix_actions( &nb_sm_f1, NB_SM_BEFORE_AVF1, Task_id[TASKID_AVF1], ring_node_for_averaging_sm_f1, current_ring_node_sm_f1->previous); |
|
119 | close_matrix_actions( &nb_sm_f1, NB_SM_BEFORE_AVF1, Task_id[TASKID_AVF1], ring_node_for_averaging_sm_f1, current_ring_node_sm_f1->previous); | |
120 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; |
|
120 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; | |
121 | spectral_matrix_regs->f1_0_address = current_ring_node_sm_f1->buffer_address; |
|
121 | spectral_matrix_regs->f1_0_address = current_ring_node_sm_f1->buffer_address; | |
122 |
spectral_matrix_regs->status = |
|
122 | spectral_matrix_regs->status = 0x04; // [0100] | |
123 | break; |
|
123 | break; | |
124 | case 2: |
|
124 | case 2: | |
125 | close_matrix_actions( &nb_sm_f1, NB_SM_BEFORE_AVF1, Task_id[TASKID_AVF1], ring_node_for_averaging_sm_f1, current_ring_node_sm_f1->previous); |
|
125 | close_matrix_actions( &nb_sm_f1, NB_SM_BEFORE_AVF1, Task_id[TASKID_AVF1], ring_node_for_averaging_sm_f1, current_ring_node_sm_f1->previous); | |
126 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; |
|
126 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; | |
127 | spectral_matrix_regs->f1_1_address = current_ring_node_sm_f1->buffer_address; |
|
127 | spectral_matrix_regs->f1_1_address = current_ring_node_sm_f1->buffer_address; | |
128 |
spectral_matrix_regs->status = |
|
128 | spectral_matrix_regs->status = 0x08; // [1000] | |
129 | break; |
|
129 | break; | |
130 | } |
|
130 | } | |
131 | } |
|
131 | } | |
@@ -143,22 +143,32 void spectral_matrices_isr_f2( void ) | |||||
143 | switch(status) |
|
143 | switch(status) | |
144 | { |
|
144 | { | |
145 | case 0: |
|
145 | case 0: | |
|
146 | break; | |||
146 | case 3: |
|
147 | case 3: | |
|
148 | spectral_matrix_regs->f2_0_address = current_ring_node_sm_f2->buffer_address; | |||
|
149 | spectral_matrix_regs->status = 0x30; // [0011 0000] | |||
|
150 | if (rtems_event_send( Task_id[TASKID_AVF2], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |||
|
151 | { | |||
|
152 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |||
|
153 | } | |||
147 | break; |
|
154 | break; | |
148 | case 1: |
|
155 | case 1: | |
149 | spectral_matrix_regs->f2_0_address = current_ring_node_sm_f2->buffer_address; |
|
156 | spectral_matrix_regs->f2_0_address = current_ring_node_sm_f2->buffer_address; | |
150 |
spectral_matrix_regs->status = |
|
157 | spectral_matrix_regs->status = 0x10; // [0001 0000] | |
|
158 | if (rtems_event_send( Task_id[TASKID_AVF2], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |||
|
159 | { | |||
|
160 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |||
|
161 | } | |||
151 | break; |
|
162 | break; | |
152 | case 2: |
|
163 | case 2: | |
153 | spectral_matrix_regs->f2_1_address = current_ring_node_sm_f2->buffer_address; |
|
164 | spectral_matrix_regs->f2_1_address = current_ring_node_sm_f2->buffer_address; | |
154 |
spectral_matrix_regs->status = |
|
165 | spectral_matrix_regs->status = 0x20; // [0010 0000] | |
155 | break; |
|
|||
156 | } |
|
|||
157 |
|
||||
158 | if (rtems_event_send( Task_id[TASKID_AVF2], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
166 | if (rtems_event_send( Task_id[TASKID_AVF2], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
159 | { |
|
167 | { | |
160 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
168 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
161 | } |
|
169 | } | |
|
170 | break; | |||
|
171 | } | |||
162 | } |
|
172 | } | |
163 |
|
173 | |||
164 | void spectral_matrix_isr_error_handler( void ) |
|
174 | void spectral_matrix_isr_error_handler( void ) | |
@@ -180,7 +190,7 rtems_isr spectral_matrices_isr( rtems_v | |||||
180 |
|
190 | |||
181 | spectral_matrices_isr_f2(); |
|
191 | spectral_matrices_isr_f2(); | |
182 |
|
192 | |||
183 | spectral_matrix_isr_error_handler(); |
|
193 | // spectral_matrix_isr_error_handler(); | |
184 | } |
|
194 | } | |
185 |
|
195 | |||
186 | rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector ) |
|
196 | rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector ) | |
@@ -629,4 +639,40 void close_matrix_actions( unsigned int | |||||
629 | } |
|
639 | } | |
630 | } |
|
640 | } | |
631 |
|
641 | |||
|
642 | unsigned char getSID( rtems_event_set event ) | |||
|
643 | { | |||
|
644 | unsigned char sid; | |||
632 |
|
645 | |||
|
646 | rtems_event_set eventSetBURST; | |||
|
647 | rtems_event_set eventSetSBM; | |||
|
648 | ||||
|
649 | //****** | |||
|
650 | // BURST | |||
|
651 | eventSetBURST = RTEMS_EVENT_BURST_BP1_F0 | |||
|
652 | | RTEMS_EVENT_BURST_BP1_F1 | |||
|
653 | | RTEMS_EVENT_BURST_BP2_F0 | |||
|
654 | | RTEMS_EVENT_BURST_BP2_F1; | |||
|
655 | ||||
|
656 | //**** | |||
|
657 | // SBM | |||
|
658 | eventSetSBM = RTEMS_EVENT_SBM_BP1_F0 | |||
|
659 | | RTEMS_EVENT_SBM_BP1_F1 | |||
|
660 | | RTEMS_EVENT_SBM_BP2_F0 | |||
|
661 | | RTEMS_EVENT_SBM_BP2_F1; | |||
|
662 | ||||
|
663 | if (event & eventSetBURST) | |||
|
664 | { | |||
|
665 | sid = SID_BURST_BP1_F0; | |||
|
666 | } | |||
|
667 | else if (event & eventSetSBM) | |||
|
668 | { | |||
|
669 | sid = SID_SBM1_BP1_F0; | |||
|
670 | } | |||
|
671 | else | |||
|
672 | { | |||
|
673 | sid = 0; | |||
|
674 | } | |||
|
675 | ||||
|
676 | return sid; | |||
|
677 | } | |||
|
678 |
@@ -372,7 +372,10 int action_dump_par( rtems_id queue_id ) | |||||
372 | int status; |
|
372 | int status; | |
373 |
|
373 | |||
374 | // UPDATE TIME |
|
374 | // UPDATE TIME | |
375 | increment_seq_counter( parameter_dump_packet.packetSequenceControl ); |
|
375 | parameter_dump_packet.packetSequenceControl[0] = (unsigned char) sequenceCounterParameterDump >> 8; | |
|
376 | parameter_dump_packet.packetSequenceControl[1] = (unsigned char) sequenceCounterParameterDump; | |||
|
377 | increment_seq_counter( &sequenceCounterParameterDump ); | |||
|
378 | ||||
376 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
379 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
377 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
380 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
378 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
381 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
General Comments 0
You need to be logged in to leave comments.
Login now