##// END OF EJS Templates
fsw-0-23...
paul -
r75:1aca4e63f8e6 VHDLib206
parent child
Show More
@@ -1,6 +1,6
1 #############################################################################
1 #############################################################################
2 # Makefile for building: bin/fsw
2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 14 08:56:42 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 14 12:02:16 2013
4 # Project: fsw-qt.pro
4 # Project: fsw-qt.pro
5 # Template: app
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
@@ -1,6 +1,6
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.1, 2013-11-14T09:19:44. -->
3 <!-- Written by QtCreator 2.8.1, 2013-11-14T11:59:15. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -34,4 +34,6 void init_housekeeping_parameters( void
34
34
35 void increment_seq_counter( unsigned char *packet_sequence_control);
35 void increment_seq_counter( unsigned char *packet_sequence_control);
36
36
37 void getTime( unsigned char *time);
38
37 #endif // FSW_MISC_H_INCLUDED
39 #endif // FSW_MISC_H_INCLUDED
@@ -32,11 +32,11 rtems_task actn_task( rtems_task_argumen
32
32
33 //***********
33 //***********
34 // TC ACTIONS
34 // TC ACTIONS
35 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
35 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
36 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
36 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
37 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
37 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
38 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
38 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
39 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
39 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
40 int action_update_time(ccsdsTelecommandPacket_t *TC);
40 int action_update_time(ccsdsTelecommandPacket_t *TC);
41
41
42 // mode transition
42 // mode transition
@@ -55,7 +55,7 int suspend_science_tasks();
55 void updateLFRCurrentMode();
55 void updateLFRCurrentMode();
56 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time);
56 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time);
57 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time);
57 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time);
58 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id);
58 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time);
59
59
60 #endif // TC_HANDLER_H_INCLUDED
60 #endif // TC_HANDLER_H_INCLUDED
61
61
@@ -15,14 +15,14 extern Packet_TM_LFR_PARAMETER_DUMP_t pa
15 extern Packet_TM_LFR_HK_t housekeeping_packet;
15 extern Packet_TM_LFR_HK_t housekeeping_packet;
16
16
17 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
17 int action_load_common_par( ccsdsTelecommandPacket_t *TC );
18 int action_load_normal_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
18 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
19 int action_load_burst_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
19 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
20 int action_load_sbm1_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
20 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
21 int action_load_sbm2_par( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
21 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
22 int action_dump_par(rtems_id queue_id );
22 int action_dump_par(rtems_id queue_id );
23
23
24 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
24 int set_sy_lfr_n_swf_l(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time);
25 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
25 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time );
26 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
26 int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
27 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
27 int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
28 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
28 int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
@@ -13,12 +13,12 extern unsigned short sequenceCounters_T
13
13
14 int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
14 int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
15 int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
15 int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
16 unsigned char byte_position, unsigned char rcv_value);
16 unsigned char byte_position, unsigned char rcv_value, unsigned char *time);
17 int send_tm_lfr_tc_exe_not_executable(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
17 int send_tm_lfr_tc_exe_not_executable(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
18 int send_tm_lfr_tc_exe_not_implemented(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
18 int send_tm_lfr_tc_exe_not_implemented(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
19 int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
19 int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
20 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
20 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
21 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID);
21 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID, unsigned char *time);
22
22
23 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id );
23 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id );
24
24
@@ -321,5 +321,13 void increment_seq_counter( unsigned cha
321 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
321 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
322 }
322 }
323
323
324 void getTime( unsigned char *time)
325 {
326 time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
327 time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
328 time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
329 time[3] = (unsigned char) (time_management_regs->coarse_time);
330 time[4] = (unsigned char) (time_management_regs->fine_time>>8);
331 time[5] = (unsigned char) (time_management_regs->fine_time);
332 }
324
333
325
@@ -120,6 +120,7 rtems_task recv_task( rtems_task_argumen
120 unsigned char destinationID;
120 unsigned char destinationID;
121 unsigned int currentTC_LEN_RCV_AsUnsignedInt;
121 unsigned int currentTC_LEN_RCV_AsUnsignedInt;
122 unsigned int parserCode;
122 unsigned int parserCode;
123 unsigned char time[6];
123 rtems_status_code status;
124 rtems_status_code status;
124 rtems_id queue_recv_id;
125 rtems_id queue_recv_id;
125 rtems_id queue_send_id;
126 rtems_id queue_send_id;
@@ -174,7 +175,11 rtems_task recv_task( rtems_task_argumen
174 {
175 {
175 destinationID = currentTC.sourceID;
176 destinationID = currentTC.sourceID;
176 }
177 }
177 send_tm_lfr_tc_exe_corrupted( &currentTC, queue_send_id, computed_CRC, currentTC_LEN_RCV, destinationID );
178 getTime( time );
179 close_action( &currentTC, LFR_DEFAULT, queue_send_id, time);
180 send_tm_lfr_tc_exe_corrupted( &currentTC, queue_send_id,
181 computed_CRC, currentTC_LEN_RCV,
182 destinationID, time );
178 }
183 }
179 }
184 }
180 else
185 else
@@ -31,6 +31,7 rtems_task actn_task( rtems_task_argumen
31 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
31 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
32 size_t size; // size of the incoming TC packet
32 size_t size; // size of the incoming TC packet
33 unsigned char subtype; // subtype of the current TC packet
33 unsigned char subtype; // subtype of the current TC packet
34 unsigned char time[6];
34 rtems_id queue_rcv_id;
35 rtems_id queue_rcv_id;
35 rtems_id queue_snd_id;
36 rtems_id queue_snd_id;
36
37
@@ -55,6 +56,7 rtems_task actn_task( rtems_task_argumen
55 {
56 {
56 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
57 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
57 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
58 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
59 getTime( time ); // set time to the current time
58 if (status!=RTEMS_SUCCESSFUL) PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
60 if (status!=RTEMS_SUCCESSFUL) PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
59 else
61 else
60 {
62 {
@@ -62,63 +64,63 rtems_task actn_task( rtems_task_argumen
62 switch(subtype)
64 switch(subtype)
63 {
65 {
64 case TC_SUBTYPE_RESET:
66 case TC_SUBTYPE_RESET:
65 result = action_reset( &TC, queue_snd_id );
67 result = action_reset( &TC, queue_snd_id, time );
66 close_action( &TC, result, queue_snd_id );
68 close_action( &TC, result, queue_snd_id, time );
67 break;
69 break;
68 //
70 //
69 case TC_SUBTYPE_LOAD_COMM:
71 case TC_SUBTYPE_LOAD_COMM:
70 result = action_load_common_par( &TC );
72 result = action_load_common_par( &TC );
71 close_action( &TC, result, queue_snd_id );
73 close_action( &TC, result, queue_snd_id, time );
72 break;
74 break;
73 //
75 //
74 case TC_SUBTYPE_LOAD_NORM:
76 case TC_SUBTYPE_LOAD_NORM:
75 result = action_load_normal_par( &TC, queue_snd_id );
77 result = action_load_normal_par( &TC, queue_snd_id, time );
76 close_action( &TC, result, queue_snd_id );
78 close_action( &TC, result, queue_snd_id, time );
77 break;
79 break;
78 //
80 //
79 case TC_SUBTYPE_LOAD_BURST:
81 case TC_SUBTYPE_LOAD_BURST:
80 result = action_load_burst_par( &TC, queue_snd_id );
82 result = action_load_burst_par( &TC, queue_snd_id, time );
81 close_action( &TC, result, queue_snd_id );
83 close_action( &TC, result, queue_snd_id, time );
82 break;
84 break;
83 //
85 //
84 case TC_SUBTYPE_LOAD_SBM1:
86 case TC_SUBTYPE_LOAD_SBM1:
85 result = action_load_sbm1_par( &TC, queue_snd_id );
87 result = action_load_sbm1_par( &TC, queue_snd_id, time );
86 close_action( &TC, result, queue_snd_id );
88 close_action( &TC, result, queue_snd_id, time );
87 break;
89 break;
88 //
90 //
89 case TC_SUBTYPE_LOAD_SBM2:
91 case TC_SUBTYPE_LOAD_SBM2:
90 result = action_load_sbm2_par( &TC, queue_snd_id );
92 result = action_load_sbm2_par( &TC, queue_snd_id, time );
91 close_action( &TC, result, queue_snd_id );
93 close_action( &TC, result, queue_snd_id, time );
92 break;
94 break;
93 //
95 //
94 case TC_SUBTYPE_DUMP:
96 case TC_SUBTYPE_DUMP:
95 result = action_dump_par( queue_snd_id );
97 result = action_dump_par( queue_snd_id );
96 close_action( &TC, result, queue_snd_id );
98 close_action( &TC, result, queue_snd_id, time );
97 break;
99 break;
98 //
100 //
99 case TC_SUBTYPE_ENTER:
101 case TC_SUBTYPE_ENTER:
100 result = action_enter_mode( &TC, queue_snd_id );
102 result = action_enter_mode( &TC, queue_snd_id, time );
101 close_action( &TC, result, queue_snd_id );
103 close_action( &TC, result, queue_snd_id, time );
102 break;
104 break;
103 //
105 //
104 case TC_SUBTYPE_UPDT_INFO:
106 case TC_SUBTYPE_UPDT_INFO:
105 result = action_update_info( &TC, queue_snd_id );
107 result = action_update_info( &TC, queue_snd_id );
106 close_action( &TC, result, queue_snd_id );
108 close_action( &TC, result, queue_snd_id, time );
107 break;
109 break;
108 //
110 //
109 case TC_SUBTYPE_EN_CAL:
111 case TC_SUBTYPE_EN_CAL:
110 result = action_enable_calibration( &TC, queue_snd_id );
112 result = action_enable_calibration( &TC, queue_snd_id, time );
111 close_action( &TC, result, queue_snd_id );
113 close_action( &TC, result, queue_snd_id, time );
112 break;
114 break;
113 //
115 //
114 case TC_SUBTYPE_DIS_CAL:
116 case TC_SUBTYPE_DIS_CAL:
115 result = action_disable_calibration( &TC, queue_snd_id );
117 result = action_disable_calibration( &TC, queue_snd_id, time );
116 close_action( &TC, result, queue_snd_id );
118 close_action( &TC, result, queue_snd_id, time );
117 break;
119 break;
118 //
120 //
119 case TC_SUBTYPE_UPDT_TIME:
121 case TC_SUBTYPE_UPDT_TIME:
120 result = action_update_time( &TC );
122 result = action_update_time( &TC );
121 close_action( &TC, result, queue_snd_id );
123 close_action( &TC, result, queue_snd_id, time );
122 break;
124 break;
123 //
125 //
124 default:
126 default:
@@ -131,7 +133,7 rtems_task actn_task( rtems_task_argumen
131 //***********
133 //***********
132 // TC ACTIONS
134 // TC ACTIONS
133
135
134 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
136 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
135 {
137 {
136 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
138 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
137 *
139 *
@@ -140,11 +142,11 int action_reset(ccsdsTelecommandPacket_
140 *
142 *
141 */
143 */
142
144
143 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
145 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
144 return LFR_DEFAULT;
146 return LFR_DEFAULT;
145 }
147 }
146
148
147 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
149 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
148 {
150 {
149 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
151 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
150 *
152 *
@@ -163,7 +165,7 int action_enter_mode(ccsdsTelecommandPa
163 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
165 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
164 {
166 {
165 status = RTEMS_UNSATISFIED;
167 status = RTEMS_UNSATISFIED;
166 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode );
168 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode, time );
167 }
169 }
168 else
170 else
169 {
171 {
@@ -193,7 +195,7 int action_enter_mode(ccsdsTelecommandPa
193 else
195 else
194 {
196 {
195 PRINTF("ERR *** in action_enter *** transition rejected\n")
197 PRINTF("ERR *** in action_enter *** transition rejected\n")
196 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
198 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
197 }
199 }
198 }
200 }
199
201
@@ -227,7 +229,7 int action_update_info(ccsdsTelecommandP
227 return result;
229 return result;
228 }
230 }
229
231
230 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
232 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
231 {
233 {
232 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
234 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
233 *
235 *
@@ -243,17 +245,17 int action_enable_calibration(ccsdsTelec
243 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
245 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
244
246
245 if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) {
247 if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) {
246 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
248 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
247 result = LFR_DEFAULT;
249 result = LFR_DEFAULT;
248 }
250 }
249 else {
251 else {
250 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
252 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
251 result = LFR_DEFAULT;
253 result = LFR_DEFAULT;
252 }
254 }
253 return result;
255 return result;
254 }
256 }
255
257
256 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
258 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
257 {
259 {
258 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
260 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
259 *
261 *
@@ -269,11 +271,11 int action_disable_calibration(ccsdsTele
269 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
271 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
270
272
271 if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) {
273 if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) {
272 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
274 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
273 result = LFR_DEFAULT;
275 result = LFR_DEFAULT;
274 }
276 }
275 else {
277 else {
276 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
278 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
277 result = LFR_DEFAULT;
279 result = LFR_DEFAULT;
278 }
280 }
279 return result;
281 return result;
@@ -709,17 +711,9 void update_last_TC_rej(ccsdsTelecommand
709 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5];
711 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5];
710 }
712 }
711
713
712 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id)
714 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time)
713 {
715 {
714 unsigned int val = 0;
716 unsigned int val = 0;
715 unsigned char time[6];
716
717 time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
718 time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
719 time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
720 time[3] = (unsigned char) (time_management_regs->coarse_time);
721 time[4] = (unsigned char) (time_management_regs->fine_time>>8);
722 time[5] = (unsigned char) (time_management_regs->fine_time);
723
717
724 if (result == LFR_SUCCESSFUL)
718 if (result == LFR_SUCCESSFUL)
725 {
719 {
@@ -29,7 +29,7 int action_load_common_par(ccsdsTelecomm
29 return LFR_SUCCESSFUL;
29 return LFR_SUCCESSFUL;
30 }
30 }
31
31
32 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
32 int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
33 {
33 {
34 /** This function updates the LFR registers with the incoming normal parameters.
34 /** This function updates the LFR registers with the incoming normal parameters.
35 *
35 *
@@ -45,7 +45,7 int action_load_normal_par(ccsdsTelecomm
45
45
46 if ( (lfrCurrentMode == LFR_MODE_NORMAL) ||
46 if ( (lfrCurrentMode == LFR_MODE_NORMAL) ||
47 (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) {
47 (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) {
48 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
48 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
49 flag = LFR_DEFAULT;
49 flag = LFR_DEFAULT;
50 }
50 }
51
51
@@ -53,7 +53,7 int action_load_normal_par(ccsdsTelecomm
53 // sy_lfr_n_swf_l
53 // sy_lfr_n_swf_l
54 if (flag == LFR_SUCCESSFUL)
54 if (flag == LFR_SUCCESSFUL)
55 {
55 {
56 result = set_sy_lfr_n_swf_l( TC, queue_id );
56 result = set_sy_lfr_n_swf_l( TC, queue_id, time );
57 if (result != LFR_SUCCESSFUL)
57 if (result != LFR_SUCCESSFUL)
58 {
58 {
59 flag = LFR_DEFAULT;
59 flag = LFR_DEFAULT;
@@ -64,7 +64,7 int action_load_normal_par(ccsdsTelecomm
64 // sy_lfr_n_swf_p
64 // sy_lfr_n_swf_p
65 if (flag == LFR_SUCCESSFUL)
65 if (flag == LFR_SUCCESSFUL)
66 {
66 {
67 result = set_sy_lfr_n_swf_p( TC, queue_id );
67 result = set_sy_lfr_n_swf_p( TC, queue_id, time );
68 if (result != LFR_SUCCESSFUL)
68 if (result != LFR_SUCCESSFUL)
69 {
69 {
70 flag = LFR_DEFAULT;
70 flag = LFR_DEFAULT;
@@ -107,7 +107,7 int action_load_normal_par(ccsdsTelecomm
107 return flag;
107 return flag;
108 }
108 }
109
109
110 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
110 int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
111 {
111 {
112 /** This function updates the LFR registers with the incoming burst parameters.
112 /** This function updates the LFR registers with the incoming burst parameters.
113 *
113 *
@@ -123,7 +123,7 int action_load_burst_par(ccsdsTelecomma
123 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
123 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
124
124
125 if ( lfrMode == LFR_MODE_BURST ) {
125 if ( lfrMode == LFR_MODE_BURST ) {
126 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
126 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
127 result = LFR_DEFAULT;
127 result = LFR_DEFAULT;
128 }
128 }
129 else {
129 else {
@@ -136,7 +136,7 int action_load_burst_par(ccsdsTelecomma
136 return result;
136 return result;
137 }
137 }
138
138
139 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
139 int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
140 {
140 {
141 /** This function updates the LFR registers with the incoming sbm1 parameters.
141 /** This function updates the LFR registers with the incoming sbm1 parameters.
142 *
142 *
@@ -151,7 +151,7 int action_load_sbm1_par(ccsdsTelecomman
151 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
151 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
152
152
153 if ( (lfrMode == LFR_MODE_SBM1) || (lfrMode == LFR_MODE_SBM2) ) {
153 if ( (lfrMode == LFR_MODE_SBM1) || (lfrMode == LFR_MODE_SBM2) ) {
154 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
154 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
155 result = LFR_DEFAULT;
155 result = LFR_DEFAULT;
156 }
156 }
157 else {
157 else {
@@ -164,7 +164,7 int action_load_sbm1_par(ccsdsTelecomman
164 return result;
164 return result;
165 }
165 }
166
166
167 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
167 int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
168 {
168 {
169 /** This function updates the LFR registers with the incoming sbm2 parameters.
169 /** This function updates the LFR registers with the incoming sbm2 parameters.
170 *
170 *
@@ -180,7 +180,7 int action_load_sbm2_par(ccsdsTelecomman
180 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
180 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
181
181
182 if ( (lfrMode == LFR_MODE_SBM2) || (lfrMode == LFR_MODE_SBM2) ) {
182 if ( (lfrMode == LFR_MODE_SBM2) || (lfrMode == LFR_MODE_SBM2) ) {
183 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
183 send_tm_lfr_tc_exe_not_executable( TC, queue_id, time );
184 result = LFR_DEFAULT;
184 result = LFR_DEFAULT;
185 }
185 }
186 else {
186 else {
@@ -232,7 +232,7 int action_dump_par( rtems_id queue_id )
232 //***********************
232 //***********************
233 // NORMAL MODE PARAMETERS
233 // NORMAL MODE PARAMETERS
234
234
235 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
235 int set_sy_lfr_n_swf_l( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
236 {
236 {
237 /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l).
237 /** This function sets the number of points of a snapshot (sy_lfr_n_swf_l).
238 *
238 *
@@ -255,12 +255,12 int set_sy_lfr_n_swf_l( ccsdsTelecommand
255
255
256 if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16
256 if ( (tmp < 16) || (tmp > 2048) ) // the snapshot period is a multiple of 16
257 { // 2048 is the maximum limit due to the size of the buffers
257 { // 2048 is the maximum limit due to the size of the buffers
258 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_L+10, lsb );
258 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_L+10, lsb, time );
259 result = WRONG_APP_DATA;
259 result = WRONG_APP_DATA;
260 }
260 }
261 else if (tmp != 2048)
261 else if (tmp != 2048)
262 {
262 {
263 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
263 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
264 result = FUNCT_NOT_IMPL;
264 result = FUNCT_NOT_IMPL;
265 }
265 }
266 else
266 else
@@ -273,7 +273,7 int set_sy_lfr_n_swf_l( ccsdsTelecommand
273 return result;
273 return result;
274 }
274 }
275
275
276 int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
276 int set_sy_lfr_n_swf_p(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time)
277 {
277 {
278 /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p).
278 /** This function sets the time between two snapshots, in s (sy_lfr_n_swf_p).
279 *
279 *
@@ -296,7 +296,7 int set_sy_lfr_n_swf_p( ccsdsTelecommand
296
296
297 if ( (tmp < 16) || (tmp > 65528) )
297 if ( (tmp < 16) || (tmp > 65528) )
298 {
298 {
299 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_P+10, lsb );
299 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_SY_LFR_N_SWF_P+10, lsb, time );
300 result = WRONG_APP_DATA;
300 result = WRONG_APP_DATA;
301 }
301 }
302 else
302 else
@@ -75,7 +75,8 int send_tm_lfr_tc_exe_success( ccsdsTel
75 }
75 }
76
76
77 int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
77 int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
78 unsigned char byte_position, unsigned char rcv_value )
78 unsigned char byte_position, unsigned char rcv_value,
79 unsigned char *time)
79 {
80 {
80 /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue.
81 /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue.
81 *
82 *
@@ -142,7 +143,7 int send_tm_lfr_tc_exe_inconsistent( ccs
142 return status;
143 return status;
143 }
144 }
144
145
145 int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
146 int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
146 {
147 {
147 /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue.
148 /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue.
148 *
149 *
@@ -207,7 +208,7 int send_tm_lfr_tc_exe_not_executable( c
207 return status;
208 return status;
208 }
209 }
209
210
210 int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
211 int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
211 {
212 {
212 /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue.
213 /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue.
213 *
214 *
@@ -270,7 +271,7 int send_tm_lfr_tc_exe_not_implemented(
270 return status;
271 return status;
271 }
272 }
272
273
273 int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
274 int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
274 {
275 {
275 /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue.
276 /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue.
276 *
277 *
@@ -335,7 +336,7 int send_tm_lfr_tc_exe_error( ccsdsTelec
335
336
336 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
337 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
337 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV,
338 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV,
338 unsigned char destinationID)
339 unsigned char destinationID, unsigned char *time)
339 {
340 {
340 /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue.
341 /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue.
341 *
342 *
General Comments 0
You need to be logged in to leave comments. Login now