FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_ctl.c @ 81:6124f48fc1fa
l1_ctl.c: fixes from the freecalypso-sw/gsm-fw version
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Tue, 29 Mar 2016 16:06:07 +0000 |
parents | 6c740cf30da3 |
children | ef6cf21cf9d6 |
comparison
equal
deleted
inserted
replaced
80:6c740cf30da3 | 81:6124f48fc1fa |
---|---|
115 | 115 |
116 #if TESTMODE | 116 #if TESTMODE |
117 #include "l1tm_msgty.h" | 117 #include "l1tm_msgty.h" |
118 #include "l1tm_varex.h" | 118 #include "l1tm_varex.h" |
119 #endif | 119 #endif |
120 #if (OP_L1_STANDALONE == 1) | |
121 #ifdef _INLINE | 120 #ifdef _INLINE |
122 #define INLINE static inline // Inline functions when -v option is set | 121 #define INLINE static inline // Inline functions when -v option is set |
123 #else // when the compiler is ivoked. | 122 #else // when the compiler is ivoked. |
124 #define INLINE | 123 #define INLINE |
125 #endif | 124 #endif |
126 #endif //omaps00090550 | |
127 #endif | 125 #endif |
128 | 126 |
129 #if(RF_FAM == 61) | 127 #if(RF_FAM == 61) |
130 #include "l1_rf61.h" | 128 #include "l1_rf61.h" |
131 #endif | 129 #endif |
132 | 130 |
133 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) | 131 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
134 #include "l1_trace.h" | 132 #include "l1_trace.h" |
135 #endif | 133 #endif |
136 | 134 |
137 extern SYS_UWORD16 Convert_l1_radio_freq(SYS_UWORD16 radio_freq); | 135 extern SYS_UWORD16 Convert_l1_radio_freq(SYS_UWORD16 radio_freq); |
136 #if(RF_FAM == 61) | |
138 extern WORD16 drp_gain_correction(UWORD16 arfcn, UWORD8 lna_off, UWORD16 agc); | 137 extern WORD16 drp_gain_correction(UWORD16 arfcn, UWORD8 lna_off, UWORD16 agc); |
139 | 138 #endif |
140 | 139 |
141 #define LNA_OFF 1 | 140 #define LNA_OFF 1 |
142 #define LNA_ON 0 | 141 #define LNA_ON 0 |
143 | 142 |
144 | 143 |
1933 UWORD32 index; | 1932 UWORD32 index; |
1934 UWORD16 g_magic; | 1933 UWORD16 g_magic; |
1935 UWORD16 arfcn; | 1934 UWORD16 arfcn; |
1936 UWORD16 dco_algo_ctl_pw_temp = 0; | 1935 UWORD16 dco_algo_ctl_pw_temp = 0; |
1937 UWORD8 if_ctl = 0; | 1936 UWORD8 if_ctl = 0; |
1938 #if (CODE_VERSION != SIMULATION) | 1937 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
1939 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 1938 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
1940 #endif | 1939 #endif |
1941 | 1940 |
1942 #if (L1_FF_MULTIBAND == 0) | 1941 #if (L1_FF_MULTIBAND == 0) |
1943 | 1942 |
1944 // initialize index | 1943 // initialize index |
1945 index = radio_freq - l1_config.std.radio_freq_index_offset; | 1944 index = radio_freq - l1_config.std.radio_freq_index_offset; |
2117 WORD16 delta_drp_gain=0; | 2116 WORD16 delta_drp_gain=0; |
2118 WORD32 index, lna_value; | 2117 WORD32 index, lna_value; |
2119 UWORD16 arfcn; | 2118 UWORD16 arfcn; |
2120 UWORD16 dco_algo_ctl_pw_temp = 0; | 2119 UWORD16 dco_algo_ctl_pw_temp = 0; |
2121 UWORD8 if_ctl = 0; | 2120 UWORD8 if_ctl = 0; |
2122 #if (CODE_VERSION != SIMULATION) | 2121 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2123 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2122 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2124 #endif | 2123 #endif |
2125 | 2124 |
2126 #if (L1_FF_MULTIBAND == 0) | 2125 #if (L1_FF_MULTIBAND == 0) |
2127 | 2126 |
2128 // initialize index | 2127 // initialize index |
2129 index = radio_freq - l1_config.std.radio_freq_index_offset; | 2128 index = radio_freq - l1_config.std.radio_freq_index_offset; |
2218 WORD32 index; | 2217 WORD32 index; |
2219 UWORD16 g_magic; | 2218 UWORD16 g_magic; |
2220 UWORD16 arfcn; | 2219 UWORD16 arfcn; |
2221 UWORD16 dco_algo_ctl_pw_temp = 0; | 2220 UWORD16 dco_algo_ctl_pw_temp = 0; |
2222 UWORD8 if_ctl = 0; | 2221 UWORD8 if_ctl = 0; |
2223 #if (CODE_VERSION != SIMULATION) | 2222 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2224 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2223 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2225 #endif | 2224 #endif |
2226 | 2225 |
2227 #if (L1_FF_MULTIBAND == 0) | 2226 #if (L1_FF_MULTIBAND == 0) |
2228 | 2227 |
2229 // initialize index | 2228 // initialize index |
2230 index = radio_freq - l1_config.std.radio_freq_index_offset; | 2229 index = radio_freq - l1_config.std.radio_freq_index_offset; |
2397 WORD32 lna_value; | 2396 WORD32 lna_value; |
2398 UWORD16 arfcn; | 2397 UWORD16 arfcn; |
2399 UWORD8 lna_off; | 2398 UWORD8 lna_off; |
2400 UWORD16 dco_algo_ctl_pw_temp = 0; | 2399 UWORD16 dco_algo_ctl_pw_temp = 0; |
2401 UWORD8 if_ctl = 0; | 2400 UWORD8 if_ctl = 0; |
2402 #if (CODE_VERSION != SIMULATION) | 2401 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2403 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2402 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2404 #endif | 2403 #endif |
2405 | 2404 |
2406 delta1_freq = l1ctl_encode_delta1(radio_freq); | 2405 delta1_freq = l1ctl_encode_delta1(radio_freq); |
2407 delta2_freq = l1ctl_encode_delta2(radio_freq); | 2406 delta2_freq = l1ctl_encode_delta2(radio_freq); |
2408 | 2407 |
2409 // Update fifo | 2408 // Update fifo |
2507 WORD32 lna_value; | 2506 WORD32 lna_value; |
2508 UWORD16 arfcn; | 2507 UWORD16 arfcn; |
2509 UWORD8 lna_off; | 2508 UWORD8 lna_off; |
2510 UWORD16 dco_algo_ctl_pw_temp = 0; | 2509 UWORD16 dco_algo_ctl_pw_temp = 0; |
2511 UWORD8 if_ctl = 0; | 2510 UWORD8 if_ctl = 0; |
2512 #if (CODE_VERSION != SIMULATION) | 2511 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2513 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2512 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2514 #endif | 2513 #endif |
2515 | 2514 |
2516 delta1_freq = l1ctl_encode_delta1(radio_freq); | 2515 delta1_freq = l1ctl_encode_delta1(radio_freq); |
2517 delta2_freq = l1ctl_encode_delta2(radio_freq); | 2516 delta2_freq = l1ctl_encode_delta2(radio_freq); |
2518 | 2517 |
2519 aset = l1a_l1s_com.dedic_set.aset; | 2518 aset = l1a_l1s_com.dedic_set.aset; |
2689 { | 2688 { |
2690 UWORD8 av_G_all, av_G_DTX; | 2689 UWORD8 av_G_all, av_G_DTX; |
2691 UWORD8 max_G_all, max_G_DTX, max_il; | 2690 UWORD8 max_G_all, max_G_DTX, max_il; |
2692 WORD32 last_known_agc, new_IL, current_calibrated_IL; | 2691 WORD32 last_known_agc, new_IL, current_calibrated_IL; |
2693 WORD8 delta1_freq, delta2_freq; | 2692 WORD8 delta1_freq, delta2_freq; |
2694 WORD16 delta_drp_gain=0; | 2693 WORD16 delta_drp_gain=0; |
2695 UWORD8 i; | 2694 UWORD8 i; |
2696 UWORD8 *tab_ptr, *tab_amr_ptr; | 2695 UWORD8 *tab_ptr, *tab_amr_ptr; |
2697 T_DEDIC_SET *aset; | 2696 T_DEDIC_SET *aset; |
2698 WORD32 lna_value; | 2697 WORD32 lna_value; |
2699 UWORD16 arfcn; | 2698 UWORD16 arfcn; |
2700 UWORD8 lna_off; | 2699 UWORD8 lna_off; |
2701 UWORD16 dco_algo_ctl_pw_temp = 0; | 2700 UWORD16 dco_algo_ctl_pw_temp = 0; |
2702 UWORD8 if_ctl = 0; | 2701 UWORD8 if_ctl = 0; |
2703 #if (CODE_VERSION != SIMULATION) | 2702 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2704 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2703 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2705 #endif | 2704 #endif |
2706 | 2705 |
2707 delta1_freq = l1ctl_encode_delta1(radio_freq); | 2706 delta1_freq = l1ctl_encode_delta1(radio_freq); |
2708 delta2_freq = l1ctl_encode_delta2(radio_freq); | 2707 delta2_freq = l1ctl_encode_delta2(radio_freq); |
2709 | 2708 |
2710 aset = l1a_l1s_com.dedic_set.aset; | 2709 aset = l1a_l1s_com.dedic_set.aset; |
3171 { | 3170 { |
3172 l1a_l1s_com.Scell_info.buff_beacon[i] = l1_config.params.il_min; | 3171 l1a_l1s_com.Scell_info.buff_beacon[i] = l1_config.params.il_min; |
3173 } | 3172 } |
3174 } | 3173 } |
3175 #endif /* #if (FF_L1_FAST_DECODING == 1) */ | 3174 #endif /* #if (FF_L1_FAST_DECODING == 1) */ |
3176 | |
3177 | |
3178 |