##// END OF EJS Templates
Forgot to remove dead code functions declarations
jeandet -
r405:f3243196bdc5 3.2.0.24 R3++ draft
parent child
Show More
@@ -1,156 +1,158
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 #define WATCHDOG_LOOP_PRINTF 10
13 #define WATCHDOG_LOOP_PRINTF 10
14 #define WATCHDOG_LOOP_DEBUG 3
14 #define WATCHDOG_LOOP_DEBUG 3
15
15
16 #define NB_RTEMS_EVENTS 32
16 #define NB_RTEMS_EVENTS 32
17 #define EVENT_12 12
17 #define EVENT_12 12
18 #define EVENT_13 13
18 #define EVENT_13 13
19 #define EVENT_14 14
19 #define EVENT_14 14
20 #define DUMB_MESSAGE_1 "in DUMB *** timecode_irq_handler"
20 #define DUMB_MESSAGE_1 "in DUMB *** timecode_irq_handler"
21 #define DUMB_MESSAGE_12 "WATCHDOG timer"
21 #define DUMB_MESSAGE_12 "WATCHDOG timer"
22 #define DUMB_MESSAGE_13 "TIMECODE timer"
22 #define DUMB_MESSAGE_13 "TIMECODE timer"
23
23
24 enum lfr_reset_cause_t{
24 enum lfr_reset_cause_t{
25 UNKNOWN_CAUSE,
25 UNKNOWN_CAUSE,
26 POWER_ON,
26 POWER_ON,
27 TC_RESET,
27 TC_RESET,
28 WATCHDOG,
28 WATCHDOG,
29 ERROR_RESET,
29 ERROR_RESET,
30 UNEXP_RESET
30 UNEXP_RESET
31 };
31 };
32
32
33 typedef struct{
33 typedef struct{
34 unsigned char dpu_spw_parity;
34 unsigned char dpu_spw_parity;
35 unsigned char dpu_spw_disconnect;
35 unsigned char dpu_spw_disconnect;
36 unsigned char dpu_spw_escape;
36 unsigned char dpu_spw_escape;
37 unsigned char dpu_spw_credit;
37 unsigned char dpu_spw_credit;
38 unsigned char dpu_spw_write_sync;
38 unsigned char dpu_spw_write_sync;
39 unsigned char timecode_erroneous;
39 unsigned char timecode_erroneous;
40 unsigned char timecode_missing;
40 unsigned char timecode_missing;
41 unsigned char timecode_invalid;
41 unsigned char timecode_invalid;
42 unsigned char time_timecode_it;
42 unsigned char time_timecode_it;
43 unsigned char time_not_synchro;
43 unsigned char time_not_synchro;
44 unsigned char time_timecode_ctr;
44 unsigned char time_timecode_ctr;
45 unsigned char ahb_correctable;
45 unsigned char ahb_correctable;
46 } hk_lfr_le_t;
46 } hk_lfr_le_t;
47
47
48 typedef struct{
48 typedef struct{
49 unsigned char dpu_spw_early_eop;
49 unsigned char dpu_spw_early_eop;
50 unsigned char dpu_spw_invalid_addr;
50 unsigned char dpu_spw_invalid_addr;
51 unsigned char dpu_spw_eep;
51 unsigned char dpu_spw_eep;
52 unsigned char dpu_spw_rx_too_big;
52 unsigned char dpu_spw_rx_too_big;
53 } hk_lfr_me_t;
53 } hk_lfr_me_t;
54
54
55 #define B00 196
55 #define B00 196
56 #define B01 196
56 #define B01 196
57 #define B02 0
57 #define B02 0
58 #define B10 131
58 #define B10 131
59 #define B11 -244
59 #define B11 -244
60 #define B12 131
60 #define B12 131
61 #define B20 161
61 #define B20 161
62 #define B21 -314
62 #define B21 -314
63 #define B22 161
63 #define B22 161
64
64
65 #define A00 1
65 #define A00 1
66 #define A01 -925
66 #define A01 -925
67 #define A02 0
67 #define A02 0
68 #define A10 1
68 #define A10 1
69 #define A11 -947
69 #define A11 -947
70 #define A12 439
70 #define A12 439
71 #define A20 1
71 #define A20 1
72 #define A21 -993
72 #define A21 -993
73 #define A22 486
73 #define A22 486
74
74
75 #define GAIN_B0 12
75 #define GAIN_B0 12
76 #define GAIN_B1 11
76 #define GAIN_B1 11
77 #define GAIN_B2 10
77 #define GAIN_B2 10
78
78
79 #define GAIN_A0 10
79 #define GAIN_A0 10
80 #define GAIN_A1 9
80 #define GAIN_A1 9
81 #define GAIN_A2 9
81 #define GAIN_A2 9
82
82
83 #define NB_COEFFS 3
83 #define NB_COEFFS 3
84 #define COEFF0 0
84 #define COEFF0 0
85 #define COEFF1 1
85 #define COEFF1 1
86 #define COEFF2 2
86 #define COEFF2 2
87
87
88 typedef struct filter_ctx
88 typedef struct filter_ctx
89 {
89 {
90 int W[NB_COEFFS][NB_COEFFS];
90 int W[NB_COEFFS][NB_COEFFS];
91 }filter_ctx;
91 }filter_ctx;
92
92
93 extern gptimer_regs_t *gptimer_regs;
93 extern gptimer_regs_t *gptimer_regs;
94 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
94 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
95 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
95 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
96
96
97 extern rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
97 extern rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
98 extern rtems_id HK_id;// id of the HK rate monotonic period
98 extern rtems_id HK_id;// id of the HK rate monotonic period
99 extern rtems_name name_avgv_rate_monotonic; // name of the AVGV rate monotonic
99 extern rtems_name name_avgv_rate_monotonic; // name of the AVGV rate monotonic
100 extern rtems_id AVGV_id;// id of the AVGV rate monotonic period
100 extern rtems_id AVGV_id;// id of the AVGV rate monotonic period
101
101
102 void timer_configure( unsigned char timer, unsigned int clock_divider,
102 void timer_configure( unsigned char timer, unsigned int clock_divider,
103 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
103 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
104 void timer_start( unsigned char timer );
104 #ifdef ENABLE_DEAD_CODE
105 void timer_start( unsigned char timer );
106 #endif
105 void timer_stop( unsigned char timer );
107 void timer_stop( unsigned char timer );
106 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
108 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
107
109
108 // WATCHDOG
110 // WATCHDOG
109 rtems_isr watchdog_isr( rtems_vector_number vector );
111 rtems_isr watchdog_isr( rtems_vector_number vector );
110 void watchdog_configure(void);
112 void watchdog_configure(void);
111 void watchdog_stop(void);
113 void watchdog_stop(void);
112 void watchdog_reload(void);
114 void watchdog_reload(void);
113 void watchdog_start(void);
115 void watchdog_start(void);
114
116
115 // SERIAL LINK
117 // SERIAL LINK
116 int send_console_outputs_on_apbuart_port( void );
118 int send_console_outputs_on_apbuart_port( void );
117 int enable_apbuart_transmitter( void );
119 int enable_apbuart_transmitter( void );
118 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
120 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
119
121
120 // RTEMS TASKS
122 // RTEMS TASKS
121 rtems_task load_task( rtems_task_argument argument );
123 rtems_task load_task( rtems_task_argument argument );
122 rtems_task hous_task( rtems_task_argument argument );
124 rtems_task hous_task( rtems_task_argument argument );
123 rtems_task avgv_task( rtems_task_argument argument );
125 rtems_task avgv_task( rtems_task_argument argument );
124 rtems_task dumb_task( rtems_task_argument unused );
126 rtems_task dumb_task( rtems_task_argument unused );
125 rtems_task scrubbing_task( rtems_task_argument unused );
127 rtems_task scrubbing_task( rtems_task_argument unused );
126 rtems_task calibration_sweep_task( rtems_task_argument unused );
128 rtems_task calibration_sweep_task( rtems_task_argument unused );
127
129
128 void init_housekeeping_parameters( void );
130 void init_housekeeping_parameters( void );
129 void increment_seq_counter(unsigned short *packetSequenceControl);
131 void increment_seq_counter(unsigned short *packetSequenceControl);
130 void getTime( unsigned char *time);
132 void getTime( unsigned char *time);
131 unsigned long long int getTimeAsUnsignedLongLongInt( );
133 unsigned long long int getTimeAsUnsignedLongLongInt( );
132 void get_temperatures( unsigned char *temperatures );
134 void get_temperatures( unsigned char *temperatures );
133 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
135 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
134 void get_cpu_load( unsigned char *resource_statistics );
136 void get_cpu_load( unsigned char *resource_statistics );
135 void set_hk_lfr_sc_potential_flag( bool state );
137 void set_hk_lfr_sc_potential_flag( bool state );
136 void set_sy_lfr_pas_filter_enabled( bool state );
138 void set_sy_lfr_pas_filter_enabled( bool state );
137 void set_sy_lfr_watchdog_enabled( bool state );
139 void set_sy_lfr_watchdog_enabled( bool state );
138 void set_hk_lfr_calib_enable( bool state );
140 void set_hk_lfr_calib_enable( bool state );
139 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
141 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
140 void hk_lfr_le_me_he_update();
142 void hk_lfr_le_me_he_update();
141 void set_hk_lfr_time_not_synchro();
143 void set_hk_lfr_time_not_synchro();
142
144
143 extern int sched_yield( void );
145 extern int sched_yield( void );
144 extern void rtems_cpu_usage_reset();
146 extern void rtems_cpu_usage_reset();
145 extern ring_node *current_ring_node_f3;
147 extern ring_node *current_ring_node_f3;
146 extern ring_node *ring_node_to_send_cwf_f3;
148 extern ring_node *ring_node_to_send_cwf_f3;
147 extern ring_node waveform_ring_f3[];
149 extern ring_node waveform_ring_f3[];
148 extern unsigned short sequenceCounterHK;
150 extern unsigned short sequenceCounterHK;
149
151
150 extern unsigned char hk_lfr_q_sd_fifo_size_max;
152 extern unsigned char hk_lfr_q_sd_fifo_size_max;
151 extern unsigned char hk_lfr_q_rv_fifo_size_max;
153 extern unsigned char hk_lfr_q_rv_fifo_size_max;
152 extern unsigned char hk_lfr_q_p0_fifo_size_max;
154 extern unsigned char hk_lfr_q_p0_fifo_size_max;
153 extern unsigned char hk_lfr_q_p1_fifo_size_max;
155 extern unsigned char hk_lfr_q_p1_fifo_size_max;
154 extern unsigned char hk_lfr_q_p2_fifo_size_max;
156 extern unsigned char hk_lfr_q_p2_fifo_size_max;
155
157
156 #endif // FSW_MISC_H_INCLUDED
158 #endif // FSW_MISC_H_INCLUDED
@@ -1,112 +1,114
1 #ifndef TC_HANDLER_H_INCLUDED
1 #ifndef TC_HANDLER_H_INCLUDED
2 #define TC_HANDLER_H_INCLUDED
2 #define TC_HANDLER_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <leon.h>
5 #include <leon.h>
6
6
7 #include "tc_load_dump_parameters.h"
7 #include "tc_load_dump_parameters.h"
8 #include "tc_acceptance.h"
8 #include "tc_acceptance.h"
9 #include "tm_lfr_tc_exe.h"
9 #include "tm_lfr_tc_exe.h"
10 #include "wf_handler.h"
10 #include "wf_handler.h"
11 #include "fsw_processing.h"
11 #include "fsw_processing.h"
12
12
13 #include "lfr_cpu_usage_report.h"
13 #include "lfr_cpu_usage_report.h"
14
14
15 #define MAX_DELTA_COARSE_TIME 3
15 #define MAX_DELTA_COARSE_TIME 3
16 #define NB_SCIENCE_TASKS 10
16 #define NB_SCIENCE_TASKS 10
17 #define NB_ASM_TASKS 6
17 #define NB_ASM_TASKS 6
18 #define STATUS_0 0
18 #define STATUS_0 0
19 #define STATUS_1 1
19 #define STATUS_1 1
20 #define STATUS_2 2
20 #define STATUS_2 2
21 #define STATUS_3 3
21 #define STATUS_3 3
22 #define STATUS_4 4
22 #define STATUS_4 4
23 #define STATUS_5 5
23 #define STATUS_5 5
24 #define STATUS_6 6
24 #define STATUS_6 6
25 #define STATUS_7 7
25 #define STATUS_7 7
26 #define STATUS_8 8
26 #define STATUS_8 8
27 #define STATUS_9 9
27 #define STATUS_9 9
28
28
29 #define CAL_F0 625.
29 #define CAL_F0 625.
30 #define CAL_F1 10000.
30 #define CAL_F1 10000.
31 #define CAL_W0 (2. * pi * CAL_F0)
31 #define CAL_W0 (2. * pi * CAL_F0)
32 #define CAL_W1 (2. * pi * CAL_F1)
32 #define CAL_W1 (2. * pi * CAL_F1)
33 #define CAL_A0 1.
33 #define CAL_A0 1.
34 #define CAL_A1 2.
34 #define CAL_A1 2.
35 #define CAL_FS 160256.410
35 #define CAL_FS 160256.410
36 #define CAL_SCALE_FACTOR (0.250 / 0.000654) // 191, 500 mVpp, 2 sinus waves => 500 mVpp each, amplitude = 250 mV
36 #define CAL_SCALE_FACTOR (0.250 / 0.000654) // 191, 500 mVpp, 2 sinus waves => 500 mVpp each, amplitude = 250 mV
37 #define CAL_NB_PTS 256
37 #define CAL_NB_PTS 256
38 #define CAL_DATA_MASK 0xfff
38 #define CAL_DATA_MASK 0xfff
39 #define CAL_F_DIVISOR 38 // 25 MHz => 160 256 (39 - 1)
39 #define CAL_F_DIVISOR 38 // 25 MHz => 160 256 (39 - 1)
40 #define CAL_F_DIVISOR_MIN 38
40 #define CAL_F_DIVISOR_MIN 38
41 #define CAL_F_DIVISOR_MAX (38*2*2*2*2)
41 #define CAL_F_DIVISOR_MAX (38*2*2*2*2)
42 // INTERLEAVED MODE
42 // INTERLEAVED MODE
43 #define CAL_FS_INTER 240384.615
43 #define CAL_FS_INTER 240384.615
44 #define CAL_NB_PTS_INTER 384
44 #define CAL_NB_PTS_INTER 384
45 #define CAL_DATA_MASK_INTER 0x3f
45 #define CAL_DATA_MASK_INTER 0x3f
46 #define CAL_DATA_SHIFT_INTER 12
46 #define CAL_DATA_SHIFT_INTER 12
47 #define BYTES_FOR_2_SAMPLES 3 // one need 3 bytes = 24 bits to store 3 samples of 12 bits in interleaved mode
47 #define BYTES_FOR_2_SAMPLES 3 // one need 3 bytes = 24 bits to store 3 samples of 12 bits in interleaved mode
48 #define STEPS_FOR_STORAGE_INTER 128
48 #define STEPS_FOR_STORAGE_INTER 128
49 #define CAL_F_DIVISOR_INTER 26 // 25 MHz => 240 384
49 #define CAL_F_DIVISOR_INTER 26 // 25 MHz => 240 384
50
50
51 extern unsigned int lastValidEnterModeTime;
51 extern unsigned int lastValidEnterModeTime;
52 extern unsigned char oneTcLfrUpdateTimeReceived;
52 extern unsigned char oneTcLfrUpdateTimeReceived;
53
53
54 //***********
54 //***********
55 // RTEMS TASK
55 // RTEMS TASK
56 rtems_task actn_task( rtems_task_argument unused );
56 rtems_task actn_task( rtems_task_argument unused );
57
57
58 //***********
58 //***********
59 // TC ACTIONS
59 // TC ACTIONS
60 int action_reset( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
60 int action_reset( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
61 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
61 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
62 int action_update_info( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
62 int action_update_info( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
63 int action_enable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
63 int action_enable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
64 int action_disable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
64 int action_disable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
65 int action_update_time( ccsdsTelecommandPacket_t *TC);
65 int action_update_time( ccsdsTelecommandPacket_t *TC);
66
66
67 // mode transition
67 // mode transition
68 int check_mode_value( unsigned char requestedMode );
68 int check_mode_value( unsigned char requestedMode );
69 int check_mode_transition( unsigned char requestedMode );
69 int check_mode_transition( unsigned char requestedMode );
70 void update_last_valid_transition_date( unsigned int transitionCoarseTime );
70 void update_last_valid_transition_date( unsigned int transitionCoarseTime );
71 int check_transition_date( unsigned int transitionCoarseTime );
71 int check_transition_date( unsigned int transitionCoarseTime );
72 int stop_spectral_matrices( void );
72 int stop_spectral_matrices( void );
73 int stop_current_mode( void );
73 int stop_current_mode( void );
74 int enter_mode_standby(void );
74 int enter_mode_standby(void );
75 int enter_mode_normal( unsigned int transitionCoarseTime );
75 int enter_mode_normal( unsigned int transitionCoarseTime );
76 int enter_mode_burst( unsigned int transitionCoarseTime );
76 int enter_mode_burst( unsigned int transitionCoarseTime );
77 int enter_mode_sbm1( unsigned int transitionCoarseTime );
77 int enter_mode_sbm1( unsigned int transitionCoarseTime );
78 int enter_mode_sbm2( unsigned int transitionCoarseTime );
78 int enter_mode_sbm2( unsigned int transitionCoarseTime );
79 int restart_science_tasks( unsigned char lfrRequestedMode );
79 int restart_science_tasks( unsigned char lfrRequestedMode );
80 int restart_asm_tasks(unsigned char lfrRequestedMode );
80 int restart_asm_tasks(unsigned char lfrRequestedMode );
81 int suspend_science_tasks(void);
81 int suspend_science_tasks(void);
82 int suspend_asm_tasks( void );
82 int suspend_asm_tasks( void );
83 void launch_waveform_picker( unsigned char mode , unsigned int transitionCoarseTime );
83 void launch_waveform_picker( unsigned char mode , unsigned int transitionCoarseTime );
84 void launch_spectral_matrix( void );
84 void launch_spectral_matrix( void );
85 void set_sm_irq_onNewMatrix( unsigned char value );
85 void set_sm_irq_onNewMatrix( unsigned char value );
86 void set_sm_irq_onError( unsigned char value );
86 void set_sm_irq_onError( unsigned char value );
87
87
88 // other functions
88 // other functions
89 void updateLFRCurrentMode(unsigned char requestedMode);
89 void updateLFRCurrentMode(unsigned char requestedMode);
90 void set_lfr_soft_reset( unsigned char value );
90 void set_lfr_soft_reset( unsigned char value );
91 void reset_lfr( void );
91 void reset_lfr( void );
92 // CALIBRATION
92 // CALIBRATION
93 void setCalibrationPrescaler( unsigned int prescaler );
93 void setCalibrationPrescaler( unsigned int prescaler );
94 void setCalibrationDivisor( unsigned int divisionFactor );
94 void setCalibrationDivisor( unsigned int divisionFactor );
95 void setCalibrationData( void );
95 void setCalibrationData( void );
96 void setCalibrationReload( bool state);
96 void setCalibrationReload( bool state);
97 void setCalibrationEnable( bool state );
97 void setCalibrationEnable( bool state );
98 void setCalibrationInterleaved( bool state );
98 #ifdef ENABLE_DEAD_CODE
99 void setCalibrationInterleaved( bool state );
100 #endif
99 void setCalibration( bool state );
101 void setCalibration( bool state );
100 void configureCalibration( bool interleaved );
102 void configureCalibration( bool interleaved );
101 //
103 //
102 void update_last_TC_exe( ccsdsTelecommandPacket_t *TC , unsigned char *time );
104 void update_last_TC_exe( ccsdsTelecommandPacket_t *TC , unsigned char *time );
103 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC , unsigned char *time );
105 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC , unsigned char *time );
104 void close_action( ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id );
106 void close_action( ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id );
105
107
106 extern rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
108 extern rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
107 extern rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
109 extern rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
108
110
109 #endif // TC_HANDLER_H_INCLUDED
111 #endif // TC_HANDLER_H_INCLUDED
110
112
111
113
112
114
@@ -1,27 +1,29
1 #ifndef TM_LFR_TC_EXE_H_INCLUDED
1 #ifndef TM_LFR_TC_EXE_H_INCLUDED
2 #define TM_LFR_TC_EXE_H_INCLUDED
2 #define TM_LFR_TC_EXE_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6 #include <ccsds_types.h>
6 #include <ccsds_types.h>
7
7
8 #include "fsw_params.h"
8 #include "fsw_params.h"
9 #include "fsw_spacewire.h"
9 #include "fsw_spacewire.h"
10
10
11 extern unsigned short sequenceCounters_TC_EXE[];
11 extern unsigned short sequenceCounters_TC_EXE[];
12
12
13 int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
13 int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
14 int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
14 int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
15 unsigned char byte_position, unsigned char rcv_value );
15 unsigned char byte_position, unsigned char rcv_value );
16 int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
16 int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
17 int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
17 #ifdef ENABLE_DEAD_CODE
18 int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
19 #endif
18 int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
20 int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
19 int send_tm_lfr_tc_exe_corrupted( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
21 int send_tm_lfr_tc_exe_corrupted( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
20 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID );
22 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID );
21
23
22 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id );
24 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id );
23
25
24 #endif // TM_LFR_TC_EXE_H_INCLUDED
26 #endif // TM_LFR_TC_EXE_H_INCLUDED
25
27
26
28
27
29
@@ -1,136 +1,136
1 cmake_minimum_required (VERSION 3.5)
1 cmake_minimum_required (VERSION 3.5)
2 project (fsw)
2 project (fsw)
3
3
4 include(sparc-rtems)
4 include(sparc-rtems)
5 include(cppcheck)
5 include(cppcheck)
6
6
7 include_directories("../header"
7 include_directories("../header"
8 "../header/lfr_common_headers"
8 "../header/lfr_common_headers"
9 "../header/processing"
9 "../header/processing"
10 "../LFR_basic-parameters"
10 "../LFR_basic-parameters"
11 "../src")
11 "../src")
12
12
13 set(SOURCES wf_handler.c
13 set(SOURCES wf_handler.c
14 tc_handler.c
14 tc_handler.c
15 fsw_misc.c
15 fsw_misc.c
16 fsw_init.c
16 fsw_init.c
17 fsw_globals.c
17 fsw_globals.c
18 fsw_spacewire.c
18 fsw_spacewire.c
19 tc_load_dump_parameters.c
19 tc_load_dump_parameters.c
20 tm_lfr_tc_exe.c
20 tm_lfr_tc_exe.c
21 tc_acceptance.c
21 tc_acceptance.c
22 processing/fsw_processing.c
22 processing/fsw_processing.c
23 processing/avf0_prc0.c
23 processing/avf0_prc0.c
24 processing/avf1_prc1.c
24 processing/avf1_prc1.c
25 processing/avf2_prc2.c
25 processing/avf2_prc2.c
26 lfr_cpu_usage_report.c
26 lfr_cpu_usage_report.c
27 ${LFR_BP_SRC}
27 ${LFR_BP_SRC}
28 ../header/wf_handler.h
28 ../header/wf_handler.h
29 ../header/tc_handler.h
29 ../header/tc_handler.h
30 ../header/grlib_regs.h
30 ../header/grlib_regs.h
31 ../header/fsw_misc.h
31 ../header/fsw_misc.h
32 ../header/fsw_init.h
32 ../header/fsw_init.h
33 ../header/fsw_spacewire.h
33 ../header/fsw_spacewire.h
34 ../header/tc_load_dump_parameters.h
34 ../header/tc_load_dump_parameters.h
35 ../header/tm_lfr_tc_exe.h
35 ../header/tm_lfr_tc_exe.h
36 ../header/tc_acceptance.h
36 ../header/tc_acceptance.h
37 ../header/processing/fsw_processing.h
37 ../header/processing/fsw_processing.h
38 ../header/processing/avf0_prc0.h
38 ../header/processing/avf0_prc0.h
39 ../header/processing/avf1_prc1.h
39 ../header/processing/avf1_prc1.h
40 ../header/processing/avf2_prc2.h
40 ../header/processing/avf2_prc2.h
41 ../header/fsw_params_wf_handler.h
41 ../header/fsw_params_wf_handler.h
42 ../header/lfr_cpu_usage_report.h
42 ../header/lfr_cpu_usage_report.h
43 ../header/lfr_common_headers/ccsds_types.h
43 ../header/lfr_common_headers/ccsds_types.h
44 ../header/lfr_common_headers/fsw_params.h
44 ../header/lfr_common_headers/fsw_params.h
45 ../header/lfr_common_headers/fsw_params_nb_bytes.h
45 ../header/lfr_common_headers/fsw_params_nb_bytes.h
46 ../header/lfr_common_headers/fsw_params_processing.h
46 ../header/lfr_common_headers/fsw_params_processing.h
47 ../header/lfr_common_headers/tm_byte_positions.h
47 ../header/lfr_common_headers/tm_byte_positions.h
48 ../LFR_basic-parameters/basic_parameters.h
48 ../LFR_basic-parameters/basic_parameters.h
49 ../LFR_basic-parameters/basic_parameters_params.h
49 ../LFR_basic-parameters/basic_parameters_params.h
50 ../header/GscMemoryLPP.hpp
50 ../header/GscMemoryLPP.hpp
51 )
51 )
52
52
53
53
54 option(FSW_verbose "Enable verbose LFR" OFF)
54 option(FSW_verbose "Enable verbose LFR" OFF)
55 option(FSW_boot_messages "Enable LFR boot messages" OFF)
55 option(FSW_boot_messages "Enable LFR boot messages" OFF)
56 option(FSW_debug_messages "Enable LFR debug messages" OFF)
56 option(FSW_debug_messages "Enable LFR debug messages" OFF)
57 option(FSW_cpu_usage_report "Enable LFR cpu usage report" OFF)
57 option(FSW_cpu_usage_report "Enable LFR cpu usage report" OFF)
58 option(FSW_stack_report "Enable LFR stack report" OFF)
58 option(FSW_stack_report "Enable LFR stack report" OFF)
59 option(FSW_vhdl_dev "?" OFF)
59 option(FSW_vhdl_dev "?" OFF)
60 option(FSW_lpp_dpu_destid "Set to debug at LPP" OFF)
60 option(FSW_lpp_dpu_destid "Set to debug at LPP" OFF)
61 option(FSW_debug_watchdog "Enable debug watchdog" OFF)
61 option(FSW_debug_watchdog "Enable debug watchdog" OFF)
62 option(FSW_debug_tch "?" OFF)
62 option(FSW_debug_tch "?" OFF)
63 option(FSW_Instrument_Scrubbing "Enable scrubbing counter" OFF)
63 option(FSW_Instrument_Scrubbing "Enable scrubbing counter" OFF)
64 option(FSW_Enable_Dead_Code "Enable dead code compilation, this is used to hide by default unused code." OFF)
64 option(FSW_Enable_Dead_Code "Enable dead code compilation, this is used to hide by default unused code." OFF)
65
65
66 set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE)
66 set(SW_VERSION_N1 "3" CACHE STRING "Choose N1 FSW Version." FORCE)
67 set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE)
67 set(SW_VERSION_N2 "2" CACHE STRING "Choose N2 FSW Version." FORCE)
68 set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE)
68 set(SW_VERSION_N3 "0" CACHE STRING "Choose N3 FSW Version." FORCE)
69 set(SW_VERSION_N4 "23" CACHE STRING "Choose N4 FSW Version." FORCE)
69 set(SW_VERSION_N4 "24" CACHE STRING "Choose N4 FSW Version." FORCE)
70
70
71 if(FSW_verbose)
71 if(FSW_verbose)
72 add_definitions(-DPRINT_MESSAGES_ON_CONSOLE)
72 add_definitions(-DPRINT_MESSAGES_ON_CONSOLE)
73 endif()
73 endif()
74 if(FSW_boot_messages)
74 if(FSW_boot_messages)
75 add_definitions(-DBOOT_MESSAGES)
75 add_definitions(-DBOOT_MESSAGES)
76 endif()
76 endif()
77 if(FSW_debug_messages)
77 if(FSW_debug_messages)
78 add_definitions(-DDEBUG_MESSAGES)
78 add_definitions(-DDEBUG_MESSAGES)
79 endif()
79 endif()
80 if(FSW_cpu_usage_report)
80 if(FSW_cpu_usage_report)
81 add_definitions(-DPRINT_TASK_STATISTICS)
81 add_definitions(-DPRINT_TASK_STATISTICS)
82 endif()
82 endif()
83 if(FSW_stack_report)
83 if(FSW_stack_report)
84 add_definitions(-DPRINT_STACK_REPORT)
84 add_definitions(-DPRINT_STACK_REPORT)
85 endif()
85 endif()
86 if(FSW_vhdl_dev)
86 if(FSW_vhdl_dev)
87 add_definitions(-DVHDL_DEV)
87 add_definitions(-DVHDL_DEV)
88 endif()
88 endif()
89 if(FSW_lpp_dpu_destid)
89 if(FSW_lpp_dpu_destid)
90 add_definitions(-DLPP_DPU_DESTID)
90 add_definitions(-DLPP_DPU_DESTID)
91 endif()
91 endif()
92 if(FSW_debug_watchdog)
92 if(FSW_debug_watchdog)
93 add_definitions(-DDEBUG_WATCHDOG)
93 add_definitions(-DDEBUG_WATCHDOG)
94 endif()
94 endif()
95 if(FSW_debug_tch)
95 if(FSW_debug_tch)
96 add_definitions(-DDEBUG_TCH)
96 add_definitions(-DDEBUG_TCH)
97 endif()
97 endif()
98
98
99 if(FSW_Enable_Dead_Code)
99 if(FSW_Enable_Dead_Code)
100 add_definitions(-DENABLE_DEAD_CODE)
100 add_definitions(-DENABLE_DEAD_CODE)
101 endif()
101 endif()
102
102
103
103
104
104
105
105
106 add_definitions(-DMSB_FIRST_TCH)
106 add_definitions(-DMSB_FIRST_TCH)
107
107
108 add_definitions(-DSWVERSION=-1-0)
108 add_definitions(-DSWVERSION=-1-0)
109 add_definitions(-DSW_VERSION_N1=${SW_VERSION_N1})
109 add_definitions(-DSW_VERSION_N1=${SW_VERSION_N1})
110 add_definitions(-DSW_VERSION_N2=${SW_VERSION_N2})
110 add_definitions(-DSW_VERSION_N2=${SW_VERSION_N2})
111 add_definitions(-DSW_VERSION_N3=${SW_VERSION_N3})
111 add_definitions(-DSW_VERSION_N3=${SW_VERSION_N3})
112 add_definitions(-DSW_VERSION_N4=${SW_VERSION_N4})
112 add_definitions(-DSW_VERSION_N4=${SW_VERSION_N4})
113
113
114 add_executable(fsw ${SOURCES})
114 add_executable(fsw ${SOURCES})
115
115
116 if(FSW_Instrument_Scrubbing)
116 if(FSW_Instrument_Scrubbing)
117 add_definitions(-DENABLE_SCRUBBING_COUNTER)
117 add_definitions(-DENABLE_SCRUBBING_COUNTER)
118 endif()
118 endif()
119
119
120 if(Coverage)
120 if(Coverage)
121 target_link_libraries(fsw gcov)
121 target_link_libraries(fsw gcov)
122 SET_TARGET_PROPERTIES(fsw PROPERTIES COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
122 SET_TARGET_PROPERTIES(fsw PROPERTIES COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
123 endif()
123 endif()
124
124
125
125
126 if(fix-b2bst)
126 if(fix-b2bst)
127 check_b2bst(fsw ${CMAKE_CURRENT_BINARY_DIR})
127 check_b2bst(fsw ${CMAKE_CURRENT_BINARY_DIR})
128 endif()
128 endif()
129
129
130 if(NOT FSW_lpp_dpu_destid)
130 if(NOT FSW_lpp_dpu_destid)
131 build_srec(fsw ${CMAKE_CURRENT_BINARY_DIR} "${SW_VERSION_N1}-${SW_VERSION_N2}-${SW_VERSION_N3}-${SW_VERSION_N4}")
131 build_srec(fsw ${CMAKE_CURRENT_BINARY_DIR} "${SW_VERSION_N1}-${SW_VERSION_N2}-${SW_VERSION_N3}-${SW_VERSION_N4}")
132 endif()
132 endif()
133
133
134
134
135 #add_test_cppcheck(fsw STYLE UNUSED_FUNCTIONS POSSIBLE_ERROR MISSING_INCLUDE)
135 #add_test_cppcheck(fsw STYLE UNUSED_FUNCTIONS POSSIBLE_ERROR MISSING_INCLUDE)
136
136
@@ -1,1692 +1,1694
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
2 -- Solar Orbiter's Low Frequency Receiver Flight Software (LFR FSW),
3 -- This file is a part of the LFR FSW
3 -- This file is a part of the LFR FSW
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
4 -- Copyright (C) 2012-2018, Plasma Physics Laboratory - CNRS
5 --
5 --
6 -- This program is free software; you can redistribute it and/or modify
6 -- This program is free software; you can redistribute it and/or modify
7 -- it under the terms of the GNU General Public License as published by
7 -- it under the terms of the GNU General Public License as published by
8 -- the Free Software Foundation; either version 2 of the License, or
8 -- the Free Software Foundation; either version 2 of the License, or
9 -- (at your option) any later version.
9 -- (at your option) any later version.
10 --
10 --
11 -- This program is distributed in the hope that it will be useful,
11 -- This program is distributed in the hope that it will be useful,
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 -- GNU General Public License for more details.
14 -- GNU General Public License for more details.
15 --
15 --
16 -- You should have received a copy of the GNU General Public License
16 -- You should have received a copy of the GNU General Public License
17 -- along with this program; if not, write to the Free Software
17 -- along with this program; if not, write to the Free Software
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------*/
19 -------------------------------------------------------------------------------*/
20 /*-- Author : Paul Leroy
20 /*-- Author : Paul Leroy
21 -- Contact : Alexis Jeandet
21 -- Contact : Alexis Jeandet
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
22 -- Mail : alexis.jeandet@lpp.polytechnique.fr
23 ----------------------------------------------------------------------------*/
23 ----------------------------------------------------------------------------*/
24 /** Functions and tasks related to TeleCommand handling.
24 /** Functions and tasks related to TeleCommand handling.
25 *
25 *
26 * @file
26 * @file
27 * @author P. LEROY
27 * @author P. LEROY
28 *
28 *
29 * A group of functions to handle TeleCommands:\n
29 * A group of functions to handle TeleCommands:\n
30 * action launching\n
30 * action launching\n
31 * TC parsing\n
31 * TC parsing\n
32 * ...
32 * ...
33 *
33 *
34 */
34 */
35
35
36 #include "tc_handler.h"
36 #include "tc_handler.h"
37 #include "math.h"
37 #include "math.h"
38
38
39 //***********
39 //***********
40 // RTEMS TASK
40 // RTEMS TASK
41
41
42 rtems_task actn_task( rtems_task_argument unused )
42 rtems_task actn_task( rtems_task_argument unused )
43 {
43 {
44 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
44 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
45 *
45 *
46 * @param unused is the starting argument of the RTEMS task
46 * @param unused is the starting argument of the RTEMS task
47 *
47 *
48 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
48 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
49 * on the incoming TeleCommand.
49 * on the incoming TeleCommand.
50 *
50 *
51 */
51 */
52
52
53 int result;
53 int result;
54 rtems_status_code status; // RTEMS status code
54 rtems_status_code status; // RTEMS status code
55 ccsdsTelecommandPacket_t __attribute__((aligned(4))) TC; // TC sent to the ACTN task
55 ccsdsTelecommandPacket_t __attribute__((aligned(4))) TC; // TC sent to the ACTN task
56 size_t size; // size of the incoming TC packet
56 size_t size; // size of the incoming TC packet
57 unsigned char subtype; // subtype of the current TC packet
57 unsigned char subtype; // subtype of the current TC packet
58 unsigned char time[BYTES_PER_TIME];
58 unsigned char time[BYTES_PER_TIME];
59 rtems_id queue_rcv_id;
59 rtems_id queue_rcv_id;
60 rtems_id queue_snd_id;
60 rtems_id queue_snd_id;
61
61
62 memset(&TC, 0, sizeof(ccsdsTelecommandPacket_t));
62 memset(&TC, 0, sizeof(ccsdsTelecommandPacket_t));
63 size = 0;
63 size = 0;
64 queue_rcv_id = RTEMS_ID_NONE;
64 queue_rcv_id = RTEMS_ID_NONE;
65 queue_snd_id = RTEMS_ID_NONE;
65 queue_snd_id = RTEMS_ID_NONE;
66
66
67 status = get_message_queue_id_recv( &queue_rcv_id );
67 status = get_message_queue_id_recv( &queue_rcv_id );
68 if (status != RTEMS_SUCCESSFUL)
68 if (status != RTEMS_SUCCESSFUL)
69 {
69 {
70 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
70 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
71 }
71 }
72
72
73 status = get_message_queue_id_send( &queue_snd_id );
73 status = get_message_queue_id_send( &queue_snd_id );
74 if (status != RTEMS_SUCCESSFUL)
74 if (status != RTEMS_SUCCESSFUL)
75 {
75 {
76 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
76 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
77 }
77 }
78
78
79 result = LFR_SUCCESSFUL;
79 result = LFR_SUCCESSFUL;
80 subtype = 0; // subtype of the current TC packet
80 subtype = 0; // subtype of the current TC packet
81
81
82 BOOT_PRINTF("in ACTN *** \n");
82 BOOT_PRINTF("in ACTN *** \n");
83
83
84 while(1)
84 while(1)
85 {
85 {
86 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
86 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
87 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
87 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
88 getTime( time ); // set time to the current time
88 getTime( time ); // set time to the current time
89 if (status!=RTEMS_SUCCESSFUL)
89 if (status!=RTEMS_SUCCESSFUL)
90 {
90 {
91 PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
91 PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
92 }
92 }
93 else
93 else
94 {
94 {
95 subtype = TC.serviceSubType;
95 subtype = TC.serviceSubType;
96 switch(subtype)
96 switch(subtype)
97 {
97 {
98 case TC_SUBTYPE_RESET:
98 case TC_SUBTYPE_RESET:
99 result = action_reset( &TC, queue_snd_id, time );
99 result = action_reset( &TC, queue_snd_id, time );
100 close_action( &TC, result, queue_snd_id );
100 close_action( &TC, result, queue_snd_id );
101 break;
101 break;
102 case TC_SUBTYPE_LOAD_COMM:
102 case TC_SUBTYPE_LOAD_COMM:
103 result = action_load_common_par( &TC );
103 result = action_load_common_par( &TC );
104 close_action( &TC, result, queue_snd_id );
104 close_action( &TC, result, queue_snd_id );
105 break;
105 break;
106 case TC_SUBTYPE_LOAD_NORM:
106 case TC_SUBTYPE_LOAD_NORM:
107 result = action_load_normal_par( &TC, queue_snd_id, time );
107 result = action_load_normal_par( &TC, queue_snd_id, time );
108 close_action( &TC, result, queue_snd_id );
108 close_action( &TC, result, queue_snd_id );
109 break;
109 break;
110 case TC_SUBTYPE_LOAD_BURST:
110 case TC_SUBTYPE_LOAD_BURST:
111 result = action_load_burst_par( &TC, queue_snd_id, time );
111 result = action_load_burst_par( &TC, queue_snd_id, time );
112 close_action( &TC, result, queue_snd_id );
112 close_action( &TC, result, queue_snd_id );
113 break;
113 break;
114 case TC_SUBTYPE_LOAD_SBM1:
114 case TC_SUBTYPE_LOAD_SBM1:
115 result = action_load_sbm1_par( &TC, queue_snd_id, time );
115 result = action_load_sbm1_par( &TC, queue_snd_id, time );
116 close_action( &TC, result, queue_snd_id );
116 close_action( &TC, result, queue_snd_id );
117 break;
117 break;
118 case TC_SUBTYPE_LOAD_SBM2:
118 case TC_SUBTYPE_LOAD_SBM2:
119 result = action_load_sbm2_par( &TC, queue_snd_id, time );
119 result = action_load_sbm2_par( &TC, queue_snd_id, time );
120 close_action( &TC, result, queue_snd_id );
120 close_action( &TC, result, queue_snd_id );
121 break;
121 break;
122 case TC_SUBTYPE_DUMP:
122 case TC_SUBTYPE_DUMP:
123 result = action_dump_par( &TC, queue_snd_id );
123 result = action_dump_par( &TC, queue_snd_id );
124 close_action( &TC, result, queue_snd_id );
124 close_action( &TC, result, queue_snd_id );
125 break;
125 break;
126 case TC_SUBTYPE_ENTER:
126 case TC_SUBTYPE_ENTER:
127 result = action_enter_mode( &TC, queue_snd_id );
127 result = action_enter_mode( &TC, queue_snd_id );
128 close_action( &TC, result, queue_snd_id );
128 close_action( &TC, result, queue_snd_id );
129 break;
129 break;
130 case TC_SUBTYPE_UPDT_INFO:
130 case TC_SUBTYPE_UPDT_INFO:
131 result = action_update_info( &TC, queue_snd_id );
131 result = action_update_info( &TC, queue_snd_id );
132 close_action( &TC, result, queue_snd_id );
132 close_action( &TC, result, queue_snd_id );
133 break;
133 break;
134 case TC_SUBTYPE_EN_CAL:
134 case TC_SUBTYPE_EN_CAL:
135 result = action_enable_calibration( &TC, queue_snd_id, time );
135 result = action_enable_calibration( &TC, queue_snd_id, time );
136 close_action( &TC, result, queue_snd_id );
136 close_action( &TC, result, queue_snd_id );
137 break;
137 break;
138 case TC_SUBTYPE_DIS_CAL:
138 case TC_SUBTYPE_DIS_CAL:
139 result = action_disable_calibration( &TC, queue_snd_id, time );
139 result = action_disable_calibration( &TC, queue_snd_id, time );
140 close_action( &TC, result, queue_snd_id );
140 close_action( &TC, result, queue_snd_id );
141 break;
141 break;
142 case TC_SUBTYPE_LOAD_K:
142 case TC_SUBTYPE_LOAD_K:
143 result = action_load_kcoefficients( &TC, queue_snd_id, time );
143 result = action_load_kcoefficients( &TC, queue_snd_id, time );
144 close_action( &TC, result, queue_snd_id );
144 close_action( &TC, result, queue_snd_id );
145 break;
145 break;
146 case TC_SUBTYPE_DUMP_K:
146 case TC_SUBTYPE_DUMP_K:
147 result = action_dump_kcoefficients( &TC, queue_snd_id, time );
147 result = action_dump_kcoefficients( &TC, queue_snd_id, time );
148 close_action( &TC, result, queue_snd_id );
148 close_action( &TC, result, queue_snd_id );
149 break;
149 break;
150 case TC_SUBTYPE_LOAD_FBINS:
150 case TC_SUBTYPE_LOAD_FBINS:
151 result = action_load_fbins_mask( &TC, queue_snd_id, time );
151 result = action_load_fbins_mask( &TC, queue_snd_id, time );
152 close_action( &TC, result, queue_snd_id );
152 close_action( &TC, result, queue_snd_id );
153 break;
153 break;
154 case TC_SUBTYPE_LOAD_FILTER_PAR:
154 case TC_SUBTYPE_LOAD_FILTER_PAR:
155 result = action_load_filter_par( &TC, queue_snd_id, time );
155 result = action_load_filter_par( &TC, queue_snd_id, time );
156 close_action( &TC, result, queue_snd_id );
156 close_action( &TC, result, queue_snd_id );
157 break;
157 break;
158 case TC_SUBTYPE_UPDT_TIME:
158 case TC_SUBTYPE_UPDT_TIME:
159 result = action_update_time( &TC );
159 result = action_update_time( &TC );
160 close_action( &TC, result, queue_snd_id );
160 close_action( &TC, result, queue_snd_id );
161 break;
161 break;
162 default:
162 default:
163 break;
163 break;
164 }
164 }
165 }
165 }
166 }
166 }
167 }
167 }
168
168
169 //***********
169 //***********
170 // TC ACTIONS
170 // TC ACTIONS
171
171
172 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
172 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
173 {
173 {
174 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
174 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
175 *
175 *
176 * @param TC points to the TeleCommand packet that is being processed
176 * @param TC points to the TeleCommand packet that is being processed
177 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
177 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
178 *
178 *
179 */
179 */
180
180
181 PRINTF("this is the end!!!\n");
181 PRINTF("this is the end!!!\n");
182 #ifdef GCOV_ENABLED
182 #ifdef GCOV_ENABLED
183 #ifndef GCOV_USE_EXIT
183 #ifndef GCOV_USE_EXIT
184 extern void gcov_exit (void);
184 extern void gcov_exit (void);
185 gcov_exit();