##// END OF EJS Templates
alignment added to variables initialized by memset...
paul -
r331:a05d13cb0957 R3_plus draft
parent child
Show More
@@ -91,6 +91,7 int check_sy_lfr_filter_parameters( ccsd
91 // KCOEFFICIENTS
91 // KCOEFFICIENTS
92 int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id);
92 int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id);
93 void copyFloatByChar( unsigned char *destination, unsigned char *source );
93 void copyFloatByChar( unsigned char *destination, unsigned char *source );
94 void copyInt32ByChar( unsigned char *destination, unsigned char *source );
94 void floatToChar( float value, unsigned char* ptr);
95 void floatToChar( float value, unsigned char* ptr);
95
96
96 void init_parameter_dump( void );
97 void init_parameter_dump( void );
@@ -124,7 +124,7 rtems_task recv_task( rtems_task_argumen
124 */
124 */
125
125
126 int len;
126 int len;
127 ccsdsTelecommandPacket_t currentTC;
127 ccsdsTelecommandPacket_t __attribute__((aligned(4))) currentTC;
128 unsigned char computed_CRC[ BYTES_PER_CRC ];
128 unsigned char computed_CRC[ BYTES_PER_CRC ];
129 unsigned char currentTC_LEN_RCV[ BYTES_PER_PKT_LEN ];
129 unsigned char currentTC_LEN_RCV[ BYTES_PER_PKT_LEN ];
130 unsigned char destinationID;
130 unsigned char destinationID;
@@ -167,7 +167,7 rtems_task recv_task( rtems_task_argumen
167 }
167 }
168 else {
168 else {
169 estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - PROTID_RES_APP); // => -3 is for Prot ID, Reserved and User App bytes
169 estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - PROTID_RES_APP); // => -3 is for Prot ID, Reserved and User App bytes
170 //PRINTF1("incoming TC with Length (byte): %d\n", len - 3);
170 // PRINTF1("incoming TC with Length (byte): %d\n", len - 3);
171 currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> SHIFT_1_BYTE);
171 currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> SHIFT_1_BYTE);
172 currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength );
172 currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength );
173 // CHECK THE TC
173 // CHECK THE TC
@@ -190,10 +190,10 rtems_task prc0_task( rtems_task_argumen
190 rtems_status_code status;
190 rtems_status_code status;
191 rtems_id queue_id;
191 rtems_id queue_id;
192 rtems_id queue_id_q_p0;
192 rtems_id queue_id_q_p0;
193 bp_packet_with_spare packet_norm_bp1;
193 bp_packet_with_spare __attribute__((aligned(4))) packet_norm_bp1;
194 bp_packet packet_norm_bp2;
194 bp_packet __attribute__((aligned(4))) packet_norm_bp2;
195 bp_packet packet_sbm_bp1;
195 bp_packet __attribute__((aligned(4))) packet_sbm_bp1;
196 bp_packet packet_sbm_bp2;
196 bp_packet __attribute__((aligned(4))) packet_sbm_bp2;
197 ring_node *current_ring_node_to_send_asm_f0;
197 ring_node *current_ring_node_to_send_asm_f0;
198 float nbSMInASMNORM;
198 float nbSMInASMNORM;
199 float nbSMInASMSBM;
199 float nbSMInASMSBM;
@@ -191,10 +191,10 rtems_task prc1_task( rtems_task_argumen
191 rtems_status_code status;
191 rtems_status_code status;
192 rtems_id queue_id_send;
192 rtems_id queue_id_send;
193 rtems_id queue_id_q_p1;
193 rtems_id queue_id_q_p1;
194 bp_packet_with_spare packet_norm_bp1;
194 bp_packet_with_spare __attribute__((aligned(4))) packet_norm_bp1;
195 bp_packet packet_norm_bp2;
195 bp_packet __attribute__((aligned(4))) packet_norm_bp2;
196 bp_packet packet_sbm_bp1;
196 bp_packet __attribute__((aligned(4))) packet_sbm_bp1;
197 bp_packet packet_sbm_bp2;
197 bp_packet __attribute__((aligned(4))) packet_sbm_bp2;
198 ring_node *current_ring_node_to_send_asm_f1;
198 ring_node *current_ring_node_to_send_asm_f1;
199 float nbSMInASMNORM;
199 float nbSMInASMNORM;
200 float nbSMInASMSBM;
200 float nbSMInASMSBM;
@@ -139,8 +139,8 rtems_task prc2_task( rtems_task_argumen
139 rtems_status_code status;
139 rtems_status_code status;
140 rtems_id queue_id_send;
140 rtems_id queue_id_send;
141 rtems_id queue_id_q_p2;
141 rtems_id queue_id_q_p2;
142 bp_packet packet_norm_bp1;
142 bp_packet __attribute__((aligned(4))) packet_norm_bp1;
143 bp_packet packet_norm_bp2;
143 bp_packet __attribute__((aligned(4))) packet_norm_bp2;
144 ring_node *current_ring_node_to_send_asm_f2;
144 ring_node *current_ring_node_to_send_asm_f2;
145 float nbSMInASMNORM;
145 float nbSMInASMNORM;
146
146
@@ -29,7 +29,7 rtems_task actn_task( rtems_task_argumen
29
29
30 int result;
30 int result;
31 rtems_status_code status; // RTEMS status code
31 rtems_status_code status; // RTEMS status code
32 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
32 ccsdsTelecommandPacket_t __attribute__((aligned(4))) TC; // TC sent to the ACTN task
33 size_t size; // size of the incoming TC packet
33 size_t size; // size of the incoming TC packet
34 unsigned char subtype; // subtype of the current TC packet
34 unsigned char subtype; // subtype of the current TC packet
35 unsigned char time[BYTES_PER_TIME];
35 unsigned char time[BYTES_PER_TIME];
@@ -178,13 +178,17 int action_enter_mode(ccsdsTelecommandPa
178 unsigned int transitionCoarseTime;
178 unsigned int transitionCoarseTime;
179 unsigned char * bytePosPtr;
179 unsigned char * bytePosPtr;
180
180
181 printf("(0)\n");
181 bytePosPtr = (unsigned char *) &TC->packetID;
182 bytePosPtr = (unsigned char *) &TC->packetID;
182
183 printf("(1)\n");
183 requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ];
184 requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ];
184 transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] );
185 printf("(2)\n");
185 transitionCoarseTime = (*transitionCoarseTime_ptr) & COARSE_TIME_MASK;
186 copyInt32ByChar( &transitionCoarseTime, &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] );
186
187 printf("(3)\n");
188 transitionCoarseTime = transitionCoarseTime & COARSE_TIME_MASK;
189 printf("(4)\n");
187 status = check_mode_value( requestedMode );
190 status = check_mode_value( requestedMode );
191 printf("(5)\n");
188
192
189 if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent
193 if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent
190 {
194 {
@@ -681,6 +685,8 int enter_mode_normal( unsigned int tran
681
685
682 status = RTEMS_UNSATISFIED;
686 status = RTEMS_UNSATISFIED;
683
687
688 printf("hop\n");
689
684 switch( lfrCurrentMode )
690 switch( lfrCurrentMode )
685 {
691 {
686 case LFR_MODE_STANDBY:
692 case LFR_MODE_STANDBY:
@@ -1409,6 +1409,14 void copyFloatByChar( unsigned char *des
1409 destination[BYTE_3] = source[BYTE_3];
1409 destination[BYTE_3] = source[BYTE_3];
1410 }
1410 }
1411
1411
1412 void copyInt32ByChar( unsigned char *destination, unsigned char *source )
1413 {
1414 destination[BYTE_0] = source[BYTE_0];
1415 destination[BYTE_1] = source[BYTE_1];
1416 destination[BYTE_2] = source[BYTE_2];
1417 destination[BYTE_3] = source[BYTE_3];
1418 }
1419
1412 void floatToChar( float value, unsigned char* ptr)
1420 void floatToChar( float value, unsigned char* ptr)
1413 {
1421 {
1414 unsigned char* valuePtr;
1422 unsigned char* valuePtr;
General Comments 0
You need to be logged in to leave comments. Login now