FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_ctl.c @ 92:3ef2a5f83a8e
l1_ctl.c: l1ctl_dpagc_amr() reconstructed
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 07 Apr 2016 14:53:25 +0000 |
parents | 51f3b9364365 |
children | a32bdc16491e |
comparison
equal
deleted
inserted
replaced
91:51f3b9364365 | 92:3ef2a5f83a8e |
---|---|
2714 WORD16 delta_drp_gain=0; | 2714 WORD16 delta_drp_gain=0; |
2715 UWORD8 i; | 2715 UWORD8 i; |
2716 UWORD8 *tab_ptr, *tab_amr_ptr; | 2716 UWORD8 *tab_ptr, *tab_amr_ptr; |
2717 T_DEDIC_SET *aset; | 2717 T_DEDIC_SET *aset; |
2718 WORD32 lna_value; | 2718 WORD32 lna_value; |
2719 UWORD16 arfcn; | 2719 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2720 UWORD16 arfcn; | |
2721 #endif | |
2720 UWORD8 lna_off; | 2722 UWORD8 lna_off; |
2721 UWORD16 dco_algo_ctl_pw_temp = 0; | 2723 UWORD16 dco_algo_ctl_pw_temp = 0; |
2722 UWORD8 if_ctl = 0; | 2724 UWORD8 if_ctl = 0; |
2723 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) | 2725 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2724 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2726 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2764 // in the associated CTL task to build the agc used in this CTL. | 2766 // in the associated CTL task to build the agc used in this CTL. |
2765 | 2767 |
2766 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); | 2768 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); |
2767 } | 2769 } |
2768 | 2770 |
2769 #if (L1_FF_MULTIBAND == 0) | 2771 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2772 #if (L1_FF_MULTIBAND == 0) | |
2770 arfcn = Convert_l1_radio_freq(radio_freq); | 2773 arfcn = Convert_l1_radio_freq(radio_freq); |
2771 #else | 2774 #else |
2772 arfcn=radio_freq; | 2775 arfcn = radio_freq; |
2773 #endif | 2776 #endif |
2777 #endif | |
2774 | 2778 |
2775 #if(RF_FAM == 61) | 2779 #if(RF_FAM == 61) |
2776 #if (CODE_VERSION != SIMULATION) | 2780 #if (CODE_VERSION != SIMULATION) |
2777 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , | 2781 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , |
2778 l1a_l1s_com.Scell_used_IL_dd.input_level, | 2782 l1a_l1s_com.Scell_used_IL_dd.input_level, |
2787 } | 2791 } |
2788 #endif | 2792 #endif |
2789 #endif | 2793 #endif |
2790 | 2794 |
2791 if (0==pm) // Check and filter illegal pm value by using last valid IL | 2795 if (0==pm) // Check and filter illegal pm value by using last valid IL |
2792 new_IL = IL_info_ptr->input_level; | 2796 new_IL = IL_info_ptr->input_level - lna_value; |
2793 else | 2797 else |
2794 new_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq)); | 2798 new_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq)); |
2795 | 2799 |
2796 current_calibrated_IL = new_IL - delta1_freq - delta2_freq; | 2800 current_calibrated_IL = new_IL - delta1_freq - delta2_freq; |
2797 | 2801 |
2889 // input_level is always store with lna_on | 2893 // input_level is always store with lna_on |
2890 | 2894 |
2891 l1ctl_encode_lna( (UWORD8)(current_calibrated_IL>>1), | 2895 l1ctl_encode_lna( (UWORD8)(current_calibrated_IL>>1), |
2892 &(IL_info_ptr->lna_off), | 2896 &(IL_info_ptr->lna_off), |
2893 radio_freq ); | 2897 radio_freq ); |
2894 IL_info_ptr->input_level = (UWORD8)new_IL ; | 2898 IL_info_ptr->input_level = (UWORD8)new_IL + l1ctl_get_lna_att(radio_freq) * |
2899 IL_info_ptr->lna_off; | |
2895 | 2900 |
2896 #if L2_L3_SIMUL | 2901 #if L2_L3_SIMUL |
2897 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC) | 2902 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC) |
2898 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, | 2903 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, |
2899 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID)); | 2904 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID)); |