@@ -92,6 +92,7 int check_sy_lfr_filter_parameters( ccsd | |||
|
92 | 92 | int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id); |
|
93 | 93 | void copyFloatByChar( unsigned char *destination, unsigned char *source ); |
|
94 | 94 | void copyInt32ByChar( unsigned char *destination, unsigned char *source ); |
|
95 | void copyInt16ByChar( unsigned char *destination, unsigned char *source ); | |
|
95 | 96 | void floatToChar( float value, unsigned char* ptr); |
|
96 | 97 | |
|
97 | 98 | void init_parameter_dump( void ); |
@@ -408,7 +408,7 rtems_task avgv_task(rtems_task_argument | |||
|
408 | 408 | if (k == (MOVING_AVERAGE-1)) |
|
409 | 409 | { |
|
410 | 410 | k = 0; |
|
411 |
|
|
|
411 | PRINTF("tick\n"); | |
|
412 | 412 | } |
|
413 | 413 | else |
|
414 | 414 | { |
@@ -167,7 +167,7 rtems_task recv_task( rtems_task_argumen | |||
|
167 | 167 | } |
|
168 | 168 | else { |
|
169 | 169 | estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - PROTID_RES_APP); // => -3 is for Prot ID, Reserved and User App bytes |
|
170 |
|
|
|
170 | PRINTF1("incoming TC with Length (byte): %d\n", len - 3); | |
|
171 | 171 | currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> SHIFT_1_BYTE); |
|
172 | 172 | currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength ); |
|
173 | 173 | // CHECK THE TC |
@@ -177,17 +177,11 int action_enter_mode(ccsdsTelecommandPa | |||
|
177 | 177 | unsigned int transitionCoarseTime; |
|
178 | 178 | unsigned char * bytePosPtr; |
|
179 | 179 | |
|
180 | printf("(0)\n"); | |
|
181 | 180 | bytePosPtr = (unsigned char *) &TC->packetID; |
|
182 | printf("(1)\n"); | |
|
183 | 181 | requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ]; |
|
184 | printf("(2)\n"); | |
|
185 | 182 | copyInt32ByChar( (char*) &transitionCoarseTime, &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); |
|
186 | printf("(3)\n"); | |
|
187 | 183 | transitionCoarseTime = transitionCoarseTime & COARSE_TIME_MASK; |
|
188 | printf("(4)\n"); | |
|
189 | 184 | status = check_mode_value( requestedMode ); |
|
190 | printf("(5)\n"); | |
|
191 | 185 | |
|
192 | 186 | if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent |
|
193 | 187 | { |
@@ -684,8 +678,6 int enter_mode_normal( unsigned int tran | |||
|
684 | 678 | |
|
685 | 679 | status = RTEMS_UNSATISFIED; |
|
686 | 680 | |
|
687 | printf("hop\n"); | |
|
688 | ||
|
689 | 681 | switch( lfrCurrentMode ) |
|
690 | 682 | { |
|
691 | 683 | case LFR_MODE_STANDBY: |
@@ -1318,7 +1318,6 int set_sy_lfr_kcoeff( ccsdsTelecommandP | |||
|
1318 | 1318 | unsigned int kcoeff; |
|
1319 | 1319 | unsigned short sy_lfr_kcoeff_frequency; |
|
1320 | 1320 | unsigned short bin; |
|
1321 | unsigned short *freqPtr; | |
|
1322 | 1321 | float *kcoeffPtr_norm; |
|
1323 | 1322 | float *kcoeffPtr_sbm; |
|
1324 | 1323 | int status; |
@@ -1327,14 +1326,14 int set_sy_lfr_kcoeff( ccsdsTelecommandP | |||
|
1327 | 1326 | unsigned char *kcoeffSbmPtr_a; |
|
1328 | 1327 | unsigned char *kcoeffSbmPtr_b; |
|
1329 | 1328 | |
|
1330 | status = LFR_SUCCESSFUL; | |
|
1331 | ||
|
1329 | sy_lfr_kcoeff_frequency = 0; | |
|
1330 | bin = 0; | |
|
1332 | 1331 | kcoeffPtr_norm = NULL; |
|
1333 | 1332 | kcoeffPtr_sbm = NULL; |
|
1334 | bin = 0; | |
|
1333 | status = LFR_SUCCESSFUL; | |
|
1335 | 1334 | |
|
1336 | freqPtr = (unsigned short *) &TC->dataAndCRC[DATAFIELD_POS_SY_LFR_KCOEFF_FREQUENCY]; | |
|
1337 | sy_lfr_kcoeff_frequency = *freqPtr; | |
|
1335 | // copy the value of the frequency byte by byte DO NOT USE A SHORT* POINTER | |
|
1336 | copyInt16ByChar( (unsigned char*) &sy_lfr_kcoeff_frequency, &TC->dataAndCRC[DATAFIELD_POS_SY_LFR_KCOEFF_FREQUENCY] ); | |
|
1338 | 1337 | |
|
1339 | 1338 | if ( sy_lfr_kcoeff_frequency >= NB_BINS_COMPRESSED_SM ) |
|
1340 | 1339 | { |
@@ -1396,7 +1395,7 int set_sy_lfr_kcoeff( ccsdsTelecommandP | |||
|
1396 | 1395 | } |
|
1397 | 1396 | } |
|
1398 | 1397 | |
|
1399 |
|
|
|
1398 | //print_k_coeff(); | |
|
1400 | 1399 | |
|
1401 | 1400 | return status; |
|
1402 | 1401 | } |
@@ -1417,6 +1416,12 void copyInt32ByChar( unsigned char *des | |||
|
1417 | 1416 | destination[BYTE_3] = source[BYTE_3]; |
|
1418 | 1417 | } |
|
1419 | 1418 | |
|
1419 | void copyInt16ByChar( unsigned char *destination, unsigned char *source ) | |
|
1420 | { | |
|
1421 | destination[BYTE_0] = source[BYTE_0]; | |
|
1422 | destination[BYTE_1] = source[BYTE_1]; | |
|
1423 | } | |
|
1424 | ||
|
1420 | 1425 | void floatToChar( float value, unsigned char* ptr) |
|
1421 | 1426 | { |
|
1422 | 1427 | unsigned char* valuePtr; |
General Comments 0
You need to be logged in to leave comments.
Login now