@@ -0,0 +1,70 | |||||
|
1 | #ifndef FSW_PARAMS_PROCESSING_H | |||
|
2 | #define FSW_PARAMS_PROCESSING_H | |||
|
3 | ||||
|
4 | #define NB_BINS_PER_SM 128 | |||
|
5 | #define NB_VALUES_PER_SM 25 | |||
|
6 | #define TOTAL_SIZE_SM 3200 // 25 * 128 | |||
|
7 | #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99 | |||
|
8 | #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117 | |||
|
9 | #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108 | |||
|
10 | #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198 | |||
|
11 | // | |||
|
12 | #define NB_RING_NODES_SM_F0 12 // AT LEAST 3 | |||
|
13 | #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3 | |||
|
14 | #define NB_RING_NODES_ASM_NORM_F0 10 // AT LEAST 3 | |||
|
15 | #define NB_RING_NODES_SM_F1 3 // AT LEAST 3 | |||
|
16 | #define NB_RING_NODES_ASM_BURST_SBM_F1 5 // AT LEAST 3 | |||
|
17 | #define NB_RING_NODES_ASM_NORM_F1 5 // AT LEAST 3 | |||
|
18 | #define NB_RING_NODES_SM_F2 3 // AT LEAST 3 | |||
|
19 | #define NB_RING_NODES_ASM_BURST_SBM_F2 3 // AT LEAST 3 | |||
|
20 | #define NB_RING_NODES_ASM_NORM_F2 3 // AT LEAST 3 | |||
|
21 | // | |||
|
22 | #define NB_BINS_PER_ASM_F0 88 | |||
|
23 | #define NB_BINS_PER_PKT_ASM_F0 44 | |||
|
24 | #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2 | |||
|
25 | #define ASM_F0_INDICE_START 17 // 88 bins | |||
|
26 | #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins | |||
|
27 | // | |||
|
28 | #define NB_BINS_PER_ASM_F1 104 | |||
|
29 | #define NB_BINS_PER_PKT_ASM_F1 52 | |||
|
30 | #define TOTAL_SIZE_ASM_F1_IN_BYTES 5200 // 25 * 104 * 2 | |||
|
31 | #define ASM_F1_INDICE_START 6 // 104 bins | |||
|
32 | #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins | |||
|
33 | // | |||
|
34 | #define NB_BINS_PER_ASM_F2 96 | |||
|
35 | #define NB_BINS_PER_PKT_ASM_F2 48 | |||
|
36 | #define TOTAL_SIZE_ASM_F2_IN_BYTES 4800 // 25 * 96 * 2 | |||
|
37 | #define ASM_F2_INDICE_START 7 // 96 bins | |||
|
38 | #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins | |||
|
39 | // | |||
|
40 | #define NB_BINS_COMPRESSED_SM_F0 11 | |||
|
41 | #define NB_BINS_COMPRESSED_SM_F1 13 | |||
|
42 | #define NB_BINS_COMPRESSED_SM_F2 12 | |||
|
43 | #define NB_BINS_COMPRESSED_SM_SBM_F0 22 | |||
|
44 | #define NB_BINS_COMPRESSED_SM_SBM_F1 26 | |||
|
45 | #define NB_BINS_COMPRESSED_SM_SBM_F2 24 | |||
|
46 | // | |||
|
47 | #define NB_BYTES_PER_BP1 9 | |||
|
48 | // | |||
|
49 | #define NB_BINS_TO_AVERAGE_ASM_F0 8 | |||
|
50 | #define NB_BINS_TO_AVERAGE_ASM_F1 8 | |||
|
51 | #define NB_BINS_TO_AVERAGE_ASM_F2 8 | |||
|
52 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4 | |||
|
53 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4 | |||
|
54 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4 | |||
|
55 | // | |||
|
56 | #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS | |||
|
57 | #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS | |||
|
58 | #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F2 300 // 12 * 25 WORDS | |||
|
59 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS | |||
|
60 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS | |||
|
61 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F2 600 // 24 * 25 WORDS | |||
|
62 | #define TOTAL_SIZE_BP1_NORM_F0 99 // 9 * 11 UNSIGNED CHAR | |||
|
63 | #define TOTAL_SIZE_BP1_SBM_F0 198 // 9 * 22 UNSIGNED CHAR | |||
|
64 | // GENERAL | |||
|
65 | #define NB_SM_BEFORE_AVF0 8 // must be 8 due to the SM_average() function | |||
|
66 | #define NB_SM_BEFORE_AVF1 8 // must be 8 due to the SM_average() function | |||
|
67 | #define NB_SM_BEFORE_AVF2 1 // must be 1 due to the SM_average_f2() function | |||
|
68 | ||||
|
69 | #endif // FSW_PARAMS_PROCESSING_H | |||
|
70 |
@@ -0,0 +1,8 | |||||
|
1 | #ifndef FSW_PARAMS_WF_HANDLER_H | |||
|
2 | #define FSW_PARAMS_WF_HANDLER_H | |||
|
3 | ||||
|
4 | #define WFRM_BUFFER 8128 // (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 | |||
|
5 | // (2688 * 3 ) + 2 + 62 = 8128 = 0X1FC0 | |||
|
6 | // 8128 * 4 = 32512 = 0x7F00 | |||
|
7 | ||||
|
8 | #endif // FSW_PARAMS_WF_HANDLER_H |
@@ -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: Tue May |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue May 13 07:12:26 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 |
@@ -87,5 +87,6 HEADERS += \ | |||||
87 | ../header/processing/fsw_processing.h \ |
|
87 | ../header/processing/fsw_processing.h \ | |
88 | ../header/processing/avf0_prc0.h \ |
|
88 | ../header/processing/avf0_prc0.h \ | |
89 | ../header/processing/avf1_prc1.h \ |
|
89 | ../header/processing/avf1_prc1.h \ | |
90 | ../header/processing/avf2_prc2.h |
|
90 | ../header/processing/avf2_prc2.h \ | |
|
91 | ../header/fsw_params_wf_handler.h | |||
91 |
|
92 |
@@ -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-05-1 |
|
3 | <!-- Written by QtCreator 3.0.1, 2014-05-13T07:49:30. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> | |
@@ -51,9 +51,9 | |||||
51 | <data> |
|
51 | <data> | |
52 | <variable>ProjectExplorer.Project.Target.0</variable> |
|
52 | <variable>ProjectExplorer.Project.Target.0</variable> | |
53 | <valuemap type="QVariantMap"> |
|
53 | <valuemap type="QVariantMap"> | |
54 |
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8. |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> | |
55 |
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8. |
|
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> | |
56 |
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ |
|
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44}</value> | |
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
@@ -192,7 +192,7 | |||||
192 | </data> |
|
192 | </data> | |
193 | <data> |
|
193 | <data> | |
194 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
194 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> | |
195 |
<value type="QByteArray">{ |
|
195 | <value type="QByteArray">{cdbf9cdc-1e84-406e-889b-c4feef49e75c}</value> | |
196 | </data> |
|
196 | </data> | |
197 | <data> |
|
197 | <data> | |
198 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
198 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
@@ -35,6 +35,7 typedef struct ring_node | |||||
35 | #define NB_RING_NODES_F0 3 // AT LEAST 3 |
|
35 | #define NB_RING_NODES_F0 3 // AT LEAST 3 | |
36 | #define NB_RING_NODES_F1 5 // AT LEAST 3 |
|
36 | #define NB_RING_NODES_F1 5 // AT LEAST 3 | |
37 | #define NB_RING_NODES_F2 5 // AT LEAST 3 |
|
37 | #define NB_RING_NODES_F2 5 // AT LEAST 3 | |
|
38 | #define NB_RING_NODES_F3 3 // AT LEAST 3 | |||
38 |
|
39 | |||
39 | //********** |
|
40 | //********** | |
40 | // LFR MODES |
|
41 | // LFR MODES |
@@ -9,6 +9,7 | |||||
9 | #include "fsw_params.h" |
|
9 | #include "fsw_params.h" | |
10 | #include "fsw_spacewire.h" |
|
10 | #include "fsw_spacewire.h" | |
11 | #include "fsw_misc.h" |
|
11 | #include "fsw_misc.h" | |
|
12 | #include "fsw_params_wf_handler.h" | |||
12 |
|
13 | |||
13 | #define pi 3.1415 |
|
14 | #define pi 3.1415 | |
14 |
|
15 | |||
@@ -16,15 +17,10 extern int fdSPW; | |||||
16 |
|
17 | |||
17 | //***************** |
|
18 | //***************** | |
18 | // waveform buffers |
|
19 | // waveform buffers | |
19 | // F0 |
|
20 | extern volatile int wf_snap_f0[ ]; | |
20 |
|
|
21 | extern volatile int wf_snap_f1[ ]; | |
21 | // F1 F2 |
|
22 | extern volatile int wf_snap_f2[ ]; | |
22 | extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ]; |
|
23 | extern volatile int wf_cont_f3[ ]; | |
23 | extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ]; |
|
|||
24 | extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ]; |
|
|||
25 | // F3 |
|
|||
26 | extern volatile int wf_cont_f3_a[ ]; |
|
|||
27 | extern volatile int wf_cont_f3_b[ ]; |
|
|||
28 | extern char wf_cont_f3_light[ ]; |
|
24 | extern char wf_cont_f3_light[ ]; | |
29 |
|
25 | |||
30 | extern waveform_picker_regs_new_t *waveform_picker_regs; |
|
26 | extern waveform_picker_regs_new_t *waveform_picker_regs; | |
@@ -57,6 +53,7 rtems_task swbd_task( rtems_task_argumen | |||||
57 | // general functions |
|
53 | // general functions | |
58 | void init_waveforms( void ); |
|
54 | void init_waveforms( void ); | |
59 | void init_waveform_rings( void ); |
|
55 | void init_waveform_rings( void ); | |
|
56 | void init_waveform_ring( ring_node waveform_ring[], unsigned char nbNodes, volatile int wfrm[] ); | |||
60 | void reset_current_ring_nodes( void ); |
|
57 | void reset_current_ring_nodes( void ); | |
61 | // |
|
58 | // | |
62 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); |
|
59 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); |
@@ -20,6 +20,7 | |||||
20 | #include "ccsds_types.h" |
|
20 | #include "ccsds_types.h" | |
21 | #include "grlib_regs.h" |
|
21 | #include "grlib_regs.h" | |
22 | #include "fsw_params.h" |
|
22 | #include "fsw_params.h" | |
|
23 | #include "fsw_params_wf_handler.h" | |||
23 |
|
24 | |||
24 | // RTEMS GLOBAL VARIABLES |
|
25 | // RTEMS GLOBAL VARIABLES | |
25 | rtems_name misc_name[5]; |
|
26 | rtems_name misc_name[5]; | |
@@ -35,14 +36,11 unsigned char lfrCurrentMode; | |||||
35 | // 97 * 256 = 24832 => delta = 248 bytes = 62 words |
|
36 | // 97 * 256 = 24832 => delta = 248 bytes = 62 words | |
36 | // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264 |
|
37 | // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264 | |
37 | // 127 * 256 = 32512 => delta = 248 bytes = 62 words |
|
38 | // 127 * 256 = 32512 => delta = 248 bytes = 62 words | |
38 | // F0 |
|
39 | // F0 F1 F2 F3 | |
39 |
volatile int wf_snap_f0[ NB_RING_NODES_F0 |
|
40 | volatile int wf_snap_f0[ NB_RING_NODES_F0 * WFRM_BUFFER ] __attribute__((aligned(0x100))); | |
40 | // F1 F2 |
|
41 | volatile int wf_snap_f1[ NB_RING_NODES_F1 * WFRM_BUFFER ] __attribute__((aligned(0x100))); | |
41 |
volatile int wf_snap_f |
|
42 | volatile int wf_snap_f2[ NB_RING_NODES_F2 * WFRM_BUFFER ] __attribute__((aligned(0x100))); | |
42 |
volatile int wf_ |
|
43 | volatile int wf_cont_f3[ NB_RING_NODES_F3 * WFRM_BUFFER ] __attribute__((aligned(0x100))); | |
43 | // F3 |
|
|||
44 | volatile int wf_cont_f3_a [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); |
|
|||
45 | volatile int wf_cont_f3_b [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); |
|
|||
46 | char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100))); |
|
44 | char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100))); | |
47 |
|
45 | |||
48 | //*********************************** |
|
46 | //*********************************** |
@@ -21,8 +21,8 float asm_f0_reorganized [ TOTAL_SIZE_ | |||||
21 | char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ]; |
|
21 | char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ]; | |
22 | float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_NORM_F0]; |
|
22 | float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_NORM_F0]; | |
23 | float compressed_sm_sbm_f0 [ TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 ]; |
|
23 | float compressed_sm_sbm_f0 [ TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 ]; | |
24 | unsigned char bp1_norm_f0 [ TOTAL_SIZE_BP1_NORM_F0 ]; |
|
24 | //unsigned char bp1_norm_f0 [ TOTAL_SIZE_BP1_NORM_F0 ]; | |
25 | unsigned char bp1_sbm_f0 [ TOTAL_SIZE_BP1_SBM_F0 ]; |
|
25 | //unsigned char bp1_sbm_f0 [ TOTAL_SIZE_BP1_SBM_F0 ]; | |
26 |
|
26 | |||
27 | //************ |
|
27 | //************ | |
28 | // RTEMS TASKS |
|
28 | // RTEMS TASKS |
@@ -27,6 +27,7 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3 | |||||
27 | ring_node waveform_ring_f0[NB_RING_NODES_F0]; |
|
27 | ring_node waveform_ring_f0[NB_RING_NODES_F0]; | |
28 | ring_node waveform_ring_f1[NB_RING_NODES_F1]; |
|
28 | ring_node waveform_ring_f1[NB_RING_NODES_F1]; | |
29 | ring_node waveform_ring_f2[NB_RING_NODES_F2]; |
|
29 | ring_node waveform_ring_f2[NB_RING_NODES_F2]; | |
|
30 | ring_node waveform_ring_f3[NB_RING_NODES_F3]; | |||
30 | ring_node *current_ring_node_f0; |
|
31 | ring_node *current_ring_node_f0; | |
31 | ring_node *ring_node_to_send_swf_f0; |
|
32 | ring_node *ring_node_to_send_swf_f0; | |
32 | ring_node *current_ring_node_f1; |
|
33 | ring_node *current_ring_node_f1; | |
@@ -35,6 +36,8 ring_node *ring_node_to_send_cwf_f1; | |||||
35 | ring_node *current_ring_node_f2; |
|
36 | ring_node *current_ring_node_f2; | |
36 | ring_node *ring_node_to_send_swf_f2; |
|
37 | ring_node *ring_node_to_send_swf_f2; | |
37 | ring_node *ring_node_to_send_cwf_f2; |
|
38 | ring_node *ring_node_to_send_cwf_f2; | |
|
39 | ring_node *current_ring_node_f3; | |||
|
40 | ring_node *ring_node_to_send_cwf_f3; | |||
38 |
|
41 | |||
39 | bool extractSWF = false; |
|
42 | bool extractSWF = false; | |
40 | bool swf_f0_ready = false; |
|
43 | bool swf_f0_ready = false; | |
@@ -71,12 +74,9 rtems_isr waveforms_isr( rtems_vector_nu | |||||
71 | { // in modes other than STANDBY and BURST, send the CWF_F3 data |
|
74 | { // in modes other than STANDBY and BURST, send the CWF_F3 data | |
72 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full |
|
75 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full | |
73 | // (1) change the receiving buffer for the waveform picker |
|
76 | // (1) change the receiving buffer for the waveform picker | |
74 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { |
|
77 | ring_node_to_send_cwf_f3 = current_ring_node_f3; | |
75 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b); |
|
78 | current_ring_node_f3 = current_ring_node_f3->next; | |
76 | } |
|
79 | waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address; | |
77 | else { |
|
|||
78 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); |
|
|||
79 | } |
|
|||
80 | // (2) send an event for the waveforms transmission |
|
80 | // (2) send an event for the waveforms transmission | |
81 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
81 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
82 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
82 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
@@ -289,33 +289,18 rtems_task cwf3_task(rtems_task_argument | |||||
289 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) |
|
289 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) | |
290 | { |
|
290 | { | |
291 | PRINTF("send CWF_LONG_F3\n") |
|
291 | PRINTF("send CWF_LONG_F3\n") | |
|
292 | send_waveform_CWF( | |||
|
293 | (volatile int*) current_ring_node_f3->buffer_address, | |||
|
294 | SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); | |||
292 | } |
|
295 | } | |
293 | else |
|
296 | else | |
294 | { |
|
297 | { | |
295 | PRINTF("send CWF_F3 (light)\n") |
|
298 | PRINTF("send CWF_F3 (light)\n") | |
296 | } |
|
299 | send_waveform_CWF3_light( | |
297 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) { |
|
300 | (volatile int*) current_ring_node_f3->buffer_address, | |
298 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) |
|
301 | headerCWF_F3_light, queue_id ); | |
299 | { |
|
|||
300 | send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); |
|
|||
301 | } |
|
|||
302 | else |
|
|||
303 | { |
|
|||
304 | send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id ); |
|
|||
305 | } |
|
|||
306 | } |
|
302 | } | |
307 | else |
|
|||
308 | { |
|
|||
309 | if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01) |
|
|||
310 | { |
|
|||
311 | send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id ); |
|
|||
312 | } |
|
|||
313 | else |
|
|||
314 | { |
|
|||
315 | send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id ); |
|
|||
316 | } |
|
|||
317 |
|
303 | |||
318 | } |
|
|||
319 | } |
|
304 | } | |
320 | else |
|
305 | else | |
321 | { |
|
306 | { | |
@@ -498,60 +483,39 void init_waveforms( void ) | |||||
498 |
|
483 | |||
499 | void init_waveform_rings( void ) |
|
484 | void init_waveform_rings( void ) | |
500 | { |
|
485 | { | |
501 | unsigned char i; |
|
|||
502 |
|
||||
503 | // F0 RING |
|
486 | // F0 RING | |
504 | waveform_ring_f0[0].next = (ring_node*) &waveform_ring_f0[1]; |
|
487 | init_waveform_ring( waveform_ring_f0, NB_RING_NODES_F0, wf_snap_f0 ); | |
505 | waveform_ring_f0[0].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-1]; |
|
|||
506 | waveform_ring_f0[0].buffer_address = (int) &wf_snap_f0[0][0]; |
|
|||
507 |
|
||||
508 | waveform_ring_f0[NB_RING_NODES_F0-1].next = (ring_node*) &waveform_ring_f0[0]; |
|
|||
509 | waveform_ring_f0[NB_RING_NODES_F0-1].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-2]; |
|
|||
510 | waveform_ring_f0[NB_RING_NODES_F0-1].buffer_address = (int) &wf_snap_f0[NB_RING_NODES_F0-1][0]; |
|
|||
511 |
|
||||
512 | for(i=1; i<NB_RING_NODES_F0-1; i++) |
|
|||
513 | { |
|
|||
514 | waveform_ring_f0[i].next = (ring_node*) &waveform_ring_f0[i+1]; |
|
|||
515 | waveform_ring_f0[i].previous = (ring_node*) &waveform_ring_f0[i-1]; |
|
|||
516 | waveform_ring_f0[i].buffer_address = (int) &wf_snap_f0[i][0]; |
|
|||
517 | } |
|
|||
518 |
|
||||
519 | // F1 RING |
|
488 | // F1 RING | |
520 | waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1]; |
|
489 | init_waveform_ring( waveform_ring_f1, NB_RING_NODES_F1, wf_snap_f1 ); | |
521 | waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1]; |
|
|||
522 | waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0]; |
|
|||
523 |
|
||||
524 | waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0]; |
|
|||
525 | waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2]; |
|
|||
526 | waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0]; |
|
|||
527 |
|
||||
528 | for(i=1; i<NB_RING_NODES_F1-1; i++) |
|
|||
529 | { |
|
|||
530 | waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1]; |
|
|||
531 | waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1]; |
|
|||
532 | waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0]; |
|
|||
533 | } |
|
|||
534 |
|
||||
535 | // F2 RING |
|
490 | // F2 RING | |
536 | waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1]; |
|
491 | init_waveform_ring( waveform_ring_f2, NB_RING_NODES_F2, wf_snap_f2 ); | |
537 | waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1]; |
|
492 | // F3 RING | |
538 | waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0]; |
|
493 | init_waveform_ring( waveform_ring_f3, NB_RING_NODES_F3, wf_cont_f3 ); | |
539 |
|
||||
540 | waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0]; |
|
|||
541 | waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2]; |
|
|||
542 | waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0]; |
|
|||
543 |
|
||||
544 | for(i=1; i<NB_RING_NODES_F2-1; i++) |
|
|||
545 | { |
|
|||
546 | waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1]; |
|
|||
547 | waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1]; |
|
|||
548 | waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0]; |
|
|||
549 | } |
|
|||
550 |
|
494 | |||
551 | DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0) |
|
495 | DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0) | |
552 | DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1) |
|
496 | DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1) | |
553 | DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2) |
|
497 | DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2) | |
|
498 | DEBUG_PRINTF1("waveform_ring_f3 @%x\n", (unsigned int) waveform_ring_f3) | |||
|
499 | } | |||
554 |
|
500 | |||
|
501 | void init_waveform_ring(ring_node waveform_ring[], unsigned char nbNodes, volatile int wfrm[] ) | |||
|
502 | { | |||
|
503 | unsigned char i; | |||
|
504 | ||||
|
505 | waveform_ring[0].next = (ring_node*) &waveform_ring[ 1 ]; | |||
|
506 | waveform_ring[0].previous = (ring_node*) &waveform_ring[ nbNodes - 1 ]; | |||
|
507 | waveform_ring[0].buffer_address = (int) &wfrm[0]; | |||
|
508 | ||||
|
509 | waveform_ring[nbNodes-1].next = (ring_node*) &waveform_ring[ 0 ]; | |||
|
510 | waveform_ring[nbNodes-1].previous = (ring_node*) &waveform_ring[ nbNodes - 2 ]; | |||
|
511 | waveform_ring[nbNodes-1].buffer_address = (int) &wfrm[ (nbNodes-1) * WFRM_BUFFER ]; | |||
|
512 | ||||
|
513 | for(i=1; i<nbNodes-1; i++) | |||
|
514 | { | |||
|
515 | waveform_ring[i].next = (ring_node*) &waveform_ring[ i + 1 ]; | |||
|
516 | waveform_ring[i].previous = (ring_node*) &waveform_ring[ i - 1 ]; | |||
|
517 | waveform_ring[i].buffer_address = (int) &wfrm[ i * WFRM_BUFFER ]; | |||
|
518 | } | |||
555 | } |
|
519 | } | |
556 |
|
520 | |||
557 | void reset_current_ring_nodes( void ) |
|
521 | void reset_current_ring_nodes( void ) | |
@@ -566,6 +530,9 void reset_current_ring_nodes( void ) | |||||
566 | current_ring_node_f2 = waveform_ring_f2; |
|
530 | current_ring_node_f2 = waveform_ring_f2; | |
567 | ring_node_to_send_cwf_f2 = waveform_ring_f2; |
|
531 | ring_node_to_send_cwf_f2 = waveform_ring_f2; | |
568 | ring_node_to_send_swf_f2 = waveform_ring_f2; |
|
532 | ring_node_to_send_swf_f2 = waveform_ring_f2; | |
|
533 | ||||
|
534 | current_ring_node_f3 = waveform_ring_f3; | |||
|
535 | ring_node_to_send_cwf_f3 = waveform_ring_f3; | |||
569 | } |
|
536 | } | |
570 |
|
537 | |||
571 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) |
|
538 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) | |
@@ -1152,7 +1119,7 void reset_waveform_picker_regs(void) | |||||
1152 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08 |
|
1119 | waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08 | |
1153 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c |
|
1120 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c | |
1154 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10 |
|
1121 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10 | |
1155 |
waveform_picker_regs->addr_data_f3 = |
|
1122 | waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address; // 0x14 | |
1156 | reset_wfp_status(); // 0x18 |
|
1123 | reset_wfp_status(); // 0x18 | |
1157 | // |
|
1124 | // | |
1158 | set_wfp_delta_snapshot(); // 0x1c |
|
1125 | set_wfp_delta_snapshot(); // 0x1c |
General Comments 0
You need to be logged in to leave comments.
Login now