@@ -22,7 +22,7 SWVERSION=-1-0 | |||
|
22 | 22 | DEFINES += SW_VERSION_N1=3 # major |
|
23 | 23 | DEFINES += SW_VERSION_N2=1 # minor |
|
24 | 24 | DEFINES += SW_VERSION_N3=0 # patch |
|
25 |
DEFINES += SW_VERSION_N4= |
|
|
25 | DEFINES += SW_VERSION_N4=3 # internal | |
|
26 | 26 | |
|
27 | 27 | # <GCOV> |
|
28 | 28 | #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage |
@@ -158,7 +158,7 rtems_task recv_task( rtems_task_argumen | |||
|
158 | 158 | PRINTF("in RECV *** packet lenght too short\n") |
|
159 | 159 | } |
|
160 | 160 | else { |
|
161 | PRINTF1("incoming TC with len: %d\n", len); | |
|
161 | // PRINTF1("incoming TC with len: %d\n", len); | |
|
162 | 162 | estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes |
|
163 | 163 | currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> 8); |
|
164 | 164 | currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength ); |
@@ -972,39 +972,114 void setFBinMask( unsigned char *fbins_m | |||
|
972 | 972 | * |
|
973 | 973 | */ |
|
974 | 974 | |
|
975 | float fmin; | |
|
976 | float fMAX; | |
|
975 | float f_RW_min; | |
|
976 | float f_RW_MAX; | |
|
977 | float fi_min; | |
|
978 | float fi_MAX; | |
|
979 | float fi; | |
|
980 | float deltaBelow; | |
|
981 | float deltaAbove; | |
|
977 | 982 | int binBelow; |
|
978 | 983 | int binAbove; |
|
984 | int closestBin; | |
|
979 | 985 | unsigned int whichByte; |
|
980 |
|
|
|
986 | int selectedByte; | |
|
981 | 987 | int bin; |
|
988 | int binToRemove[3]; | |
|
989 | int k; | |
|
982 | 990 | |
|
983 | 991 | whichByte = 0; |
|
984 | 992 | bin = 0; |
|
985 | 993 | |
|
994 | binToRemove[0] = -1; | |
|
995 | binToRemove[1] = -1; | |
|
996 | binToRemove[2] = -1; | |
|
997 | ||
|
986 | 998 | // compute the frequency range to filter [ rw_f - delta_f/2; rw_f + delta_f/2 ] |
|
987 | fmin = rw_f - filterPar.sy_lfr_sc_rw_delta_f / 2.; | |
|
988 | fMAX = rw_f + filterPar.sy_lfr_sc_rw_delta_f / 2.; | |
|
999 | f_RW_min = rw_f - filterPar.sy_lfr_sc_rw_delta_f / 2.; | |
|
1000 | f_RW_MAX = rw_f + filterPar.sy_lfr_sc_rw_delta_f / 2.; | |
|
1001 | ||
|
1002 | // compute the index of the frequency bin immediately below rw_f | |
|
1003 | binBelow = (int) ( floor( ((double) rw_f) / ((double) deltaFreq)) ); | |
|
1004 | deltaBelow = rw_f - binBelow * deltaFreq; | |
|
1005 | ||
|
1006 | // compute the index of the frequency bin immediately above rw_f | |
|
1007 | binAbove = (int) ( ceil( ((double) rw_f) / ((double) deltaFreq)) ); | |
|
1008 | deltaAbove = binAbove * deltaFreq - rw_f; | |
|
989 | 1009 | |
|
990 | // compute the index of the frequency bin immediately below fmin | |
|
991 | binBelow = (int) ( floor( ((double) fmin) / ((double) deltaFreq)) ); | |
|
1010 | // search the closest bin | |
|
1011 | if (deltaAbove > deltaBelow) | |
|
1012 | { | |
|
1013 | closestBin = binBelow; | |
|
1014 | } | |
|
1015 | else | |
|
1016 | { | |
|
1017 | closestBin = binAbove; | |
|
1018 | } | |
|
1019 | ||
|
1020 | // compute the fi interval [fi - Delta_f * 0.285, fi + Delta_f * 0.285] | |
|
1021 | fi = closestBin * deltaFreq; | |
|
992 | 1022 | |
|
993 | // compute the index of the frequency bin immediately above fMAX | |
|
994 | binAbove = (int) ( floor( ((double) fMAX) / ((double) deltaFreq)) ); | |
|
1023 | fi_min = fi - (deltaFreq * 0.285); | |
|
1024 | if ( fi_min < 0 ) | |
|
1025 | { | |
|
1026 | fi_min = 0; | |
|
1027 | } | |
|
1028 | else if ( fi_min > (deltaFreq*127) ) | |
|
1029 | { | |
|
1030 | fi_min = -1; | |
|
1031 | } | |
|
1032 | ||
|
1033 | fi_MAX = fi + (deltaFreq * 0.285); | |
|
1034 | if ( fi_MAX > (deltaFreq*127) ) | |
|
1035 | { | |
|
1036 | fi_MAX = -1; | |
|
1037 | } | |
|
995 | 1038 | |
|
996 | for (bin = binBelow; bin <= binAbove; bin++) | |
|
1039 | // 1. IF [ f_RW_min, f_RW_MAX] is included in [ fi_min; fi_MAX ] | |
|
1040 | // => remove f_(i), f_(i-1) and f_(i+1) | |
|
1041 | if ( ( f_RW_min > fi_min ) && ( f_RW_MAX < fi_MAX ) ) | |
|
997 | 1042 | { |
|
998 | if ( (bin >= 0) && (bin<=127) ) | |
|
1043 | binToRemove[0] = closestBin - 1; | |
|
1044 | binToRemove[1] = closestBin; | |
|
1045 | binToRemove[2] = closestBin + 1; | |
|
1046 | } | |
|
1047 | // 2. ELSE | |
|
1048 | // => remove the two f_(i) which are around f_RW | |
|
1049 | else | |
|
1050 | { | |
|
1051 | binToRemove[0] = binBelow; | |
|
1052 | binToRemove[1] = binAbove; | |
|
1053 | binToRemove[2] = -1; | |
|
1054 | } | |
|
1055 | ||
|
1056 | for (k = 0; k <= 3; k++) | |
|
1057 | { | |
|
1058 | bin = binToRemove[k]; | |
|
1059 | if ( (bin >= 0) && (bin <= 127) ) | |
|
999 | 1060 | { |
|
1000 | 1061 | if (flag == 1) |
|
1001 | 1062 | { |
|
1002 | whichByte = bin >> 3; // division by 8 | |
|
1003 |
selectedByte = |
|
|
1004 | fbins_mask[whichByte] = fbins_mask[whichByte] & (~selectedByte); | |
|
1063 | whichByte = (bin >> 3); // division by 8 | |
|
1064 | selectedByte = ( 1 << (bin - (whichByte * 8)) ); | |
|
1065 | ||
|
1066 | printf("whichByte = %d, bin = %d, selectedByte = %x (%x)\n", whichByte, bin, selectedByte, ~selectedByte); | |
|
1067 | ||
|
1068 | fbins_mask[15 - whichByte] = fbins_mask[15 - whichByte] & ((unsigned char) (~selectedByte)); // bytes are ordered MSB first in the packets | |
|
1005 | 1069 | } |
|
1006 | 1070 | } |
|
1007 | 1071 | } |
|
1072 | ||
|
1073 | if (flag == 1) | |
|
1074 | { | |
|
1075 | printf("fi = %f, fi_min = %f, fi_MAX = %f\n", fi, fi_min, fi_MAX); | |
|
1076 | printf("deltaFreq = %d, flag = %d, rw_f = %f, f_RW_min = %f, f_RW_MAX = %f\n", deltaFreq, flag, rw_f, f_RW_min, f_RW_MAX); | |
|
1077 | printf("%x %x %x %x ** %x %x %x %x ** %x %x %x %x ** %x %x %x %x\n\n", fbins_mask[0], fbins_mask[1], fbins_mask[2], fbins_mask[3], | |
|
1078 | fbins_mask[4], fbins_mask[5], fbins_mask[6], fbins_mask[7], | |
|
1079 | fbins_mask[8], fbins_mask[9], fbins_mask[10], fbins_mask[11], | |
|
1080 | fbins_mask[12], fbins_mask[13], fbins_mask[14], fbins_mask[15]); | |
|
1081 | } | |
|
1082 | ||
|
1008 | 1083 | } |
|
1009 | 1084 | |
|
1010 | 1085 | void build_sy_lfr_rw_mask( unsigned int channel ) |
@@ -1064,7 +1139,7 void build_sy_lfr_rw_mask( unsigned int | |||
|
1064 | 1139 | setFBinMask( local_rw_fbins_mask, cp_rpw_sc_rw4_f1, deltaF, (cp_rpw_sc_rw_f_flags & 0x02) >> 1 ); // [0000 0010] |
|
1065 | 1140 | |
|
1066 | 1141 | // RW4 F2 |
|
1067 |
setFBinMask( local_rw_fbins_mask, cp_rpw_sc_rw |
|
|
1142 | setFBinMask( local_rw_fbins_mask, cp_rpw_sc_rw4_f2, deltaF, (cp_rpw_sc_rw_f_flags & 0x01) ); // [0000 0001] | |
|
1068 | 1143 | |
|
1069 | 1144 | // update the value of the fbins related to reaction wheels frequency filtering |
|
1070 | 1145 | if (maskPtr != NULL) |
General Comments 0
You need to be logged in to leave comments.
Login now