##// END OF EJS Templates
STAT task removec...
paul -
r239:1c5814170464 R3
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 e1bf35e31e3c8c1d1448d2e485c71f5f1259615c header/lfr_common_headers
2 721463c11a484e6a3439e16c99f8bd27720b9265 header/lfr_common_headers
@@ -1,69 +1,77
1 #ifndef FSW_MISC_H_INCLUDED
1 #ifndef FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6 #include <grspw.h>
6 #include <grspw.h>
7 #include <grlib_regs.h>
7 #include <grlib_regs.h>
8
8
9 #include "fsw_params.h"
9 #include "fsw_params.h"
10 #include "fsw_spacewire.h"
10 #include "fsw_spacewire.h"
11 #include "lfr_cpu_usage_report.h"
11 #include "lfr_cpu_usage_report.h"
12
12
13 enum lfr_reset_cause_t{
13 enum lfr_reset_cause_t{
14 UNKNOWN_CAUSE,
14 UNKNOWN_CAUSE,
15 POWER_ON,
15 POWER_ON,
16 TC_RESET,
16 TC_RESET,
17 WATCHDOG,
17 WATCHDOG,
18 ERROR_RESET,
18 ERROR_RESET,
19 UNEXP_RESET
19 UNEXP_RESET
20 };
20 };
21
21
22 extern gptimer_regs_t *gptimer_regs;
23
22 #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0
24 #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0
23
25
24 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
26 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
25 rtems_id HK_id; // id of the HK rate monotonic period
27 rtems_id HK_id; // id of the HK rate monotonic period
26
28
27 void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
29 void timer_configure( unsigned char timer, unsigned int clock_divider,
28 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
30 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
29 void timer_start( gptimer_regs_t *gptimer_regs, unsigned char timer );
31 void timer_start( unsigned char timer );
30 void timer_stop( gptimer_regs_t *gptimer_regs, unsigned char timer );
32 void timer_stop( unsigned char timer );
31 void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider);
33 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
34
35 // WATCHDOG
36 rtems_isr watchdog_isr( rtems_vector_number vector );
37 void watchdog_configure(void);
38 void watchdog_stop(void);
39 void watchdog_start(void);
32
40
33 // SERIAL LINK
41 // SERIAL LINK
34 int send_console_outputs_on_apbuart_port( void );
42 int send_console_outputs_on_apbuart_port( void );
35 int enable_apbuart_transmitter( void );
43 int enable_apbuart_transmitter( void );
36 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
44 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
37
45
38 // RTEMS TASKS
46 // RTEMS TASKS
39 rtems_task stat_task( rtems_task_argument argument );
47 rtems_task load_task( rtems_task_argument argument );
40 rtems_task hous_task( rtems_task_argument argument );
48 rtems_task hous_task( rtems_task_argument argument );
41 rtems_task dumb_task( rtems_task_argument unused );
49 rtems_task dumb_task( rtems_task_argument unused );
42
50
43 void init_housekeeping_parameters( void );
51 void init_housekeeping_parameters( void );
44 void increment_seq_counter(unsigned short *packetSequenceControl);
52 void increment_seq_counter(unsigned short *packetSequenceControl);
45 void getTime( unsigned char *time);
53 void getTime( unsigned char *time);
46 unsigned long long int getTimeAsUnsignedLongLongInt( );
54 unsigned long long int getTimeAsUnsignedLongLongInt( );
47 void send_dumb_hk( void );
55 void send_dumb_hk( void );
48 void get_temperatures( unsigned char *temperatures );
56 void get_temperatures( unsigned char *temperatures );
49 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
57 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
50 void get_cpu_load( unsigned char *resource_statistics );
58 void get_cpu_load( unsigned char *resource_statistics );
51 void set_hk_lfr_sc_potential_flag( bool state );
59 void set_hk_lfr_sc_potential_flag( bool state );
52 void set_hk_lfr_mag_fields_flag( bool state );
60 void set_hk_lfr_mag_fields_flag( bool state );
53 void set_hk_lfr_calib_enable( bool state );
61 void set_hk_lfr_calib_enable( bool state );
54 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
62 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
55
63
56 extern int sched_yield( void );
64 extern int sched_yield( void );
57 extern void rtems_cpu_usage_reset();
65 extern void rtems_cpu_usage_reset();
58 extern ring_node *current_ring_node_f3;
66 extern ring_node *current_ring_node_f3;
59 extern ring_node *ring_node_to_send_cwf_f3;
67 extern ring_node *ring_node_to_send_cwf_f3;
60 extern ring_node waveform_ring_f3[];
68 extern ring_node waveform_ring_f3[];
61 extern unsigned short sequenceCounterHK;
69 extern unsigned short sequenceCounterHK;
62
70
63 extern unsigned char hk_lfr_q_sd_fifo_size_max;
71 extern unsigned char hk_lfr_q_sd_fifo_size_max;
64 extern unsigned char hk_lfr_q_rv_fifo_size_max;
72 extern unsigned char hk_lfr_q_rv_fifo_size_max;
65 extern unsigned char hk_lfr_q_p0_fifo_size_max;
73 extern unsigned char hk_lfr_q_p0_fifo_size_max;
66 extern unsigned char hk_lfr_q_p1_fifo_size_max;
74 extern unsigned char hk_lfr_q_p1_fifo_size_max;
67 extern unsigned char hk_lfr_q_p2_fifo_size_max;
75 extern unsigned char hk_lfr_q_p2_fifo_size_max;
68
76
69 #endif // FSW_MISC_H_INCLUDED
77 #endif // FSW_MISC_H_INCLUDED
@@ -1,329 +1,327
1 #ifndef FSW_PROCESSING_H_INCLUDED
1 #ifndef FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6 #include <math.h>
6 #include <math.h>
7 #include <stdlib.h> // abs() is in the stdlib
7 #include <stdlib.h> // abs() is in the stdlib
8 #include <stdio.h>
8 #include <stdio.h>
9 #include <math.h>
9 #include <math.h>
10 #include <grlib_regs.h>
10 #include <grlib_regs.h>
11
11
12 #include "fsw_params.h"
12 #include "fsw_params.h"
13
13
14 typedef struct ring_node_asm
14 typedef struct ring_node_asm
15 {
15 {
16 struct ring_node_asm *next;
16 struct ring_node_asm *next;
17 float matrix[ TOTAL_SIZE_SM ];
17 float matrix[ TOTAL_SIZE_SM ];
18 unsigned int status;
18 unsigned int status;
19 } ring_node_asm;
19 } ring_node_asm;
20
20
21 typedef struct
21 typedef struct
22 {
22 {
23 unsigned char targetLogicalAddress;
23 unsigned char targetLogicalAddress;
24 unsigned char protocolIdentifier;
24 unsigned char protocolIdentifier;
25 unsigned char reserved;
25 unsigned char reserved;
26 unsigned char userApplication;
26 unsigned char userApplication;
27 unsigned char packetID[2];
27 unsigned char packetID[2];
28 unsigned char packetSequenceControl[2];
28 unsigned char packetSequenceControl[2];
29 unsigned char packetLength[2];
29 unsigned char packetLength[2];
30 // DATA FIELD HEADER
30 // DATA FIELD HEADER
31 unsigned char spare1_pusVersion_spare2;
31 unsigned char spare1_pusVersion_spare2;
32 unsigned char serviceType;
32 unsigned char serviceType;
33 unsigned char serviceSubType;
33 unsigned char serviceSubType;
34 unsigned char destinationID;
34 unsigned char destinationID;
35 unsigned char time[6];
35 unsigned char time[6];
36 // AUXILIARY HEADER
36 // AUXILIARY HEADER
37 unsigned char sid;
37 unsigned char sid;
38 unsigned char biaStatusInfo;
38 unsigned char biaStatusInfo;
39 unsigned char sy_lfr_common_parameters_spare;
39 unsigned char sy_lfr_common_parameters_spare;
40 unsigned char sy_lfr_common_parameters;
40 unsigned char sy_lfr_common_parameters;
41 unsigned char acquisitionTime[6];
41 unsigned char acquisitionTime[6];
42 unsigned char pa_lfr_bp_blk_nr[2];
42 unsigned char pa_lfr_bp_blk_nr[2];
43 // SOURCE DATA
43 // SOURCE DATA
44 unsigned char data[ 780 ]; // MAX size is 26 bins * 30 Bytes [TM_LFR_SCIENCE_BURST_BP2_F1]
44 unsigned char data[ 780 ]; // MAX size is 26 bins * 30 Bytes [TM_LFR_SCIENCE_BURST_BP2_F1]
45 } bp_packet;
45 } bp_packet;
46
46
47 typedef struct
47 typedef struct
48 {
48 {
49 unsigned char targetLogicalAddress;
49 unsigned char targetLogicalAddress;
50 unsigned char protocolIdentifier;
50 unsigned char protocolIdentifier;
51 unsigned char reserved;
51 unsigned char reserved;
52 unsigned char userApplication;
52 unsigned char userApplication;
53 unsigned char packetID[2];
53 unsigned char packetID[2];
54 unsigned char packetSequenceControl[2];
54 unsigned char packetSequenceControl[2];
55 unsigned char packetLength[2];
55 unsigned char packetLength[2];
56 // DATA FIELD HEADER
56 // DATA FIELD HEADER
57 unsigned char spare1_pusVersion_spare2;
57 unsigned char spare1_pusVersion_spare2;
58 unsigned char serviceType;
58 unsigned char serviceType;
59 unsigned char serviceSubType;
59 unsigned char serviceSubType;
60 unsigned char destinationID;
60 unsigned char destinationID;
61 unsigned char time[6];
61 unsigned char time[6];
62 // AUXILIARY HEADER
62 // AUXILIARY HEADER
63 unsigned char sid;
63 unsigned char sid;
64 unsigned char biaStatusInfo;
64 unsigned char biaStatusInfo;
65 unsigned char sy_lfr_common_parameters_spare;
65 unsigned char sy_lfr_common_parameters_spare;
66 unsigned char sy_lfr_common_parameters;
66 unsigned char sy_lfr_common_parameters;
67 unsigned char acquisitionTime[6];
67 unsigned char acquisitionTime[6];
68 unsigned char source_data_spare;
68 unsigned char source_data_spare;
69 unsigned char pa_lfr_bp_blk_nr[2];
69 unsigned char pa_lfr_bp_blk_nr[2];
70 // SOURCE DATA
70 // SOURCE DATA
71 unsigned char data[ 143 ]; // 13 bins * 11 Bytes
71 unsigned char data[ 143 ]; // 13 bins * 11 Bytes
72 } bp_packet_with_spare; // only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1
72 } bp_packet_with_spare; // only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1
73
73
74 typedef struct asm_msg
74 typedef struct asm_msg
75 {
75 {
76 ring_node_asm *norm;
76 ring_node_asm *norm;
77 ring_node_asm *burst_sbm;
77 ring_node_asm *burst_sbm;
78 rtems_event_set event;
78 rtems_event_set event;
79 unsigned int coarseTimeNORM;
79 unsigned int coarseTimeNORM;
80 unsigned int fineTimeNORM;
80 unsigned int fineTimeNORM;
81 unsigned int coarseTimeSBM;
81 unsigned int coarseTimeSBM;
82 unsigned int fineTimeSBM;
82 unsigned int fineTimeSBM;
83 } asm_msg;
83 } asm_msg;
84
84
85 extern volatile int sm_f0[ ];
85 extern volatile int sm_f0[ ];
86 extern volatile int sm_f1[ ];
86 extern volatile int sm_f1[ ];
87 extern volatile int sm_f2[ ];
87 extern volatile int sm_f2[ ];
88
88
89 // parameters
89 // parameters
90 extern struct param_local_str param_local;
90 extern struct param_local_str param_local;
91 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
91 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
92
92
93 // registers
93 // registers
94 extern time_management_regs_t *time_management_regs;
94 extern time_management_regs_t *time_management_regs;
95 extern volatile spectral_matrix_regs_t *spectral_matrix_regs;
95 extern volatile spectral_matrix_regs_t *spectral_matrix_regs;
96
96
97 extern rtems_name misc_name[5];
97 extern rtems_name misc_name[5];
98 extern rtems_id Task_id[20]; /* array of task ids */
98 extern rtems_id Task_id[20]; /* array of task ids */
99
99
100 //
101 ring_node * getRingNodeForAveraging( unsigned char frequencyChannel);
100 ring_node * getRingNodeForAveraging( unsigned char frequencyChannel);
102 // ISR
101 // ISR
103 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
102 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
104 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector );
105
103
106 //******************
104 //******************
107 // Spectral Matrices
105 // Spectral Matrices
108 void reset_nb_sm( void );
106 void reset_nb_sm( void );
109 // SM
107 // SM
110 void SM_init_rings( void );
108 void SM_init_rings( void );
111 void SM_reset_current_ring_nodes( void );
109 void SM_reset_current_ring_nodes( void );
112 // ASM
110 // ASM
113 void ASM_generic_init_ring(ring_node_asm *ring, unsigned char nbNodes );
111 void ASM_generic_init_ring(ring_node_asm *ring, unsigned char nbNodes );
114
112
115 //*****************
113 //*****************
116 // Basic Parameters
114 // Basic Parameters
117
115
118 void BP_reset_current_ring_nodes( void );
116 void BP_reset_current_ring_nodes( void );
119 void BP_init_header(bp_packet *packet,
117 void BP_init_header(bp_packet *packet,
120 unsigned int apid, unsigned char sid,
118 unsigned int apid, unsigned char sid,
121 unsigned int packetLength , unsigned char blkNr);
119 unsigned int packetLength , unsigned char blkNr);
122 void BP_init_header_with_spare(bp_packet_with_spare *packet,
120 void BP_init_header_with_spare(bp_packet_with_spare *packet,
123 unsigned int apid, unsigned char sid,
121 unsigned int apid, unsigned char sid,
124 unsigned int packetLength, unsigned char blkNr );
122 unsigned int packetLength, unsigned char blkNr );
125 void BP_send( char *data,
123 void BP_send( char *data,
126 rtems_id queue_id ,
124 rtems_id queue_id ,
127 unsigned int nbBytesToSend , unsigned int sid );
125 unsigned int nbBytesToSend , unsigned int sid );
128
126
129 //******************
127 //******************
130 // general functions
128 // general functions
131 void reset_sm_status( void );
129 void reset_sm_status( void );
132 void reset_spectral_matrix_regs( void );
130 void reset_spectral_matrix_regs( void );
133 void set_time(unsigned char *time, unsigned char *timeInBuffer );
131 void set_time(unsigned char *time, unsigned char *timeInBuffer );
134 unsigned long long int get_acquisition_time( unsigned char *timePtr );
132 unsigned long long int get_acquisition_time( unsigned char *timePtr );
135 unsigned char getSID( rtems_event_set event );
133 unsigned char getSID( rtems_event_set event );
136
134
137 extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
135 extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id );
138 extern rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
136 extern rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id );
139
137
140 //***************************************
138 //***************************************
141 // DEFINITIONS OF STATIC INLINE FUNCTIONS
139 // DEFINITIONS OF STATIC INLINE FUNCTIONS
142 static inline void SM_average(float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
140 static inline void SM_average(float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
143 ring_node *ring_node_tab[],
141 ring_node *ring_node_tab[],
144 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
142 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
145 asm_msg *msgForMATR );
143 asm_msg *msgForMATR );
146
144
147 static inline void SM_average_debug(float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
145 static inline void SM_average_debug(float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
148 ring_node *ring_node_tab[],
146 ring_node *ring_node_tab[],
149 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
147 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
150 asm_msg *msgForMATR );
148 asm_msg *msgForMATR );
151
149
152 void ASM_patch( float *inputASM, float *outputASM );
150 void ASM_patch( float *inputASM, float *outputASM );
153
151
154 void extractReImVectors(float *inputASM, float *outputASM, unsigned int asmComponent );
152 void extractReImVectors(float *inputASM, float *outputASM, unsigned int asmComponent );
155
153
156 static inline void ASM_reorganize_and_divide(float *averaged_spec_mat, float *averaged_spec_mat_reorganized,
154 static inline void ASM_reorganize_and_divide(float *averaged_spec_mat, float *averaged_spec_mat_reorganized,
157 float divider );
155 float divider );
158
156
159 static inline void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat,
157 static inline void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat,
160 float divider,
158 float divider,
161 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart);
159 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart);
162
160
163 static inline void ASM_convert(volatile float *input_matrix, char *output_matrix);
161 static inline void ASM_convert(volatile float *input_matrix, char *output_matrix);
164
162
165 void SM_average( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
163 void SM_average( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
166 ring_node *ring_node_tab[],
164 ring_node *ring_node_tab[],
167 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
165 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
168 asm_msg *msgForMATR )
166 asm_msg *msgForMATR )
169 {
167 {
170 float sum;
168 float sum;
171 unsigned int i;
169 unsigned int i;
172
170
173 for(i=0; i<TOTAL_SIZE_SM; i++)
171 for(i=0; i<TOTAL_SIZE_SM; i++)
174 {
172 {
175 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ]
173 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ]
176 + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ]
174 + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ]
177 + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ]
175 + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ]
178 + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ]
176 + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ]
179 + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ]
177 + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ]
180 + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ]
178 + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ]
181 + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ]
179 + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ]
182 + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ];
180 + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ];
183
181
184 if ( (nbAverageNORM == 0) && (nbAverageSBM == 0) )
182 if ( (nbAverageNORM == 0) && (nbAverageSBM == 0) )
185 {
183 {
186 averaged_spec_mat_NORM[ i ] = sum;
184 averaged_spec_mat_NORM[ i ] = sum;
187 averaged_spec_mat_SBM[ i ] = sum;
185 averaged_spec_mat_SBM[ i ] = sum;
188 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
186 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
189 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
187 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
190 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
188 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
191 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
189 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
192 }
190 }
193 else if ( (nbAverageNORM != 0) && (nbAverageSBM != 0) )
191 else if ( (nbAverageNORM != 0) && (nbAverageSBM != 0) )
194 {
192 {
195 averaged_spec_mat_NORM[ i ] = ( averaged_spec_mat_NORM[ i ] + sum );
193 averaged_spec_mat_NORM[ i ] = ( averaged_spec_mat_NORM[ i ] + sum );
196 averaged_spec_mat_SBM[ i ] = ( averaged_spec_mat_SBM[ i ] + sum );
194 averaged_spec_mat_SBM[ i ] = ( averaged_spec_mat_SBM[ i ] + sum );
197 }
195 }
198 else if ( (nbAverageNORM != 0) && (nbAverageSBM == 0) )
196 else if ( (nbAverageNORM != 0) && (nbAverageSBM == 0) )
199 {
197 {
200 averaged_spec_mat_NORM[ i ] = ( averaged_spec_mat_NORM[ i ] + sum );
198 averaged_spec_mat_NORM[ i ] = ( averaged_spec_mat_NORM[ i ] + sum );
201 averaged_spec_mat_SBM[ i ] = sum;
199 averaged_spec_mat_SBM[ i ] = sum;
202 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
200 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
203 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
201 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
204 }
202 }
205 else
203 else
206 {
204 {
207 averaged_spec_mat_NORM[ i ] = sum;
205 averaged_spec_mat_NORM[ i ] = sum;
208 averaged_spec_mat_SBM[ i ] = ( averaged_spec_mat_SBM[ i ] + sum );
206 averaged_spec_mat_SBM[ i ] = ( averaged_spec_mat_SBM[ i ] + sum );
209 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
207 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
210 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
208 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
211 // PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNORM, nbAverageSBM)
209 // PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNORM, nbAverageSBM)
212 }
210 }
213 }
211 }
214 }
212 }
215
213
216 void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
214 void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
217 ring_node *ring_node_tab[],
215 ring_node *ring_node_tab[],
218 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
216 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
219 asm_msg *msgForMATR )
217 asm_msg *msgForMATR )
220 {
218 {
221 float sum;
219 float sum;
222 unsigned int i;
220 unsigned int i;
223
221
224 for(i=0; i<TOTAL_SIZE_SM; i++)
222 for(i=0; i<TOTAL_SIZE_SM; i++)
225 {
223 {
226 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ];
224 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ];
227 averaged_spec_mat_NORM[ i ] = sum;
225 averaged_spec_mat_NORM[ i ] = sum;
228 averaged_spec_mat_SBM[ i ] = sum;
226 averaged_spec_mat_SBM[ i ] = sum;
229 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
227 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
230 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
228 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
231 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
229 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
232 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
230 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
233 }
231 }
234 }
232 }
235
233
236 void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider )
234 void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider )
237 {
235 {
238 int frequencyBin;
236 int frequencyBin;
239 int asmComponent;
237 int asmComponent;
240 unsigned int offsetASM;
238 unsigned int offsetASM;
241 unsigned int offsetASMReorganized;
239 unsigned int offsetASMReorganized;
242
240
243 // BUILD DATA
241 // BUILD DATA
244 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
242 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
245 {
243 {
246 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
244 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
247 {
245 {
248 offsetASMReorganized =
246 offsetASMReorganized =
249 frequencyBin * NB_VALUES_PER_SM
247 frequencyBin * NB_VALUES_PER_SM
250 + asmComponent;
248 + asmComponent;
251 offsetASM =
249 offsetASM =
252 asmComponent * NB_BINS_PER_SM
250 asmComponent * NB_BINS_PER_SM
253 + frequencyBin;
251 + frequencyBin;
254 averaged_spec_mat_reorganized[offsetASMReorganized ] =
252 averaged_spec_mat_reorganized[offsetASMReorganized ] =
255 averaged_spec_mat[ offsetASM ] / divider;
253 averaged_spec_mat[ offsetASM ] / divider;
256 }
254 }
257 }
255 }
258 }
256 }
259
257
260 void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat , float divider,
258 void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat , float divider,
261 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage, unsigned char ASMIndexStart )
259 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage, unsigned char ASMIndexStart )
262 {
260 {
263 int frequencyBin;
261 int frequencyBin;
264 int asmComponent;
262 int asmComponent;
265 int offsetASM;
263 int offsetASM;
266 int offsetCompressed;
264 int offsetCompressed;
267 int k;
265 int k;
268
266
269 // BUILD DATA
267 // BUILD DATA
270 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
268 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
271 {
269 {
272 for( frequencyBin = 0; frequencyBin < nbBinsCompressedMatrix; frequencyBin++ )
270 for( frequencyBin = 0; frequencyBin < nbBinsCompressedMatrix; frequencyBin++ )
273 {
271 {
274 offsetCompressed = // NO TIME OFFSET
272 offsetCompressed = // NO TIME OFFSET
275 frequencyBin * NB_VALUES_PER_SM
273 frequencyBin * NB_VALUES_PER_SM
276 + asmComponent;
274 + asmComponent;
277 offsetASM = // NO TIME OFFSET
275 offsetASM = // NO TIME OFFSET
278 asmComponent * NB_BINS_PER_SM
276 asmComponent * NB_BINS_PER_SM
279 + ASMIndexStart
277 + ASMIndexStart
280 + frequencyBin * nbBinsToAverage;
278 + frequencyBin * nbBinsToAverage;
281 compressed_spec_mat[ offsetCompressed ] = 0;
279 compressed_spec_mat[ offsetCompressed ] = 0;
282 for ( k = 0; k < nbBinsToAverage; k++ )
280 for ( k = 0; k < nbBinsToAverage; k++ )
283 {
281 {
284 compressed_spec_mat[offsetCompressed ] =
282 compressed_spec_mat[offsetCompressed ] =
285 ( compressed_spec_mat[ offsetCompressed ]
283 ( compressed_spec_mat[ offsetCompressed ]
286 + averaged_spec_mat[ offsetASM + k ] );
284 + averaged_spec_mat[ offsetASM + k ] );
287 }
285 }
288 compressed_spec_mat[ offsetCompressed ] =
286 compressed_spec_mat[ offsetCompressed ] =
289 compressed_spec_mat[ offsetCompressed ] / (divider * nbBinsToAverage);
287 compressed_spec_mat[ offsetCompressed ] / (divider * nbBinsToAverage);
290 }
288 }
291 }
289 }
292 }
290 }
293
291
294 void ASM_convert( volatile float *input_matrix, char *output_matrix)
292 void ASM_convert( volatile float *input_matrix, char *output_matrix)
295 {
293 {
296 unsigned int frequencyBin;
294 unsigned int frequencyBin;
297 unsigned int asmComponent;
295 unsigned int asmComponent;
298 char * pt_char_input;
296 char * pt_char_input;
299 char * pt_char_output;
297 char * pt_char_output;
300 unsigned int offsetInput;
298 unsigned int offsetInput;
301 unsigned int offsetOutput;
299 unsigned int offsetOutput;
302
300
303 pt_char_input = (char*) &input_matrix;
301 pt_char_input = (char*) &input_matrix;
304 pt_char_output = (char*) &output_matrix;
302 pt_char_output = (char*) &output_matrix;
305
303
306 // convert all other data
304 // convert all other data
307 for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++)
305 for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++)
308 {
306 {
309 for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++)
307 for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++)
310 {
308 {
311 offsetInput = (frequencyBin*NB_VALUES_PER_SM) + asmComponent ;
309 offsetInput = (frequencyBin*NB_VALUES_PER_SM) + asmComponent ;
312 offsetOutput = 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) ;
310 offsetOutput = 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) ;
313 pt_char_input = (char*) &input_matrix [ offsetInput ];
311 pt_char_input = (char*) &input_matrix [ offsetInput ];
314 pt_char_output = (char*) &output_matrix[ offsetOutput ];
312 pt_char_output = (char*) &output_matrix[ offsetOutput ];
315 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
313 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
316 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
314 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
317 }
315 }
318 }
316 }
319 }
317 }
320
318
321 void ASM_compress_reorganize_and_divide_mask(float *averaged_spec_mat, float *compressed_spec_mat,
319 void ASM_compress_reorganize_and_divide_mask(float *averaged_spec_mat, float *compressed_spec_mat,
322 float divider,
320 float divider,
323 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart, unsigned char channel);
321 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart, unsigned char channel);
324
322
325 int getFBinMask(int k, unsigned char channel);
323 int getFBinMask(int k, unsigned char channel);
326
324
327 void init_kcoeff_sbm_from_kcoeff_norm( float *input_kcoeff, float *output_kcoeff, unsigned char nb_bins_norm);
325 void init_kcoeff_sbm_from_kcoeff_norm( float *input_kcoeff, float *output_kcoeff, unsigned char nb_bins_norm);
328
326
329 #endif // FSW_PROCESSING_H_INCLUDED
327 #endif // FSW_PROCESSING_H_INCLUDED
@@ -1,872 +1,864
1 /** This is the RTEMS initialization module.
1 /** This is the RTEMS initialization module.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * This module contains two very different information:
6 * This module contains two very different information:
7 * - specific instructions to configure the compilation of the RTEMS executive
7 * - specific instructions to configure the compilation of the RTEMS executive
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
8 * - functions related to the fligth softwre initialization, especially the INIT RTEMS task
9 *
9 *
10 */
10 */
11
11
12 //*************************
12 //*************************
13 // GPL reminder to be added
13 // GPL reminder to be added
14 //*************************
14 //*************************
15
15
16 #include <rtems.h>
16 #include <rtems.h>
17
17
18 /* configuration information */
18 /* configuration information */
19
19
20 #define CONFIGURE_INIT
20 #define CONFIGURE_INIT
21
21
22 #include <bsp.h> /* for device driver prototypes */
22 #include <bsp.h> /* for device driver prototypes */
23
23
24 /* configuration information */
24 /* configuration information */
25
25
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
26 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
27 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
28
28
29 #define CONFIGURE_MAXIMUM_TASKS 20
29 #define CONFIGURE_MAXIMUM_TASKS 20
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
30 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
31 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
32 #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
33 #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
34 #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT)
35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
35 #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT)
36 #define CONFIGURE_MAXIMUM_DRIVERS 16
36 #define CONFIGURE_MAXIMUM_DRIVERS 16
37 #define CONFIGURE_MAXIMUM_PERIODS 5
37 #define CONFIGURE_MAXIMUM_PERIODS 5
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s)
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s)
39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
39 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5
40 #ifdef PRINT_STACK_REPORT
40 #ifdef PRINT_STACK_REPORT
41 #define CONFIGURE_STACK_CHECKER_ENABLED
41 #define CONFIGURE_STACK_CHECKER_ENABLED
42 #endif
42 #endif
43
43
44 #include <rtems/confdefs.h>
44 #include <rtems/confdefs.h>
45
45
46 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
46 /* If --drvmgr was enabled during the configuration of the RTEMS kernel */
47 #ifdef RTEMS_DRVMGR_STARTUP
47 #ifdef RTEMS_DRVMGR_STARTUP
48 #ifdef LEON3
48 #ifdef LEON3
49 /* Add Timer and UART Driver */
49 /* Add Timer and UART Driver */
50 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
50 #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
51 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
51 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
52 #endif
52 #endif
53 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
53 #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
54 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
54 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
55 #endif
55 #endif
56 #endif
56 #endif
57 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
57 #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */
58 #include <drvmgr/drvmgr_confdefs.h>
58 #include <drvmgr/drvmgr_confdefs.h>
59 #endif
59 #endif
60
60
61 #include "fsw_init.h"
61 #include "fsw_init.h"
62 #include "fsw_config.c"
62 #include "fsw_config.c"
63 #include "GscMemoryLPP.hpp"
63 #include "GscMemoryLPP.hpp"
64
64
65 void initCache()
65 void initCache()
66 {
66 {
67 unsigned int cacheControlRegister;
67 unsigned int cacheControlRegister;
68
68
69 cacheControlRegister = getCacheControlRegister();
69 cacheControlRegister = getCacheControlRegister();
70 PRINTF1("(0) cacheControlRegister = %x\n", cacheControlRegister)
70 PRINTF1("(0) cacheControlRegister = %x\n", cacheControlRegister)
71
71
72 resetCacheControlRegister();
72 resetCacheControlRegister();
73
73
74 enableInstructionCache();
74 enableInstructionCache();
75 enableDataCache();
75 enableDataCache();
76 enableInstructionBurstFetch();
76 enableInstructionBurstFetch();
77
77
78 cacheControlRegister = getCacheControlRegister();
78 cacheControlRegister = getCacheControlRegister();
79 PRINTF1("(1) cacheControlRegister = %x\n", cacheControlRegister)
79 PRINTF1("(1) cacheControlRegister = %x\n", cacheControlRegister)
80 }
80 }
81
81
82 rtems_task Init( rtems_task_argument ignored )
82 rtems_task Init( rtems_task_argument ignored )
83 {
83 {
84 /** This is the RTEMS INIT taks, it is the first task launched by the system.
84 /** This is the RTEMS INIT taks, it is the first task launched by the system.
85 *
85 *
86 * @param unused is the starting argument of the RTEMS task
86 * @param unused is the starting argument of the RTEMS task
87 *
87 *
88 * The INIT task create and run all other RTEMS tasks.
88 * The INIT task create and run all other RTEMS tasks.
89 *
89 *
90 */
90 */
91
91
92 //***********
92 //***********
93 // INIT CACHE
93 // INIT CACHE
94
94
95 unsigned char *vhdlVersion;
95 unsigned char *vhdlVersion;
96
96
97 reset_lfr();
97 reset_lfr();
98
98
99 reset_local_time();
99 reset_local_time();
100
100
101 rtems_cpu_usage_reset();
101 rtems_cpu_usage_reset();
102
102
103 rtems_status_code status;
103 rtems_status_code status;
104 rtems_status_code status_spw;
104 rtems_status_code status_spw;
105 rtems_isr_entry old_isr_handler;
105 rtems_isr_entry old_isr_handler;
106
106
107 // UART settings
107 // UART settings
108 send_console_outputs_on_apbuart_port();
108 send_console_outputs_on_apbuart_port();
109 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
109 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
110 enable_apbuart_transmitter();
110 enable_apbuart_transmitter();
111
111
112 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
112 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
113
113
114
114
115 PRINTF("\n\n\n\n\n")
115 PRINTF("\n\n\n\n\n")
116
116
117 initCache();
117 initCache();
118
118
119 PRINTF("*************************\n")
119 PRINTF("*************************\n")
120 PRINTF("** LFR Flight Software **\n")
120 PRINTF("** LFR Flight Software **\n")
121 PRINTF1("** %d.", SW_VERSION_N1)
121 PRINTF1("** %d.", SW_VERSION_N1)
122 PRINTF1("%d." , SW_VERSION_N2)
122 PRINTF1("%d." , SW_VERSION_N2)
123 PRINTF1("%d." , SW_VERSION_N3)
123 PRINTF1("%d." , SW_VERSION_N3)
124 PRINTF1("%d **\n", SW_VERSION_N4)
124 PRINTF1("%d **\n", SW_VERSION_N4)
125
125
126 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
126 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
127 PRINTF("** VHDL **\n")
127 PRINTF("** VHDL **\n")
128 PRINTF1("** %d.", vhdlVersion[1])
128 PRINTF1("** %d.", vhdlVersion[1])
129 PRINTF1("%d." , vhdlVersion[2])
129 PRINTF1("%d." , vhdlVersion[2])
130 PRINTF1("%d **\n", vhdlVersion[3])
130 PRINTF1("%d **\n", vhdlVersion[3])
131 PRINTF("*************************\n")
131 PRINTF("*************************\n")
132 PRINTF("\n\n")
132 PRINTF("\n\n")
133
133
134 init_parameter_dump();
134 init_parameter_dump();
135 init_kcoefficients_dump();
135 init_kcoefficients_dump();
136 init_local_mode_parameters();
136 init_local_mode_parameters();
137 init_housekeeping_parameters();
137 init_housekeeping_parameters();
138 init_k_coefficients_prc0();
138 init_k_coefficients_prc0();
139 init_k_coefficients_prc1();
139 init_k_coefficients_prc1();
140 init_k_coefficients_prc2();
140 init_k_coefficients_prc2();
141 pa_bia_status_info = 0x00;
141 pa_bia_status_info = 0x00;
142
142
143 // waveform picker initialization
143 // waveform picker initialization
144 WFP_init_rings(); // initialize the waveform rings
144 WFP_init_rings(); LEON_Clear_interrupt( IRQ_SPARC_GPTIMER_WATCHDOG ); // initialize the waveform rings
145 WFP_reset_current_ring_nodes();
145 WFP_reset_current_ring_nodes();
146 reset_waveform_picker_regs();
146 reset_waveform_picker_regs();
147
147
148 // spectral matrices initialization
148 // spectral matrices initialization
149 SM_init_rings(); // initialize spectral matrices rings
149 SM_init_rings(); // initialize spectral matrices rings
150 SM_reset_current_ring_nodes();
150 SM_reset_current_ring_nodes();
151 reset_spectral_matrix_regs();
151 reset_spectral_matrix_regs();
152
152
153 // configure calibration
153 // configure calibration
154 configureCalibration( false ); // true means interleaved mode, false is for normal mode
154 configureCalibration( false ); // true means interleaved mode, false is for normal mode
155
155
156 updateLFRCurrentMode();
156 updateLFRCurrentMode();
157
157
158 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
158 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
159
159
160 create_names(); // create all names
160 create_names(); // create all names
161
161
162 status = create_message_queues(); // create message queues
162 status = create_message_queues(); // create message queues
163 if (status != RTEMS_SUCCESSFUL)
163 if (status != RTEMS_SUCCESSFUL)
164 {
164 {
165 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
165 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
166 }
166 }
167
167
168 status = create_all_tasks(); // create all tasks
168 status = create_all_tasks(); // create all tasks
169 if (status != RTEMS_SUCCESSFUL)
169 if (status != RTEMS_SUCCESSFUL)
170 {
170 {
171 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
171 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
172 }
172 }
173
173
174 // **************************
174 // **************************
175 // <SPACEWIRE INITIALIZATION>
175 // <SPACEWIRE INITIALIZATION>
176 grspw_timecode_callback = &timecode_irq_handler;
176 grspw_timecode_callback = &timecode_irq_handler;
177
177
178 status_spw = spacewire_open_link(); // (1) open the link
178 status_spw = spacewire_open_link(); // (1) open the link
179 if ( status_spw != RTEMS_SUCCESSFUL )
179 if ( status_spw != RTEMS_SUCCESSFUL )
180 {
180 {
181 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
181 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
182 }
182 }
183
183