diff 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
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_ctl.c	Thu Apr 07 02:25:26 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_ctl.c	Thu Apr 07 02:52:54 2016 +0000
@@ -2113,11 +2113,13 @@
    WORD8   delta1_freq, delta2_freq;
    WORD16  delta_drp_gain=0;
    WORD32  index, lna_value;
-   UWORD16 arfcn;
+   #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION)
+     UWORD16 arfcn;
+   #endif
    UWORD16 dco_algo_ctl_pw_temp = 0;
    UWORD8 if_ctl = 0;
    #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION)
-   UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM;
+     UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM;
    #endif
 
 #if (L1_FF_MULTIBAND == 0)
@@ -2142,11 +2144,14 @@
    // contain the input_level value we use
    // in the associated CTL task to build
    // the agc used in this CTL.
-#if (L1_FF_MULTIBAND == 0)  
+
+#if (RF_RAM == 61) && (CODE_VERSION != SIMULATION)
+#if (L1_FF_MULTIBAND == 0)
   arfcn = Convert_l1_radio_freq(radio_freq);
 #else
-  arfcn=radio_freq;
-#endif 
+  arfcn = radio_freq;
+#endif
+#endif
 
 #if(RF_FAM == 61)
    #if (CODE_VERSION != SIMULATION)
@@ -2172,7 +2177,7 @@
 #endif
 
    if (0==pm)  // Check and filter illegal pm value by using last valid IL
-     current_IL = l1a_l1s_com.last_input_level[index].input_level ;
+     current_IL = l1a_l1s_com.last_input_level[index].input_level - lna_value;
    else
      current_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq));
 
@@ -2189,7 +2194,9 @@
                     &(l1a_l1s_com.last_input_level[index].lna_off),
                     radio_freq);
 
-   l1a_l1s_com.last_input_level[index].input_level = (UWORD8)current_IL;
+   l1a_l1s_com.last_input_level[index].input_level = (UWORD8)current_IL +
+      l1ctl_get_lna_att(radio_freq) *
+	l1a_l1s_com.last_input_level[index].lna_off;
 
    return((UWORD8)current_calibrated_IL);
 }