##// END OF EJS Templates
TC_LFR_LOAD_KCOEFFICIENTS...
paul -
r194:72cdb2a15242 R3
parent child
Show More
@@ -1,2 +1,2
1 a586fe639ac179e95bdc150ebdbab0312f31dc30 LFR_basic-parameters
1 a586fe639ac179e95bdc150ebdbab0312f31dc30 LFR_basic-parameters
2 ddd0a6fe16cc1861ad679bf646663e070189e037 header/lfr_common_headers
2 5467523e44cd6a627a81b156673a891f4d6b0017 header/lfr_common_headers
@@ -1,47 +1,48
1 #ifndef FSW_SPACEWIRE_H_INCLUDED
1 #ifndef FSW_SPACEWIRE_H_INCLUDED
2 #define FSW_SPACEWIRE_H_INCLUDED
2 #define FSW_SPACEWIRE_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6
6
7 #include <fcntl.h> // for O_RDWR
7 #include <fcntl.h> // for O_RDWR
8 #include <unistd.h> // for the read call
8 #include <unistd.h> // for the read call
9 #include <sys/ioctl.h> // for the ioctl call
9 #include <sys/ioctl.h> // for the ioctl call
10 #include <errno.h>
10 #include <errno.h>
11
11
12 #include "fsw_params.h"
12 #include "fsw_params.h"
13 #include "tc_handler.h"
13 #include "tc_handler.h"
14
14
15 extern spw_stats spacewire_stats;
15 extern spw_stats spacewire_stats;
16 extern spw_stats spacewire_stats_backup;
16 extern spw_stats spacewire_stats_backup;
17
17
18 // RTEMS TASK
18 // RTEMS TASK
19 rtems_task spiq_task( rtems_task_argument argument );
19 rtems_task spiq_task( rtems_task_argument argument );
20 rtems_task recv_task( rtems_task_argument unused );
20 rtems_task recv_task( rtems_task_argument unused );
21 rtems_task send_task( rtems_task_argument argument );
21 rtems_task send_task( rtems_task_argument argument );
22 rtems_task wtdg_task( rtems_task_argument argument );
22 rtems_task wtdg_task( rtems_task_argument argument );
23
23
24 int spacewire_open_link( void );
24 int spacewire_open_link( void );
25 int spacewire_start_link( int fd );
25 int spacewire_start_link( int fd );
26 int spacewire_stop_and_start_link( int fd );
26 int spacewire_stop_and_start_link( int fd );
27 int spacewire_configure_link(int fd );
27 int spacewire_configure_link(int fd );
28 int spacewire_reset_link( void );
28 int spacewire_reset_link( void );
29 void spacewire_set_NP( unsigned char val, unsigned int regAddr ); // No Port force
29 void spacewire_set_NP( unsigned char val, unsigned int regAddr ); // No Port force
30 void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable
30 void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable
31 void spacewire_compute_stats_offsets( void );
31 void spacewire_compute_stats_offsets( void );
32 void spacewire_update_statistics( void );
32 void spacewire_update_statistics( void );
33
33
34 void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header );
34 void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header );
35 void init_header_swf( Header_TM_LFR_SCIENCE_SWF_t *header );
35 void init_header_swf( Header_TM_LFR_SCIENCE_SWF_t *header );
36 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header );
36 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header );
37 int spw_send_waveform_CWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
37 int spw_send_waveform_CWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
38 int spw_send_waveform_SWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_SWF_t *header );
38 int spw_send_waveform_SWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_SWF_t *header );
39 int spw_send_waveform_CWF3_light( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
39 int spw_send_waveform_CWF3_light( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
40 void spw_send_asm( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
40 void spw_send_asm( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
41 void spw_send_k_dump( ring_node *ring_node_to_send );
41
42
42 void timecode_irq_handler( void *pDev, void *regs, int minor, unsigned int tc );
43 void timecode_irq_handler( void *pDev, void *regs, int minor, unsigned int tc );
43 rtems_timer_service_routine user_routine( rtems_id timer_id, void *user_data );
44 rtems_timer_service_routine user_routine( rtems_id timer_id, void *user_data );
44
45
45 void (*grspw_timecode_callback) ( void *pDev, void *regs, int minor, unsigned int tc );
46 void (*grspw_timecode_callback) ( void *pDev, void *regs, int minor, unsigned int tc );
46
47
47 #endif // FSW_SPACEWIRE_H_INCLUDED
48 #endif // FSW_SPACEWIRE_H_INCLUDED
@@ -1,54 +1,65
1 #ifndef TC_LOAD_DUMP_PARAMETERS_H
1 #ifndef TC_LOAD_DUMP_PARAMETERS_H
2 #define TC_LOAD_DUMP_PARAMETERS_H
2 #define TC_LOAD_DUMP_PARAMETERS_H
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6
6
7 #include "fsw_params.h"
7 #include "fsw_params.h"
8 #include "wf_handler.h"
8 #include "wf_handler.h"
9 #include "tm_lfr_tc_exe.h"
9 #include "tm_lfr_tc_exe.h"
10 #include "fsw_misc.h"
10 #include "fsw_misc.h"
11 #include "basic_parameters_params.h"
11
12
12 #define FLOAT_EQUAL_ZERO 0.001
13 #define FLOAT_EQUAL_ZERO 0.001
13
14
14 extern unsigned short sequenceCounterParameterDump;
15 extern unsigned short sequenceCounterParameterDump;
16 extern float k_coeff_intercalib_f0_norm[ ];
17 extern float k_coeff_intercalib_f0_sbm[ ];
18 extern float k_coeff_intercalib_f1_norm[ ];
19 extern float k_coeff_intercalib_f1_sbm[ ];
20 extern float k_coeff_intercalib_f2[ ];
15
21
16 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
22 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
17 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
23 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
18 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
24 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
19 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
25 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
20 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
26 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
21 int action_load_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
27 int action_load_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
22 int action_load_fbins_mask(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
28 int action_load_fbins_mask(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
23 int action_dump_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
29 int action_dump_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
24 int action_dump_par(rtems_id queue_id );
30 int action_dump_par(rtems_id queue_id );
25
31
26 // NORMAL
32 // NORMAL
27 int check_common_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
33 int check_common_par_consistency( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
28 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC );
34 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC );
29 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC );
35 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC );
30 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC );
36 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC );
31 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC );
37 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC );
32 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC );
38 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC );
33 int set_sy_lfr_n_cwf_long_f3( ccsdsTelecommandPacket_t *TC );
39 int set_sy_lfr_n_cwf_long_f3( ccsdsTelecommandPacket_t *TC );
34
40
35 // BURST
41 // BURST
36 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC );
42 int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC );
37 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC );
43 int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC );
38
44
39 // SBM1
45 // SBM1
40 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC );
46 int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC );
41 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC );
47 int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC );
42
48
43 // SBM2
49 // SBM2
44 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC );
50 int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC );
45 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC );
51 int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC );
46
52
47 // TC_LFR_UPDATE_INFO
53 // TC_LFR_UPDATE_INFO
48 unsigned int check_update_info_hk_lfr_mode( unsigned char mode );
54 unsigned int check_update_info_hk_lfr_mode( unsigned char mode );
49 unsigned int check_update_info_hk_tds_mode( unsigned char mode );
55 unsigned int check_update_info_hk_tds_mode( unsigned char mode );
50 unsigned int check_update_info_hk_thr_mode( unsigned char mode );
56 unsigned int check_update_info_hk_thr_mode( unsigned char mode );
51
57
58 // KCOEFFICIENTS
59 int set_sy_lfr_kcoeff( ccsdsTelecommandPacket_t *TC );
60
52 void init_parameter_dump( void );
61 void init_parameter_dump( void );
62 void init_kcoefficients_dump( void );
63 void init_kcoefficients_dump_packet( Packet_TM_LFR_KCOEFFICIENTS_DUMP_t *kcoefficients_dump, unsigned char pkt_nr, unsigned char blk_nr );
53
64
54 #endif // TC_LOAD_DUMP_PARAMETERS_H
65 #endif // TC_LOAD_DUMP_PARAMETERS_H
@@ -1,14 +1,14
1 # LOAD FSW USING LINK 1
1 # LOAD FSW USING LINK 1
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
2 SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
3
3
4 #dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
4 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
5 dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
5 #dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
6 dsu3plugin0.loadFile()
6 dsu3plugin0.loadFile()
7
7
8 dsu3plugin0.run()
8 dsu3plugin0.run()
9
9
10 # START SENDING TIMECODES AT 1 Hz
10 # START SENDING TIMECODES AT 1 Hz
11 SpwPlugin0.StarDundeeStartTimecodes( 1 )
11 SpwPlugin0.StarDundeeStartTimecodes( 1 )
12
12
13 # it is possible to change the time code frequency
13 # it is possible to change the time code frequency
14 #RMAPPlugin0.changeTimecodeFrequency(2)
14 #RMAPPlugin0.changeTimecodeFrequency(2)
@@ -1,29 +1,30
1 #!/usr/bin/lppmon -e
1 #!/usr/bin/lppmon -e
2
2
3 import time
3 import time
4
4
5 proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
5 proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
6 SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
6 SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
7
7
8 proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
8 proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
9 proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
9 proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
10
10
11 availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
11 availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
12 print "availableBrickCount = ", availableBrickCount
12 print "availableBrickCount = ", availableBrickCount
13
13
14 SpwPlugin0.StarDundeeSelectBrick(1)
14 SpwPlugin0.StarDundeeSelectBrick(1)
15 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
15 SpwPlugin0.StarDundeeSetBrickAsARouter(1)
16 SpwPlugin0.connectBridge()
16 SpwPlugin0.connectBridge()
17
17
18 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
18 #SpwPlugin0.TCPServerSetIP("127.0.0.1")
19 SpwPlugin0.TCPServerConnect()
19 SpwPlugin0.TCPServerConnect()
20
20
21 #LFRControlPlugin0.SetSpwServerIP(129,104,27,164)
21 #LFRControlPlugin0.SetSpwServerIP(129,104,27,164)
22 LFRControlPlugin0.TCPServerConnect()
22 LFRControlPlugin0.TCPServerConnect()
23
23
24 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
24 dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw")
25 #dsu3plugin0.openFile("/opt/LFR/LFR-FSW/2.0.2.3/fsw")
25 dsu3plugin0.loadFile()
26 dsu3plugin0.loadFile()
26 dsu3plugin0.run()
27 dsu3plugin0.run()
27
28
28 LFRControlPlugin0.TMEchoBridgeOpenPort()
29 LFRControlPlugin0.TMEchoBridgeOpenPort()
29
30
@@ -1,813 +1,814
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
63
64 void initCache()
64 void initCache()
65 {
65 {
66 // unsigned int cacheControlRegister;
66 // unsigned int cacheControlRegister;
67
67
68 // cacheControlRegister = getCacheControlRegister();
68 // cacheControlRegister = getCacheControlRegister();
69 // printf("(0) cacheControlRegister = %x\n", cacheControlRegister);
69 // printf("(0) cacheControlRegister = %x\n", cacheControlRegister);
70
70
71 enableInstructionCache();
71 enableInstructionCache();
72 enableDataCache();
72 enableDataCache();
73 enableInstructionBurstFetch();
73 enableInstructionBurstFetch();
74
74
75 // cacheControlRegister = getCacheControlRegister();
75 // cacheControlRegister = getCacheControlRegister();
76 // printf("(1) cacheControlRegister = %x\n", cacheControlRegister);
76 // printf("(1) cacheControlRegister = %x\n", cacheControlRegister);
77 }
77 }
78
78
79 rtems_task Init( rtems_task_argument ignored )
79 rtems_task Init( rtems_task_argument ignored )
80 {
80 {
81 /** This is the RTEMS INIT taks, it the first task launched by the system.
81 /** This is the RTEMS INIT taks, it the first task launched by the system.
82 *
82 *
83 * @param unused is the starting argument of the RTEMS task
83 * @param unused is the starting argument of the RTEMS task
84 *
84 *
85 * The INIT task create and run all other RTEMS tasks.
85 * The INIT task create and run all other RTEMS tasks.
86 *
86 *
87 */
87 */
88
88
89 //***********
89 //***********
90 // INIT CACHE
90 // INIT CACHE
91
91
92 unsigned char *vhdlVersion;
92 unsigned char *vhdlVersion;
93
93
94 reset_lfr();
94 reset_lfr();
95
95
96 reset_local_time();
96 reset_local_time();
97
97
98 rtems_cpu_usage_reset();
98 rtems_cpu_usage_reset();
99
99
100 rtems_status_code status;
100 rtems_status_code status;
101 rtems_status_code status_spw;
101 rtems_status_code status_spw;
102 rtems_isr_entry old_isr_handler;
102 rtems_isr_entry old_isr_handler;
103
103
104 // UART settings
104 // UART settings
105 send_console_outputs_on_apbuart_port();
105 send_console_outputs_on_apbuart_port();
106 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
106 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
107 enable_apbuart_transmitter();
107 enable_apbuart_transmitter();
108
108
109 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
109 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
110
110
111
111
112 PRINTF("\n\n\n\n\n")
112 PRINTF("\n\n\n\n\n")
113
113
114 initCache();
114 initCache();
115
115
116 PRINTF("*************************\n")
116 PRINTF("*************************\n")
117 PRINTF("** LFR Flight Software **\n")
117 PRINTF("** LFR Flight Software **\n")
118 PRINTF1("** %d.", SW_VERSION_N1)
118 PRINTF1("** %d.", SW_VERSION_N1)
119 PRINTF1("%d." , SW_VERSION_N2)
119 PRINTF1("%d." , SW_VERSION_N2)
120 PRINTF1("%d." , SW_VERSION_N3)
120 PRINTF1("%d." , SW_VERSION_N3)
121 PRINTF1("%d **\n", SW_VERSION_N4)
121 PRINTF1("%d **\n", SW_VERSION_N4)
122
122
123 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
123 vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
124 PRINTF("** VHDL **\n")
124 PRINTF("** VHDL **\n")
125 PRINTF1("** %d.", vhdlVersion[1])
125 PRINTF1("** %d.", vhdlVersion[1])
126 PRINTF1("%d." , vhdlVersion[2])
126 PRINTF1("%d." , vhdlVersion[2])
127 PRINTF1("%d **\n", vhdlVersion[3])
127 PRINTF1("%d **\n", vhdlVersion[3])
128 PRINTF("*************************\n")
128 PRINTF("*************************\n")
129 PRINTF("\n\n")
129 PRINTF("\n\n")
130
130
131 init_parameter_dump();
131 init_parameter_dump();
132 init_kcoefficients_dump();
132 init_local_mode_parameters();
133 init_local_mode_parameters();
133 init_housekeeping_parameters();
134 init_housekeeping_parameters();
134 init_k_coefficients_f0();
135 init_k_coefficients_f0();
135 init_k_coefficients_f1();
136 init_k_coefficients_f1();
136 init_k_coefficients_f2();
137 init_k_coefficients_f2();
137
138
138 // waveform picker initialization
139 // waveform picker initialization
139 WFP_init_rings(); // initialize the waveform rings
140 WFP_init_rings(); // initialize the waveform rings
140 WFP_reset_current_ring_nodes();
141 WFP_reset_current_ring_nodes();
141 reset_waveform_picker_regs();
142 reset_waveform_picker_regs();
142
143
143 // spectral matrices initialization
144 // spectral matrices initialization
144 SM_init_rings(); // initialize spectral matrices rings
145 SM_init_rings(); // initialize spectral matrices rings
145 SM_reset_current_ring_nodes();
146 SM_reset_current_ring_nodes();
146 reset_spectral_matrix_regs();
147 reset_spectral_matrix_regs();
147
148
148 // configure calibration
149 // configure calibration
149 configureCalibration( false ); // true means interleaved mode, false is for normal mode
150 configureCalibration( false ); // true means interleaved mode, false is for normal mode
150
151
151 updateLFRCurrentMode();
152 updateLFRCurrentMode();
152
153
153 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
154 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
154
155
155 create_names(); // create all names
156 create_names(); // create all names
156
157
157 status = create_message_queues(); // create message queues
158 status = create_message_queues(); // create message queues
158 if (status != RTEMS_SUCCESSFUL)
159 if (status != RTEMS_SUCCESSFUL)
159 {
160 {
160 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
161 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
161 }
162 }
162
163
163 status = create_all_tasks(); // create all tasks
164 status = create_all_tasks(); // create all tasks
164 if (status != RTEMS_SUCCESSFUL)
165 if (status != RTEMS_SUCCESSFUL)
165 {
166 {
166 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
167 PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status)
167 }
168 }
168
169
169 // **************************
170 // **************************
170 // <SPACEWIRE INITIALIZATION>
171 // <SPACEWIRE INITIALIZATION>
171 grspw_timecode_callback = &timecode_irq_handler;
172 grspw_timecode_callback = &timecode_irq_handler;
172
173
173 status_spw = spacewire_open_link(); // (1) open the link
174 status_spw = spacewire_open_link(); // (1) open the link
174 if ( status_spw != RTEMS_SUCCESSFUL )
175 if ( status_spw != RTEMS_SUCCESSFUL )
175 {
176 {
176 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
177 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
177 }
178 }
178
179
179 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
180 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
180 {
181 {
181 status_spw = spacewire_configure_link( fdSPW );
182 status_spw = spacewire_configure_link( fdSPW );
182 if ( status_spw != RTEMS_SUCCESSFUL )
183 if ( status_spw != RTEMS_SUCCESSFUL )
183 {
184 {
184 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
185 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
185 }
186 }
186 }
187 }
187
188
188 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
189 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
189 {
190 {
190 status_spw = spacewire_start_link( fdSPW );
191 status_spw = spacewire_start_link( fdSPW );
191 if ( status_spw != RTEMS_SUCCESSFUL )
192 if ( status_spw != RTEMS_SUCCESSFUL )
192 {
193 {
193 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
194 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
194 }
195 }
195 }
196 }
196 // </SPACEWIRE INITIALIZATION>
197 // </SPACEWIRE INITIALIZATION>
197 // ***************************
198 // ***************************
198
199
199 status = start_all_tasks(); // start all tasks
200 status = start_all_tasks(); // start all tasks
200 if (status != RTEMS_SUCCESSFUL)
201 if (status != RTEMS_SUCCESSFUL)
201 {
202 {
202 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
203 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
203 }
204 }
204
205
205 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
206 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
206 status = start_recv_send_tasks();
207 status = start_recv_send_tasks();
207 if ( status != RTEMS_SUCCESSFUL )
208 if ( status != RTEMS_SUCCESSFUL )
208 {
209 {
209 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
210 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
210 }
211 }
211
212
212 // suspend science tasks, they will be restarted later depending on the mode
213 // suspend science tasks, they will be restarted later depending on the mode
213 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
214 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
214 if (status != RTEMS_SUCCESSFUL)
215 if (status != RTEMS_SUCCESSFUL)
215 {
216 {
216 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
217 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
217 }
218 }
218
219
219 //******************************
220 //******************************
220 // <SPECTRAL MATRICES SIMULATOR>
221 // <SPECTRAL MATRICES SIMULATOR>
221 LEON_Mask_interrupt( IRQ_SM_SIMULATOR );
222 LEON_Mask_interrupt( IRQ_SM_SIMULATOR );
222 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
223 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
223 IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu );
224 IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu );
224 // </SPECTRAL MATRICES SIMULATOR>
225 // </SPECTRAL MATRICES SIMULATOR>
225 //*******************************
226 //*******************************
226
227
227 // configure IRQ handling for the waveform picker unit
228 // configure IRQ handling for the waveform picker unit
228 status = rtems_interrupt_catch( waveforms_isr,
229 status = rtems_interrupt_catch( waveforms_isr,
229 IRQ_SPARC_WAVEFORM_PICKER,
230 IRQ_SPARC_WAVEFORM_PICKER,
230 &old_isr_handler) ;
231 &old_isr_handler) ;
231 // configure IRQ handling for the spectral matrices unit
232 // configure IRQ handling for the spectral matrices unit
232 status = rtems_interrupt_catch( spectral_matrices_isr,
233 status = rtems_interrupt_catch( spectral_matrices_isr,
233 IRQ_SPARC_SPECTRAL_MATRIX,
234 IRQ_SPARC_SPECTRAL_MATRIX,
234 &old_isr_handler) ;
235 &old_isr_handler) ;
235
236
236 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
237 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
237 if ( status_spw != RTEMS_SUCCESSFUL )
238 if ( status_spw != RTEMS_SUCCESSFUL )
238 {
239 {
239 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
240 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
240 if ( status != RTEMS_SUCCESSFUL ) {
241 if ( status != RTEMS_SUCCESSFUL ) {
241 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
242 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
242 }
243 }
243 }
244 }
244
245
245 BOOT_PRINTF("delete INIT\n")
246 BOOT_PRINTF("delete INIT\n")
246
247
247 // test_TCH();
248 // test_TCH();
248
249
249 status = rtems_task_delete(RTEMS_SELF);
250 status = rtems_task_delete(RTEMS_SELF);
250
251
251 }
252 }
252
253
253 void init_local_mode_parameters( void )
254 void init_local_mode_parameters( void )
254 {
255 {
255 /** This function initialize the param_local global variable with default values.
256 /** This function initialize the param_local global variable with default values.
256 *
257 *
257 */
258 */
258
259
259 unsigned int i;
260 unsigned int i;
260
261
261 // LOCAL PARAMETERS
262 // LOCAL PARAMETERS
262
263
263 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
264 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
264 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
265 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
265 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
266 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
266
267
267 // init sequence counters
268 // init sequence counters
268
269
269 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
270 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
270 {
271 {
271 sequenceCounters_TC_EXE[i] = 0x00;
272 sequenceCounters_TC_EXE[i] = 0x00;
272 }
273 }
273 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
274 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
274 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
275 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
275 sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
276 sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
276 sequenceCounterParameterDump = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
277 sequenceCounterParameterDump = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
277 }
278 }
278
279
279 void reset_local_time( void )
280 void reset_local_time( void )
280 {
281 {
281 time_management_regs->ctrl = time_management_regs->ctrl | 0x02; // [0010] software reset, coarse time = 0x80000000
282 time_management_regs->ctrl = time_management_regs->ctrl | 0x02; // [0010] software reset, coarse time = 0x80000000
282 }
283 }
283
284
284 void create_names( void ) // create all names for tasks and queues
285 void create_names( void ) // create all names for tasks and queues
285 {
286 {
286 /** This function creates all RTEMS names used in the software for tasks and queues.
287 /** This function creates all RTEMS names used in the software for tasks and queues.
287 *
288 *
288 * @return RTEMS directive status codes:
289 * @return RTEMS directive status codes:
289 * - RTEMS_SUCCESSFUL - successful completion
290 * - RTEMS_SUCCESSFUL - successful completion
290 *
291 *
291 */
292 */
292
293
293 // task names
294 // task names
294 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
295 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
295 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
296 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
296 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
297 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
297 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
298 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
298 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
299 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
299 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
300 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
300 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
301 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
301 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
302 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
302 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
303 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
303 Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' );
304 Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' );
304 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
305 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
305 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
306 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
306 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
307 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
307 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
308 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
308 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
309 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
309 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
310 Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' );
310 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
311 Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' );
311 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
312 Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' );
312 Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' );
313 Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' );
313
314
314 // rate monotonic period names
315 // rate monotonic period names
315 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
316 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
316
317
317 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
318 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
318 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
319 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
319 misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' );
320 misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' );
320 misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' );
321 misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' );
321 misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' );
322 misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' );
322 }
323 }
323
324
324 int create_all_tasks( void ) // create all tasks which run in the software
325 int create_all_tasks( void ) // create all tasks which run in the software
325 {
326 {
326 /** This function creates all RTEMS tasks used in the software.
327 /** This function creates all RTEMS tasks used in the software.
327 *
328 *
328 * @return RTEMS directive status codes:
329 * @return RTEMS directive status codes:
329 * - RTEMS_SUCCESSFUL - task created successfully
330 * - RTEMS_SUCCESSFUL - task created successfully
330 * - RTEMS_INVALID_ADDRESS - id is NULL
331 * - RTEMS_INVALID_ADDRESS - id is NULL
331 * - RTEMS_INVALID_NAME - invalid task name
332 * - RTEMS_INVALID_NAME - invalid task name
332 * - RTEMS_INVALID_PRIORITY - invalid task priority
333 * - RTEMS_INVALID_PRIORITY - invalid task priority
333 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
334 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
334 * - RTEMS_TOO_MANY - too many tasks created
335 * - RTEMS_TOO_MANY - too many tasks created
335 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
336 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
336 * - RTEMS_TOO_MANY - too many global objects
337 * - RTEMS_TOO_MANY - too many global objects
337 *
338 *
338 */
339 */
339
340
340 rtems_status_code status;
341 rtems_status_code status;
341
342
342 //**********
343 //**********
343 // SPACEWIRE
344 // SPACEWIRE
344 // RECV
345 // RECV
345 status = rtems_task_create(
346 status = rtems_task_create(
346 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
347 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
347 RTEMS_DEFAULT_MODES,
348 RTEMS_DEFAULT_MODES,
348 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
349 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
349 );
350 );
350 if (status == RTEMS_SUCCESSFUL) // SEND
351 if (status == RTEMS_SUCCESSFUL) // SEND
351 {
352 {
352 status = rtems_task_create(
353 status = rtems_task_create(
353 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE * 2,
354 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE * 2,
354 RTEMS_DEFAULT_MODES,
355 RTEMS_DEFAULT_MODES,
355 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SEND]
356 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SEND]
356 );
357 );
357 }
358 }
358 if (status == RTEMS_SUCCESSFUL) // WTDG
359 if (status == RTEMS_SUCCESSFUL) // WTDG
359 {
360 {
360 status = rtems_task_create(
361 status = rtems_task_create(
361 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
362 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
362 RTEMS_DEFAULT_MODES,
363 RTEMS_DEFAULT_MODES,
363 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
364 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
364 );
365 );
365 }
366 }
366 if (status == RTEMS_SUCCESSFUL) // ACTN
367 if (status == RTEMS_SUCCESSFUL) // ACTN
367 {
368 {
368 status = rtems_task_create(
369 status = rtems_task_create(
369 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
370 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
370 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
371 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
371 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
372 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
372 );
373 );
373 }
374 }
374 if (status == RTEMS_SUCCESSFUL) // SPIQ
375 if (status == RTEMS_SUCCESSFUL) // SPIQ
375 {
376 {
376 status = rtems_task_create(
377 status = rtems_task_create(
377 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
378 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
378 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
379 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
379 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
380 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
380 );
381 );
381 }
382 }
382
383
383 //******************
384 //******************
384 // SPECTRAL MATRICES
385 // SPECTRAL MATRICES
385 if (status == RTEMS_SUCCESSFUL) // AVF0
386 if (status == RTEMS_SUCCESSFUL) // AVF0
386 {
387 {
387 status = rtems_task_create(
388 status = rtems_task_create(
388 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
389 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
389 RTEMS_DEFAULT_MODES,
390 RTEMS_DEFAULT_MODES,
390 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
391 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
391 );
392 );
392 }
393 }
393 if (status == RTEMS_SUCCESSFUL) // PRC0
394 if (status == RTEMS_SUCCESSFUL) // PRC0
394 {
395 {
395 status = rtems_task_create(
396 status = rtems_task_create(
396 Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2,
397 Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2,
397 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
398 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
398 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0]
399 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0]
399 );
400 );
400 }
401 }
401 if (status == RTEMS_SUCCESSFUL) // AVF1
402 if (status == RTEMS_SUCCESSFUL) // AVF1
402 {
403 {
403 status = rtems_task_create(
404 status = rtems_task_create(
404 Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE,
405 Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE,
405 RTEMS_DEFAULT_MODES,
406 RTEMS_DEFAULT_MODES,
406 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1]
407 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1]
407 );
408 );
408 }
409 }
409 if (status == RTEMS_SUCCESSFUL) // PRC1
410 if (status == RTEMS_SUCCESSFUL) // PRC1
410 {
411 {
411 status = rtems_task_create(
412 status = rtems_task_create(
412 Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2,
413 Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2,
413 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
414 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
414 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1]
415 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1]
415 );
416 );
416 }
417 }
417 if (status == RTEMS_SUCCESSFUL) // AVF2
418 if (status == RTEMS_SUCCESSFUL) // AVF2
418 {
419 {
419 status = rtems_task_create(
420 status = rtems_task_create(
420 Task_name[TASKID_AVF2], TASK_PRIORITY_AVF2, RTEMS_MINIMUM_STACK_SIZE,
421 Task_name[TASKID_AVF2], TASK_PRIORITY_AVF2, RTEMS_MINIMUM_STACK_SIZE,
421 RTEMS_DEFAULT_MODES,
422 RTEMS_DEFAULT_MODES,
422 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF2]
423 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF2]
423 );
424 );
424 }
425 }
425 if (status == RTEMS_SUCCESSFUL) // PRC2
426 if (status == RTEMS_SUCCESSFUL) // PRC2
426 {
427 {
427 status = rtems_task_create(
428 status = rtems_task_create(
428 Task_name[TASKID_PRC2], TASK_PRIORITY_PRC2, RTEMS_MINIMUM_STACK_SIZE * 2,
429 Task_name[TASKID_PRC2], TASK_PRIORITY_PRC2, RTEMS_MINIMUM_STACK_SIZE * 2,
429 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
430 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
430 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC2]
431 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC2]
431 );
432 );
432 }
433 }
433
434
434 //****************
435 //****************