@@ -5,7 +5,7 | |||
|
5 | 5 | #include <grspw.h> |
|
6 | 6 | #include <math.h> |
|
7 | 7 | #include <stdlib.h> // abs() is in the stdlib |
|
8 |
#include <stdio.h> |
|
|
8 | #include <stdio.h> | |
|
9 | 9 | #include <math.h> |
|
10 | 10 | #include <grlib_regs.h> |
|
11 | 11 |
@@ -14,6 +14,7 | |||
|
14 | 14 | #define FLOAT_EQUAL_ZERO 0.001 |
|
15 | 15 | |
|
16 | 16 | extern unsigned short sequenceCounterParameterDump; |
|
17 | extern unsigned short sequenceCounters_TM_DUMP[]; | |
|
17 | 18 | extern float k_coeff_intercalib_f0_norm[ ]; |
|
18 | 19 | extern float k_coeff_intercalib_f0_sbm[ ]; |
|
19 | 20 | extern float k_coeff_intercalib_f1_norm[ ]; |
@@ -66,6 +67,6 void copyFloatByChar( unsigned char *des | |||
|
66 | 67 | void init_parameter_dump( void ); |
|
67 | 68 | void init_kcoefficients_dump( void ); |
|
68 | 69 | void init_kcoefficients_dump_packet( Packet_TM_LFR_KCOEFFICIENTS_DUMP_t *kcoefficients_dump, unsigned char pkt_nr, unsigned char blk_nr ); |
|
69 | void print_k_coeff(); | |
|
70 | void increment_seq_counter_destination_id_dump( unsigned char *packet_sequence_control, unsigned char destination_id ); | |
|
70 | 71 | |
|
71 | 72 | #endif // TC_LOAD_DUMP_PARAMETERS_H |
@@ -71,8 +71,8 unsigned char hk_lfr_q_p2_fifo_size_max; | |||
|
71 | 71 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
72 | 72 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
73 | 73 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; |
|
74 | unsigned short sequenceCounters_TM_DUMP[SEQ_CNT_NB_DEST_ID]; | |
|
74 | 75 | unsigned short sequenceCounterHK; |
|
75 | unsigned short sequenceCounterParameterDump; | |
|
76 | 76 | spw_stats spacewire_stats; |
|
77 | 77 | spw_stats spacewire_stats_backup; |
|
78 | 78 |
@@ -67,7 +67,7 void initCache() | |||
|
67 | 67 | unsigned int cacheControlRegister; |
|
68 | 68 | |
|
69 | 69 | cacheControlRegister = getCacheControlRegister(); |
|
70 |
|
|
|
70 | PRINTF1("(0) cacheControlRegister = %x\n", cacheControlRegister) | |
|
71 | 71 | |
|
72 | 72 | resetCacheControlRegister(); |
|
73 | 73 | |
@@ -76,7 +76,7 void initCache() | |||
|
76 | 76 | enableInstructionBurstFetch(); |
|
77 | 77 | |
|
78 | 78 | cacheControlRegister = getCacheControlRegister(); |
|
79 |
|
|
|
79 | PRINTF1("(1) cacheControlRegister = %x\n", cacheControlRegister) | |
|
80 | 80 | } |
|
81 | 81 | |
|
82 | 82 | rtems_task Init( rtems_task_argument ignored ) |
@@ -274,11 +274,11 void init_local_mode_parameters( void ) | |||
|
274 | 274 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) |
|
275 | 275 | { |
|
276 | 276 | sequenceCounters_TC_EXE[i] = 0x00; |
|
277 | sequenceCounters_TM_DUMP[i] = 0x00; | |
|
277 | 278 | } |
|
278 | 279 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; |
|
279 | 280 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; |
|
280 | 281 | sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8; |
|
281 | sequenceCounterParameterDump = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |
|
282 | 282 | } |
|
283 | 283 | |
|
284 | 284 | void reset_local_time( void ) |
@@ -235,7 +235,7 rtems_task hous_task(rtems_task_argument | |||
|
235 | 235 | PRINTF("in HOUS *** deleting task\n") |
|
236 | 236 | |
|
237 | 237 | status = rtems_task_delete( RTEMS_SELF ); // should not return |
|
238 | printf( "rtems_task_delete returned with status of %d.\n", status ); | |
|
238 | ||
|
239 | 239 | return; |
|
240 | 240 | } |
|
241 | 241 | |
@@ -283,7 +283,6 rtems_task dumb_task( rtems_task_argumen | |||
|
283 | 283 | { |
|
284 | 284 | coarse_time = time_management_regs->coarse_time; |
|
285 | 285 | fine_time = time_management_regs->fine_time; |
|
286 | printf("in DUMB *** coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[i]); | |
|
287 | 286 | if (i==8) |
|
288 | 287 | { |
|
289 | 288 | } |
@@ -286,7 +286,7 rtems_task send_task( rtems_task_argumen | |||
|
286 | 286 | } |
|
287 | 287 | else |
|
288 | 288 | { |
|
289 |
|
|
|
289 | PRINTF1("unexpected sid = %d\n", sid); | |
|
290 | 290 | } |
|
291 | 291 | } |
|
292 | 292 | else if ( incomingData[0] == CCSDS_DESTINATION_ID ) // the incoming message is a ccsds packet |
@@ -301,13 +301,6 rtems_task send_task( rtems_task_argumen | |||
|
301 | 301 | spw_ioctl_send = (spw_ioctl_pkt_send*) incomingData; |
|
302 | 302 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send ); |
|
303 | 303 | if (status == -1){ |
|
304 | printf("size = %d, %x, %x, %x, %x, %x\n", | |
|
305 | size, | |
|
306 | incomingData[0], | |
|
307 | incomingData[1], | |
|
308 | incomingData[2], | |
|
309 | incomingData[3], | |
|
310 | incomingData[4]); | |
|
311 | 304 | PRINTF2("in SEND *** (2.b) ERRNO = %d, RTEMS = %d\n", errno, status) |
|
312 | 305 | } |
|
313 | 306 | } |
@@ -873,7 +866,6 int spw_send_waveform_CWF( ring_node *ri | |||
|
873 | 866 | |
|
874 | 867 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, &spw_ioctl_send_CWF ); |
|
875 | 868 | if (status != RTEMS_SUCCESSFUL) { |
|
876 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
|
877 | 869 | ret = LFR_DEFAULT; |
|
878 | 870 | } |
|
879 | 871 | } |
@@ -963,7 +955,6 int spw_send_waveform_SWF( ring_node *ri | |||
|
963 | 955 | // SEND PACKET |
|
964 | 956 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, &spw_ioctl_send_SWF ); |
|
965 | 957 | if (status != RTEMS_SUCCESSFUL) { |
|
966 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
|
967 | 958 | ret = LFR_DEFAULT; |
|
968 | 959 | } |
|
969 | 960 | } |
@@ -1044,7 +1035,6 int spw_send_waveform_CWF3_light( ring_n | |||
|
1044 | 1035 | // SEND PACKET |
|
1045 | 1036 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, &spw_ioctl_send_CWF ); |
|
1046 | 1037 | if (status != RTEMS_SUCCESSFUL) { |
|
1047 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
|
1048 | 1038 | ret = LFR_DEFAULT; |
|
1049 | 1039 | } |
|
1050 | 1040 | } |
@@ -1127,7 +1117,7 void spw_send_asm_f0( ring_node *ring_no | |||
|
1127 | 1117 | // (4) SEND PACKET |
|
1128 | 1118 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, &spw_ioctl_send_ASM ); |
|
1129 | 1119 | if (status != RTEMS_SUCCESSFUL) { |
|
1130 |
|
|
|
1120 | PRINTF1("in ASM_send *** ERR %d\n", (int) status) | |
|
1131 | 1121 | } |
|
1132 | 1122 | } |
|
1133 | 1123 | } |
@@ -1207,7 +1197,7 void spw_send_asm_f1( ring_node *ring_no | |||
|
1207 | 1197 | // (4) SEND PACKET |
|
1208 | 1198 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, &spw_ioctl_send_ASM ); |
|
1209 | 1199 | if (status != RTEMS_SUCCESSFUL) { |
|
1210 |
|
|
|
1200 | PRINTF1("in ASM_send *** ERR %d\n", (int) status) | |
|
1211 | 1201 | } |
|
1212 | 1202 | } |
|
1213 | 1203 | } |
@@ -1274,7 +1264,7 void spw_send_asm_f2( ring_node *ring_no | |||
|
1274 | 1264 | // (4) SEND PACKET |
|
1275 | 1265 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, &spw_ioctl_send_ASM ); |
|
1276 | 1266 | if (status != RTEMS_SUCCESSFUL) { |
|
1277 |
|
|
|
1267 | PRINTF1("in ASM_send *** ERR %d\n", (int) status) | |
|
1278 | 1268 | } |
|
1279 | 1269 | } |
|
1280 | 1270 | } |
@@ -1286,7 +1276,7 void spw_send_k_dump( ring_node *ring_no | |||
|
1286 | 1276 | unsigned int packetLength; |
|
1287 | 1277 | unsigned int size; |
|
1288 | 1278 | |
|
1289 |
|
|
|
1279 | PRINTF("spw_send_k_dump\n") | |
|
1290 | 1280 | |
|
1291 | 1281 | kcoefficients_dump = (Packet_TM_LFR_KCOEFFICIENTS_DUMP_t *) ring_node_to_send->buffer_address; |
|
1292 | 1282 | |
@@ -1294,7 +1284,7 void spw_send_k_dump( ring_node *ring_no | |||
|
1294 | 1284 | |
|
1295 | 1285 | size = packetLength + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
1296 | 1286 | |
|
1297 |
|
|
|
1287 | PRINTF2("packetLength %d, size %d\n", packetLength, size ) | |
|
1298 | 1288 | |
|
1299 | 1289 | status = write( fdSPW, (char *) ring_node_to_send->buffer_address, size ); |
|
1300 | 1290 |
@@ -175,7 +175,7 rtems_task avf0_task( rtems_task_argumen | |||
|
175 | 175 | } |
|
176 | 176 | |
|
177 | 177 | if (status != RTEMS_SUCCESSFUL) { |
|
178 |
|
|
|
178 | PRINTF1("in AVF0 *** Error sending message to MATR, code %d\n", status) | |
|
179 | 179 | } |
|
180 | 180 | } |
|
181 | 181 | } |
@@ -176,7 +176,7 rtems_task avf1_task( rtems_task_argumen | |||
|
176 | 176 | } |
|
177 | 177 | |
|
178 | 178 | if (status != RTEMS_SUCCESSFUL) { |
|
179 |
|
|
|
179 | PRINTF1("in AVF1 *** Error sending message to PRC1, code %d\n", status) | |
|
180 | 180 | } |
|
181 | 181 | } |
|
182 | 182 | } |
@@ -75,18 +75,6 rtems_task avf2_task( rtems_task_argumen | |||
|
75 | 75 | |
|
76 | 76 | nodeForAveraging = getRingNodeForAveraging( 2 ); |
|
77 | 77 | |
|
78 | // printf(" **0** %x . %x", sm_ring_f2[0].coarseTime, sm_ring_f2[0].fineTime); | |
|
79 | // printf(" **1** %x . %x", sm_ring_f2[1].coarseTime, sm_ring_f2[1].fineTime); | |
|
80 | // printf(" **2** %x . %x", sm_ring_f2[2].coarseTime, sm_ring_f2[2].fineTime); | |
|
81 | // printf(" **3** %x . %x", sm_ring_f2[3].coarseTime, sm_ring_f2[3].fineTime); | |
|
82 | // printf(" **4** %x . %x", sm_ring_f2[4].coarseTime, sm_ring_f2[4].fineTime); | |
|
83 | // printf(" **5** %x . %x", sm_ring_f2[5].coarseTime, sm_ring_f2[5].fineTime); | |
|
84 | // printf(" **6** %x . %x", sm_ring_f2[6].coarseTime, sm_ring_f2[6].fineTime); | |
|
85 | // printf(" **7** %x . %x", sm_ring_f2[7].coarseTime, sm_ring_f2[7].fineTime); | |
|
86 | // printf(" **8** %x . %x", sm_ring_f2[8].coarseTime, sm_ring_f2[8].fineTime); | |
|
87 | // printf(" **9** %x . %x", sm_ring_f2[9].coarseTime, sm_ring_f2[9].fineTime); | |
|
88 | // printf(" **10** %x . %x\n", sm_ring_f2[10].coarseTime, sm_ring_f2[10].fineTime); | |
|
89 | ||
|
90 | 78 | // compute the average and store it in the averaged_sm_f2 buffer |
|
91 | 79 | SM_average_f2( current_ring_node_asm_norm_f2->matrix, |
|
92 | 80 | nodeForAveraging, |
@@ -138,7 +126,7 rtems_task avf2_task( rtems_task_argumen | |||
|
138 | 126 | } |
|
139 | 127 | |
|
140 | 128 | if (status != RTEMS_SUCCESSFUL) { |
|
141 |
|
|
|
129 | PRINTF1("in AVF2 *** Error sending message to MATR, code %d\n", status) | |
|
142 | 130 | } |
|
143 | 131 | } |
|
144 | 132 | } |
@@ -433,7 +433,7 void BP_send(char *data, rtems_id queue_ | |||
|
433 | 433 | status = rtems_message_queue_send( queue_id, data, nbBytesToSend); |
|
434 | 434 | if (status != RTEMS_SUCCESSFUL) |
|
435 | 435 | { |
|
436 |
|
|
|
436 | PRINTF1("ERR *** in BP_send *** ERR %d\n", (int) status) | |
|
437 | 437 | } |
|
438 | 438 | } |
|
439 | 439 |
@@ -146,7 +146,7 int action_reset(ccsdsTelecommandPacket_ | |||
|
146 | 146 | * |
|
147 | 147 | */ |
|
148 | 148 | |
|
149 |
|
|
|
149 | PRINTF("this is the end!!!\n") | |
|
150 | 150 | exit(0); |
|
151 | 151 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
152 | 152 | return LFR_DEFAULT; |
@@ -683,7 +683,7 int suspend_science_tasks() | |||
|
683 | 683 | |
|
684 | 684 | rtems_status_code status; |
|
685 | 685 | |
|
686 |
|
|
|
686 | PRINTF("in suspend_science_tasks\n") | |
|
687 | 687 | |
|
688 | 688 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); // suspend AVF0 |
|
689 | 689 | if ((status != RTEMS_SUCCESSFUL) && (status != RTEMS_ALREADY_SUSPENDED)) |
@@ -1134,14 +1134,14 void close_action(ccsdsTelecommandPacket | |||
|
1134 | 1134 | rtems_isr commutation_isr1( rtems_vector_number vector ) |
|
1135 | 1135 | { |
|
1136 | 1136 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
1137 |
|
|
|
1137 | PRINTF("In commutation_isr1 *** Error sending event to DUMB\n") | |
|
1138 | 1138 | } |
|
1139 | 1139 | } |
|
1140 | 1140 | |
|
1141 | 1141 | rtems_isr commutation_isr2( rtems_vector_number vector ) |
|
1142 | 1142 | { |
|
1143 | 1143 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
1144 |
|
|
|
1144 | PRINTF("In commutation_isr2 *** Error sending event to DUMB\n") | |
|
1145 | 1145 | } |
|
1146 | 1146 | } |
|
1147 | 1147 |
@@ -310,18 +310,6 int action_load_fbins_mask(ccsdsTelecomm | |||
|
310 | 310 | return flag; |
|
311 | 311 | } |
|
312 | 312 | |
|
313 | void printKCoefficients(unsigned int freq, unsigned int bin, float *k_coeff) | |
|
314 | { | |
|
315 | printf("freq = %d *** bin = %d *** (0) %f *** (1) %f *** (2) %f *** (3) %f *** (4) %f\n", | |
|
316 | freq, | |
|
317 | bin, | |
|
318 | k_coeff[ (bin*NB_K_COEFF_PER_BIN) + 0 ], | |
|
319 | k_coeff[ (bin*NB_K_COEFF_PER_BIN) + 1 ], | |
|
320 | k_coeff[ (bin*NB_K_COEFF_PER_BIN) + 2 ], | |
|
321 | k_coeff[ (bin*NB_K_COEFF_PER_BIN) + 3 ], | |
|
322 | k_coeff[ (bin*NB_K_COEFF_PER_BIN) + 4 ]); | |
|
323 | } | |
|
324 | ||
|
325 | 313 | int action_dump_kcoefficients(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
326 | 314 | { |
|
327 | 315 | /** This function updates the LFR registers with the incoming sbm2 parameters. |
@@ -348,10 +336,8 int action_dump_kcoefficients(ccsdsTelec | |||
|
348 | 336 | //********* |
|
349 | 337 | // PACKET 1 |
|
350 | 338 | // 11 F0 bins, 13 F1 bins and 6 F2 bins |
|
351 | kcoefficients_dump_1.packetSequenceControl[0] = (unsigned char) (sequenceCounterParameterDump >> 8); | |
|
352 | kcoefficients_dump_1.packetSequenceControl[1] = (unsigned char) (sequenceCounterParameterDump ); | |
|
353 | 339 | kcoefficients_dump_1.destinationID = TC->sourceID; |
|
354 | increment_seq_counter( &sequenceCounterParameterDump ); | |
|
340 | increment_seq_counter_destination_id_dump( kcoefficients_dump_1.packetSequenceControl, TC->sourceID ); | |
|
355 | 341 | for( freq=0; |
|
356 | 342 | freq<NB_BINS_COMPRESSED_SM_F0; |
|
357 | 343 | freq++ ) |
@@ -411,10 +397,8 int action_dump_kcoefficients(ccsdsTelec | |||
|
411 | 397 | //******** |
|
412 | 398 | // PACKET 2 |
|
413 | 399 | // 6 F2 bins |
|
414 | kcoefficients_dump_2.packetSequenceControl[0] = (unsigned char) (sequenceCounterParameterDump >> 8); | |
|
415 | kcoefficients_dump_2.packetSequenceControl[1] = (unsigned char) (sequenceCounterParameterDump ); | |
|
416 | 400 | kcoefficients_dump_2.destinationID = TC->sourceID; |
|
417 | increment_seq_counter( &sequenceCounterParameterDump ); | |
|
401 | increment_seq_counter_destination_id_dump( kcoefficients_dump_2.packetSequenceControl, TC->sourceID ); | |
|
418 | 402 | for( freq=0; freq<6; freq++ ) |
|
419 | 403 | { |
|
420 | 404 | kcoefficients_dump_2.kcoeff_blks[ freq*KCOEFF_BLK_SIZE + 1 ] = NB_BINS_COMPRESSED_SM_F0 + NB_BINS_COMPRESSED_SM_F1 + 6 + freq; |
@@ -462,12 +446,10 int action_dump_par( ccsdsTelecommandPac | |||
|
462 | 446 | |
|
463 | 447 | int status; |
|
464 | 448 | |
|
465 | // UPDATE TIME | |
|
466 | parameter_dump_packet.packetSequenceControl[0] = (unsigned char) (sequenceCounterParameterDump >> 8); | |
|
467 | parameter_dump_packet.packetSequenceControl[1] = (unsigned char) (sequenceCounterParameterDump ); | |
|
468 | increment_seq_counter( &sequenceCounterParameterDump ); | |
|
449 | increment_seq_counter_destination_id_dump( parameter_dump_packet.packetSequenceControl, TC->sourceID ); | |
|
469 | 450 | parameter_dump_packet.destinationID = TC->sourceID; |
|
470 | 451 | |
|
452 | // UPDATE TIME | |
|
471 | 453 | parameter_dump_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
472 | 454 | parameter_dump_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
473 | 455 | parameter_dump_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
@@ -897,7 +879,6 int set_sy_lfr_fbins( ccsdsTelecommandPa | |||
|
897 | 879 | { |
|
898 | 880 | unsigned char *auxPtr; |
|
899 | 881 | auxPtr = ¶meter_dump_packet.sy_lfr_fbins_f0_word1[k*NB_BYTES_PER_FBINS_MASK]; |
|
900 | printf("%x %x %x %x\n", auxPtr[0], auxPtr[1], auxPtr[2], auxPtr[3]); | |
|
901 | 882 | } |
|
902 | 883 | |
|
903 | 884 | |
@@ -961,8 +942,6 int set_sy_lfr_kcoeff( ccsdsTelecommandP | |||
|
961 | 942 | } |
|
962 | 943 | } |
|
963 | 944 | |
|
964 | printf("in set_sy_lfr_kcoeff *** freq = %d, bin = %d\n", sy_lfr_kcoeff_frequency, bin); | |
|
965 | ||
|
966 | 945 | if (kcoeffPtr_norm != NULL ) // update K coefficient for NORMAL data products |
|
967 | 946 | { |
|
968 | 947 | for (kcoeff=0; kcoeff<NB_K_COEFF_PER_BIN; kcoeff++) |
@@ -1143,33 +1122,80 void init_kcoefficients_dump_packet( Pac | |||
|
1143 | 1122 | } |
|
1144 | 1123 | } |
|
1145 | 1124 | |
|
1146 | void print_k_coeff() | |
|
1125 | void increment_seq_counter_destination_id_dump( unsigned char *packet_sequence_control, unsigned char destination_id ) | |
|
1147 | 1126 | { |
|
1148 | unsigned int kcoeff; | |
|
1149 | unsigned int bin; | |
|
1127 | /** This function increment the packet sequence control parameter of a TC, depending on its destination ID. | |
|
1128 | * | |
|
1129 | * @param packet_sequence_control points to the packet sequence control which will be incremented | |
|
1130 | * @param destination_id is the destination ID of the TM, there is one counter by destination ID | |
|
1131 | * | |
|
1132 | * If the destination ID is not known, a dedicated counter is incremented. | |
|
1133 | * | |
|
1134 | */ | |
|
1150 | 1135 | |
|
1151 | for (kcoeff=0; kcoeff<NB_K_COEFF_PER_BIN; kcoeff++) | |
|
1136 | unsigned short sequence_cnt; | |
|
1137 | unsigned short segmentation_grouping_flag; | |
|
1138 | unsigned short new_packet_sequence_control; | |
|
1139 | unsigned char i; | |
|
1140 | ||
|
1141 | switch (destination_id) | |
|
1152 | 1142 | { |
|
1153 | printf("kcoeff = %d *** ", kcoeff); | |
|
1154 | for (bin=0; bin<NB_BINS_COMPRESSED_SM_F0; bin++) | |
|
1155 |
|
|
|
1156 | printf( "%f ", k_coeff_intercalib_f0_norm[bin*NB_K_COEFF_PER_BIN+kcoeff] ); | |
|
1157 | } | |
|
1158 | printf("\n"); | |
|
1143 | case SID_TC_GROUND: | |
|
1144 | i = GROUND; | |
|
1145 | break; | |
|
1146 | case SID_TC_MISSION_TIMELINE: | |
|
1147 | i = MISSION_TIMELINE; | |
|
1148 | break; | |
|
1149 | case SID_TC_TC_SEQUENCES: | |
|
1150 | i = TC_SEQUENCES; | |
|
1151 | break; | |
|
1152 | case SID_TC_RECOVERY_ACTION_CMD: | |
|
1153 | i = RECOVERY_ACTION_CMD; | |
|
1154 | break; | |
|
1155 | case SID_TC_BACKUP_MISSION_TIMELINE: | |
|
1156 | i = BACKUP_MISSION_TIMELINE; | |
|
1157 | break; | |
|
1158 | case SID_TC_DIRECT_CMD: | |
|
1159 | i = DIRECT_CMD; | |
|
1160 | break; | |
|
1161 | case SID_TC_SPARE_GRD_SRC1: | |
|
1162 | i = SPARE_GRD_SRC1; | |
|
1163 | break; | |
|
1164 | case SID_TC_SPARE_GRD_SRC2: | |
|
1165 | i = SPARE_GRD_SRC2; | |
|
1166 | break; | |
|
1167 | case SID_TC_OBCP: | |
|
1168 | i = OBCP; | |
|
1169 | break; | |
|
1170 | case SID_TC_SYSTEM_CONTROL: | |
|
1171 | i = SYSTEM_CONTROL; | |
|
1172 | break; | |
|
1173 | case SID_TC_AOCS: | |
|
1174 | i = AOCS; | |
|
1175 | break; | |
|
1176 | case SID_TC_RPW_INTERNAL: | |
|
1177 | i = RPW_INTERNAL; | |
|
1178 | break; | |
|
1179 | default: | |
|
1180 | i = GROUND; | |
|
1181 | break; | |
|
1159 | 1182 | } |
|
1160 | 1183 | |
|
1161 | printf("\n"); | |
|
1184 | segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |
|
1185 | sequence_cnt = sequenceCounters_TM_DUMP[ i ] & 0x3fff; | |
|
1186 | ||
|
1187 | new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ; | |
|
1162 | 1188 | |
|
1163 | for (kcoeff=0; kcoeff<NB_K_COEFF_PER_BIN; kcoeff++) | |
|
1189 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |
|
1190 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |
|
1191 | ||
|
1192 | // increment the sequence counter | |
|
1193 | if ( sequenceCounters_TM_DUMP[ i ] < SEQ_CNT_MAX ) | |
|
1164 | 1194 | { |
|
1165 | printf("kcoeff = %d *** ", kcoeff); | |
|
1166 | for (bin=0; bin<NB_BINS_COMPRESSED_SM_F0; bin++) | |
|
1167 | { | |
|
1168 | printf( "[%f, %f] ", | |
|
1169 | k_coeff_intercalib_f0_sbm[(bin*NB_K_COEFF_PER_BIN )*2 + kcoeff], | |
|
1170 | k_coeff_intercalib_f0_sbm[(bin*NB_K_COEFF_PER_BIN+1)*2 + kcoeff]); | |
|
1171 | } | |
|
1172 | printf("\n"); | |
|
1195 | sequenceCounters_TM_DUMP[ i ] = sequenceCounters_TM_DUMP[ i ] + 1; | |
|
1196 | } | |
|
1197 | else | |
|
1198 | { | |
|
1199 | sequenceCounters_TM_DUMP[ i ] = 0; | |
|
1173 | 1200 | } |
|
1174 | 1201 | } |
|
1175 |
@@ -700,7 +700,9 rtems_task cwf1_task(rtems_task_argument | |||
|
700 | 700 | ring_node_to_send_cwf_f1->sid = SID_SBM1_CWF_F1; |
|
701 | 701 | status = rtems_message_queue_send( queue_id, &ring_node_to_send_cwf, sizeof( ring_node* ) ); |
|
702 | 702 | if (status != 0) |
|
703 | printf("cwf sending failed\n"); | |
|
703 | { | |
|
704 | PRINTF("cwf sending failed\n") | |
|
705 | } | |
|
704 | 706 | // launch snapshot extraction if needed |
|
705 | 707 | if (extractSWF == true) |
|
706 | 708 | { |
@@ -842,7 +844,6 int send_waveform_CWF3_light( ring_node | |||
|
842 | 844 | // SEND PACKET |
|
843 | 845 | status = rtems_message_queue_send( queue_id, &ring_node_cwf3_light, sizeof( ring_node* ) ); |
|
844 | 846 | if (status != RTEMS_SUCCESSFUL) { |
|
845 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); | |
|
846 | 847 | ret = LFR_DEFAULT; |
|
847 | 848 | } |
|
848 | 849 | |
@@ -1066,13 +1067,13 void snapshot_resynchronization( unsigne | |||
|
1066 | 1067 | { |
|
1067 | 1068 | deltaTickInF2 = floor( (deltaNext * 256. / 1000.) ); // the division by 2 is important here |
|
1068 | 1069 | waveform_picker_regs->delta_snapshot = waveform_picker_regs->delta_snapshot + deltaTickInF2; |
|
1069 |
|
|
|
1070 | PRINTF1("correction of = + %u\n", deltaTickInF2) | |
|
1070 | 1071 | } |
|
1071 | 1072 | else |
|
1072 | 1073 | { |
|
1073 | 1074 | deltaTickInF2 = floor( (deltaPrevious * 256. / 1000.) ); // the division by 2 is important here |
|
1074 | 1075 | waveform_picker_regs->delta_snapshot = waveform_picker_regs->delta_snapshot - deltaTickInF2; |
|
1075 |
|
|
|
1076 | PRINTF1("correction of = - %u\n", deltaTickInF2) | |
|
1076 | 1077 | } |
|
1077 | 1078 | } |
|
1078 | 1079 |
General Comments 0
You need to be logged in to leave comments.
Login now