##// END OF EJS Templates
fsw-1-0...
paul -
r82:4237b1096e59 VHDLib206
parent child
Show More
@@ -1,6 +1,6
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Fri Nov 15 17:09:56 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Nov 19 10:04:58 2013
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=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=1 -DSW_VERSION_N4=0 -DPRINT_MESSAGES_ON_CONSOLE
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=0 -DPRINT_MESSAGES_ON_CONSOLE
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
@@ -1,6 +1,6
1 1 SREC_PREFIX = RpwLfrApp
2 SREC_COUNTER = 0001
3 SREC_FSW_REF = fsw-0-7
2 SREC_COUNTER = 0002
3 SREC_FSW_REF = fsw-1-0
4 4 SREC_SUFFIX = .srec
5 5 SREC_TEXT = $(SREC_PREFIX)_$(SREC_COUNTER)_text_$(SREC_FSW_REF)$(SREC_SUFFIX)
6 6 SREC_DATA = $(SREC_PREFIX)_$(SREC_COUNTER)_data_$(SREC_FSW_REF)$(SREC_SUFFIX)
@@ -8,10 +8,10 include(./sparc.pri)
8 8
9 9 # flight software version
10 10 SWVERSION=-1-0
11 DEFINES += SW_VERSION_N1=0
12 DEFINES += SW_VERSION_N2=0
13 DEFINES += SW_VERSION_N3=1
14 DEFINES += SW_VERSION_N4=0
11 DEFINES += SW_VERSION_N1=1 # major
12 DEFINES += SW_VERSION_N2=0 # minor
13 DEFINES += SW_VERSION_N3=0 # patch
14 DEFINES += SW_VERSION_N4=0 # internal
15 15
16 16 contains( CONFIG, verbose ) {
17 17 DEFINES += PRINT_MESSAGES_ON_CONSOLE
@@ -1,6 +1,6
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.1, 2013-11-15T17:08:10. -->
3 <!-- Written by QtCreator 2.8.1, 2013-11-19T10:04:48. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -404,7 +404,7
404 404 <value type="int">13</value>
405 405 <value type="int">14</value>
406 406 </valuelist>
407 <value type="int" key="PE.EnvironmentAspect.Base">-1</value>
407 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
408 408 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
409 409 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
410 410 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
@@ -12,6 +12,9
12 12
13 13 #include "fsw_spacewire.h"
14 14
15 extern rtems_name Task_name[20]; /* array of task names */
16 extern rtems_id Task_id[20]; /* array of task ids */
17
15 18 // RTEMS TASKS
16 19 rtems_task Init( rtems_task_argument argument);
17 20
@@ -21,6 +24,8 int create_all_tasks( void );
21 24 int start_all_tasks( void );
22 25 //
23 26 rtems_status_code create_message_queues( void );
27 rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
28 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
24 29 //
25 30 int start_recv_send_tasks( void );
26 31 //
@@ -48,6 +48,9 void update_last_TC_exe(ccsdsTelecommand
48 48 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time);
49 49 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time);
50 50
51 extern rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
52 extern rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
53
51 54 #endif // TC_HANDLER_H_INCLUDED
52 55
53 56
@@ -35,8 +35,6 extern struct param_local_str param_loca
35 35 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
36 36 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
37 37
38 extern rtems_name misc_name[5];
39 extern rtems_name Task_name[20]; /* array of task ids */
40 38 extern rtems_id Task_id[20]; /* array of task ids */
41 39
42 40 extern unsigned char lfrCurrentMode;
@@ -584,3 +584,27 rtems_status_code create_message_queues(
584 584
585 585 return ret;
586 586 }
587
588 rtems_status_code get_message_queue_id_send( rtems_id *queue_id )
589 {
590 rtems_status_code status;
591 rtems_name queue_name;
592
593 queue_name = rtems_build_name( 'Q', '_', 'S', 'D' );
594
595 status = rtems_message_queue_ident( queue_name, 0, queue_id );
596
597 return status;
598 }
599
600 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id )
601 {
602 rtems_status_code status;
603 rtems_name queue_name;
604
605 queue_name = rtems_build_name( 'Q', '_', 'R', 'V' );
606
607 status = rtems_message_queue_ident( queue_name, 0, queue_id );
608
609 return status;
610 }
@@ -143,10 +143,10 rtems_task hous_task(rtems_task_argument
143 143 rtems_status_code status;
144 144 rtems_id queue_id;
145 145
146 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
146 status = get_message_queue_id_send( &queue_id );
147 147 if (status != RTEMS_SUCCESSFUL)
148 148 {
149 PRINTF1("in HOUS *** ERR %d\n", status)
149 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
150 150 }
151 151
152 152 BOOT_PRINTF("in HOUS ***\n")
@@ -172,6 +172,7 rtems_task hous_task(rtems_task_argument
172 172 housekeeping_packet.serviceType = TM_TYPE_HK;
173 173 housekeeping_packet.serviceSubType = TM_SUBTYPE_HK;
174 174 housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND;
175 housekeeping_packet.sid = SID_HK;
175 176
176 177 status = rtems_rate_monotonic_cancel(HK_id);
177 178 if( status != RTEMS_SUCCESSFUL ) {
@@ -195,7 +196,6 rtems_task hous_task(rtems_task_argument
195 196 housekeeping_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
196 197 housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
197 198 housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
198 housekeeping_packet.sid = SID_HK;
199 199
200 200 spacewire_update_statistics();
201 201
@@ -188,10 +188,10 rtems_task matr_task(rtems_task_argument
188 188
189 189 init_header_asm( &headerASM );
190 190
191 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
191 status = get_message_queue_id_send( &queue_id );
192 192 if (status != RTEMS_SUCCESSFUL)
193 193 {
194 PRINTF1("in MATR *** ERR getting queue id, %d\n", status)
194 PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status)
195 195 }
196 196
197 197 BOOT_PRINTF("in MATR *** \n")
@@ -125,16 +125,16 rtems_task recv_task( rtems_task_argumen
125 125
126 126 initLookUpTableForCRC(); // the table is used to compute Cyclic Redundancy Codes
127 127
128 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_recv_id );
128 status = get_message_queue_id_recv( &queue_recv_id );
129 129 if (status != RTEMS_SUCCESSFUL)
130 130 {
131 PRINTF1("in RECV *** ERR getting QUEUE_RECV id, %d\n", status)
131 PRINTF1("in RECV *** ERR get_message_queue_id_recv %d\n", status)
132 132 }
133 133
134 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_send_id );
134 status = get_message_queue_id_send( &queue_send_id );
135 135 if (status != RTEMS_SUCCESSFUL)
136 136 {
137 PRINTF1("in RECV *** ERR getting QUEUE_SEND id, %d\n", status)
137 PRINTF1("in RECV *** ERR get_message_queue_id_send %d\n", status)
138 138 }
139 139
140 140 BOOT_PRINTF("in RECV *** \n")
@@ -211,10 +211,10 rtems_task send_task( rtems_task_argumen
211 211 u_int32_t count;
212 212 rtems_id queue_id;
213 213
214 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_id );
214 status = get_message_queue_id_send( &queue_id );
215 215 if (status != RTEMS_SUCCESSFUL)
216 216 {
217 PRINTF1("in SEND *** ERR getting queue id, %d\n", status)
217 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
218 218 }
219 219
220 220 BOOT_PRINTF("in SEND *** \n")
@@ -604,21 +604,3 rtems_timer_service_routine user_routine
604 604 status = RTEMS_SUCCESSFUL;
605 605 }
606 606 }
607
608 rtems_status_code rtems_message_queue_send_lfr( rtems_id id, const void *buffer, size_t size )
609 {
610 rtems_status_code status;
611 rtems_mode previous_mode_set;
612
613 // set the preemption OFF
614 status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode_set );
615
616 // use the message queue
617 status = rtems_message_queue_send_lfr( id, buffer, size );
618
619 // set the preemption ON
620 status = rtems_task_mode( RTEMS_PREEMPT , RTEMS_PREEMPT_MASK, &previous_mode_set );
621
622 return status;
623 }
624
@@ -35,16 +35,16 rtems_task actn_task( rtems_task_argumen
35 35 rtems_id queue_rcv_id;
36 36 rtems_id queue_snd_id;
37 37
38 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_rcv_id );
38 status = get_message_queue_id_recv( &queue_rcv_id );
39 39 if (status != RTEMS_SUCCESSFUL)
40 40 {
41 PRINTF1("in ACTN *** ERR getting queue_rcv_id %d\n", status)
41 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
42 42 }
43 43
44 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_snd_id );
44 status = get_message_queue_id_send( &queue_snd_id );
45 45 if (status != RTEMS_SUCCESSFUL)
46 46 {
47 PRINTF1("in ACTN *** ERR getting queue_snd_id %d\n", status)
47 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
48 48 }
49 49
50 50 result = LFR_SUCCESSFUL;
@@ -239,6 +239,7 rtems_task wfrm_task(rtems_task_argument
239 239
240 240 rtems_event_set event_out;
241 241 rtems_id queue_id;
242 rtems_status_code status;
242 243
243 244 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
244 245 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
@@ -246,7 +247,11 rtems_task wfrm_task(rtems_task_argument
246 247
247 248 init_waveforms();
248 249
249 queue_id = get_pkts_queue_id();
250 status = get_message_queue_id_send( &queue_id );
251 if (status != RTEMS_SUCCESSFUL)
252 {
253 PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
254 }
250 255
251 256 BOOT_PRINTF("in WFRM ***\n")
252 257
@@ -314,11 +319,16 rtems_task cwf3_task(rtems_task_argument
314 319
315 320 rtems_event_set event_out;
316 321 rtems_id queue_id;
322 rtems_status_code status;
317 323
318 324 init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 );
319 325 init_header_continuous_wf3_light_table( headerCWF_F3_light );
320 326
321 queue_id = get_pkts_queue_id();
327 status = get_message_queue_id_send( &queue_id );
328 if (status != RTEMS_SUCCESSFUL)
329 {
330 PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
331 }
322 332
323 333 BOOT_PRINTF("in CWF3 ***\n")
324 334
@@ -353,11 +363,16 rtems_task cwf2_task(rtems_task_argument
353 363
354 364 rtems_event_set event_out;
355 365 rtems_id queue_id;
366 rtems_status_code status;
356 367
357 368 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
358 369 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
359 370
360 queue_id = get_pkts_queue_id();
371 status = get_message_queue_id_send( &queue_id );
372 if (status != RTEMS_SUCCESSFUL)
373 {
374 PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
375 }
361 376
362 377 BOOT_PRINTF("in CWF2 ***\n")
363 378
@@ -418,10 +433,15 rtems_task cwf1_task(rtems_task_argument
418 433
419 434 rtems_event_set event_out;
420 435 rtems_id queue_id;
436 rtems_status_code status;
421 437
422 438 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
423 439
424 queue_id = get_pkts_queue_id();
440 status = get_message_queue_id_send( &queue_id );
441 if (status != RTEMS_SUCCESSFUL)
442 {
443 PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
444 }
425 445
426 446 BOOT_PRINTF("in CWF1 ***\n")
427 447
@@ -1161,22 +1181,6 void reset_local_sbm2_nb_cwf_sent( void
1161 1181 param_local.local_sbm2_nb_cwf_sent = 0;
1162 1182 }
1163 1183
1164 rtems_id get_pkts_queue_id( void )
1165 {
1166 rtems_id queue_id;
1167 rtems_status_code status;
1168 rtems_name queue_send_name;
1169
1170 queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' );
1171
1172 status = rtems_message_queue_ident( queue_send_name, 0, &queue_id );
1173 if (status != RTEMS_SUCCESSFUL)
1174 {
1175 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
1176 }
1177 return queue_id;
1178 }
1179
1180 1184 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1181 1185 {
1182 1186 unsigned short *sequence_cnt;
General Comments 0
You need to be logged in to leave comments. Login now