FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_ctl.c @ 88:4a2ba7076906
l1_ctl.c: l1ctl_pgc() reconstructed
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 07 Apr 2016 02:52:54 +0000 |
parents | 33c16c173666 |
children | 2a56451df569 |
comparison
equal
deleted
inserted
replaced
87:33c16c173666 | 88:4a2ba7076906 |
---|---|
2111 WORD32 last_known_agc; | 2111 WORD32 last_known_agc; |
2112 WORD32 current_IL, current_calibrated_IL; | 2112 WORD32 current_IL, current_calibrated_IL; |
2113 WORD8 delta1_freq, delta2_freq; | 2113 WORD8 delta1_freq, delta2_freq; |
2114 WORD16 delta_drp_gain=0; | 2114 WORD16 delta_drp_gain=0; |
2115 WORD32 index, lna_value; | 2115 WORD32 index, lna_value; |
2116 UWORD16 arfcn; | 2116 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2117 UWORD16 arfcn; | |
2118 #endif | |
2117 UWORD16 dco_algo_ctl_pw_temp = 0; | 2119 UWORD16 dco_algo_ctl_pw_temp = 0; |
2118 UWORD8 if_ctl = 0; | 2120 UWORD8 if_ctl = 0; |
2119 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) | 2121 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2120 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2122 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2121 #endif | 2123 #endif |
2122 | 2124 |
2123 #if (L1_FF_MULTIBAND == 0) | 2125 #if (L1_FF_MULTIBAND == 0) |
2124 | 2126 |
2125 // initialize index | 2127 // initialize index |
2140 // F7.1 in order to be compatible with | 2142 // F7.1 in order to be compatible with |
2141 // pm and IL formats [-20,+140 in F7.1] | 2143 // pm and IL formats [-20,+140 in F7.1] |
2142 // contain the input_level value we use | 2144 // contain the input_level value we use |
2143 // in the associated CTL task to build | 2145 // in the associated CTL task to build |
2144 // the agc used in this CTL. | 2146 // the agc used in this CTL. |
2145 #if (L1_FF_MULTIBAND == 0) | 2147 |
2148 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) | |
2149 #if (L1_FF_MULTIBAND == 0) | |
2146 arfcn = Convert_l1_radio_freq(radio_freq); | 2150 arfcn = Convert_l1_radio_freq(radio_freq); |
2147 #else | 2151 #else |
2148 arfcn=radio_freq; | 2152 arfcn = radio_freq; |
2149 #endif | 2153 #endif |
2154 #endif | |
2150 | 2155 |
2151 #if(RF_FAM == 61) | 2156 #if(RF_FAM == 61) |
2152 #if (CODE_VERSION != SIMULATION) | 2157 #if (CODE_VERSION != SIMULATION) |
2153 | 2158 |
2154 #if (PWMEAS_IF_MODE_FORCE == 0) | 2159 #if (PWMEAS_IF_MODE_FORCE == 0) |
2170 | 2175 |
2171 #endif | 2176 #endif |
2172 #endif | 2177 #endif |
2173 | 2178 |
2174 if (0==pm) // Check and filter illegal pm value by using last valid IL | 2179 if (0==pm) // Check and filter illegal pm value by using last valid IL |
2175 current_IL = l1a_l1s_com.last_input_level[index].input_level ; | 2180 current_IL = l1a_l1s_com.last_input_level[index].input_level - lna_value; |
2176 else | 2181 else |
2177 current_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq)); | 2182 current_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq)); |
2178 | 2183 |
2179 current_calibrated_IL = current_IL - delta1_freq - delta2_freq; | 2184 current_calibrated_IL = current_IL - delta1_freq - delta2_freq; |
2180 | 2185 |
2187 // we validate the measure and save input_level and lna_off fields | 2192 // we validate the measure and save input_level and lna_off fields |
2188 l1ctl_encode_lna((UWORD8)(current_calibrated_IL>>1), | 2193 l1ctl_encode_lna((UWORD8)(current_calibrated_IL>>1), |
2189 &(l1a_l1s_com.last_input_level[index].lna_off), | 2194 &(l1a_l1s_com.last_input_level[index].lna_off), |
2190 radio_freq); | 2195 radio_freq); |
2191 | 2196 |
2192 l1a_l1s_com.last_input_level[index].input_level = (UWORD8)current_IL; | 2197 l1a_l1s_com.last_input_level[index].input_level = (UWORD8)current_IL + |
2198 l1ctl_get_lna_att(radio_freq) * | |
2199 l1a_l1s_com.last_input_level[index].lna_off; | |
2193 | 2200 |
2194 return((UWORD8)current_calibrated_IL); | 2201 return((UWORD8)current_calibrated_IL); |
2195 } | 2202 } |
2196 | 2203 |
2197 | 2204 |