##// END OF EJS Templates
enum transition_type_t removed
paul -
r245:7b784bd3b88b R3a
parent child
Show More
@@ -1,81 +1,80
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 extern unsigned int lastValidEnterModeTime;
15 extern unsigned int lastValidEnterModeTime;
16 extern enum lfr_transition_type_t lfrTransitionType;
17
16
18 //****
17 //****
19 // ISR
18 // ISR
20 rtems_isr commutation_isr1( rtems_vector_number vector );
19 rtems_isr commutation_isr1( rtems_vector_number vector );
21 rtems_isr commutation_isr2( rtems_vector_number vector );
20 rtems_isr commutation_isr2( rtems_vector_number vector );
22
21
23 //***********
22 //***********
24 // RTEMS TASK
23 // RTEMS TASK
25 rtems_task actn_task( rtems_task_argument unused );
24 rtems_task actn_task( rtems_task_argument unused );
26
25
27 //***********
26 //***********
28 // TC ACTIONS
27 // TC ACTIONS
29 int action_reset( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
28 int action_reset( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
30 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
29 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
31 int action_update_info( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
30 int action_update_info( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
32 int action_enable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
31 int action_enable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
33 int action_disable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
32 int action_disable_calibration( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
34 int action_update_time( ccsdsTelecommandPacket_t *TC);
33 int action_update_time( ccsdsTelecommandPacket_t *TC);
35
34
36 // mode transition
35 // mode transition
37 int check_mode_value( unsigned char requestedMode );
36 int check_mode_value( unsigned char requestedMode );
38 int check_mode_transition( unsigned char requestedMode );
37 int check_mode_transition( unsigned char requestedMode );
39 void update_last_valid_transition_date( unsigned int transitionCoarseTime );
38 void update_last_valid_transition_date( unsigned int transitionCoarseTime );
40 int check_transition_date( unsigned int transitionCoarseTime );
39 int check_transition_date( unsigned int transitionCoarseTime );
41 int stop_spectral_matrices( void );
40 int stop_spectral_matrices( void );
42 int stop_current_mode( void );
41 int stop_current_mode( void );
43 int enter_mode_standby( void );
42 int enter_mode_standby( void );
44 int enter_mode_normal( unsigned int transitionCoarseTime );
43 int enter_mode_normal( unsigned int transitionCoarseTime );
45 int enter_mode_burst( unsigned int transitionCoarseTime );
44 int enter_mode_burst( unsigned int transitionCoarseTime );
46 int enter_mode_sbm1( unsigned int transitionCoarseTime );
45 int enter_mode_sbm1( unsigned int transitionCoarseTime );
47 int enter_mode_sbm2( unsigned int transitionCoarseTime );
46 int enter_mode_sbm2( unsigned int transitionCoarseTime );
48 int restart_science_tasks( unsigned char lfrRequestedMode );
47 int restart_science_tasks( unsigned char lfrRequestedMode );
49 int restart_asm_tasks(unsigned char lfrRequestedMode );
48 int restart_asm_tasks(unsigned char lfrRequestedMode );
50 int suspend_science_tasks(void);
49 int suspend_science_tasks(void);
51 int suspend_asm_tasks( void );
50 int suspend_asm_tasks( void );
52 void launch_waveform_picker( unsigned char mode , unsigned int transitionCoarseTime );
51 void launch_waveform_picker( unsigned char mode , unsigned int transitionCoarseTime );
53 void launch_spectral_matrix( void );
52 void launch_spectral_matrix( void );
54 void set_sm_irq_onNewMatrix( unsigned char value );
53 void set_sm_irq_onNewMatrix( unsigned char value );
55 void set_sm_irq_onError( unsigned char value );
54 void set_sm_irq_onError( unsigned char value );
56
55
57 // other functions
56 // other functions
58 void updateLFRCurrentMode();
57 void updateLFRCurrentMode();
59 void set_lfr_soft_reset( unsigned char value );
58 void set_lfr_soft_reset( unsigned char value );
60 void reset_lfr( void );
59 void reset_lfr( void );
61 // CALIBRATION
60 // CALIBRATION
62 void setCalibrationPrescaler( unsigned int prescaler );
61 void setCalibrationPrescaler( unsigned int prescaler );
63 void setCalibrationDivisor( unsigned int divisionFactor );
62 void setCalibrationDivisor( unsigned int divisionFactor );
64 void setCalibrationData( void );
63 void setCalibrationData( void );
65 void setCalibrationReload( bool state);
64 void setCalibrationReload( bool state);
66 void setCalibrationEnable( bool state );
65 void setCalibrationEnable( bool state );
67 void setCalibrationInterleaved( bool state );
66 void setCalibrationInterleaved( bool state );
68 void setCalibration( bool state );
67 void setCalibration( bool state );
69 void configureCalibration( bool interleaved );
68 void configureCalibration( bool interleaved );
70 //
69 //
71 void update_last_TC_exe( ccsdsTelecommandPacket_t *TC , unsigned char *time );
70 void update_last_TC_exe( ccsdsTelecommandPacket_t *TC , unsigned char *time );
72 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC , unsigned char *time );
71 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC , unsigned char *time );
73 void close_action( ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id );
72 void close_action( ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id );
74
73
75 extern rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
74 extern rtems_status_code get_message_queue_id_send( rtems_id *queue_id );
76 extern rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
75 extern rtems_status_code get_message_queue_id_recv( rtems_id *queue_id );
77
76
78 #endif // TC_HANDLER_H_INCLUDED
77 #endif // TC_HANDLER_H_INCLUDED
79
78
80
79
81
80
@@ -1,81 +1,80
1 /** Global variables of the LFR flight software.
1 /** Global variables of the LFR flight software.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * Among global variables, there are:
6 * Among global variables, there are:
7 * - RTEMS names and id.
7 * - RTEMS names and id.
8 * - APB configuration registers.
8 * - APB configuration registers.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
9 * - waveforms global buffers, used by the waveform picker hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
10 * - spectral matrices buffesr, used by the hardware module to store data.
11 * - variable related to LFR modes parameters.
11 * - variable related to LFR modes parameters.
12 * - the global HK packet buffer.
12 * - the global HK packet buffer.
13 * - the global dump parameter buffer.
13 * - the global dump parameter buffer.
14 *
14 *
15 */
15 */
16
16
17 #include <rtems.h>
17 #include <rtems.h>
18 #include <grspw.h>
18 #include <grspw.h>
19
19
20 #include "ccsds_types.h"
20 #include "ccsds_types.h"
21 #include "grlib_regs.h"
21 #include "grlib_regs.h"
22 #include "fsw_params.h"
22 #include "fsw_params.h"
23 #include "fsw_params_wf_handler.h"
23 #include "fsw_params_wf_handler.h"
24
24
25 // RTEMS GLOBAL VARIABLES
25 // RTEMS GLOBAL VARIABLES
26 rtems_name misc_name[5];
26 rtems_name misc_name[5];
27 rtems_name Task_name[20]; /* array of task names */
27 rtems_name Task_name[20]; /* array of task names */
28 rtems_id Task_id[20]; /* array of task ids */
28 rtems_id Task_id[20]; /* array of task ids */
29 int fdSPW = 0;
29 int fdSPW = 0;
30 int fdUART = 0;
30 int fdUART = 0;
31 unsigned char lfrCurrentMode;
31 unsigned char lfrCurrentMode;
32 unsigned char pa_bia_status_info;
32 unsigned char pa_bia_status_info;
33
33
34 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584
34 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584
35 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
35 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
36 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
36 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
37 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
37 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
38 // F0 F1 F2 F3
38 // F0 F1 F2 F3
39 volatile int wf_buffer_f0[ NB_RING_NODES_F0 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
39 volatile int wf_buffer_f0[ NB_RING_NODES_F0 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
40 volatile int wf_buffer_f1[ NB_RING_NODES_F1 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
40 volatile int wf_buffer_f1[ NB_RING_NODES_F1 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
41 volatile int wf_buffer_f2[ NB_RING_NODES_F2 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
41 volatile int wf_buffer_f2[ NB_RING_NODES_F2 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
42 volatile int wf_buffer_f3[ NB_RING_NODES_F3 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
42 volatile int wf_buffer_f3[ NB_RING_NODES_F3 * WFRM_BUFFER ] __attribute__((aligned(0x100)));
43
43
44 //***********************************
44 //***********************************
45 // SPECTRAL MATRICES GLOBAL VARIABLES
45 // SPECTRAL MATRICES GLOBAL VARIABLES
46
46
47 // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00
47 // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00
48 volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
48 volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
49 volatile int sm_f1[ NB_RING_NODES_SM_F1 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
49 volatile int sm_f1[ NB_RING_NODES_SM_F1 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
50 volatile int sm_f2[ NB_RING_NODES_SM_F2 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
50 volatile int sm_f2[ NB_RING_NODES_SM_F2 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
51
51
52 // APB CONFIGURATION REGISTERS
52 // APB CONFIGURATION REGISTERS
53 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
53 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
54 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
54 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
55 waveform_picker_regs_0_1_18_t *waveform_picker_regs = (waveform_picker_regs_0_1_18_t*) REGS_ADDR_WAVEFORM_PICKER;
55 waveform_picker_regs_0_1_18_t *waveform_picker_regs = (waveform_picker_regs_0_1_18_t*) REGS_ADDR_WAVEFORM_PICKER;
56 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
56 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
57
57
58 // MODE PARAMETERS
58 // MODE PARAMETERS
59 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
59 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
60 struct param_local_str param_local;
60 struct param_local_str param_local;
61 unsigned int lastValidEnterModeTime;
61 unsigned int lastValidEnterModeTime;
62 enum lfr_transition_type_t lfrTransitionType;
63
62
64 // HK PACKETS
63 // HK PACKETS
65 Packet_TM_LFR_HK_t housekeeping_packet;
64 Packet_TM_LFR_HK_t housekeeping_packet;
66 // message queues occupancy
65 // message queues occupancy
67 unsigned char hk_lfr_q_sd_fifo_size_max;
66 unsigned char hk_lfr_q_sd_fifo_size_max;
68 unsigned char hk_lfr_q_rv_fifo_size_max;
67 unsigned char hk_lfr_q_rv_fifo_size_max;
69 unsigned char hk_lfr_q_p0_fifo_size_max;
68 unsigned char hk_lfr_q_p0_fifo_size_max;
70 unsigned char hk_lfr_q_p1_fifo_size_max;
69 unsigned char hk_lfr_q_p1_fifo_size_max;
71 unsigned char hk_lfr_q_p2_fifo_size_max;
70 unsigned char hk_lfr_q_p2_fifo_size_max;
72 // sequence counters are incremented by APID (PID + CAT) and destination ID
71 // sequence counters are incremented by APID (PID + CAT) and destination ID
73 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
72 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
74 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
73 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
75 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
74 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
76 unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID];
75 unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID];
77 unsigned short sequenceCounterHK;
76 unsigned short sequenceCounterHK;
78 spw_stats spacewire_stats;
77 spw_stats spacewire_stats;
79 spw_stats spacewire_stats_backup;
78 spw_stats spacewire_stats_backup;
80
79
81
80
@@ -1,1618 +1,1604
1 /** Functions and tasks related to TeleCommand handling.
1 /** Functions and tasks related to TeleCommand handling.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * A group of functions to handle TeleCommands:\n
6 * A group of functions to handle TeleCommands:\n
7 * action launching\n
7 * action launching\n
8 * TC parsing\n
8 * TC parsing\n
9 * ...
9 * ...
10 *
10 *
11 */
11 */
12
12
13 #include "tc_handler.h"
13 #include "tc_handler.h"
14 #include "math.h"
14 #include "math.h"
15
15
16 //***********
16 //***********
17 // RTEMS TASK
17 // RTEMS TASK
18
18
19 rtems_task actn_task( rtems_task_argument unused )
19 rtems_task actn_task( rtems_task_argument unused )
20 {
20 {
21 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
21 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
22 *
22 *
23 * @param unused is the starting argument of the RTEMS task
23 * @param unused is the starting argument of the RTEMS task
24 *
24 *
25 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
25 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
26 * on the incoming TeleCommand.
26 * on the incoming TeleCommand.
27 *
27 *
28 */
28 */
29
29
30 int result;
30 int result;
31 rtems_status_code status; // RTEMS status code
31 rtems_status_code status; // RTEMS status code
32 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
32 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
33 size_t size; // size of the incoming TC packet
33 size_t size; // size of the incoming TC packet
34 unsigned char subtype; // subtype of the current TC packet
34 unsigned char subtype; // subtype of the current TC packet
35 unsigned char time[6];
35 unsigned char time[6];
36 rtems_id queue_rcv_id;
36 rtems_id queue_rcv_id;
37 rtems_id queue_snd_id;
37 rtems_id queue_snd_id;
38
38
39 status = get_message_queue_id_recv( &queue_rcv_id );
39 status = get_message_queue_id_recv( &queue_rcv_id );
40 if (status != RTEMS_SUCCESSFUL)
40 if (status != RTEMS_SUCCESSFUL)
41 {
41 {
42 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
42 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
43 }
43 }
44
44
45 status = get_message_queue_id_send( &queue_snd_id );
45 status = get_message_queue_id_send( &queue_snd_id );
46 if (status != RTEMS_SUCCESSFUL)
46 if (status != RTEMS_SUCCESSFUL)
47 {
47 {
48 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
48 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
49 }
49 }
50
50
51 result = LFR_SUCCESSFUL;
51 result = LFR_SUCCESSFUL;
52 subtype = 0; // subtype of the current TC packet
52 subtype = 0; // subtype of the current TC packet
53
53
54 BOOT_PRINTF("in ACTN *** \n")
54 BOOT_PRINTF("in ACTN *** \n")
55
55
56 while(1)
56 while(1)
57 {
57 {
58 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
58 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
59 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
59 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
60 getTime( time ); // set time to the current time
60 getTime( time ); // set time to the current time
61 if (status!=RTEMS_SUCCESSFUL)
61 if (status!=RTEMS_SUCCESSFUL)
62 {
62 {
63 PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
63 PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
64 }
64 }
65 else
65 else
66 {
66 {
67 subtype = TC.serviceSubType;
67 subtype = TC.serviceSubType;
68 switch(subtype)
68 switch(subtype)
69 {
69 {
70 case TC_SUBTYPE_RESET:
70 case TC_SUBTYPE_RESET:
71 result = action_reset( &TC, queue_snd_id, time );
71 result = action_reset( &TC, queue_snd_id, time );
72 close_action( &TC, result, queue_snd_id );
72 close_action( &TC, result, queue_snd_id );
73 break;
73 break;
74 case TC_SUBTYPE_LOAD_COMM:
74 case TC_SUBTYPE_LOAD_COMM:
75 result = action_load_common_par( &TC );
75 result = action_load_common_par( &TC );
76 close_action( &TC, result, queue_snd_id );
76 close_action( &TC, result, queue_snd_id );
77 break;
77 break;
78 case TC_SUBTYPE_LOAD_NORM:
78 case TC_SUBTYPE_LOAD_NORM:
79 result = action_load_normal_par( &TC, queue_snd_id, time );
79 result = action_load_normal_par( &TC, queue_snd_id, time );
80 close_action( &TC, result, queue_snd_id );
80 close_action( &TC, result, queue_snd_id );
81 break;
81 break;
82 case TC_SUBTYPE_LOAD_BURST:
82 case TC_SUBTYPE_LOAD_BURST:
83 result = action_load_burst_par( &TC, queue_snd_id, time );
83 result = action_load_burst_par( &TC, queue_snd_id, time );
84 close_action( &TC, result, queue_snd_id );
84 close_action( &TC, result, queue_snd_id );
85 break;
85 break;
86 case TC_SUBTYPE_LOAD_SBM1:
86 case TC_SUBTYPE_LOAD_SBM1:
87 result = action_load_sbm1_par( &TC, queue_snd_id, time );
87 result = action_load_sbm1_par( &TC, queue_snd_id, time );
88 close_action( &TC, result, queue_snd_id );
88 close_action( &TC, result, queue_snd_id );
89 break;
89 break;
90 case TC_SUBTYPE_LOAD_SBM2:
90 case TC_SUBTYPE_LOAD_SBM2:
91 result = action_load_sbm2_par( &TC, queue_snd_id, time );
91 result = action_load_sbm2_par( &TC, queue_snd_id, time );
92 close_action( &TC, result, queue_snd_id );
92 close_action( &TC, result, queue_snd_id );
93 break;
93 break;
94 case TC_SUBTYPE_DUMP:
94 case TC_SUBTYPE_DUMP:
95 result = action_dump_par( &TC, queue_snd_id );
95 result = action_dump_par( &TC, queue_snd_id );
96 close_action( &TC, result, queue_snd_id );
96 close_action( &TC, result, queue_snd_id );
97 break;
97 break;
98 case TC_SUBTYPE_ENTER:
98 case TC_SUBTYPE_ENTER:
99 result = action_enter_mode( &TC, queue_snd_id );
99 result = action_enter_mode( &TC, queue_snd_id );
100 close_action( &TC, result, queue_snd_id );
100 close_action( &TC, result, queue_snd_id );
101 break;
101 break;
102 case TC_SUBTYPE_UPDT_INFO:
102 case TC_SUBTYPE_UPDT_INFO:
103 result = action_update_info( &TC, queue_snd_id );
103 result = action_update_info( &TC, queue_snd_id );
104 close_action( &TC, result, queue_snd_id );
104 close_action( &TC, result, queue_snd_id );
105 break;
105 break;
106 case TC_SUBTYPE_EN_CAL:
106 case TC_SUBTYPE_EN_CAL:
107 result = action_enable_calibration( &TC, queue_snd_id, time );
107 result = action_enable_calibration( &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_DIS_CAL:
110 case TC_SUBTYPE_DIS_CAL:
111 result = action_disable_calibration( &TC, queue_snd_id, time );
111 result = action_disable_calibration( &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_K:
114 case TC_SUBTYPE_LOAD_K:
115 result = action_load_kcoefficients( &TC, queue_snd_id, time );
115 result = action_load_kcoefficients( &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_DUMP_K:
118 case TC_SUBTYPE_DUMP_K:
119 result = action_dump_kcoefficients( &TC, queue_snd_id, time );
119 result = action_dump_kcoefficients( &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_LOAD_FBINS:
122 case TC_SUBTYPE_LOAD_FBINS:
123 result = action_load_fbins_mask( &TC, queue_snd_id, time );
123 result = action_load_fbins_mask( &TC, queue_snd_id, time );
124 close_action( &TC, result, queue_snd_id );
124 close_action( &TC, result, queue_snd_id );
125 break;
125 break;
126 case TC_SUBTYPE_UPDT_TIME:
126 case TC_SUBTYPE_UPDT_TIME:
127 result = action_update_time( &TC );
127 result = action_update_time( &TC );
128 close_action( &TC, result, queue_snd_id );
128 close_action( &TC, result, queue_snd_id );
129 break;
129 break;
130 default:
130 default:
131 break;
131 break;
132 }
132 }
133 }
133 }
134 }
134 }
135 }
135 }
136
136
137 //***********
137 //***********
138 // TC ACTIONS
138 // TC ACTIONS
139
139
140 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
140 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
141 {
141 {
142 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
142 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
143 *
143 *
144 * @param TC points to the TeleCommand packet that is being processed
144 * @param TC points to the TeleCommand packet that is being processed
145 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
145 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
146 *
146 *
147 */
147 */
148
148
149 PRINTF("this is the end!!!\n")
149 PRINTF("this is the end!!!\n")
150 exit(0);
150 exit(0);
151 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
151 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
152 return LFR_DEFAULT;
152 return LFR_DEFAULT;
153 }
153 }
154
154
155 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
155 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
156 {
156 {
157 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
157 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
158 *
158 *
159 * @param TC points to the TeleCommand packet that is being processed
159 * @param TC points to the TeleCommand packet that is being processed
160 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
160 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
161 *
161 *
162 */
162 */
163
163
164 rtems_status_code status;
164 rtems_status_code status;
165 unsigned char requestedMode;
165 unsigned char requestedMode;
166 unsigned int *transitionCoarseTime_ptr;
166 unsigned int *transitionCoarseTime_ptr;
167 unsigned int transitionCoarseTime;
167 unsigned int transitionCoarseTime;
168 unsigned char * bytePosPtr;
168 unsigned char * bytePosPtr;
169
169
170 bytePosPtr = (unsigned char *) &TC->packetID;
170 bytePosPtr = (unsigned char *) &TC->packetID;
171
171
172 requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ];
172 requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ];
173 transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] );
173 transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] );
174 transitionCoarseTime = (*transitionCoarseTime_ptr) & 0x7fffffff;
174 transitionCoarseTime = (*transitionCoarseTime_ptr) & 0x7fffffff;
175
175
176 status = check_mode_value( requestedMode );
176 status = check_mode_value( requestedMode );
177
177
178 if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent
178 if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent
179 {
179 {
180 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_MODE_LFR_SET, requestedMode );
180 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_MODE_LFR_SET, requestedMode );
181 }
181 }
182
182
183 else // the mode value is valid, check the transition
183 else // the mode value is valid, check the transition
184 {
184 {
185 status = check_mode_transition(requestedMode);
185 status = check_mode_transition(requestedMode);
186 if (status != LFR_SUCCESSFUL)
186 if (status != LFR_SUCCESSFUL)
187 {
187 {
188 PRINTF("ERR *** in action_enter_mode *** check_mode_transition\n")
188 PRINTF("ERR *** in action_enter_mode *** check_mode_transition\n")
189 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
189 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
190 }
190 }
191 }
191 }
192
192
193 if ( status == LFR_SUCCESSFUL ) // the transition is valid, check the date
193 if ( status == LFR_SUCCESSFUL ) // the transition is valid, check the date
194 {
194 {
195 status = check_transition_date( transitionCoarseTime );
195 status = check_transition_date( transitionCoarseTime );
196 if (status != LFR_SUCCESSFUL)
196 if (status != LFR_SUCCESSFUL)
197 {
197 {
198 PRINTF("ERR *** in action_enter_mode *** check_transition_date\n")
198 PRINTF("ERR *** in action_enter_mode *** check_transition_date\n")
199 send_tm_lfr_tc_exe_inconsistent( TC, queue_id,
199 send_tm_lfr_tc_exe_inconsistent( TC, queue_id,
200 BYTE_POS_CP_LFR_ENTER_MODE_TIME,
200 BYTE_POS_CP_LFR_ENTER_MODE_TIME,
201 bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] );
201 bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] );
202 }
202 }
203 }
203 }
204
204
205 if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode
205 if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode
206 {
206 {
207 PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode);
207 PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode);
208
208
209 update_last_valid_transition_date( transitionCoarseTime );
209 update_last_valid_transition_date( transitionCoarseTime );
210
210
211 switch(requestedMode)
211 switch(requestedMode)
212 {
212 {
213 case LFR_MODE_STANDBY:
213 case LFR_MODE_STANDBY:
214 status = enter_mode_standby();
214 status = enter_mode_standby();
215 break;
215 break;
216 case LFR_MODE_NORMAL:
216 case LFR_MODE_NORMAL:
217 status = enter_mode_normal( transitionCoarseTime );
217 status = enter_mode_normal( transitionCoarseTime );
218 break;
218 break;
219 case LFR_MODE_BURST:
219 case LFR_MODE_BURST:
220 status = enter_mode_burst( transitionCoarseTime );
220 status = enter_mode_burst( transitionCoarseTime );
221 break;
221 break;
222 case LFR_MODE_SBM1:
222 case LFR_MODE_SBM1:
223 status = enter_mode_sbm1( transitionCoarseTime );
223 status = enter_mode_sbm1( transitionCoarseTime );
224 break;
224 break;
225 case LFR_MODE_SBM2:
225 case LFR_MODE_SBM2:
226 status = enter_mode_sbm2( transitionCoarseTime );
226 status = enter_mode_sbm2( transitionCoarseTime );
227 break;
227 break;
228 default:
228 default:
229 break;
229 break;
230 }
230 }
231 }
231 }
232
232
233 return status;
233 return status;
234 }
234 }
235
235
236 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
236 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
237 {
237 {
238 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
238 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
239 *
239 *
240 * @param TC points to the TeleCommand packet that is being processed
240 * @param TC points to the TeleCommand packet that is being processed
241 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
241 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
242 *
242 *
243 * @return LFR directive status code:
243 * @return LFR directive status code:
244 * - LFR_DEFAULT
244 * - LFR_DEFAULT
245 * - LFR_SUCCESSFUL
245 * - LFR_SUCCESSFUL
246 *
246 *
247 */
247 */
248
248
249 unsigned int val;
249 unsigned int val;
250 int result;
250 int result;
251 unsigned int status;
251 unsigned int status;
252 unsigned char mode;
252 unsigned char mode;
253 unsigned char * bytePosPtr;
253 unsigned char * bytePosPtr;
254
254
255 bytePosPtr = (unsigned char *) &TC->packetID;
255 bytePosPtr = (unsigned char *) &TC->packetID;
256
256
257 // check LFR mode
257 // check LFR mode
258 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 ] & 0x1e) >> 1;
258 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 ] & 0x1e) >> 1;
259 status = check_update_info_hk_lfr_mode( mode );
259 status = check_update_info_hk_lfr_mode( mode );
260 if (status == LFR_SUCCESSFUL) // check TDS mode
260 if (status == LFR_SUCCESSFUL) // check TDS mode
261 {
261 {
262 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0xf0) >> 4;
262 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0xf0) >> 4;
263 status = check_update_info_hk_tds_mode( mode );
263 status = check_update_info_hk_tds_mode( mode );
264 }
264 }
265 if (status == LFR_SUCCESSFUL) // check THR mode
265 if (status == LFR_SUCCESSFUL) // check THR mode
266 {
266 {
267 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0x0f);
267 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0x0f);
268 status = check_update_info_hk_thr_mode( mode );
268 status = check_update_info_hk_thr_mode( mode );
269 }
269 }
270 if (status == LFR_SUCCESSFUL) // if the parameter check is successful
270 if (status == LFR_SUCCESSFUL) // if the parameter check is successful
271 {
271 {
272 val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256
272 val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256
273 + housekeeping_packet.hk_lfr_update_info_tc_cnt[1];
273 + housekeeping_packet.hk_lfr_update_info_tc_cnt[1];
274 val++;
274 val++;
275 housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8);
275 housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8);
276 housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val);
276 housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val);
277 }
277 }
278
278
279 // pa_bia_status_info
279 // pa_bia_status_info
280 // => pa_bia_mode_mux_set 3 bits
280 // => pa_bia_mode_mux_set 3 bits
281 // => pa_bia_mode_hv_enabled 1 bit
281 // => pa_bia_mode_hv_enabled 1 bit
282 // => pa_bia_mode_bias1_enabled 1 bit
282 // => pa_bia_mode_bias1_enabled 1 bit
283 // => pa_bia_mode_bias2_enabled 1 bit
283 // => pa_bia_mode_bias2_enabled 1 bit
284 // => pa_bia_mode_bias3_enabled 1 bit
284 // => pa_bia_mode_bias3_enabled 1 bit
285 // => pa_bia_on_off (cp_dpu_bias_on_off)
285 // => pa_bia_on_off (cp_dpu_bias_on_off)
286 pa_bia_status_info = bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET2 ] & 0xfe; // [1111 1110]
286 pa_bia_status_info = bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET2 ] & 0xfe; // [1111 1110]
287 pa_bia_status_info = pa_bia_status_info
287 pa_bia_status_info = pa_bia_status_info
288 | (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET1 ] & 0x1);
288 | (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET1 ] & 0x1);
289
289
290 result = status;
290 result = status;
291
291
292 return result;
292 return result;
293 }
293 }
294
294
295 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
295 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
296 {
296 {
297 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
297 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
298 *
298 *
299 * @param TC points to the TeleCommand packet that is being processed
299 * @param TC points to the TeleCommand packet that is being processed
300 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
300 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
301 *
301 *
302 */
302 */
303
303
304 int result;
304 int result;
305
305
306 result = LFR_DEFAULT;
306 result = LFR_DEFAULT;
307
307
308 setCalibration( true );
308 setCalibration( true );
309
309
310 result = LFR_SUCCESSFUL;
310 result = LFR_SUCCESSFUL;
311
311
312 return result;
312 return result;
313 }
313 }
314
314
315 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
315 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
316 {
316 {
317 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
317 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
318 *
318 *
319 * @param TC points to the TeleCommand packet that is being processed
319 * @param TC points to the TeleCommand packet that is being processed
320 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
320 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
321 *
321 *
322 */
322 */
323
323
324 int result;
324 int result;
325
325
326 result = LFR_DEFAULT;
326 result = LFR_DEFAULT;
327
327
328 setCalibration( false );
328 setCalibration( false );
329
329
330 result = LFR_SUCCESSFUL;
330 result = LFR_SUCCESSFUL;
331
331
332 return result;
332 return result;
333 }
333 }
334
334
335 int action_update_time(ccsdsTelecommandPacket_t *TC)
335 int action_update_time(ccsdsTelecommandPacket_t *TC)
336 {
336 {
337 /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received.
337 /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received.
338 *
338 *
339 * @param TC points to the TeleCommand packet that is being processed
339 * @param TC points to the TeleCommand packet that is being processed
340 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
340 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
341 *
341 *
342 * @return LFR_SUCCESSFUL
342 * @return LFR_SUCCESSFUL
343 *
343 *
344 */
344 */
345
345
346 unsigned int val;
346 unsigned int val;
347
347
348 time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24)
348 time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24)
349 + (TC->dataAndCRC[1] << 16)
349 + (TC->dataAndCRC[1] << 16)
350 + (TC->dataAndCRC[2] << 8)
350 + (TC->dataAndCRC[2] << 8)
351 + TC->dataAndCRC[3];
351 + TC->dataAndCRC[3];
352
352
353 val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256
353 val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256
354 + housekeeping_packet.hk_lfr_update_time_tc_cnt[1];
354 + housekeeping_packet.hk_lfr_update_time_tc_cnt[1];
355 val++;
355 val++;
356 housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8);
356 housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8);
357 housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val);
357 housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val);
358
358
359 return LFR_SUCCESSFUL;
359 return LFR_SUCCESSFUL;
360 }
360 }
361
361
362 //*******************
362 //*******************
363 // ENTERING THE MODES
363 // ENTERING THE MODES
364 int check_mode_value( unsigned char requestedMode )
364 int check_mode_value( unsigned char requestedMode )
365 {
365 {
366 int status;
366 int status;
367
367
368 if ( (requestedMode != LFR_MODE_STANDBY)
368 if ( (requestedMode != LFR_MODE_STANDBY)
369 && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST)
369 && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST)
370 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
370 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
371 {
371 {
372 status = LFR_DEFAULT;
372 status = LFR_DEFAULT;
373 }
373 }
374 else
374 else
375 {
375 {
376 status = LFR_SUCCESSFUL;
376 status = LFR_SUCCESSFUL;
377 }
377 }
378
378
379 return status;
379 return status;
380 }
380 }
381
381
382 int check_mode_transition( unsigned char requestedMode )
382 int check_mode_transition( unsigned char requestedMode )
383 {
383 {
384 /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE.
384 /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE.
385 *
385 *
386 * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE
386 * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE
387 *
387 *
388 * @return LFR directive status codes:
388 * @return LFR directive status codes:
389 * - LFR_SUCCESSFUL - the transition is authorized
389 * - LFR_SUCCESSFUL - the transition is authorized
390 * - LFR_DEFAULT - the transition is not authorized
390 * - LFR_DEFAULT - the transition is not authorized
391 *
391 *
392 */
392 */
393
393
394 int status;
394 int status;
395
395
396 switch (requestedMode)
396 switch (requestedMode)
397 {
397 {
398 case LFR_MODE_STANDBY:
398 case LFR_MODE_STANDBY:
399 if ( lfrCurrentMode == LFR_MODE_STANDBY ) {
399 if ( lfrCurrentMode == LFR_MODE_STANDBY ) {
400 status = LFR_DEFAULT;
400 status = LFR_DEFAULT;
401 }
401 }
402 else
402 else
403 {
403 {
404 status = LFR_SUCCESSFUL;
404 status = LFR_SUCCESSFUL;
405 }
405 }
406 break;
406 break;
407 case LFR_MODE_NORMAL:
407 case LFR_MODE_NORMAL:
408 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
408 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
409 status = LFR_DEFAULT;
409 status = LFR_DEFAULT;
410 }
410 }
411 else {
411 else {
412 status = LFR_SUCCESSFUL;
412 status = LFR_SUCCESSFUL;
413 }
413 }
414 break;
414 break;
415 case LFR_MODE_BURST:
415 case LFR_MODE_BURST:
416 if ( lfrCurrentMode == LFR_MODE_BURST ) {
416 if ( lfrCurrentMode == LFR_MODE_BURST ) {
417 status = LFR_DEFAULT;
417 status = LFR_DEFAULT;
418 }
418 }
419 else {
419 else {
420 status = LFR_SUCCESSFUL;
420 status = LFR_SUCCESSFUL;
421 }
421 }
422 break;
422 break;
423 case LFR_MODE_SBM1:
423 case LFR_MODE_SBM1:
424 if ( lfrCurrentMode == LFR_MODE_SBM1 ) {
424 if ( lfrCurrentMode == LFR_MODE_SBM1 ) {
425 status = LFR_DEFAULT;
425 status = LFR_DEFAULT;
426 }
426 }
427 else {
427 else {
428 status = LFR_SUCCESSFUL;
428 status = LFR_SUCCESSFUL;
429 }
429 }
430 break;
430 break;
431 case LFR_MODE_SBM2:
431 case LFR_MODE_SBM2:
432 if ( lfrCurrentMode == LFR_MODE_SBM2 ) {
432 if ( lfrCurrentMode == LFR_MODE_SBM2 ) {
433 status = LFR_DEFAULT;
433 status = LFR_DEFAULT;
434 }
434 }
435 else {
435 else {
436 status = LFR_SUCCESSFUL;
436 status = LFR_SUCCESSFUL;
437 }
437 }
438 break;
438 break;
439 default:
439 default:
440 status = LFR_DEFAULT;
440 status = LFR_DEFAULT;
441 break;
441 break;