@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: bin/fsw |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8. |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue May 6 08:24:43 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= |
|
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=7 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS | |
|
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../header/processing -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 | |
|
4 | CONFIG += console verbose cpu_usage_report | |
|
5 | 5 | CONFIG -= qt |
|
6 | 6 | |
|
7 | 7 | include(./sparc.pri) |
@@ -11,7 +11,7 SWVERSION=-1-0 | |||
|
11 | 11 | DEFINES += SW_VERSION_N1=1 # major |
|
12 | 12 | DEFINES += SW_VERSION_N2=0 # minor |
|
13 | 13 | DEFINES += SW_VERSION_N3=0 # patch |
|
14 |
DEFINES += SW_VERSION_N4= |
|
|
14 | DEFINES += SW_VERSION_N4=7 # internal | |
|
15 | 15 | |
|
16 | 16 | contains( CONFIG, debug_tch ) { |
|
17 | 17 | DEFINES += DEBUG_TCH |
@@ -1,6 +1,6 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by QtCreator 3.0.1, 2014-05-0 |
|
|
3 | <!-- Written by QtCreator 3.0.1, 2014-05-06T09:36:02. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -36,6 +36,7 void increment_seq_counter( unsigned cha | |||
|
36 | 36 | void getTime( unsigned char *time); |
|
37 | 37 | unsigned long long int getTimeAsUnsignedLongLongInt( ); |
|
38 | 38 | void send_dumb_hk( void ); |
|
39 | void get_v_e1_e2_f3 (unsigned char *v, unsigned char *e1, unsigned char *e2, bool init_buffer_addr ); | |
|
39 | 40 | |
|
40 | 41 | extern int sched_yield( void ); |
|
41 | 42 |
@@ -321,7 +321,7 int create_all_tasks( void ) // create a | |||
|
321 | 321 | { |
|
322 | 322 | status = rtems_task_create( |
|
323 | 323 | Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE, |
|
324 | RTEMS_DEFAULT_MODES, | |
|
324 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
|
325 | 325 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN] |
|
326 | 326 | ); |
|
327 | 327 | } |
@@ -221,6 +221,10 rtems_task hous_task(rtems_task_argument | |||
|
221 | 221 | |
|
222 | 222 | spacewire_update_statistics(); |
|
223 | 223 | |
|
224 | get_v_e1_e2_f3( | |
|
225 | housekeeping_packet.hk_lfr_sc_v_f3, housekeeping_packet.hk_lfr_sc_e1_f3, housekeeping_packet.hk_lfr_sc_e2_f3, | |
|
226 | false ); | |
|
227 | ||
|
224 | 228 | // SEND PACKET |
|
225 | 229 | status = rtems_message_queue_urgent( queue_id, &housekeeping_packet, |
|
226 | 230 | PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); |
@@ -255,7 +259,7 rtems_task dumb_task( rtems_task_argumen | |||
|
255 | 259 | |
|
256 | 260 | char *DumbMessages[10] = {"in DUMB *** default", // RTEMS_EVENT_0 |
|
257 | 261 | "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1 |
|
258 |
"in DUMB *** |
|
|
262 | "in DUMB *** f3 buffer changed", // RTEMS_EVENT_2 | |
|
259 | 263 | "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3 |
|
260 | 264 | "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4 |
|
261 | 265 | "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5 |
@@ -432,3 +436,66 void send_dumb_hk( void ) | |||
|
432 | 436 | rtems_message_queue_urgent( queue_id, &dummy_hk_packet, |
|
433 | 437 | PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES); |
|
434 | 438 | } |
|
439 | ||
|
440 | void get_v_e1_e2_f3( unsigned char *v, unsigned char *e1, unsigned char *e2, bool init_buffer_addr ) | |
|
441 | { | |
|
442 | static int *current_addr_data_f3 = NULL; | |
|
443 | int *new_addr_data_f3; | |
|
444 | unsigned char *ptr; | |
|
445 | ||
|
446 | static unsigned int counter = 0; | |
|
447 | unsigned int offset_in_samples; | |
|
448 | unsigned int offset_in_words; | |
|
449 | unsigned char delta = 16; // v, e1 and e2 will be picked up each second, f3 = 16 Hz | |
|
450 | ||
|
451 | new_addr_data_f3 = (int *) waveform_picker_regs->addr_data_f3; | |
|
452 | ||
|
453 | if (init_buffer_addr == true) // when the waveform_picker is launched | |
|
454 | { | |
|
455 | current_addr_data_f3 = NULL; | |
|
456 | } | |
|
457 | else | |
|
458 | { | |
|
459 | if (lfrCurrentMode == LFR_MODE_STANDBY) | |
|
460 | { | |
|
461 | v[0] = 0x00; | |
|
462 | v[1] = 0x00; | |
|
463 | e1[0] = 0x00; | |
|
464 | e1[1] = 0x00; | |
|
465 | e2[0] = 0x00; | |
|
466 | e2[1] = 0x00; | |
|
467 | } | |
|
468 | else | |
|
469 | { | |
|
470 | if ( new_addr_data_f3 != current_addr_data_f3 ) | |
|
471 | { | |
|
472 | counter = 0; | |
|
473 | offset_in_samples = 0; | |
|
474 | current_addr_data_f3 = new_addr_data_f3; | |
|
475 | } | |
|
476 | else | |
|
477 | { | |
|
478 | counter = counter + 1; | |
|
479 | offset_in_samples = counter * delta; | |
|
480 | if ( offset_in_samples > NB_SAMPLES_PER_SNAPSHOT ) | |
|
481 | { | |
|
482 | offset_in_samples = NB_SAMPLES_PER_SNAPSHOT -1; | |
|
483 | PRINTF1("ERR *** in get_v_e1_e2_f3 *** trying to read out the buffer, counter = %d\n", counter) | |
|
484 | } | |
|
485 | } | |
|
486 | offset_in_words = TIME_OFFSET + offset_in_samples * NB_WORDS_SWF_BLK; | |
|
487 | ptr = (unsigned char*) ¤t_addr_data_f3[ offset_in_words ]; | |
|
488 | v[0] = ptr[0]; | |
|
489 | v[1] = ptr[1]; | |
|
490 | e1[0] = ptr[2]; | |
|
491 | e1[1] = ptr[3]; | |
|
492 | e2[0] = ptr[4]; | |
|
493 | e2[1] = ptr[5]; | |
|
494 | } | |
|
495 | } | |
|
496 | } | |
|
497 | ||
|
498 | ||
|
499 | ||
|
500 | ||
|
501 |
@@ -751,6 +751,7 void launch_waveform_picker( unsigned ch | |||
|
751 | 751 | reset_current_ring_nodes(); |
|
752 | 752 | reset_waveform_picker_regs(); |
|
753 | 753 | set_wfp_burst_enable_register( mode ); |
|
754 | get_v_e1_e2_f3( NULL, NULL, NULL, true ); | |
|
754 | 755 | |
|
755 | 756 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
756 | 757 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
@@ -66,7 +66,7 rtems_isr waveforms_isr( rtems_vector_nu | |||
|
66 | 66 | |
|
67 | 67 | rtems_status_code status; |
|
68 | 68 | |
|
69 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
69 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_BURST) // in BURST the data are used to place v, e1 and e2 in the HK packet | |
|
70 | 70 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
71 | 71 | { // in modes other than STANDBY and BURST, send the CWF_F3 data |
|
72 | 72 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full |
@@ -282,35 +282,43 rtems_task cwf3_task(rtems_task_argument | |||
|
282 | 282 | // wait for an RTEMS_EVENT |
|
283 | 283 | rtems_event_receive( RTEMS_EVENT_0, |
|
284 | 284 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
285 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
|
285 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
|
286 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode==LFR_MODE_SBM2) ) | |
|
286 | 287 | { |
|
287 | PRINTF("send CWF_LONG_F3\n") | |
|
288 | } | |
|
289 | else | |
|
290 | { | |
|
291 | PRINTF("send CWF_F3 (light)\n") | |
|
292 | } | |
|
293 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { | |
|
294 | 288 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) |
|
295 | 289 | { |
|
296 | send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
|
290 | PRINTF("send CWF_LONG_F3\n") | |
|
297 | 291 | } |
|
298 | 292 | else |
|
299 | 293 | { |
|
300 | send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id ); | |
|
294 | PRINTF("send CWF_F3 (light)\n") | |
|
295 | } | |
|
296 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { | |
|
297 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
|
298 | { | |
|
299 | send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
|
300 | } | |
|
301 | else | |
|
302 | { | |
|
303 | send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id ); | |
|
304 | } | |
|
305 | } | |
|
306 | else | |
|
307 | { | |
|
308 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
|
309 | { | |
|
310 | send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
|
311 | } | |
|
312 | else | |
|
313 | { | |
|
314 | send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id ); | |
|
315 | } | |
|
316 | ||
|
301 | 317 | } |
|
302 | 318 | } |
|
303 | 319 | else |
|
304 | 320 | { |
|
305 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
|
306 | { | |
|
307 | send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |
|
308 | } | |
|
309 | else | |
|
310 | { | |
|
311 | send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id ); | |
|
312 | } | |
|
313 | ||
|
321 | PRINTF1("in CWF3 *** lfrCurrentMode is %d, no data will be sent\n", lfrCurrentMode) | |
|
314 | 322 | } |
|
315 | 323 | } |
|
316 | 324 | } |
@@ -1205,7 +1213,8 void set_wfp_burst_enable_register( unsi | |||
|
1205 | 1213 | break; |
|
1206 | 1214 | case(LFR_MODE_BURST): |
|
1207 | 1215 | waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1208 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2 | |
|
1216 | // waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2 | |
|
1217 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x06; // [0110] enable f3 AND f2 | |
|
1209 | 1218 | break; |
|
1210 | 1219 | case(LFR_MODE_SBM1): |
|
1211 | 1220 | waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled |
General Comments 0
You need to be logged in to leave comments.
Login now