@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 |
# Makefile for building: bin/fsw |
|
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: |
|
|
2 | # Makefile for building: bin/fsw | |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Mon Feb 17 07:55:25 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=1 -DPRINT_MESSAGES_ON_CONSOLE |
|
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=1 -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 -I../../LFR_basic-parameters |
@@ -89,9 +89,9 DIST = /usr/lib64/qt4/mkspecs/c | |||
|
89 | 89 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
90 | 90 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
91 | 91 | fsw-qt.pro |
|
92 |
QMAKE_TARGET = fsw |
|
|
92 | QMAKE_TARGET = fsw | |
|
93 | 93 | DESTDIR = bin/ |
|
94 |
TARGET = bin/fsw |
|
|
94 | TARGET = bin/fsw | |
|
95 | 95 | |
|
96 | 96 | first: all |
|
97 | 97 | ####### Implicit rules |
@@ -172,8 +172,8 qmake: FORCE | |||
|
172 | 172 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
173 | 173 | |
|
174 | 174 | dist: |
|
175 |
@$(CHK_DIR_EXISTS) obj/fsw |
|
|
176 |
$(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw |
|
|
175 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 | |
|
176 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0 | |
|
177 | 177 | |
|
178 | 178 | |
|
179 | 179 | clean:compiler_clean |
@@ -7,7 +7,7 proxy.loadSysDriverToParent("dsu3plugin" | |||
|
7 | 7 | BUTTON_selectGRESB.click() |
|
8 | 8 | |
|
9 | 9 | BUTTON_rmapOpenCommunication.click() |
|
10 |
dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw |
|
|
10 | dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw") | |
|
11 | 11 | dsu3plugin0.loadFile() |
|
12 | 12 | dsu3plugin0.run() |
|
13 | 13 |
@@ -1,6 +1,6 | |||
|
1 | 1 | #!/usr/bin/lppmon -e |
|
2 | 2 | |
|
3 |
dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw |
|
|
3 | dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw") | |
|
4 | 4 | dsu3plugin0.loadFile() |
|
5 | 5 | dsu3plugin0.run() |
|
6 | 6 |
@@ -1,7 +1,7 | |||
|
1 | 1 | TEMPLATE = app |
|
2 | 2 | # CONFIG += console v8 sim |
|
3 |
# CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report |
|
|
4 | CONFIG += console verbose debug_messages vhdl_dev cpu_usage_report | |
|
3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report | |
|
4 | CONFIG += console verbose | |
|
5 | 5 | CONFIG -= qt |
|
6 | 6 | |
|
7 | 7 | include(./sparc.pri) |
@@ -38,16 +38,6 contains( CONFIG, boot_messages ) { | |||
|
38 | 38 | #QMAKE_EXTRA_TARGETS += doxygen |
|
39 | 39 | |
|
40 | 40 | TARGET = fsw |
|
41 | contains( CONFIG, gsa ) { | |
|
42 | DEFINES += GSA | |
|
43 | TARGET = fsw-gsa | |
|
44 | } | |
|
45 | ||
|
46 | TARGET = fsw | |
|
47 | contains( CONFIG, vhdl_dev ) { | |
|
48 | DEFINES += VHDL_DEV | |
|
49 | TARGET = fsw-vhdl-dev | |
|
50 | } | |
|
51 | 41 | |
|
52 | 42 | INCLUDEPATH += \ |
|
53 | 43 | ../src \ |
@@ -29,8 +29,9 typedef struct ring_node_sm | |||
|
29 | 29 | // flight software version |
|
30 | 30 | // this parameters is handled by the Qt project options |
|
31 | 31 | |
|
32 | //#define NB_SAMPLES_PER_SNAPSHOT 2048 | |
|
33 | #define NB_SAMPLES_PER_SNAPSHOT 2352 // 336 * 7 = 2352 | |
|
32 | #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk | |
|
33 | #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk | |
|
34 | #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688 | |
|
34 | 35 | #define TIME_OFFSET 2 |
|
35 | 36 | #define TIME_OFFSET_IN_BYTES 8 |
|
36 | 37 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
@@ -75,6 +76,7 typedef struct ring_node_sm | |||
|
75 | 76 | #define SY_LFR_N_ASM_P 3600 // sec |
|
76 | 77 | #define SY_LFR_N_BP_P0 4 // sec |
|
77 | 78 | #define SY_LFR_N_BP_P1 20 // sec |
|
79 | #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3 | |
|
78 | 80 | #define MIN_DELTA_SNAPSHOT 16 // sec |
|
79 | 81 | // BURST |
|
80 | 82 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec |
@@ -98,19 +100,15 typedef struct ring_node_sm | |||
|
98 | 100 | |
|
99 | 101 | //***************************** |
|
100 | 102 | // APB REGISTERS BASE ADDRESSES |
|
101 | #define REGS_ADDR_APBUART 0x80000100 | |
|
102 | #define REGS_ADDR_GPTIMER 0x80000300 | |
|
103 | #define REGS_ADDR_GRSPW 0x80000500 | |
|
104 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 | |
|
105 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 | |
|
103 | #define REGS_ADDR_APBUART 0x80000100 | |
|
104 | #define REGS_ADDR_GPTIMER 0x80000300 | |
|
105 | #define REGS_ADDR_GRSPW 0x80000500 | |
|
106 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 | |
|
107 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 | |
|
108 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 | |
|
106 | 109 | |
|
107 | #ifdef GSA | |
|
108 | #else | |
|
109 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 | |
|
110 | #endif | |
|
111 | ||
|
112 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff | |
|
113 | #define APBUART_CTRL_REG_MASK_TE 0x00000002 | |
|
110 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff | |
|
111 | #define APBUART_CTRL_REG_MASK_TE 0x00000002 | |
|
114 | 112 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) |
|
115 | 113 | |
|
116 | 114 | //********** |
@@ -33,13 +33,8 int action_update_time(ccsdsTelecommandP | |||
|
33 | 33 | |
|
34 | 34 | // mode transition |
|
35 | 35 | int transition_validation(unsigned char requestedMode); |
|
36 | int stop_current_mode(); | |
|
36 | int stop_current_mode( void ); | |
|
37 | 37 | int enter_mode(unsigned char mode); |
|
38 | int enter_standby_mode(); | |
|
39 | int enter_normal_mode(); | |
|
40 | int enter_burst_mode(); | |
|
41 | int enter_sbm1_mode(); | |
|
42 | int enter_sbm2_mode(); | |
|
43 | 38 | int restart_science_tasks(); |
|
44 | 39 | int suspend_science_tasks(); |
|
45 | 40 | void launch_waveform_picker( unsigned char mode ); |
@@ -27,11 +27,7 extern volatile int wf_cont_f3_a[ ]; | |||
|
27 | 27 | extern volatile int wf_cont_f3_b[ ]; |
|
28 | 28 | extern char wf_cont_f3_light[ ]; |
|
29 | 29 | |
|
30 | #ifdef VHDL_DEV | |
|
31 | 30 | extern waveform_picker_regs_new_t *waveform_picker_regs; |
|
32 | #else | |
|
33 | extern waveform_picker_regs_t *waveform_picker_regs; | |
|
34 | #endif | |
|
35 | 31 | extern time_management_regs_t *time_management_regs; |
|
36 | 32 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
37 | 33 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
@@ -66,7 +62,8 int send_waveform_CWF( volatile int *wa | |||
|
66 | 62 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
67 | 63 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
68 | 64 | // |
|
69 |
void compute_acquisition_time(unsigned int |
|
|
65 | void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime, | |
|
66 | unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime ); | |
|
70 | 67 | // |
|
71 | 68 | rtems_id get_pkts_queue_id( void ); |
|
72 | 69 |
@@ -51,12 +51,7 volatile int sm_f2[ NB_RING_NODES_ASM_F2 | |||
|
51 | 51 | // APB CONFIGURATION REGISTERS |
|
52 | 52 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; |
|
53 | 53 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; |
|
54 | ||
|
55 | #ifdef VHDL_DEV | |
|
56 | 54 | waveform_picker_regs_new_t *waveform_picker_regs = (waveform_picker_regs_new_t*) REGS_ADDR_WAVEFORM_PICKER; |
|
57 | #else | |
|
58 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; | |
|
59 | #endif | |
|
60 | 55 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; |
|
61 | 56 | |
|
62 | 57 | // MODE PARAMETERS |
@@ -79,16 +79,17 rtems_task Init( rtems_task_argument ign | |||
|
79 | 79 | send_console_outputs_on_apbuart_port(); |
|
80 | 80 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
81 | 81 | enable_apbuart_transmitter(); |
|
82 | PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") | |
|
82 | DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") | |
|
83 | 83 | |
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
|
87 | #ifdef VHDL_DEV | |
|
88 | PRINTF("/!\\ this is the VHDL_DEV flight software /!\\ \n") | |
|
89 | #endif | |
|
90 | BOOT_PRINTF("***************************\n") | |
|
91 | BOOT_PRINTF("\n\n") | |
|
84 | PRINTF("\n\n\n\n\n") | |
|
85 | PRINTF("*************************\n") | |
|
86 | PRINTF("** LFR Flight Software **\n") | |
|
87 | PRINTF1("** %d.", SW_VERSION_N1) | |
|
88 | PRINTF1("%d.", SW_VERSION_N2) | |
|
89 | PRINTF1("%d.", SW_VERSION_N3) | |
|
90 | PRINTF1("%d\n", SW_VERSION_N4) | |
|
91 | PRINTF("*************************\n") | |
|
92 | PRINTF("\n\n") | |
|
92 | 93 | |
|
93 | 94 | reset_wfp_burst_enable(); // stop the waveform picker if it was running |
|
94 | 95 | init_waveform_rings(); // initialize the waveform rings |
@@ -364,7 +365,7 int create_all_tasks( void ) // create a | |||
|
364 | 365 | status = rtems_task_create( |
|
365 | 366 | Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE, |
|
366 | 367 | RTEMS_DEFAULT_MODES, |
|
367 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF3] | |
|
368 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3] | |
|
368 | 369 | ); |
|
369 | 370 | } |
|
370 | 371 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
@@ -372,7 +373,7 int create_all_tasks( void ) // create a | |||
|
372 | 373 | status = rtems_task_create( |
|
373 | 374 | Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE, |
|
374 | 375 | RTEMS_DEFAULT_MODES, |
|
375 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF2] | |
|
376 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2] | |
|
376 | 377 | ); |
|
377 | 378 | } |
|
378 | 379 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
@@ -380,7 +381,7 int create_all_tasks( void ) // create a | |||
|
380 | 381 | status = rtems_task_create( |
|
381 | 382 | Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE, |
|
382 | 383 | RTEMS_DEFAULT_MODES, |
|
383 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF1] | |
|
384 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1] | |
|
384 | 385 | ); |
|
385 | 386 | } |
|
386 | 387 | if (status == RTEMS_SUCCESSFUL) // SEND |
@@ -87,7 +87,7 rtems_task spiq_task(rtems_task_argument | |||
|
87 | 87 | if ( status != RTEMS_SUCCESSFUL ) { |
|
88 | 88 | PRINTF1("in SPIQ *** ERR stop_current_mode *** code %d\n", status) |
|
89 | 89 | } |
|
90 |
status = enter_ |
|
|
90 | status = enter_mode( LFR_MODE_STANDBY ); | |
|
91 | 91 | if ( status != RTEMS_SUCCESSFUL ) { |
|
92 | 92 | PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status) |
|
93 | 93 | } |
@@ -379,7 +379,7 int transition_validation(unsigned char | |||
|
379 | 379 | return status; |
|
380 | 380 | } |
|
381 | 381 | |
|
382 | int stop_current_mode() | |
|
382 | int stop_current_mode(void) | |
|
383 | 383 | { |
|
384 | 384 | /** This function stops the current mode by masking interrupt lines and suspending science tasks. |
|
385 | 385 | * |
@@ -438,132 +438,43 int enter_mode(unsigned char mode ) | |||
|
438 | 438 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d); |
|
439 | 439 | updateLFRCurrentMode(); |
|
440 | 440 | |
|
441 | switch(mode){ | |
|
442 | case LFR_MODE_STANDBY: | |
|
443 | status = enter_standby_mode( ); | |
|
444 | break; | |
|
445 | case LFR_MODE_NORMAL: | |
|
446 | status = enter_normal_mode( ); | |
|
447 | break; | |
|
448 | case LFR_MODE_BURST: | |
|
449 | status = enter_burst_mode( ); | |
|
450 | break; | |
|
451 | case LFR_MODE_SBM1: | |
|
452 | status = enter_sbm1_mode( ); | |
|
453 | break; | |
|
454 | case LFR_MODE_SBM2: | |
|
455 | status = enter_sbm2_mode( ); | |
|
456 | break; | |
|
457 | default: | |
|
441 | if ( (mode == LFR_MODE_NORMAL) || (mode == LFR_MODE_BURST) | |
|
442 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2) ) | |
|
443 | { | |
|
444 | status = restart_science_tasks(); | |
|
445 | launch_waveform_picker( mode ); | |
|
446 | // launch_spectral_matrix( mode ); | |
|
447 | } | |
|
448 | else if ( mode == LFR_MODE_STANDBY ) | |
|
449 | { | |
|
450 | status = stop_current_mode(); | |
|
451 | } | |
|
452 | else | |
|
453 | { | |
|
458 | 454 | status = RTEMS_UNSATISFIED; |
|
459 | 455 | } |
|
460 | 456 | |
|
457 | if (mode == LFR_MODE_STANDBY) | |
|
458 | { | |
|
459 | PRINTF1("maxCount = %d\n", maxCount) | |
|
460 | #ifdef PRINT_TASK_STATISTICS | |
|
461 | rtems_cpu_usage_report(); | |
|
462 | #endif | |
|
463 | ||
|
464 | #ifdef PRINT_STACK_REPORT | |
|
465 | rtems_stack_checker_report_usage(); | |
|
466 | #endif | |
|
467 | } | |
|
468 | ||
|
461 | 469 | if (status != RTEMS_SUCCESSFUL) |
|
462 | 470 | { |
|
463 | PRINTF("in enter_mode *** ERR\n") | |
|
471 | PRINTF1("in enter_mode *** ERR = %d\n", status) | |
|
464 | 472 | status = RTEMS_UNSATISFIED; |
|
465 | 473 | } |
|
466 | 474 | |
|
467 | 475 | return status; |
|
468 | 476 | } |
|
469 | 477 | |
|
470 | int enter_standby_mode() | |
|
471 | { | |
|
472 | /** This function is used to enter the STANDBY mode. | |
|
473 | * | |
|
474 | * @return RTEMS directive status codes: | |
|
475 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
|
476 | * | |
|
477 | */ | |
|
478 | ||
|
479 | PRINTF1("maxCount = %d\n", maxCount) | |
|
480 | ||
|
481 | #ifdef PRINT_TASK_STATISTICS | |
|
482 | rtems_cpu_usage_report(); | |
|
483 | #endif | |
|
484 | ||
|
485 | #ifdef PRINT_STACK_REPORT | |
|
486 | rtems_stack_checker_report_usage(); | |
|
487 | #endif | |
|
488 | ||
|
489 | return LFR_SUCCESSFUL; | |
|
490 | } | |
|
491 | ||
|
492 | int enter_normal_mode() | |
|
493 | { | |
|
494 | rtems_status_code status; | |
|
495 | ||
|
496 | status = restart_science_tasks(); | |
|
497 | ||
|
498 | launch_waveform_picker( LFR_MODE_NORMAL ); | |
|
499 | // launch_spectral_matrix( LFR_MODE_NORMAL ); | |
|
500 | ||
|
501 | return status; | |
|
502 | } | |
|
503 | ||
|
504 | int enter_burst_mode() | |
|
505 | { | |
|
506 | /** This function is used to enter the STANDBY mode. | |
|
507 | * | |
|
508 | * @return RTEMS directive status codes: | |
|
509 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
|
510 | * - RTEMS_INVALID_ID - task id invalid | |
|
511 | * - RTEMS_INCORRECT_STATE - task never started | |
|
512 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
|
513 | * | |
|
514 | */ | |
|
515 | ||
|
516 | rtems_status_code status; | |
|
517 | ||
|
518 | status = restart_science_tasks(); | |
|
519 | ||
|
520 | launch_waveform_picker( LFR_MODE_BURST ); | |
|
521 | ||
|
522 | return status; | |
|
523 | } | |
|
524 | ||
|
525 | int enter_sbm1_mode() | |
|
526 | { | |
|
527 | /** This function is used to enter the SBM1 mode. | |
|
528 | * | |
|
529 | * @return RTEMS directive status codes: | |
|
530 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
|
531 | * - RTEMS_INVALID_ID - task id invalid | |
|
532 | * - RTEMS_INCORRECT_STATE - task never started | |
|
533 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
|
534 | * | |
|
535 | */ | |
|
536 | ||
|
537 | rtems_status_code status; | |
|
538 | ||
|
539 | status = restart_science_tasks(); | |
|
540 | ||
|
541 | launch_waveform_picker( LFR_MODE_SBM1 ); | |
|
542 | ||
|
543 | return status; | |
|
544 | } | |
|
545 | ||
|
546 | int enter_sbm2_mode() | |
|
547 | { | |
|
548 | /** This function is used to enter the SBM2 mode. | |
|
549 | * | |
|
550 | * @return RTEMS directive status codes: | |
|
551 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
|
552 | * - RTEMS_INVALID_ID - task id invalid | |
|
553 | * - RTEMS_INCORRECT_STATE - task never started | |
|
554 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
|
555 | * | |
|
556 | */ | |
|
557 | ||
|
558 | rtems_status_code status; | |
|
559 | ||
|
560 | status = restart_science_tasks(); | |
|
561 | ||
|
562 | launch_waveform_picker( LFR_MODE_SBM2 ); | |
|
563 | ||
|
564 | return status; | |
|
565 | } | |
|
566 | ||
|
567 | 478 | int restart_science_tasks() |
|
568 | 479 | { |
|
569 | 480 | /** This function is used to restart all science tasks. |
@@ -73,7 +73,7 int action_load_normal_par(ccsdsTelecomm | |||
|
73 | 73 | } |
|
74 | 74 | |
|
75 | 75 | //*************** |
|
76 | // SY_LFR_N_ASM_P | |
|
76 | // sy_lfr_n_asm_p | |
|
77 | 77 | if (flag == LFR_SUCCESSFUL) |
|
78 | 78 | { |
|
79 | 79 | result = set_sy_lfr_n_asm_p( TC, queue_id ); |
@@ -84,7 +84,7 int action_load_normal_par(ccsdsTelecomm | |||
|
84 | 84 | } |
|
85 | 85 | |
|
86 | 86 | //*************** |
|
87 | // SY_LFR_N_BP_P0 | |
|
87 | // sy_lfr_n_bp_p0 | |
|
88 | 88 | if (flag == LFR_SUCCESSFUL) |
|
89 | 89 | { |
|
90 | 90 | result = set_sy_lfr_n_bp_p0( TC, queue_id ); |
@@ -457,6 +457,7 void init_parameter_dump( void ) | |||
|
457 | 457 | parameter_dump_packet.sy_lfr_n_asm_p[1] = (unsigned char) (SY_LFR_N_ASM_P ); |
|
458 | 458 | parameter_dump_packet.sy_lfr_n_bp_p0 = (unsigned char) SY_LFR_N_BP_P0; |
|
459 | 459 | parameter_dump_packet.sy_lfr_n_bp_p1 = (unsigned char) SY_LFR_N_BP_P1; |
|
460 | parameter_dump_packet.sy_lfr_n_cwf_long_f3 = (unsigned char) SY_LFR_N_CWF_LONG_F3; | |
|
460 | 461 | |
|
461 | 462 | //***************** |
|
462 | 463 | // BURST PARAMETERS |
@@ -16,11 +16,11 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0 | |||
|
16 | 16 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7]; |
|
17 | 17 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7]; |
|
18 | 18 | // CWF |
|
19 |
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[ |
|
|
20 |
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[ |
|
|
21 |
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[ |
|
|
22 |
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[ |
|
|
23 |
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[ |
|
|
19 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |
|
20 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |
|
21 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |
|
22 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[ NB_PACKETS_PER_GROUP_OF_CWF ]; | |
|
23 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[ NB_PACKETS_PER_GROUP_OF_CWF_LIGHT ]; | |
|
24 | 24 | |
|
25 | 25 | //************** |
|
26 | 26 | // waveform ring |
@@ -429,7 +429,14 rtems_task cwf3_task(rtems_task_argument | |||
|
429 | 429 | // wait for an RTEMS_EVENT |
|
430 | 430 | rtems_event_receive( RTEMS_EVENT_0, |
|
431 | 431 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
432 | PRINTF("send CWF F3 \n") | |
|
432 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
|
433 | { | |
|
434 | PRINTF("send CWF_LONG_F3\n") | |
|
435 | } | |
|
436 | else | |
|
437 | { | |
|
438 | PRINTF("send CWF_F3 (light)\n") | |
|
439 | } | |
|
433 | 440 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { |
|
434 | 441 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) |
|
435 | 442 | { |
@@ -442,7 +449,7 rtems_task cwf3_task(rtems_task_argument | |||
|
442 | 449 | } |
|
443 | 450 | else |
|
444 | 451 | { |
|
445 |
if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x0 |
|
|
452 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
|
446 | 453 | { |
|
447 | 454 | send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); |
|
448 | 455 | } |
@@ -688,7 +695,7 int init_header_continuous_wf_table( uns | |||
|
688 | 695 | { |
|
689 | 696 | unsigned int i; |
|
690 | 697 | |
|
691 |
for (i=0; i< |
|
|
698 | for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++) | |
|
692 | 699 | { |
|
693 | 700 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
694 | 701 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
@@ -732,7 +739,7 int init_header_continuous_cwf3_light_ta | |||
|
732 | 739 | { |
|
733 | 740 | unsigned int i; |
|
734 | 741 | |
|
735 | for (i=0; i<7; i++) | |
|
742 | for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) | |
|
736 | 743 | { |
|
737 | 744 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
738 | 745 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
@@ -794,16 +801,15 int send_waveform_SWF( volatile int *wav | |||
|
794 | 801 | |
|
795 | 802 | ret = LFR_DEFAULT; |
|
796 | 803 | |
|
797 | PRINTF1("sid = %d, ", sid) | |
|
798 | PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1]) | |
|
804 | DEBUG_PRINTF1("sid = %d, ", sid) | |
|
805 | DEBUG_PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1]) | |
|
806 | ||
|
807 | coarseTime = waveform[0]; | |
|
808 | fineTime = waveform[1]; | |
|
799 | 809 | |
|
800 | 810 | for (i=0; i<7; i++) // send waveform |
|
801 | 811 | { |
|
802 | #ifdef VHDL_DEV | |
|
803 | 812 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET]; |
|
804 | #else | |
|
805 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) ]; | |
|
806 | #endif | |
|
807 | 813 | spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ]; |
|
808 | 814 | // BUILD THE DATA |
|
809 | 815 | if (i==6) { |
@@ -815,25 +821,8 int send_waveform_SWF( volatile int *wav | |||
|
815 | 821 | // SET PACKET SEQUENCE COUNTER |
|
816 | 822 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); |
|
817 | 823 | // SET PACKET TIME |
|
818 | #ifdef VHDL_DEV | |
|
819 | coarseTime = waveform[0]; | |
|
820 | fineTime = waveform[1]; | |
|
821 | compute_acquisition_time( &coarseTime, &fineTime, sid, i); | |
|
822 | ||
|
823 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime >> 24 ); | |
|
824 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime >> 16 ); | |
|
825 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime >> 8 ); | |
|
826 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime ); | |
|
827 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime >> 8 ); | |
|
828 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime ); | |
|
829 | #else | |
|
830 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
|
831 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
|
832 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
|
833 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); | |
|
834 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
|
835 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); | |
|
836 | #endif | |
|
824 | compute_acquisition_time( coarseTime, fineTime, sid, i, headerSWF[ i ].acquisitionTime ); | |
|
825 | // | |
|
837 | 826 | headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
838 | 827 | headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
839 | 828 | headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
@@ -846,7 +835,7 int send_waveform_SWF( volatile int *wav | |||
|
846 | 835 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
847 | 836 | ret = LFR_DEFAULT; |
|
848 | 837 | } |
|
849 |
|
|
|
838 | rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds | |
|
850 | 839 | } |
|
851 | 840 | |
|
852 | 841 | return ret; |
@@ -869,8 +858,8 int send_waveform_CWF(volatile int *wave | |||
|
869 | 858 | |
|
870 | 859 | unsigned int i; |
|
871 | 860 | int ret; |
|
872 |
unsigned |
|
|
873 |
unsigned |
|
|
861 | unsigned int coarseTime; | |
|
862 | unsigned int fineTime; | |
|
874 | 863 | rtems_status_code status; |
|
875 | 864 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
876 | 865 | |
@@ -879,47 +868,26 int send_waveform_CWF(volatile int *wave | |||
|
879 | 868 | |
|
880 | 869 | ret = LFR_DEFAULT; |
|
881 | 870 | |
|
882 | for (i=0; i<7; i++) // send waveform | |
|
871 | coarseTime = waveform[0]; | |
|
872 | fineTime = waveform[1]; | |
|
873 | ||
|
874 | for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++) // send waveform | |
|
883 | 875 | { |
|
884 | int coarseTime = 0x00; | |
|
885 | int fineTime = 0x00; | |
|
886 | #ifdef VHDL_DEV | |
|
887 | 876 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET]; |
|
888 | #else | |
|
889 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) ]; | |
|
890 | #endif | |
|
891 | 877 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
892 | 878 | // BUILD THE DATA |
|
893 | 879 | spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK; |
|
894 | 880 | // SET PACKET SEQUENCE COUNTER |
|
895 | 881 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); |
|
896 | 882 | // SET PACKET TIME |
|
897 | #ifdef VHDL_DEV | |
|
898 | coarseTimePtr = (unsigned char *) &waveform; | |
|
899 | fineTimePtr = (unsigned char *) &waveform[1]; | |
|
900 | headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2]; | |
|
901 | headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3]; | |
|
902 | headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0]; | |
|
903 | headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1]; | |
|
904 | headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0]; | |
|
905 | headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1]; | |
|
906 | #else | |
|
907 | coarseTime = time_management_regs->coarse_time; | |
|
908 | fineTime = time_management_regs->fine_time; | |
|
909 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
|
910 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
|
911 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
|
912 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
|
913 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
|
914 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
|
915 | #endif | |
|
916 | ||
|
917 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
|
918 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
|
919 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
|
920 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
|
921 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
|
922 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
|
883 | compute_acquisition_time( coarseTime, fineTime, sid, i, headerCWF[ i ].acquisitionTime); | |
|
884 | // | |
|
885 | headerCWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
|
886 | headerCWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
|
887 | headerCWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
|
888 | headerCWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); | |
|
889 | headerCWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
|
890 | headerCWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); | |
|
923 | 891 | // SEND PACKET |
|
924 | 892 | if (sid == SID_NORM_CWF_LONG_F3) |
|
925 | 893 | { |
@@ -959,8 +927,8 int send_waveform_CWF3_light(volatile in | |||
|
959 | 927 | |
|
960 | 928 | unsigned int i; |
|
961 | 929 | int ret; |
|
962 |
unsigned |
|
|
963 |
unsigned |
|
|
930 | unsigned int coarseTime; | |
|
931 | unsigned int fineTime; | |
|
964 | 932 | rtems_status_code status; |
|
965 | 933 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
966 | 934 | char *sample; |
@@ -974,69 +942,37 int send_waveform_CWF3_light(volatile in | |||
|
974 | 942 | // BUILD CWF3_light DATA |
|
975 | 943 | for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
976 | 944 | { |
|
977 | #ifdef VHDL_DEV | |
|
978 | 945 | sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ]; |
|
979 | 946 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ]; |
|
980 | 947 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ]; |
|
981 | 948 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ]; |
|
982 | 949 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ]; |
|
983 | 950 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ]; |
|
984 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ]; | |
|
985 | #else | |
|
986 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; | |
|
987 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; | |
|
988 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; | |
|
989 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; | |
|
990 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; | |
|
991 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; | |
|
992 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; | |
|
993 | #endif | |
|
951 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ]; | |
|
994 | 952 |
|
|
995 | 953 | |
|
954 | coarseTime = waveform[0]; | |
|
955 | fineTime = waveform[1]; | |
|
956 | ||
|
996 | 957 | //********************* |
|
997 | 958 | // SEND CWF3_light DATA |
|
998 | ||
|
999 | for (i=0; i<7; i++) // send waveform | |
|
959 | for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform | |
|
1000 | 960 | { |
|
1001 | int coarseTime = 0x00; | |
|
1002 | int fineTime = 0x00; | |
|
1003 | ||
|
1004 | #ifdef VHDL_DEV | |
|
1005 | 961 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES]; |
|
1006 | #else | |
|
1007 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) ]; | |
|
1008 | #endif | |
|
1009 | 962 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
1010 | 963 | // BUILD THE DATA |
|
1011 | 964 | spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK; |
|
1012 | 965 | // SET PACKET SEQUENCE COUNTER |
|
1013 | 966 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); |
|
1014 | 967 | // SET PACKET TIME |
|
1015 | #ifdef VHDL_DEV | |
|
1016 | coarseTimePtr = (unsigned char *) &waveform; | |
|
1017 | fineTimePtr = (unsigned char *) &waveform[1]; | |
|
1018 | headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2]; | |
|
1019 | headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3]; | |
|
1020 | headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0]; | |
|
1021 | headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1]; | |
|
1022 | headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0]; | |
|
1023 | headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1]; | |
|
1024 | #else | |
|
1025 | coarseTime = time_management_regs->coarse_time; | |
|
1026 | fineTime = time_management_regs->fine_time; | |
|
1027 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
|
1028 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
|
1029 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
|
1030 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
|
1031 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
|
1032 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
|
1033 | #endif | |
|
1034 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
|
1035 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
|
1036 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
|
1037 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
|
1038 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
|
1039 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
|
968 | compute_acquisition_time( coarseTime, fineTime, SID_NORM_CWF_F3, i, headerCWF[ i ].acquisitionTime ); | |
|
969 | // | |
|
970 | headerCWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
|
971 | headerCWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
|
972 | headerCWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
|
973 | headerCWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); | |
|
974 | headerCWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
|
975 | headerCWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); | |
|
1040 | 976 | // SEND PACKET |
|
1041 | 977 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
1042 | 978 | if (status != RTEMS_SUCCESSFUL) { |
@@ -1049,39 +985,56 int send_waveform_CWF3_light(volatile in | |||
|
1049 | 985 | return ret; |
|
1050 | 986 | } |
|
1051 | 987 | |
|
1052 |
void compute_acquisition_time( unsigned int |
|
|
988 | void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime, | |
|
989 | unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime ) | |
|
1053 | 990 | { |
|
1054 | 991 | unsigned long long int acquisitionTimeAsLong; |
|
1055 | unsigned char acquisitionTime[6]; | |
|
1056 |
|
|
|
992 | unsigned char localAcquisitionTime[6]; | |
|
993 | double deltaT = 0.; | |
|
1057 | 994 | |
|
1058 |
acquisitionTime[0] = (unsigned char) ( |
|
|
1059 |
acquisitionTime[1] = (unsigned char) ( |
|
|
1060 |
acquisitionTime[2] = (unsigned char) ( |
|
|
1061 |
acquisitionTime[3] = (unsigned char) ( |
|
|
1062 |
acquisitionTime[4] = (unsigned char) ( |
|
|
1063 |
acquisitionTime[5] = (unsigned char) ( |
|
|
995 | localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 8 ); | |
|
996 | localAcquisitionTime[1] = (unsigned char) ( coarseTime ); | |
|
997 | localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 24 ); | |
|
998 | localAcquisitionTime[3] = (unsigned char) ( coarseTime >> 16 ); | |
|
999 | localAcquisitionTime[4] = (unsigned char) ( fineTime >> 24 ); | |
|
1000 | localAcquisitionTime[5] = (unsigned char) ( fineTime >> 16 ); | |
|
1064 | 1001 | |
|
1065 | acquisitionTimeAsLong = ( (unsigned long long int) acquisitionTime[0] << 40 ) | |
|
1066 | + ( (unsigned long long int) acquisitionTime[1] << 32 ) | |
|
1067 | + ( acquisitionTime[2] << 24 ) | |
|
1068 | + ( acquisitionTime[3] << 16 ) | |
|
1069 | + ( acquisitionTime[4] << 8 ) | |
|
1070 | + ( acquisitionTime[5] ); | |
|
1002 | acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 ) | |
|
1003 | + ( (unsigned long long int) localAcquisitionTime[1] << 32 ) | |
|
1004 | + ( localAcquisitionTime[2] << 24 ) | |
|
1005 | + ( localAcquisitionTime[3] << 16 ) | |
|
1006 | + ( localAcquisitionTime[4] << 8 ) | |
|
1007 | + ( localAcquisitionTime[5] ); | |
|
1071 | 1008 | |
|
1072 | 1009 | switch( sid ) |
|
1073 | 1010 | { |
|
1074 | 1011 | case SID_NORM_SWF_F0: |
|
1075 |
|
|
|
1076 |
|
|
|
1012 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ; | |
|
1013 | break; | |
|
1077 | 1014 | |
|
1078 | 1015 | case SID_NORM_SWF_F1: |
|
1079 |
|
|
|
1080 |
|
|
|
1016 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ; | |
|
1017 | break; | |
|
1018 | ||
|
1019 | case SID_SBM1_CWF_F1: | |
|
1020 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ; | |
|
1021 | break; | |
|
1081 | 1022 | |
|
1082 | 1023 | case SID_NORM_SWF_F2: |
|
1083 |
|
|
|
1084 |
|
|
|
1024 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ; | |
|
1025 | break; | |
|
1026 | ||
|
1027 | case SID_SBM2_CWF_F2: | |
|
1028 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ; | |
|
1029 | break; | |
|
1030 | ||
|
1031 | case SID_NORM_CWF_F3: | |
|
1032 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ; | |
|
1033 | break; | |
|
1034 | ||
|
1035 | case SID_NORM_CWF_LONG_F3: | |
|
1036 | deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ; | |
|
1037 | break; | |
|
1085 | 1038 | |
|
1086 | 1039 | default: |
|
1087 | 1040 | deltaT = 0.; |
@@ -1089,9 +1042,13 void compute_acquisition_time( unsigned | |||
|
1089 | 1042 | } |
|
1090 | 1043 | |
|
1091 | 1044 | acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT; |
|
1092 | ||
|
1093 |
|
|
|
1094 |
|
|
|
1045 | // | |
|
1046 | acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40); | |
|
1047 | acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32); | |
|
1048 | acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24); | |
|
1049 | acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16); | |
|
1050 | acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 ); | |
|
1051 | acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong ); | |
|
1095 | 1052 | } |
|
1096 | 1053 | |
|
1097 | 1054 | //************** |
@@ -1104,11 +1061,7 void reset_wfp_burst_enable(void) | |||
|
1104 | 1061 | * |
|
1105 | 1062 | */ |
|
1106 | 1063 | |
|
1107 | #ifdef VHDL_DEV | |
|
1108 | 1064 | waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
1109 | #else | |
|
1110 | waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |
|
1111 | #endif | |
|
1112 | 1065 | } |
|
1113 | 1066 | |
|
1114 | 1067 | void reset_wfp_status( void ) |
@@ -1119,10 +1072,7 void reset_wfp_status( void ) | |||
|
1119 | 1072 | * |
|
1120 | 1073 | */ |
|
1121 | 1074 | |
|
1122 | #ifdef GSA | |
|
1123 | #else | |
|
1124 | 1075 | waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
1125 | #endif | |
|
1126 | 1076 | } |
|
1127 | 1077 | |
|
1128 | 1078 | void reset_waveform_picker_regs(void) |
@@ -1166,11 +1116,11 void reset_waveform_picker_regs(void) | |||
|
1166 | 1116 | DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2) |
|
1167 | 1117 | DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1) |
|
1168 | 1118 | DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2) |
|
1169 |
// 2 |
|
|
1170 |
waveform_picker_regs->nb_data_by_buffer = 0x |
|
|
1171 |
waveform_picker_regs->snapshot_param = 0x |
|
|
1119 | // 2688 = 8 * 336 | |
|
1120 | waveform_picker_regs->nb_data_by_buffer = 0xa7f; // 0x30 *** 2688 - 1 => nb samples -1 | |
|
1121 | waveform_picker_regs->snapshot_param = 0xa80; // 0x34 *** 2688 => nb samples | |
|
1172 | 1122 | waveform_picker_regs->start_date = 0x00; // 0x38 |
|
1173 |
waveform_picker_regs->nb_word_in_buffer = 0x1 |
|
|
1123 | waveform_picker_regs->nb_word_in_buffer = 0x1f82; // 0x3c *** 2688 * 3 + 2 = 8066 | |
|
1174 | 1124 | } |
|
1175 | 1125 | |
|
1176 | 1126 | void set_wfp_data_shaping( void ) |
General Comments 0
You need to be logged in to leave comments.
Login now