changeset 315:27a933036b4f

l1p_ctl.c: l1pctl_dpcmb_agc_read() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2017 04:03:00 +0000
parents e520acd157e2
children ec71c9658110
files chipsetsw/layer1/p_cfile/l1p_ctl.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/p_cfile/l1p_ctl.c	Wed Oct 04 00:49:05 2017 +0000
+++ b/chipsetsw/layer1/p_cfile/l1p_ctl.c	Wed Oct 04 04:03:00 2017 +0000
@@ -1410,7 +1410,8 @@
       // current_IL processing
       if (0==pm)  // Check and filter illegal pm value by using last valid IL
       {
-          current_IL = l1a_l1s_com.last_input_level[serving_index].input_level;
+          current_IL = l1a_l1s_com.last_input_level[serving_index].input_level
+                       - lna_value;
 
           if (radio_freq != l1a_l1s_com.Scell_info.radio_freq)
             current_IL += (l1ps.last_PR_good);
@@ -1556,7 +1557,9 @@
                        &(l1a_l1s_com.last_input_level[serving_index].lna_off),
                        l1a_l1s_com.Scell_info.radio_freq);
 
-      l1a_l1s_com.last_input_level[serving_index].input_level = new_IL;
+      l1a_l1s_com.last_input_level[serving_index].input_level = new_IL +
+        l1a_l1s_com.last_input_level[serving_index].lna_off *
+          l1ctl_get_lna_att(l1a_l1s_com.Scell_info.radio_freq);
     }
 
     // transfer_meas updating
@@ -1564,7 +1567,10 @@
 
     // IL = (min IL in FIFO) + PR (Middle of the range specified by the last decoded PR with CRC and TFI good)
     // Input levels are always stored with lna_on
-    input_level = l1a_l1s_com.last_input_level[serving_index].input_level + l1ps.last_PR_good;
+    input_level = l1a_l1s_com.last_input_level[serving_index].input_level
+                  - l1a_l1s_com.last_input_level[serving_index].lna_off *
+                    l1ctl_get_lna_att(l1a_l1s_com.Scell_info.radio_freq)
+                  + l1ps.last_PR_good;
 
     // IL_2_AGC_xx array size 
     if (input_level>INDEX_MAX) input_level = INDEX_MAX;
@@ -1576,7 +1582,9 @@
 
     l1ctl_encode_lna((UWORD8)(new_calibrated_IL>>1), &(l1a_l1s_com.Scell_info.transfer_meas.lna_off), l1ps.read_param.radio_freq_for_lna);
 
-    l1a_l1s_com.Scell_info.transfer_meas.input_level = (UWORD8)input_level;
+    l1a_l1s_com.Scell_info.transfer_meas.input_level = input_level +
+      l1a_l1s_com.Scell_info.transfer_meas.lna_off *
+        l1ctl_get_lna_att(l1ps.read_param.radio_freq_for_lna);
 
   } // End if "burst = 3"