@@ -109,6 +109,7 int check_sy_lfr_filter_parameters( ccsd | |||
|
109 | 109 | int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id); |
|
110 | 110 | void copyFloatByChar( unsigned char *destination, unsigned char *source ); |
|
111 | 111 | void copyInt32ByChar( unsigned char *destination, unsigned char *source ); |
|
112 | void copyInt16ByChar( unsigned char *destination, unsigned char *source ); | |
|
112 | 113 | void floatToChar( float value, unsigned char* ptr); |
|
113 | 114 | |
|
114 | 115 | void init_parameter_dump( void ); |
@@ -421,7 +421,7 rtems_task avgv_task(rtems_task_argument | |||
|
421 | 421 | if (k == (MOVING_AVERAGE-1)) |
|
422 | 422 | { |
|
423 | 423 | k = 0; |
|
424 |
|
|
|
424 | PRINTF("tick\n"); | |
|
425 | 425 | } |
|
426 | 426 | else |
|
427 | 427 | { |
@@ -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 | { |
@@ -685,8 +679,6 int enter_mode_normal( unsigned int tran | |||
|
685 | 679 | |
|
686 | 680 | status = RTEMS_UNSATISFIED; |
|
687 | 681 | |
|
688 | printf("hop\n"); | |
|
689 | ||
|
690 | 682 | switch( lfrCurrentMode ) |
|
691 | 683 | { |
|
692 | 684 | case LFR_MODE_STANDBY: |
@@ -1420,7 +1420,6 int set_sy_lfr_kcoeff( ccsdsTelecommandP | |||
|
1420 | 1420 | unsigned int kcoeff; |
|
1421 | 1421 | unsigned short sy_lfr_kcoeff_frequency; |
|
1422 | 1422 | unsigned short bin; |
|
1423 | unsigned short *freqPtr; | |
|
1424 | 1423 | float *kcoeffPtr_norm; |
|
1425 | 1424 | float *kcoeffPtr_sbm; |
|
1426 | 1425 | int status; |
@@ -1429,14 +1428,15 int set_sy_lfr_kcoeff( ccsdsTelecommandP | |||
|
1429 | 1428 | unsigned char *kcoeffSbmPtr_a; |
|
1430 | 1429 | unsigned char *kcoeffSbmPtr_b; |
|
1431 | 1430 | |
|
1432 | status = LFR_SUCCESSFUL; | |
|
1433 | ||
|
1431 | sy_lfr_kcoeff_frequency = 0; | |
|
1432 | bin = 0; | |
|
1434 | 1433 | kcoeffPtr_norm = NULL; |
|
1435 | 1434 | kcoeffPtr_sbm = NULL; |
|
1436 | bin = 0; | |
|
1435 | status = LFR_SUCCESSFUL; | |
|
1437 | 1436 | |
|
1438 | freqPtr = (unsigned short *) &TC->dataAndCRC[DATAFIELD_POS_SY_LFR_KCOEFF_FREQUENCY]; | |
|
1439 | sy_lfr_kcoeff_frequency = *freqPtr; | |
|
1437 | // copy the value of the frequency byte by byte DO NOT USE A SHORT* POINTER | |
|
1438 | copyInt16ByChar( (unsigned char*) &sy_lfr_kcoeff_frequency, &TC->dataAndCRC[DATAFIELD_POS_SY_LFR_KCOEFF_FREQUENCY] ); | |
|
1439 | ||
|
1440 | 1440 | |
|
1441 | 1441 | if ( sy_lfr_kcoeff_frequency >= NB_BINS_COMPRESSED_SM ) |
|
1442 | 1442 | { |
@@ -1519,6 +1519,12 void copyInt32ByChar( unsigned char *des | |||
|
1519 | 1519 | destination[BYTE_3] = source[BYTE_3]; |
|
1520 | 1520 | } |
|
1521 | 1521 | |
|
1522 | void copyInt16ByChar( unsigned char *destination, unsigned char *source ) | |
|
1523 | { | |
|
1524 | destination[BYTE_0] = source[BYTE_0]; | |
|
1525 | destination[BYTE_1] = source[BYTE_1]; | |
|
1526 | } | |
|
1527 | ||
|
1522 | 1528 | void floatToChar( float value, unsigned char* ptr) |
|
1523 | 1529 | { |
|
1524 | 1530 | unsigned char* valuePtr; |
General Comments 0
You need to be logged in to leave comments.
Login now