FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_ctl.c @ 89:2a56451df569
l1_ctl.c: l1ctl_pgc2() reconstructed
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 07 Apr 2016 03:00:32 +0000 |
parents | 4a2ba7076906 |
children | 1bcd93a7c518 |
comparison
equal
deleted
inserted
replaced
88:4a2ba7076906 | 89:2a56451df569 |
---|---|
2219 WORD8 delta1_freq, delta2_freq; | 2219 WORD8 delta1_freq, delta2_freq; |
2220 WORD16 delta_high_drp_gain=0; | 2220 WORD16 delta_high_drp_gain=0; |
2221 WORD16 delta_low_drp_gain=0; | 2221 WORD16 delta_low_drp_gain=0; |
2222 WORD32 index; | 2222 WORD32 index; |
2223 UWORD16 g_magic; | 2223 UWORD16 g_magic; |
2224 UWORD16 arfcn; | 2224 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2225 UWORD16 arfcn; | |
2226 #endif | |
2225 UWORD16 dco_algo_ctl_pw_temp = 0; | 2227 UWORD16 dco_algo_ctl_pw_temp = 0; |
2226 UWORD8 if_ctl = 0; | 2228 UWORD8 if_ctl = 0; |
2227 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) | 2229 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2228 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2230 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2229 #endif | 2231 #endif |
2230 | 2232 |
2231 #if (L1_FF_MULTIBAND == 0) | 2233 #if (L1_FF_MULTIBAND == 0) |
2232 | 2234 |
2233 // initialize index | 2235 // initialize index |
2246 g_magic = l1ctl_get_g_magic(radio_freq); | 2248 g_magic = l1ctl_get_g_magic(radio_freq); |
2247 | 2249 |
2248 // lna_off was set to 0 during CTRL, so lna_value = 0 do not appear in the following | 2250 // lna_off was set to 0 during CTRL, so lna_value = 0 do not appear in the following |
2249 // formula. | 2251 // formula. |
2250 | 2252 |
2251 #if (L1_FF_MULTIBAND == 0) | 2253 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2254 #if (L1_FF_MULTIBAND == 0) | |
2252 arfcn = Convert_l1_radio_freq(radio_freq); | 2255 arfcn = Convert_l1_radio_freq(radio_freq); |
2253 #else | 2256 #else |
2254 arfcn=radio_freq; | 2257 arfcn = radio_freq; |
2255 #endif | 2258 #endif |
2259 #endif | |
2256 | 2260 |
2257 if ((0==pm_high_agc) || (0==pm_low_agc)) // Check and filter illegal pm value(s) by using last valid IL | 2261 if ((0==pm_high_agc) || (0==pm_low_agc)) // Check and filter illegal pm value(s) by using last valid IL |
2258 new_IL = l1a_l1s_com.last_input_level[index].input_level; | 2262 new_IL = l1a_l1s_com.last_input_level[index].input_level; |
2259 else | 2263 else |
2260 { | 2264 { |
2343 // setting the AGC for the next task. | 2347 // setting the AGC for the next task. |
2344 l1ctl_encode_lna((UWORD8)(current_calibrated_IL>>1), | 2348 l1ctl_encode_lna((UWORD8)(current_calibrated_IL>>1), |
2345 &(l1a_l1s_com.last_input_level[index].lna_off), | 2349 &(l1a_l1s_com.last_input_level[index].lna_off), |
2346 radio_freq); | 2350 radio_freq); |
2347 | 2351 |
2348 l1a_l1s_com.last_input_level[index].input_level = (UWORD8)new_IL; | 2352 l1a_l1s_com.last_input_level[index].input_level = (UWORD8)new_IL + |
2353 l1ctl_get_lna_att(radio_freq) * | |
2354 l1a_l1s_com.last_input_level[index].lna_off; | |
2349 } | 2355 } |
2350 | 2356 |
2351 | 2357 |
2352 /*-------------------------------------------------------*/ | 2358 /*-------------------------------------------------------*/ |
2353 /* l1ctl_find_max() */ | 2359 /* l1ctl_find_max() */ |