@@ -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: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Mon Nov 4 07:05:32 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 | |
@@ -10,7 +10,7 | |||||
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 |
DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4= |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=20 -DPRINT_MESSAGES_ON_CONSOLE | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -7,11 +7,11 CONFIG -= qt | |||||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) | |
8 |
|
8 | |||
9 | # flight software version |
|
9 | # flight software version | |
10 |
SWVERSION=-0- |
|
10 | SWVERSION=-0-20 | |
11 | DEFINES += SW_VERSION_N1=0 |
|
11 | DEFINES += SW_VERSION_N1=0 | |
12 | DEFINES += SW_VERSION_N2=0 |
|
12 | DEFINES += SW_VERSION_N2=0 | |
13 | DEFINES += SW_VERSION_N3=0 |
|
13 | DEFINES += SW_VERSION_N3=0 | |
14 |
DEFINES += SW_VERSION_N4= |
|
14 | DEFINES += SW_VERSION_N4=20 | |
15 |
|
15 | |||
16 | contains( CONFIG, verbose ) { |
|
16 | contains( CONFIG, verbose ) { | |
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
|
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
@@ -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.0, 2013-1 |
|
3 | <!-- Written by QtCreator 2.8.0, 2013-11-04T07:04:49. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -107,18 +107,20 | |||||
107 |
|
107 | |||
108 | // FAILURE CODES |
|
108 | // FAILURE CODES | |
109 | #define ILLEGAL_APID 0 |
|
109 | #define ILLEGAL_APID 0 | |
110 |
#define WRONG_LEN_P |
|
110 | #define WRONG_LEN_PKT 1 | |
111 | #define INCOR_CHECKSUM 2 |
|
111 | #define INCOR_CHECKSUM 2 | |
112 | #define ILL_TYPE 3 |
|
112 | #define ILL_TYPE 3 | |
113 | #define ILL_SUBTYPE 4 |
|
113 | #define ILL_SUBTYPE 4 | |
114 |
#define WRONG_APP_DATA 5 |
|
114 | #define WRONG_APP_DATA 5 // 0x00 0x05 | |
115 | // |
|
|||
116 | #define CCSDS_TM_VALID 7 |
|
|||
117 | #define TC_NOT_EXE 42000 // 0xa4 0x10 |
|
115 | #define TC_NOT_EXE 42000 // 0xa4 0x10 | |
|
116 | #define WRONG_SRC_ID 42001 // 0xa4 0x11 | |||
118 | #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12 |
|
117 | #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12 | |
119 | #define FAIL_DETECTED 42003 // 0xa4 0x13 |
|
118 | #define FAIL_DETECTED 42003 // 0xa4 0x13 | |
|
119 | #define NOT_ALLOWED 42004 // 0xa4 0x14 | |||
120 | #define CORRUPTED 42005 // 0xa4 0x15 |
|
120 | #define CORRUPTED 42005 // 0xa4 0x15 | |
|
121 | #define CCSDS_TM_VALID 7 | |||
121 |
|
122 | |||
|
123 | // TC SID | |||
122 | #define SID_TC_DEFAULT 0 // the default SID for TC sent to the LFR |
|
124 | #define SID_TC_DEFAULT 0 // the default SID for TC sent to the LFR | |
123 | #define SID_TC_GROUND 0 |
|
125 | #define SID_TC_GROUND 0 | |
124 | #define SID_TC_MISSION_TIMELINE 110 |
|
126 | #define SID_TC_MISSION_TIMELINE 110 |
@@ -61,6 +61,25 struct waveform_picker_regs_str{ | |||||
61 | }; |
|
61 | }; | |
62 | typedef struct waveform_picker_regs_str waveform_picker_regs_t; |
|
62 | typedef struct waveform_picker_regs_str waveform_picker_regs_t; | |
63 |
|
63 | |||
|
64 | struct waveform_picker_regs_str_alt{ | |||
|
65 | volatile int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW | |||
|
66 | volatile int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] | |||
|
67 | volatile int addr_data_f0; // 0x08 | |||
|
68 | volatile int addr_data_f1; // 0x0c | |||
|
69 | volatile int addr_data_f2; // 0x10 | |||
|
70 | volatile int addr_data_f3; // 0x14 | |||
|
71 | volatile int status; // 0x18 | |||
|
72 | volatile int delta_snapshot; // 0x1c | |||
|
73 | volatile int delta_f0; // 0x20 | |||
|
74 | volatile int delta_f0_2; | |||
|
75 | volatile int delta_f1; | |||
|
76 | volatile int delta_f2; | |||
|
77 | volatile int nb_data_by_buffer; | |||
|
78 | volatile int snapshot_param; | |||
|
79 | volatile int start_date; | |||
|
80 | }; | |||
|
81 | typedef struct waveform_picker_regs_str_alt waveform_picker_regs_t_alt; | |||
|
82 | ||||
64 | struct spectral_matrix_regs_str{ |
|
83 | struct spectral_matrix_regs_str{ | |
65 | volatile int config; |
|
84 | volatile int config; | |
66 | volatile int status; |
|
85 | volatile int status; |
@@ -25,6 +25,7 extern volatile int wf_cont_f3[ ]; | |||||
25 | extern volatile int wf_cont_f3_bis[ ]; |
|
25 | extern volatile int wf_cont_f3_bis[ ]; | |
26 | extern char wf_cont_f3_light[ ]; |
|
26 | extern char wf_cont_f3_light[ ]; | |
27 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
27 | extern waveform_picker_regs_t *waveform_picker_regs; | |
|
28 | extern waveform_picker_regs_t_alt *waveform_picker_regs_alt; | |||
28 | extern time_management_regs_t *time_management_regs; |
|
29 | extern time_management_regs_t *time_management_regs; | |
29 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
30 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |
30 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
31 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
@@ -37,6 +37,7 gptimer_regs_t *gptimer_regs | |||||
37 | #ifdef GSA |
|
37 | #ifdef GSA | |
38 | #else |
|
38 | #else | |
39 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; |
|
39 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; | |
|
40 | waveform_picker_regs_t_alt *waveform_picker_regs_alt = (waveform_picker_regs_t_alt*) REGS_ADDR_WAVEFORM_PICKER; | |||
40 | #endif |
|
41 | #endif | |
41 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; |
|
42 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; | |
42 |
|
43 |
@@ -156,12 +156,6 rtems_task Init( rtems_task_argument ign | |||||
156 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
156 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) | |
157 | } |
|
157 | } | |
158 |
|
158 | |||
159 | status = stop_current_mode(); // go in STANDBY mode |
|
|||
160 | if (status != RTEMS_SUCCESSFUL) |
|
|||
161 | { |
|
|||
162 | PRINTF1("in INIT *** ERR in stop_current_mode, code %d", status) |
|
|||
163 | } |
|
|||
164 |
|
||||
165 | #ifdef GSA |
|
159 | #ifdef GSA | |
166 | // mask IRQ lines |
|
160 | // mask IRQ lines | |
167 | LEON_Mask_interrupt( IRQ_SM ); |
|
161 | LEON_Mask_interrupt( IRQ_SM ); |
@@ -288,6 +288,5 void init_housekeeping_parameters( void | |||||
288 | housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3; |
|
288 | housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3; | |
289 | housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4; |
|
289 | housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4; | |
290 |
|
290 | |||
291 | updateLFRCurrentMode(); |
|
|||
292 | } |
|
291 | } | |
293 |
|
292 |
@@ -41,7 +41,7 rtems_task spiq_task(rtems_task_argument | |||||
41 | rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT |
|
41 | rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT | |
42 | PRINTF("in SPIQ *** got SPW_LINKERR_EVENT\n") |
|
42 | PRINTF("in SPIQ *** got SPW_LINKERR_EVENT\n") | |
43 |
|
43 | |||
44 |
// [0] SUSPEND RECV A |
|
44 | // [0] SUSPEND RECV AND SEND TASKS | |
45 | rtems_task_suspend( Task_id[ TASKID_RECV ] ); |
|
45 | rtems_task_suspend( Task_id[ TASKID_RECV ] ); | |
46 | rtems_task_suspend( Task_id[ TASKID_SEND ] ); |
|
46 | rtems_task_suspend( Task_id[ TASKID_SEND ] ); | |
47 |
|
47 | |||
@@ -82,9 +82,13 rtems_task spiq_task(rtems_task_argument | |||||
82 | } |
|
82 | } | |
83 | else // [3.b] the link is not in run state, go in STANDBY mode |
|
83 | else // [3.b] the link is not in run state, go in STANDBY mode | |
84 | { |
|
84 | { | |
85 | status = enter_mode( LFR_MODE_STANDBY, NULL ); // enter the STANDBY mode |
|
85 | status = stop_current_mode(); | |
86 | if ( status != RTEMS_SUCCESSFUL ) { |
|
86 | if ( status != RTEMS_SUCCESSFUL ) { | |
87 |
PRINTF1("in SPIQ *** ERR ent |
|
87 | PRINTF1("in SPIQ *** ERR stop_current_mode *** code %d\n", status) | |
|
88 | } | |||
|
89 | status = enter_standby_mode(); | |||
|
90 | if ( status != RTEMS_SUCCESSFUL ) { | |||
|
91 | PRINTF1("in SPIQ *** ERR enter_standby_mode *** code %d\n", status) | |||
88 | } |
|
92 | } | |
89 | // wake the WTDG task up to wait for the link recovery |
|
93 | // wake the WTDG task up to wait for the link recovery | |
90 | status = rtems_event_send ( Task_id[TASKID_WTDG], RTEMS_EVENT_0 ); |
|
94 | status = rtems_event_send ( Task_id[TASKID_WTDG], RTEMS_EVENT_0 ); | |
@@ -148,11 +152,19 rtems_task recv_task( rtems_task_argumen | |||||
148 | currentTC_LEN_RCV[ 1 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt ); |
|
152 | currentTC_LEN_RCV[ 1 ] = (unsigned char) (currentTC_LEN_RCV_AsUnsignedInt ); | |
149 | // CHECK THE TC |
|
153 | // CHECK THE TC | |
150 | parserCode = tc_parser( ¤tTC, currentTC_LEN_RCV_AsUnsignedInt, computed_CRC ) ; |
|
154 | parserCode = tc_parser( ¤tTC, currentTC_LEN_RCV_AsUnsignedInt, computed_CRC ) ; | |
151 |
if ( (parserCode == ILLEGAL_APID) || (parserCode == WRONG_LEN_P |
|
155 | if ( (parserCode == ILLEGAL_APID) || (parserCode == WRONG_LEN_PKT) | |
152 | | (parserCode == ILL_TYPE) || (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA) ) |
|
156 | || (parserCode == INCOR_CHECKSUM) || (parserCode == ILL_TYPE) | |
|
157 | || (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA) | |||
|
158 | || (parserCode == WRONG_SRC_ID) ) | |||
153 | { // send TM_LFR_TC_EXE_CORRUPTED |
|
159 | { // send TM_LFR_TC_EXE_CORRUPTED | |
|
160 | if ( !( (currentTC.serviceType==TC_TYPE_TIME) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_TIME) ) | |||
|
161 | && | |||
|
162 | !( (currentTC.serviceType==TC_TYPE_GEN) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_INFO)) | |||
|
163 | ) | |||
|
164 | { | |||
154 | send_tm_lfr_tc_exe_corrupted( ¤tTC, queue_send_id, computed_CRC, currentTC_LEN_RCV ); |
|
165 | send_tm_lfr_tc_exe_corrupted( ¤tTC, queue_send_id, computed_CRC, currentTC_LEN_RCV ); | |
155 | } |
|
166 | } | |
|
167 | } | |||
156 | else |
|
168 | else | |
157 | { // send valid TC to the action launcher |
|
169 | { // send valid TC to the action launcher | |
158 | status = rtems_message_queue_send( queue_recv_id, ¤tTC, |
|
170 | status = rtems_message_queue_send( queue_recv_id, ¤tTC, |
@@ -19,6 +19,7 unsigned int Crc_opt( unsigned char D, u | |||||
19 | * |
|
19 | * | |
20 | * @param D is the current byte of data. |
|
20 | * @param D is the current byte of data. | |
21 | * @param Chk is the current syndrom value. |
|
21 | * @param Chk is the current syndrom value. | |
|
22 | * | |||
22 | * @return the value of the new syndrome on two bytes. |
|
23 | * @return the value of the new syndrome on two bytes. | |
23 | * |
|
24 | * | |
24 | */ |
|
25 | */ | |
@@ -143,13 +144,13 int tc_parser(ccsdsTelecommandPacket_t * | |||||
143 | if (status == CCSDS_TM_VALID) // CHECK THE PACKET LENGTH FIELD AND THE ACTUAL LENGTH COMPLIANCE |
|
144 | if (status == CCSDS_TM_VALID) // CHECK THE PACKET LENGTH FIELD AND THE ACTUAL LENGTH COMPLIANCE | |
144 | { |
|
145 | { | |
145 | if (length != TC_LEN_RCV ) { |
|
146 | if (length != TC_LEN_RCV ) { | |
146 |
status = WRONG_LEN_P |
|
147 | status = WRONG_LEN_PKT; | |
147 | } |
|
148 | } | |
148 | } |
|
149 | } | |
149 | if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE |
|
150 | if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE | |
150 | { |
|
151 | { | |
151 | if ( length >= CCSDS_TC_PKT_MAX_SIZE ) { |
|
152 | if ( length >= CCSDS_TC_PKT_MAX_SIZE ) { | |
152 |
status = WRONG_LEN_P |
|
153 | status = WRONG_LEN_PKT; | |
153 | } |
|
154 | } | |
154 | } |
|
155 | } | |
155 | if (status == CCSDS_TM_VALID) // CHECK THE TYPE |
|
156 | if (status == CCSDS_TM_VALID) // CHECK THE TYPE | |
@@ -225,7 +226,7 int tc_check_subtype( unsigned char pack | |||||
225 | } |
|
226 | } | |
226 | else |
|
227 | else | |
227 | { |
|
228 | { | |
228 | status = ILL_TYPE; |
|
229 | status = ILL_SUBTYPE; | |
229 | } |
|
230 | } | |
230 |
|
231 | |||
231 | return status; |
|
232 | return status; | |
@@ -254,7 +255,7 int tc_check_sid( unsigned char sid ) | |||||
254 | } |
|
255 | } | |
255 | else |
|
256 | else | |
256 | { |
|
257 | { | |
257 |
status = |
|
258 | status = WRONG_SRC_ID; | |
258 | } |
|
259 | } | |
259 |
|
260 | |||
260 | return status; |
|
261 | return status; | |
@@ -279,7 +280,7 int tc_check_length( unsigned char packe | |||||
279 | { |
|
280 | { | |
280 | case TC_SUBTYPE_RESET: |
|
281 | case TC_SUBTYPE_RESET: | |
281 | if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
282 | if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) { | |
282 |
status = WRONG_LEN_P |
|
283 | status = WRONG_LEN_PKT; | |
283 | } |
|
284 | } | |
284 | else { |
|
285 | else { | |
285 | status = CCSDS_TM_VALID; |
|
286 | status = CCSDS_TM_VALID; | |
@@ -287,7 +288,7 int tc_check_length( unsigned char packe | |||||
287 | break; |
|
288 | break; | |
288 | case TC_SUBTYPE_LOAD_COMM: |
|
289 | case TC_SUBTYPE_LOAD_COMM: | |
289 | if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
290 | if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) { | |
290 |
status = WRONG_LEN_P |
|
291 | status = WRONG_LEN_PKT; | |
291 | } |
|
292 | } | |
292 | else { |
|
293 | else { | |
293 | status = CCSDS_TM_VALID; |
|
294 | status = CCSDS_TM_VALID; | |
@@ -295,7 +296,7 int tc_check_length( unsigned char packe | |||||
295 | break; |
|
296 | break; | |
296 | case TC_SUBTYPE_LOAD_NORM: |
|
297 | case TC_SUBTYPE_LOAD_NORM: | |
297 | if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
298 | if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) { | |
298 |
status = WRONG_LEN_P |
|
299 | status = WRONG_LEN_PKT; | |
299 | } |
|
300 | } | |
300 | else { |
|
301 | else { | |
301 | status = CCSDS_TM_VALID; |
|
302 | status = CCSDS_TM_VALID; | |
@@ -303,7 +304,7 int tc_check_length( unsigned char packe | |||||
303 | break; |
|
304 | break; | |
304 | case TC_SUBTYPE_LOAD_BURST: |
|
305 | case TC_SUBTYPE_LOAD_BURST: | |
305 | if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
306 | if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) { | |
306 |
status = WRONG_LEN_P |
|
307 | status = WRONG_LEN_PKT; | |
307 | } |
|
308 | } | |
308 | else { |
|
309 | else { | |
309 | status = CCSDS_TM_VALID; |
|
310 | status = CCSDS_TM_VALID; | |
@@ -311,7 +312,7 int tc_check_length( unsigned char packe | |||||
311 | break; |
|
312 | break; | |
312 | case TC_SUBTYPE_LOAD_SBM1: |
|
313 | case TC_SUBTYPE_LOAD_SBM1: | |
313 | if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
314 | if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) { | |
314 |
status = WRONG_LEN_P |
|
315 | status = WRONG_LEN_PKT; | |
315 | } |
|
316 | } | |
316 | else { |
|
317 | else { | |
317 | status = CCSDS_TM_VALID; |
|
318 | status = CCSDS_TM_VALID; | |
@@ -319,7 +320,7 int tc_check_length( unsigned char packe | |||||
319 | break; |
|
320 | break; | |
320 | case TC_SUBTYPE_LOAD_SBM2: |
|
321 | case TC_SUBTYPE_LOAD_SBM2: | |
321 | if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
322 | if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) { | |
322 |
status = WRONG_LEN_P |
|
323 | status = WRONG_LEN_PKT; | |
323 | } |
|
324 | } | |
324 | else { |
|
325 | else { | |
325 | status = CCSDS_TM_VALID; |
|
326 | status = CCSDS_TM_VALID; | |
@@ -327,7 +328,7 int tc_check_length( unsigned char packe | |||||
327 | break; |
|
328 | break; | |
328 | case TC_SUBTYPE_DUMP: |
|
329 | case TC_SUBTYPE_DUMP: | |
329 | if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
330 | if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) { | |
330 |
status = WRONG_LEN_P |
|
331 | status = WRONG_LEN_PKT; | |
331 | } |
|
332 | } | |
332 | else { |
|
333 | else { | |
333 | status = CCSDS_TM_VALID; |
|
334 | status = CCSDS_TM_VALID; | |
@@ -335,7 +336,7 int tc_check_length( unsigned char packe | |||||
335 | break; |
|
336 | break; | |
336 | case TC_SUBTYPE_ENTER: |
|
337 | case TC_SUBTYPE_ENTER: | |
337 | if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
338 | if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) { | |
338 |
status = WRONG_LEN_P |
|
339 | status = WRONG_LEN_PKT; | |
339 | } |
|
340 | } | |
340 | else { |
|
341 | else { | |
341 | status = CCSDS_TM_VALID; |
|
342 | status = CCSDS_TM_VALID; | |
@@ -343,7 +344,7 int tc_check_length( unsigned char packe | |||||
343 | break; |
|
344 | break; | |
344 | case TC_SUBTYPE_UPDT_INFO: |
|
345 | case TC_SUBTYPE_UPDT_INFO: | |
345 | if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
346 | if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) { | |
346 |
status = WRONG_LEN_P |
|
347 | status = WRONG_LEN_PKT; | |
347 | } |
|
348 | } | |
348 | else { |
|
349 | else { | |
349 | status = CCSDS_TM_VALID; |
|
350 | status = CCSDS_TM_VALID; | |
@@ -351,7 +352,7 int tc_check_length( unsigned char packe | |||||
351 | break; |
|
352 | break; | |
352 | case TC_SUBTYPE_EN_CAL: |
|
353 | case TC_SUBTYPE_EN_CAL: | |
353 | if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
354 | if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { | |
354 |
status = WRONG_LEN_P |
|
355 | status = WRONG_LEN_PKT; | |
355 | } |
|
356 | } | |
356 | else { |
|
357 | else { | |
357 | status = CCSDS_TM_VALID; |
|
358 | status = CCSDS_TM_VALID; | |
@@ -359,7 +360,7 int tc_check_length( unsigned char packe | |||||
359 | break; |
|
360 | break; | |
360 | case TC_SUBTYPE_DIS_CAL: |
|
361 | case TC_SUBTYPE_DIS_CAL: | |
361 | if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
362 | if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { | |
362 |
status = WRONG_LEN_P |
|
363 | status = WRONG_LEN_PKT; | |
363 | } |
|
364 | } | |
364 | else { |
|
365 | else { | |
365 | status = CCSDS_TM_VALID; |
|
366 | status = CCSDS_TM_VALID; | |
@@ -367,7 +368,7 int tc_check_length( unsigned char packe | |||||
367 | break; |
|
368 | break; | |
368 | case TC_SUBTYPE_UPDT_TIME: |
|
369 | case TC_SUBTYPE_UPDT_TIME: | |
369 | if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
370 | if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) { | |
370 |
status = WRONG_LEN_P |
|
371 | status = WRONG_LEN_PKT; | |
371 | } |
|
372 | } | |
372 | else { |
|
373 | else { | |
373 | status = CCSDS_TM_VALID; |
|
374 | status = CCSDS_TM_VALID; |
@@ -242,7 +242,7 int action_enable_calibration(ccsdsTelec | |||||
242 | result = LFR_DEFAULT; |
|
242 | result = LFR_DEFAULT; | |
243 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
243 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
244 |
|
244 | |||
245 | if ( (lfrMode == LFR_MODE_STANDBY) | (lfrMode == LFR_MODE_BURST) | (lfrMode == LFR_MODE_SBM2) ) { |
|
245 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { | |
246 | send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
246 | send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
247 | result = LFR_DEFAULT; |
|
247 | result = LFR_DEFAULT; | |
248 | } |
|
248 | } | |
@@ -268,7 +268,7 int action_disable_calibration(ccsdsTele | |||||
268 | result = LFR_DEFAULT; |
|
268 | result = LFR_DEFAULT; | |
269 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
269 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
270 |
|
270 | |||
271 | if ( (lfrMode == LFR_MODE_STANDBY) | (lfrMode == LFR_MODE_BURST) | (lfrMode == LFR_MODE_SBM2) ) { |
|
271 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { | |
272 | send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
272 | send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
273 | result = LFR_DEFAULT; |
|
273 | result = LFR_DEFAULT; | |
274 | } |
|
274 | } | |
@@ -415,23 +415,23 int enter_mode(unsigned char mode, ccsds | |||||
415 | status = RTEMS_UNSATISFIED; |
|
415 | status = RTEMS_UNSATISFIED; | |
416 |
|
416 | |||
417 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d); |
|
417 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d); | |
418 |
|
|
418 | updateLFRCurrentMode(); | |
419 |
|
419 | |||
420 | switch(mode){ |
|
420 | switch(mode){ | |
421 | case LFR_MODE_STANDBY: |
|
421 | case LFR_MODE_STANDBY: | |
422 |
status = enter_standby_mode( |
|
422 | status = enter_standby_mode( ); | |
423 | break; |
|
423 | break; | |
424 | case LFR_MODE_NORMAL: |
|
424 | case LFR_MODE_NORMAL: | |
425 |
status = enter_normal_mode( |
|
425 | status = enter_normal_mode( ); | |
426 | break; |
|
426 | break; | |
427 | case LFR_MODE_BURST: |
|
427 | case LFR_MODE_BURST: | |
428 |
status = enter_burst_mode( |
|
428 | status = enter_burst_mode( ); | |
429 | break; |
|
429 | break; | |
430 | case LFR_MODE_SBM1: |
|
430 | case LFR_MODE_SBM1: | |
431 |
status = enter_sbm1_mode( |
|
431 | status = enter_sbm1_mode( ); | |
432 | break; |
|
432 | break; | |
433 | case LFR_MODE_SBM2: |
|
433 | case LFR_MODE_SBM2: | |
434 |
status = enter_sbm2_mode( |
|
434 | status = enter_sbm2_mode( ); | |
435 | break; |
|
435 | break; | |
436 | default: |
|
436 | default: | |
437 | status = RTEMS_UNSATISFIED; |
|
437 | status = RTEMS_UNSATISFIED; | |
@@ -448,8 +448,6 int enter_mode(unsigned char mode, ccsds | |||||
448 |
|
448 | |||
449 | int enter_standby_mode() |
|
449 | int enter_standby_mode() | |
450 | { |
|
450 | { | |
451 | reset_waveform_picker_regs(); |
|
|||
452 |
|
||||
453 | PRINTF1("maxCount = %d\n", maxCount) |
|
451 | PRINTF1("maxCount = %d\n", maxCount) | |
454 |
|
452 | |||
455 | #ifdef PRINT_TASK_STATISTICS |
|
453 | #ifdef PRINT_TASK_STATISTICS |
@@ -150,7 +150,7 int action_load_sbm1_par(ccsdsTelecomman | |||||
150 | result = LFR_DEFAULT; |
|
150 | result = LFR_DEFAULT; | |
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 ) { |
|
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 ); | |
155 | result = LFR_DEFAULT; |
|
155 | result = LFR_DEFAULT; | |
156 | } |
|
156 | } | |
@@ -179,7 +179,7 int action_load_sbm2_par(ccsdsTelecomman | |||||
179 | result = LFR_DEFAULT; |
|
179 | result = LFR_DEFAULT; | |
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 ) { |
|
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 ); | |
184 | result = LFR_DEFAULT; |
|
184 | result = LFR_DEFAULT; | |
185 | } |
|
185 | } |
@@ -51,7 +51,7 int send_tm_lfr_tc_exe_success( ccsdsTel | |||||
51 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
51 | TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
52 | TM.serviceType = TM_TYPE_TC_EXE; |
|
52 | TM.serviceType = TM_TYPE_TC_EXE; | |
53 | TM.serviceSubType = TM_SUBTYPE_EXE_OK; |
|
53 | TM.serviceSubType = TM_SUBTYPE_EXE_OK; | |
54 | TM.destinationID = TM_DESTINATION_ID_GROUND; // default destination id |
|
54 | TM.destinationID = TC->sourceID; | |
55 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
55 | TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
56 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
56 | TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
57 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
57 | TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
@@ -1071,20 +1071,41 void reset_waveform_picker_regs() | |||||
1071 | #ifdef GSA |
|
1071 | #ifdef GSA | |
1072 | #else |
|
1072 | #else | |
1073 | reset_wfp_burst_enable(); |
|
1073 | reset_wfp_burst_enable(); | |
1074 |
set_wfp_ |
|
1074 | reset_wfp_status(); | |
|
1075 | // set buffer addresses | |||
1075 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // |
|
1076 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // | |
1076 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // |
|
1077 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // | |
1077 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // |
|
1078 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // | |
1078 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // |
|
1079 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // | |
|
1080 | // set other parameters | |||
|
1081 | set_wfp_data_shaping(); | |||
1079 | set_wfp_delta_snapshot(); // time in seconds between two snapshots |
|
1082 | set_wfp_delta_snapshot(); // time in seconds between two snapshots | |
1080 | waveform_picker_regs->delta_f2_f1 = 0xffff; // 0x16800 => 92160 (max 4 bytes) |
|
1083 | waveform_picker_regs->delta_f2_f1 = 0xffff; // 0x16800 => 92160 (max 4 bytes) | |
1081 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // 97 280 (max 5 bytes) |
|
1084 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // 97 280 (max 5 bytes) | |
1082 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) |
|
1085 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) | |
1083 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 |
|
1086 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 | |
1084 | reset_wfp_status(); |
|
|||
1085 | #endif |
|
1087 | #endif | |
1086 | } |
|
1088 | } | |
1087 |
|
1089 | |||
|
1090 | void reset_waveform_picker_regs_alt() | |||
|
1091 | { | |||
|
1092 | waveform_picker_regs_alt->data_shaping = 0x01; // 0x00 00 *** R1 R0 SP1 SP0 BW | |||
|
1093 | waveform_picker_regs_alt->run_burst_enable = 0x00; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] | |||
|
1094 | waveform_picker_regs_alt->addr_data_f0 = (int) (wf_snap_f0); // 0x08 | |||
|
1095 | waveform_picker_regs_alt->addr_data_f1 = (int) (wf_snap_f1); // 0x0c | |||
|
1096 | waveform_picker_regs_alt->addr_data_f2 = (int) (wf_snap_f2); // 0x10 | |||
|
1097 | waveform_picker_regs_alt->addr_data_f3 = (int) (wf_cont_f3); // 0x14 | |||
|
1098 | waveform_picker_regs_alt->status = 0x00; // 0x18 | |||
|
1099 | waveform_picker_regs_alt->delta_snapshot = 0x12800; // 0x1c | |||
|
1100 | waveform_picker_regs_alt->delta_f0 = 0x3f5; // 0x20 *** 1013 | |||
|
1101 | waveform_picker_regs_alt->delta_f0_2 = 0x7; // 0x24 *** 7 | |||
|
1102 | waveform_picker_regs_alt->delta_f1 = 0x3c0; // 0x28 *** 960 | |||
|
1103 | waveform_picker_regs_alt->delta_f2 = 0x12200; // 0x2c *** 74240 | |||
|
1104 | waveform_picker_regs_alt->nb_data_by_buffer = 0x1802; // 0x30 *** 2048 * 3 + 2 | |||
|
1105 | waveform_picker_regs_alt->snapshot_param = 0x7ff; // 0x34 *** 2048 -1 | |||
|
1106 | waveform_picker_regs_alt->start_date = 0x00; | |||
|
1107 | } | |||
|
1108 | ||||
1088 | //***************** |
|
1109 | //***************** | |
1089 | // local parameters |
|
1110 | // local parameters | |
1090 | void set_local_sbm1_nb_cwf_max() |
|
1111 | void set_local_sbm1_nb_cwf_max() |
General Comments 0
You need to be logged in to leave comments.
Login now