##// END OF EJS Templates
snapshot resynchro changed...
paul -
r257:132f1c3627d7 R3a
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 80d727bb9d808ae67c801c4c6101811d68b94af6 header/lfr_common_headers
2 4ffa7549495b4d1e5ddbda520569468a5e3b8779 header/lfr_common_headers
@@ -1,87 +1,89
1 #ifndef WF_HANDLER_H_INCLUDED
1 #ifndef WF_HANDLER_H_INCLUDED
2 #define WF_HANDLER_H_INCLUDED
2 #define WF_HANDLER_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6 #include <stdio.h>
6 #include <stdio.h>
7 #include <math.h>
7 #include <math.h>
8 #include <fsw_params.h>
8 #include <fsw_params.h>
9
9
10 #include "fsw_init.h"
10 #include "fsw_init.h"
11 #include "fsw_params_wf_handler.h"
11 #include "fsw_params_wf_handler.h"
12
12
13 #define pi 3.14159265359
13 #define pi 3.14159265359
14
14
15 extern int fdSPW;
15 extern int fdSPW;
16
16
17 //*****************
17 //*****************
18 // waveform buffers
18 // waveform buffers
19 extern volatile int wf_buffer_f0[ ];
19 extern volatile int wf_buffer_f0[ ];
20 extern volatile int wf_buffer_f1[ ];
20 extern volatile int wf_buffer_f1[ ];
21 extern volatile int wf_buffer_f2[ ];
21 extern volatile int wf_buffer_f2[ ];
22 extern volatile int wf_buffer_f3[ ];
22 extern volatile int wf_buffer_f3[ ];
23
23
24 extern waveform_picker_regs_0_1_18_t *waveform_picker_regs;
24 extern waveform_picker_regs_0_1_18_t *waveform_picker_regs;
25 extern time_management_regs_t *time_management_regs;
25 extern time_management_regs_t *time_management_regs;
26 extern Packet_TM_LFR_HK_t housekeeping_packet;
26 extern Packet_TM_LFR_HK_t housekeeping_packet;
27 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
27 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
28 extern struct param_local_str param_local;
28 extern struct param_local_str param_local;
29
29
30 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
30 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
31 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
31 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
32
32
33 extern rtems_id Task_id[20]; /* array of task ids */
33 extern rtems_id Task_id[20]; /* array of task ids */
34
34
35 extern unsigned char lfrCurrentMode;
35 extern unsigned char lfrCurrentMode;
36
36
37 //**********
37 //**********
38 // RTEMS_ISR
38 // RTEMS_ISR
39 void reset_extractSWF( void );
39 void reset_extractSWF( void );
40 rtems_isr waveforms_isr( rtems_vector_number vector );
40 rtems_isr waveforms_isr( rtems_vector_number vector );
41
41
42 //***********
42 //***********
43 // RTEMS_TASK
43 // RTEMS_TASK
44 rtems_task wfrm_task( rtems_task_argument argument );
44 rtems_task wfrm_task( rtems_task_argument argument );
45 rtems_task cwf3_task( rtems_task_argument argument );
45 rtems_task cwf3_task( rtems_task_argument argument );
46 rtems_task cwf2_task( rtems_task_argument argument );
46 rtems_task cwf2_task( rtems_task_argument argument );
47 rtems_task cwf1_task( rtems_task_argument argument );
47 rtems_task cwf1_task( rtems_task_argument argument );
48 rtems_task swbd_task( rtems_task_argument argument );
48 rtems_task swbd_task( rtems_task_argument argument );
49
49
50 //******************
50 //******************
51 // general functions
51 // general functions
52 void WFP_init_rings( void );
52 void WFP_init_rings( void );
53 void init_ring( ring_node ring[], unsigned char nbNodes, volatile int buffer[] , unsigned int bufferSize );
53 void init_ring( ring_node ring[], unsigned char nbNodes, volatile int buffer[] , unsigned int bufferSize );
54 void WFP_reset_current_ring_nodes( void );
54 void WFP_reset_current_ring_nodes( void );
55 //
55 //
56 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
56 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
57 //
57 //
58 int send_waveform_CWF3_light(ring_node *ring_node_to_send, ring_node *ring_node_cwf3_light, rtems_id queue_id );
58 int send_waveform_CWF3_light(ring_node *ring_node_to_send, ring_node *ring_node_cwf3_light, rtems_id queue_id );
59 //
59 //
60 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
60 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
61 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
61 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
62 void build_snapshot_from_ring(ring_node *ring_node_to_send, unsigned char frequencyChannel ,
62 void build_snapshot_from_ring(ring_node *ring_node_to_send, unsigned char frequencyChannel ,
63 unsigned long long acquisitionTimeF0_asLong, ring_node *ring_node_swf_extracted, int *swf_extracted);
63 unsigned long long acquisitionTimeF0_asLong, ring_node *ring_node_swf_extracted, int *swf_extracted);
64 double computeCorrection( unsigned char *timePtr );
65 void applyCorrection( double correction );
64 void snapshot_resynchronization( unsigned char *timePtr );
66 void snapshot_resynchronization( unsigned char *timePtr );
65 //
67 //
66 rtems_id get_pkts_queue_id( void );
68 rtems_id get_pkts_queue_id( void );
67
69
68 //**************
70 //**************
69 // wfp registers
71 // wfp registers
70 // RESET
72 // RESET
71 void reset_wfp_burst_enable( void );
73 void reset_wfp_burst_enable( void );
72 void reset_wfp_status( void );
74 void reset_wfp_status( void );
73 void reset_wfp_buffer_addresses( void );
75 void reset_wfp_buffer_addresses( void );
74 void reset_waveform_picker_regs( void );
76 void reset_waveform_picker_regs( void );
75 // SET
77 // SET
76 void set_wfp_data_shaping(void);
78 void set_wfp_data_shaping(void);
77 void set_wfp_burst_enable_register( unsigned char mode );
79 void set_wfp_burst_enable_register( unsigned char mode );
78 void set_wfp_delta_snapshot( void );
80 void set_wfp_delta_snapshot( void );
79 void set_wfp_delta_f0_f0_2( void );
81 void set_wfp_delta_f0_f0_2( void );
80 void set_wfp_delta_f1( void );
82 void set_wfp_delta_f1( void );
81 void set_wfp_delta_f2( void );
83 void set_wfp_delta_f2( void );
82
84
83 //*****************
85 //*****************
84 // local parameters
86 // local parameters
85 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
87 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
86
88
87 #endif // WF_HANDLER_H_INCLUDED
89 #endif // WF_HANDLER_H_INCLUDED
@@ -1,909 +1,912
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 // [spiq] [link] [spacewire_reset_link]
38 #define CONFIGURE_MAXIMUM_TIMERS 5 // [spiq] [link] [spacewire_reset_link]
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 // ASI 2 contains a few control registers that have not been assigned as ancillary state registers.
67 // ASI 2 contains a few control registers that have not been assigned as ancillary state registers.
68 // These should only be read and written using 32-bit LDA/STA instructions.
68 // These should only be read and written using 32-bit LDA/STA instructions.
69 // All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2.
69 // All cache registers are accessed through load/store operations to the alternate address space (LDA/STA), using ASI = 2.
70 // The table below shows the register addresses:
70 // The table below shows the register addresses:
71 // 0x00 Cache control register
71 // 0x00 Cache control register
72 // 0x04 Reserved
72 // 0x04 Reserved
73 // 0x08 Instruction cache configuration register
73 // 0x08 Instruction cache configuration register
74 // 0x0C Data cache configuration register
74 // 0x0C Data cache configuration register
75
75
76 // Cache Control Register Leon3 / Leon3FT
76 // Cache Control Register Leon3 / Leon3FT
77 // 31..30 29 28 27..24 23 22 21 20..19 18 17 16
77 // 31..30 29 28 27..24 23 22 21 20..19 18 17 16
78 // RFT PS TB DS FD FI FT ST IB
78 // RFT PS TB DS FD FI FT ST IB
79 // 15 14 13..12 11..10 9..8 7..6 5 4 3..2 1..0
79 // 15 14 13..12 11..10 9..8 7..6 5 4 3..2 1..0
80 // IP DP ITE IDE DTE DDE DF IF DCS ICS
80 // IP DP ITE IDE DTE DDE DF IF DCS ICS
81
81
82 unsigned int cacheControlRegister;
82 unsigned int cacheControlRegister;
83
83
84 cacheControlRegister = CCR_getValue();
84 cacheControlRegister = CCR_getValue();
85 PRINTF1("(0) cacheControlRegister = %x\n", cacheControlRegister);
85 PRINTF1("(0) cacheControlRegister = %x\n", cacheControlRegister);
86
86
87 CCR_resetCacheControlRegister();
87 CCR_resetCacheControlRegister();
88
88
89 CCR_enableInstructionCache(); // ICS bits
89 CCR_enableInstructionCache(); // ICS bits
90 CCR_enableDataCache(); // DCS bits
90 CCR_enableDataCache(); // DCS bits
91 CCR_enableInstructionBurstFetch(); // IB bit
91 CCR_enableInstructionBurstFetch(); // IB bit
92
92
93 cacheControlRegister = CCR_getValue();
93 cacheControlRegister = CCR_getValue();
94 PRINTF1("(1) cacheControlRegister = %x\n", cacheControlRegister);
94 PRINTF1("(1) cacheControlRegister = %x\n", cacheControlRegister);
95
95
96 CCR_faultTolerantScheme();
96 CCR_faultTolerantScheme();
97
97
98 PRINTF("\n");
98 PRINTF("\n");
99 }
99 }
100
100
101 rtems_task Init( rtems_task_argument ignored )
101 rtems_task Init( rtems_task_argument ignored )
102 {
102 {
103 /** This is the RTEMS INIT taks, it is the first task launched by the system.
103 /** This is the RTEMS INIT taks, it is the first task launched by the system.
104 *
104 *
105 * @param unused is the starting argument of the RTEMS task
105 * @param unused is the starting argument of the RTEMS task
106 *
106 *
107 * The INIT task create and run all other RTEMS tasks.
107 * The INIT task create and run all other RTEMS tasks.
108 *
108 *
109 */
109 */
110
110
111 //***********
111 //***********
112 // INIT CACHE
112 // INIT CACHE
113
113
114 unsigned char *vhdlVersion;
114 unsigned char *vhdlVersion;
115
115
116 reset_lfr();
116 reset_lfr();
117
117
118 reset_local_time();
118 reset_local_time();
119
119
120 rtems_cpu_usage_reset();
120 rtems_cpu_usage_reset();
121
121
122 rtems_status_code status;
122 rtems_status_code status;
123 rtems_status_code status_spw;
123 rtems_status_code status_spw;
124 rtems_isr_entry old_isr_handler;
124 rtems_isr_entry old_isr_handler;
125
125
126 // UART settings
126 // UART settings
127 enable_apbuart_transmitter();
127 enable_apbuart_transmitter();
128 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
128 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
129
129
130 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
130 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
131
131
132
132
133 PRINTF("\n\n\n\n\n")
133 PRINTF("\n\n\n\n\n")
134
134
135 initCache();
135 initCache();
136
136
137 PRINTF("*************************\n")
137 PRINTF("*************************\n")
138 PRINTF("** LFR Flight Software **\n")
138 PRINTF("** LFR Flight Software **\n")
139 PRINTF1("** %d.", SW_VERSION_N1)
139 PRINTF1("** %d.", SW_VERSION_N1)
140 PRINTF1("%d." , SW_VERSION_N2)
140 PRINTF1("%d." , SW_VERSION_N2)
141 PRINTF1("%d." , SW_VERSION_N3)
141 PRINTF1("%d." , SW_VERSION_N3)
142 PRINTF1("%d **\n", SW_VERSION_N4)
142 PRINTF1("%d **\n", SW_VERSION_N4)
143
143
144 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
144 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
145 PRINTF("** VHDL **\n")
145 PRINTF("** VHDL **\n")
146 PRINTF1("** %d.", vhdlVersion[1])
146 PRINTF1("** %d.", vhdlVersion[1])
147 PRINTF1("%d." , vhdlVersion[2])
147 PRINTF1("%d." , vhdlVersion[2])
148 PRINTF1("%d **\n", vhdlVersion[3])
148 PRINTF1("%d **\n", vhdlVersion[3])
149 PRINTF("*************************\n")
149 PRINTF("*************************\n")
150 PRINTF("\n\n")
150 PRINTF("\n\n")
151
151
152 init_parameter_dump();
152 init_parameter_dump();
153 init_kcoefficients_dump();
153 init_kcoefficients_dump();
154 init_local_mode_parameters();
154 init_local_mode_parameters();
155 init_housekeeping_parameters();
155 init_housekeeping_parameters();
156 init_k_coefficients_prc0();
156 init_k_coefficients_prc0();
157 init_k_coefficients_prc1();
157 init_k_coefficients_prc1();
158 init_k_coefficients_prc2();
158 init_k_coefficients_prc2();
159 pa_bia_status_info = 0x00;
159 pa_bia_status_info = 0x00;
160 update_last_valid_transition_date( DEFAULT_LAST_VALID_TRANSITION_DATE );
160 update_last_valid_transition_date( DEFAULT_LAST_VALID_TRANSITION_DATE );
161
161
162 // waveform picker initialization
162 // waveform picker initialization
163 WFP_init_rings(); LEON_Clear_interrupt( IRQ_SPARC_GPTIMER_WATCHDOG ); // initialize the waveform rings
163 WFP_init_rings(); LEON_Clear_interrupt( IRQ_SPARC_GPTIMER_WATCHDOG ); // initialize the waveform rings
164 WFP_reset_current_ring_nodes();
164 WFP_reset_current_ring_nodes();
165 reset_waveform_picker_regs();
165 reset_waveform_picker_regs();
166
166
167 // spectral matrices initialization
167 // spectral matrices initialization
168 SM_init_rings(); // initialize spectral matrices rings
168 SM_init_rings(); // initialize spectral matrices rings
169 SM_reset_current_ring_nodes();
169 SM_reset_current_ring_nodes();
170 reset_spectral_matrix_regs();
170 reset_spectral_matrix_regs();
171
171
172 // configure calibration
172 // configure calibration
173 configureCalibration( false ); // true means interleaved mode, false is for normal mode
173 configureCalibration( false ); // true means interleaved mode, false is for normal mode
174
174
175 updateLFRCurrentMode( LFR_MODE_STANDBY );
175 updateLFRCurrentMode( LFR_MODE_STANDBY );
176
176
177 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
177 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
178
178
179 create_names(); // create all names
179 create_names(); // create all names
180
180
181 status = create_timecode_timer(); // create the timer used by timecode_irq_handler
181 status = create_timecode_timer(); // create the timer used by timecode_irq_handler
182 if (status != RTEMS_SUCCESSFUL)
182 if (status != RTEMS_SUCCESSFUL)
183 {
183 {
184 PRINTF1("in INIT *** ERR in create_timer_timecode, code %d", status)
184 PRINTF1("in INIT *** ERR in create_timer_timecode, code %d", status)
185 }
185 }
186
186
187 status = create_message_queues(); // create message queues
187 status = create_message_queues(); // create message queues
188 if (status != RTEMS_SUCCESSFUL)
188 if (status != RTEMS_SUCCESSFUL)
189 {
189 {
190 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
190 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
191 }
191 }
192
192
193 status = create_all_tasks(); // create all tasks
193 status = create_all_tasks(); // create all tasks
194 if (status != RTEMS_SUCCESSFUL)
194 if (status != RTEMS_SUCCESSFUL)
195 {
195 {
196 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
196 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
197 }
197 }
198
198
199 // **************************
199 // **************************
200 // <SPACEWIRE INITIALIZATION>
200 // <SPACEWIRE INITIALIZATION>
201 grspw_timecode_callback = &timecode_irq_handler;
201 grspw_timecode_callback = &timecode_irq_handler;
202
202
203 status_spw = spacewire_open_link(); // (1) open the link
203 status_spw = spacewire_open_link(); // (1) open the link
204 if ( status_spw != RTEMS_SUCCESSFUL )
204 if ( status_spw != RTEMS_SUCCESSFUL )
205 {
205 {
206 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
206 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
207 }
207 }
208
208
209 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
209 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
210 {
210 {
211 status_spw = spacewire_configure_link( fdSPW );
211 status_spw = spacewire_configure_link( fdSPW );
212 if ( status_spw != RTEMS_SUCCESSFUL )
212 if ( status_spw != RTEMS_SUCCESSFUL )
213 {
213 {
214 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
214 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
215 }
215 }
216 }
216 }
217
217
218 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
218 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
219 {
219 {
220 status_spw = spacewire_start_link( fdSPW );
220 status_spw = spacewire_start_link( fdSPW );
221 if ( status_spw != RTEMS_SUCCESSFUL )
221 if ( status_spw != RTEMS_SUCCESSFUL )
222 {
222 {
223 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
223 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
224 }
224 }
225 }
225 }
226 // </SPACEWIRE INITIALIZATION>
226 // </SPACEWIRE INITIALIZATION>
227 // ***************************
227 // ***************************
228
228
229 status = start_all_tasks(); // start all tasks
229 status = start_all_tasks(); // start all tasks
230 if (status != RTEMS_SUCCESSFUL)
230 if (status != RTEMS_SUCCESSFUL)
231 {
231 {
232 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
232 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
233 }
233 }
234
234
235 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
235 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
236 status = start_recv_send_tasks();
236 status = start_recv_send_tasks();
237 if ( status != RTEMS_SUCCESSFUL )
237 if ( status != RTEMS_SUCCESSFUL )
238 {
238 {
239 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
239 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
240 }
240 }
241
241
242 // suspend science tasks, they will be restarted later depending on the mode
242 // suspend science tasks, they will be restarted later depending on the mode
243 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
243 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
244 if (status != RTEMS_SUCCESSFUL)
244 if (status != RTEMS_SUCCESSFUL)
245 {
245 {
246 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
246 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
247 }
247 }
248
248
249 // configure IRQ handling for the waveform picker unit
249 // configure IRQ handling for the waveform picker unit
250 status = rtems_interrupt_catch( waveforms_isr,
250 status = rtems_interrupt_catch( waveforms_isr,
251 IRQ_SPARC_WAVEFORM_PICKER,
251 IRQ_SPARC_WAVEFORM_PICKER,
252 &old_isr_handler) ;
252 &old_isr_handler) ;
253 // configure IRQ handling for the spectral matrices unit
253 // configure IRQ handling for the spectral matrices unit
254 status = rtems_interrupt_catch( spectral_matrices_isr,
254 status = rtems_interrupt_catch( spectral_matrices_isr,
255 IRQ_SPARC_SPECTRAL_MATRIX,
255 IRQ_SPARC_SPECTRAL_MATRIX,
256 &old_isr_handler) ;
256 &old_isr_handler) ;
257
257
258 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
258 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
259 if ( status_spw != RTEMS_SUCCESSFUL )
259 if ( status_spw != RTEMS_SUCCESSFUL )
260 {
260 {
261 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
261 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
262 if ( status != RTEMS_SUCCESSFUL ) {
262 if ( status != RTEMS_SUCCESSFUL ) {
263 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
263 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
264 }
264 }
265 }
265 }
266
266
267 BOOT_PRINTF("delete INIT\n")
267 BOOT_PRINTF("delete INIT\n")
268
268
269 set_hk_lfr_sc_potential_flag( true );
269 set_hk_lfr_sc_potential_flag( true );
270
270
271 // start the timer used for the detection of missing parameters (started also by the timecode_irq_handler ISR)
272 status = rtems_timer_fire_after( timecode_timer_id, TIMECODE_TIMER_TIMEOUT, timecode_timer_routine, NULL );
273
271 status = rtems_task_delete(RTEMS_SELF);
274 status = rtems_task_delete(RTEMS_SELF);
272
275
273 }
276 }
274
277
275 void init_local_mode_parameters( void )
278 void init_local_mode_parameters( void )
276 {
279 {
277 /** This function initialize the param_local global variable with default values.
280 /** This function initialize the param_local global variable with default values.
278 *
281 *
279 */
282 */
280
283
281 unsigned int i;
284 unsigned int i;
282
285
283 // LOCAL PARAMETERS
286 // LOCAL PARAMETERS
284
287
285 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
288 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
286 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
289 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
287 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
290 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
288
291
289 // init sequence counters
292 // init sequence counters
290
293
291 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
294 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
292 {
295 {
293 sequenceCounters_TC_EXE[i] = 0x00;
296 sequenceCounters_TC_EXE[i] = 0x00;
294 sequenceCounters_TM_DUMP[i] = 0x00;
297 sequenceCounters_TM_DUMP[i] = 0x00;
295 }
298 }
296 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
299 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
297 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
300 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
298 sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
301 sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
299 }
302 }
300
303
301 void reset_local_time( void )
304 void reset_local_time( void )
302 {
305 {
303 time_management_regs->ctrl = time_management_regs->ctrl | 0x02; // [0010] software reset, coarse time = 0x80000000
306 time_management_regs->ctrl = time_management_regs->ctrl | 0x02; // [0010] software reset, coarse time = 0x80000000
304 }
307 }
305
308
306 void create_names( void ) // create all names for tasks and queues
309 void create_names( void ) // create all names for tasks and queues
307 {
310 {
308 /** This function creates all RTEMS names used in the software for tasks and queues.
311 /** This function creates all RTEMS names used in the software for tasks and queues.
309 *
312 *
310 * @return RTEMS directive status codes:
313 * @return RTEMS directive status codes:
311 * - RTEMS_SUCCESSFUL - successful completion
314 * - RTEMS_SUCCESSFUL - successful completion
312 *
315 *
313 */
316 */
314
317
315 // task names
318 // task names
316 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
319 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
317 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
320 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
318 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
321 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
319 Task_name[TASKID_LOAD] = rtems_build_name( 'L', 'O', 'A', 'D' );
322 Task_name[TASKID_LOAD] = rtems_build_name( 'L', 'O', 'A', 'D' );
320 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
323 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
321 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
324 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
322 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
325 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
323 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
326 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
324 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
327 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
325 Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' );
328 Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' );
326 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
329 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
327 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
330 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
328 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
331 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
329 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
332 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
330 Task_name[TASKID_LINK] = rtems_build_name( 'L', 'I', 'N', 'K' );
333 Task_name[TASKID_LINK] = rtems_build_name( 'L', 'I', 'N', 'K' );
331 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
334 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
332 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
335 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
333 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
336 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
334 Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' );
337 Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' );
335
338
336 // rate monotonic period names
339 // rate monotonic period names
337 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
340 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
338
341
339 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
342 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
340 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
343 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
341 misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' );
344 misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' );
342 misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' );
345 misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' );
343 misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' );
346 misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' );
344
347
345 timecode_timer_name = rtems_build_name( 'S', 'P', 'T', 'C' );
348 timecode_timer_name = rtems_build_name( 'S', 'P', 'T', 'C' );
346 }
349 }
347
350
348 int create_all_tasks( void ) // create all tasks which run in the software
351 int create_all_tasks( void ) // create all tasks which run in the software
349 {
352 {
350 /** This function creates all RTEMS tasks used in the software.
353 /** This function creates all RTEMS tasks used in the software.
351 *
354 *
352 * @return RTEMS directive status codes:
355 * @return RTEMS directive status codes:
353 * - RTEMS_SUCCESSFUL - task created successfully
356 * - RTEMS_SUCCESSFUL - task created successfully
354 * - RTEMS_INVALID_ADDRESS - id is NULL
357 * - RTEMS_INVALID_ADDRESS - id is NULL
355 * - RTEMS_INVALID_NAME - invalid task name
358 * - RTEMS_INVALID_NAME - invalid task name
356 * - RTEMS_INVALID_PRIORITY - invalid task priority
359 * - RTEMS_INVALID_PRIORITY - invalid task priority
357 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
360 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
358 * - RTEMS_TOO_MANY - too many tasks created
361 * - RTEMS_TOO_MANY - too many tasks created
359 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
362 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
360 * - RTEMS_TOO_MANY - too many global objects
363 * - RTEMS_TOO_MANY - too many global objects
361 *
364 *
362 */
365 */
363
366
364 rtems_status_code status;
367 rtems_status_code status;
365
368
366 //**********
369 //**********
367 // SPACEWIRE
370 // SPACEWIRE
368 // RECV
371 // RECV
369 status = rtems_task_create(
372 status = rtems_task_create(
370 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
373 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
371 RTEMS_DEFAULT_MODES,
374 RTEMS_DEFAULT_MODES,
372 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
375 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
373 );
376 );
374 if (status == RTEMS_SUCCESSFUL) // SEND
377 if (status == RTEMS_SUCCESSFUL) // SEND
375 {
378 {
376 status = rtems_task_create(
379 status = rtems_task_create(
377 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE * 2,
380 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE * 2,
378 RTEMS_DEFAULT_MODES,
381 RTEMS_DEFAULT_MODES,
379 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SEND]
382 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SEND]
380 );
383 );
381 }
384 }
382 if (status == RTEMS_SUCCESSFUL) // LINK
385 if (status == RTEMS_SUCCESSFUL) // LINK
383 {
386 {
384 status = rtems_task_create(
387 status = rtems_task_create(
385 Task_name[TASKID_LINK], TASK_PRIORITY_LINK, RTEMS_MINIMUM_STACK_SIZE,
388 Task_name[TASKID_LINK], TASK_PRIORITY_LINK, RTEMS_MINIMUM_STACK_SIZE,
386 RTEMS_DEFAULT_MODES,
389 RTEMS_DEFAULT_MODES,
387 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_LINK]
390 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_LINK]
388 );
391 );
389 }
392 }
390 if (status == RTEMS_SUCCESSFUL) // ACTN
393 if (status == RTEMS_SUCCESSFUL) // ACTN
391 {
394 {
392 status = rtems_task_create(
395 status = rtems_task_create(
393 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
396 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
394 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
397 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
395 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
398 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
396 );
399 );
397 }
400 }
398 if (status == RTEMS_SUCCESSFUL) // SPIQ
401 if (status == RTEMS_SUCCESSFUL) // SPIQ
399 {
402 {
400 status = rtems_task_create(
403 status = rtems_task_create(
401 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
404 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
402 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
405 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
403 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
406 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
404 );
407 );
405 }
408 }
406
409
407 //******************
410 //******************
408 // SPECTRAL MATRICES
411 // SPECTRAL MATRICES
409 if (status == RTEMS_SUCCESSFUL) // AVF0
412 if (status == RTEMS_SUCCESSFUL) // AVF0
410 {
413 {
411 status = rtems_task_create(
414 status = rtems_task_create(
412 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
415 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
413 RTEMS_DEFAULT_MODES,
416 RTEMS_DEFAULT_MODES,
414 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
417 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
415 );
418 );
416 }
419 }
417 if (status == RTEMS_SUCCESSFUL) // PRC0
420 if (status == RTEMS_SUCCESSFUL) // PRC0
418 {
421 {
419 status = rtems_task_create(
422 status = rtems_task_create(
420 Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2,
423 Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2,
421 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
424 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
422 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0]
425 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0]
423 );
426 );
424 }
427 }
425 if (status == RTEMS_SUCCESSFUL) // AVF1
428 if (status == RTEMS_SUCCESSFUL) // AVF1
426 {
429 {
427 status = rtems_task_create(
430 status = rtems_task_create(
428 Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE,
431 Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE,
429 RTEMS_DEFAULT_MODES,
432 RTEMS_DEFAULT_MODES,
430 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1]
433 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1]
431 );
434 );
432 }
435 }
433 if (status == RTEMS_SUCCESSFUL) // PRC1
436 if (status == RTEMS_SUCCESSFUL) // PRC1
434 {
437 {
435 status = rtems_task_create(
438 status = rtems_task_create(
436 Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2,
439 Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2,
437 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
440 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
438 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1]
441 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1]
439 );
442 );
440 }
443 }
441 if (status == RTEMS_SUCCESSFUL) // AVF2
444 if (status == RTEMS_SUCCESSFUL) // AVF2
442 {
445 {
443 status = rtems_task_create(
446 status = rtems_task_create(
444 Task_name[TASKID_AVF2], TASK_PRIORITY_AVF2, RTEMS_MINIMUM_STACK_SIZE,
447 Task_name[TASKID_AVF2], TASK_PRIORITY_AVF2, RTEMS_MINIMUM_STACK_SIZE,
445 RTEMS_DEFAULT_MODES,
448 RTEMS_DEFAULT_MODES,
446 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF2]
449 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF2]
447 );
450 );
448 }
451 }
449 if (status == RTEMS_SUCCESSFUL) // PRC2
452 if (status == RTEMS_SUCCESSFUL) // PRC2
450 {
453 {
451 status = rtems_task_create(
454 status = rtems_task_create(
452 Task_name[TASKID_PRC2], TASK_PRIORITY_PRC2, RTEMS_MINIMUM_STACK_SIZE * 2,
455 Task_name[TASKID_PRC2], TASK_PRIORITY_PRC2, RTEMS_MINIMUM_STACK_SIZE * 2,
453 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
456 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
454 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC2]
457 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC2]
455 );
458 );
456 }
459 }
457
460
458 //****************
461 //****************
459 // WAVEFORM PICKER
462 // WAVEFORM PICKER
460 if (status == RTEMS_SUCCESSFUL) // WFRM
463 if (status == RTEMS_SUCCESSFUL) // WFRM
461 {
464 {
462 status = rtems_task_create(
465 status = rtems_task_create(
463 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
466 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
464 RTEMS_DEFAULT_MODES,
467 RTEMS_DEFAULT_MODES,
465 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
468 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
466 );
469 );
467 }
470 }
468 if (status == RTEMS_SUCCESSFUL) // CWF3
471 if (status == RTEMS_SUCCESSFUL) // CWF3
469 {
472 {
470 status = rtems_task_create(
473 status = rtems_task_create(
471 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
474 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
472 RTEMS_DEFAULT_MODES,
475 RTEMS_DEFAULT_MODES,
473 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3]
476 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3]
474 );
477 );
475 }
478 }
476 if (status == RTEMS_SUCCESSFUL) // CWF2
479 if (status == RTEMS_SUCCESSFUL) // CWF2
477 {
480 {
478 status = rtems_task_create(
481 status = rtems_task_create(
479 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
482 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
480 RTEMS_DEFAULT_MODES,
483 RTEMS_DEFAULT_MODES,
481 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2]
484 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2]
482 );
485 );
483 }
486 }
484 if (status == RTEMS_SUCCESSFUL) // CWF1
487 if (status == RTEMS_SUCCESSFUL) // CWF1
485 {
488 {
486 status = rtems_task_create(
489 status = rtems_task_create(
487 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
490 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
488 RTEMS_DEFAULT_MODES,
491 RTEMS_DEFAULT_MODES,
489 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1]
492 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1]
490 );
493 );
491 }
494 }
492 if (status == RTEMS_SUCCESSFUL) // SWBD
495 if (status == RTEMS_SUCCESSFUL) // SWBD
493 {
496 {
494 status = rtems_task_create(
497 status = rtems_task_create(
495 Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE,
498 Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE,
496 RTEMS_DEFAULT_MODES,
499 RTEMS_DEFAULT_MODES,
497 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD]
500 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD]
498 );
501 );
499 }
502 }
500
503
501 //*****
504 //*****
502 // MISC
505 // MISC
503 if (status == RTEMS_SUCCESSFUL) // LOAD
506 if (status == RTEMS_SUCCESSFUL) // LOAD
504 {
507 {
505 status = rtems_task_create(
508 status = rtems_task_create(
506 Task_name[TASKID_LOAD], TASK_PRIORITY_LOAD, RTEMS_MINIMUM_STACK_SIZE,
509 Task_name[TASKID_LOAD], TASK_PRIORITY_LOAD, RTEMS_MINIMUM_STACK_SIZE,
507 RTEMS_DEFAULT_MODES,
510 RTEMS_DEFAULT_MODES,
508 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_LOAD]
511 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_LOAD]
509 );
512 );
510 }
513 }