##// END OF EJS Templates
minor updates
paul -
r285:bc5036e4a86c R3_plus draft
parent child
Show More
@@ -68,7 +68,7 void build_rw_fbins_masks();
68 68 int set_sy_lfr_fbins( ccsdsTelecommandPacket_t *TC );
69 69
70 70 // TC_LFR_LOAD_PARS_FILTER_PAR
71 int check_sy_lfr_pas_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
71 int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id );
72 72
73 73 // KCOEFFICIENTS
74 74 int set_sy_lfr_kcoeff(ccsdsTelecommandPacket_t *TC , rtems_id queue_id);
@@ -51,9 +51,9 rtems_task actn_task( rtems_task_argumen
51 51 result = LFR_SUCCESSFUL;
52 52 subtype = 0; // subtype of the current TC packet
53 53
54 BOOT_PRINTF("in ACTN *** \n")
54 BOOT_PRINTF("in ACTN *** \n");
55 55
56 while(1)
56 while(1)
57 57 {
58 58 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
59 59 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
@@ -323,7 +323,7 int action_load_filter_par(ccsdsTelecomm
323 323
324 324 flag = LFR_DEFAULT;
325 325
326 flag = check_sy_lfr_pas_filter_parameters( TC, queue_id );
326 flag = check_sy_lfr_filter_parameters( TC, queue_id );
327 327
328 328 if (flag == LFR_SUCCESSFUL)
329 329 {
@@ -907,57 +907,51 void getReactionWheelsFrequencies( ccsds
907 907 bytePosPtr = (unsigned char *) &TC->packetID;
908 908
909 909 // cp_rpw_sc_rw1_f1
910 floatPtr = (unsigned char *) &cp_rpw_sc_rw1_f1;
911 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F1 ];
912 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F1 + 1 ];
913 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F1 + 2 ];
914 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F1 + 3 ];
910 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw1_f1,
911 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F1 ] );
912
915 913 // cp_rpw_sc_rw1_f2
916 floatPtr = (unsigned char *) &cp_rpw_sc_rw1_f2;
917 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F2 ];
918 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F2 + 1 ];
919 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F2 + 2 ];
920 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F2 + 3 ];
914 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw1_f2,
915 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW1_F2 ] );
916
921 917 // cp_rpw_sc_rw2_f1
922 floatPtr = (unsigned char *) &cp_rpw_sc_rw2_f1;
923 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F1 ];
924 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F1 + 1 ];
925 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F1 + 2 ];
926 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F1 + 3 ];
918 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw2_f1,
919 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F1 ] );
920
927 921 // cp_rpw_sc_rw2_f2
928 floatPtr = (unsigned char *) &cp_rpw_sc_rw2_f2;
929 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F2 ];
930 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F2 + 1 ];
931 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F2 + 2 ];
932 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F2 + 3 ];
922 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw2_f2,
923 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW2_F2 ] );
924
933 925 // cp_rpw_sc_rw3_f1
934 floatPtr = (unsigned char *) &cp_rpw_sc_rw3_f1;
935 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F1 ];
936 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F1 + 1 ];
937 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F1 + 2 ];
938 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F1 + 3 ];
926 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw3_f1,
927 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F1 ] );
928
939 929 // cp_rpw_sc_rw3_f2
940 floatPtr = (unsigned char *) &cp_rpw_sc_rw3_f2;
941 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F2 ];
942 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F2 + 1 ];
943 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F2 + 2 ];
944 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F2 + 3 ];
930 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw3_f2,
931 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW3_F2 ] );
932
945 933 // cp_rpw_sc_rw4_f1
946 floatPtr = (unsigned char *) &cp_rpw_sc_rw4_f1;
947 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F1 ];
948 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F1 + 1 ];
949 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F1 + 2 ];
950 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F1 + 3 ];
934 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw4_f1,
935 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F1 ] );
936
951 937 // cp_rpw_sc_rw4_f2
952 floatPtr = (unsigned char *) &cp_rpw_sc_rw4_f2;
953 floatPtr[0] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F2 ];
954 floatPtr[1] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F2 + 1 ];
955 floatPtr[2] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F2 + 2 ];
956 floatPtr[3] = bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F2 + 3 ];
938 copyFloatByChar( (unsigned char*) &cp_rpw_sc_rw4_f2,
939 (unsigned char*) &bytePosPtr[ BYTE_POS_UPDATE_INFO_CP_RPW_SC_RW4_F2 ] );
957 940 }
958 941
959 942 void setFBinMask( unsigned char *fbins_mask, float freq, unsigned char deltaFreq, unsigned char flag )
960 943 {
944 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
945 *
946 * @param fbins_mask
947 * @param freq
948 * @param deltaFreq
949 * @param flag [true] filtering enabled [false] filtering disabled
950 *
951 * @return void
952 *
953 */
954
961 955 unsigned int fBelow;
962 956
963 957 // compute the index of the frequency immediately below the reaction wheel frequency
@@ -1005,7 +999,7 void build_rw_fbins_mask( unsigned int c
1005 999 }
1006 1000
1007 1001 // RW1 F1
1008 // setFBinMask( rw_fbins_mask, fBelow );
1002 setFBinMask( rw_fbins_mask, fBelow );
1009 1003
1010 1004 // RW1 F2
1011 1005
@@ -1068,7 +1062,7 int set_sy_lfr_fbins( ccsdsTelecommandPa
1068 1062 //***************************
1069 1063 // TC_LFR_LOAD_PAS_FILTER_PAR
1070 1064
1071 int check_sy_lfr_pas_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
1065 int check_sy_lfr_filter_parameters( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
1072 1066 {
1073 1067 int flag;
1074 1068 rtems_status_code status;
@@ -1077,39 +1071,81 int check_sy_lfr_pas_filter_parameters(
1077 1071 unsigned char sy_lfr_pas_filter_modulus;
1078 1072 float sy_lfr_pas_filter_tbad;
1079 1073 unsigned char sy_lfr_pas_filter_offset;
1080 float sy_lfr_pas_filtershift;
1074 float sy_lfr_pas_filter_shift;
1081 1075 float sy_lfr_sc_rw_delta_f;
1076 char *parPtr;
1082 1077
1083 1078 flag = LFR_SUCCESSFUL;
1079 sy_lfr_pas_filter_tbad = 0.0;
1080 sy_lfr_pas_filter_shift = 0.0;
1081 sy_lfr_sc_rw_delta_f = 0.0;
1082 parPtr = NULL;
1084 1083
1085 1084 //***************
1086 1085 // get parameters
1087 sy_lfr_pas_filter_enabled = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_ENABLED ] & 0x01; // [0000 0001]
1088 sy_lfr_pas_filter_modulus = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_MODULUS ];
1089
1090 sy_lfr_pas_filter_offset = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_OFFSET ];
1086 sy_lfr_pas_filter_enabled = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_ENABLED ] & 0x01; // [0000 0001]
1087 sy_lfr_pas_filter_modulus = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_MODULUS ];
1088 copyFloatByChar(
1089 (char*) &sy_lfr_pas_filter_tbad,
1090 (char*) &TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_TBAD ]
1091 );
1092 sy_lfr_pas_filter_offset = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_OFFSET ];
1093 copyFloatByChar(
1094 (char*) &sy_lfr_pas_filter_shift,
1095 (char*) &TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_PAS_FILTER_SHIFT ]
1096 );
1097 copyFloatByChar(
1098 (char*) &sy_lfr_sc_rw_delta_f,
1099 (char*) &TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F ]
1100 );
1091 1101
1092 1102 //******************
1093 // check consistency
1103 // CHECK CONSISTENCY
1104
1105 //**************************
1094 1106 // sy_lfr_pas_filter_enabled
1107 // nothing to check, value is 0 or 1
1108
1109 //**************************
1095 1110 // sy_lfr_pas_filter_modulus
1096 1111 if ( (sy_lfr_pas_filter_modulus < 4) || (sy_lfr_pas_filter_modulus > 8) )
1097 1112 {
1098 1113 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_PAS_FILTER_MODULUS+10, sy_lfr_pas_filter_modulus );
1099 1114 flag = WRONG_APP_DATA;
1100 1115 }
1116
1117 //***********************
1101 1118 // sy_lfr_pas_filter_tbad
1119 if ( (sy_lfr_pas_filter_tbad < 0.0) || (sy_lfr_pas_filter_tbad > 4.0) )
1120 {
1121 parPtr = (char*) &sy_lfr_pas_filter_tbad;
1122 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_PAS_FILTER_TBAD+10, parPtr[3] );
1123 flag = WRONG_APP_DATA;
1124 }
1125
1126 //*************************
1102 1127 // sy_lfr_pas_filter_offset
1103 1128 if (flag == LFR_SUCCESSFUL)
1104 1129 {
1105 if (sy_lfr_pas_filter_offset > 7)
1130 if ( (sy_lfr_pas_filter_offset < 0) || (sy_lfr_pas_filter_offset > 7) )
1106 1131 {
1107 1132 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_PAS_FILTER_OFFSET+10, sy_lfr_pas_filter_offset );
1108 1133 flag = WRONG_APP_DATA;
1109 1134 }
1110 1135 }
1111 // sy_lfr_pas_filtershift
1136
1137 //************************
1138 // sy_lfr_pas_filter_shift
1139 if ( (sy_lfr_pas_filter_shift < 0.0) || (sy_lfr_pas_filter_shift > 1.0) )
1140 {
1141 parPtr = (char*) &sy_lfr_pas_filter_shift;
1142 status = send_tm_lfr_tc_exe_inconsistent( TC, queue_id, DATAFIELD_POS_SY_LFR_PAS_FILTER_SHIFT+10, parPtr[3] );
1143 flag = WRONG_APP_DATA;
1144 }
1145
1146 //*********************
1112 1147 // sy_lfr_sc_rw_delta_f
1148 // nothing to check, no default value in the ICD
1113 1149
1114 1150 return flag;
1115 1151 }
@@ -85,7 +85,7 int send_tm_lfr_tc_exe_inconsistent( ccs
85 85 * @param TC points to the TeleCommand packet that is being processed
86 86 * @param queue_id is the id of the queue which handles TM
87 87 * @param byte_position is the byte position of the MSB of the parameter that has been seen as inconsistent
88 * @param rcv_value is the value of the LSB of the parameter that has been deteced as inconsistent
88 * @param rcv_value is the value of the LSB of the parameter that has been detected as inconsistent
89 89 *
90 90 * @return RTEMS directive status code:
91 91 * - RTEMS_SUCCESSFUL - message sent successfully
General Comments 0
You need to be logged in to leave comments. Login now