changeset 307:b3831227ecb1

l1p_cmpl.c: l1ps_read_pdtch() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 02 Oct 2017 19:39:27 +0000
parents a7f15f8a2d8b
children c9e7acd56fe2
files chipsetsw/layer1/p_cfile/l1p_cmpl.c
diffstat 1 files changed, 33 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/p_cfile/l1p_cmpl.c	Mon Oct 02 18:40:18 2017 +0000
+++ b/chipsetsw/layer1/p_cfile/l1p_cmpl.c	Mon Oct 02 19:39:27 2017 +0000
@@ -1598,7 +1598,6 @@
     WORD8           ts       = 0;
     UWORD8          bit_mask = 0x80;
     WORD8           bcch_level;
-    UWORD8          txpwr[8];
     UWORD8          rx_no = 0;
     BOOL            first_valid_block = TRUE;
     BOOL            crc_error =  TRUE;
@@ -1704,7 +1703,11 @@
       // burst4 of READ phase ("l1ps_ctrl_pdtch()") to be used on burst4 of CTRL phase.
 
       // Call Uplink Transmit Power level algorithm
+#if 0	/* LoCosto version */
       maca_power_control(l1ps.read_param.assignment_id,
+#else	/* TCS211 reconstruction */
+      maca_power_control(DL_pwr_ctrl.assignment_id,
+#endif
                          DL_pwr_ctrl.crc_error,
                          DL_pwr_ctrl.bcch_level,
                          DL_pwr_ctrl.radio_freq_tbl,
@@ -1769,19 +1772,35 @@
         if(l1s.toa_snr_mask == 0)
       #endif
       {
-        UWORD32 snr_temp;
-        snr_temp = (crc_error_tbl[0] == FALSE) ? snr_val[burst_id] : 0;
         #if (TOA_ALGO == 2)
         {
+          UWORD32 snr_temp;
+          snr_temp = (crc_error_tbl[0] == FALSE) ? snr_val[burst_id] : 0;
           l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa_val[burst_id]);
         }
         #else
         {
-          l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa_val[burst_id], &l1s.toa_update, &l1s.toa_period_count
-#if (FF_L1_FAST_DECODING == 1)
-              ,0
-#endif
-              );
+          /* FreeCalypso TCS211 reconstruction */
+          if (crc_error_tbl[0] == FALSE)
+          {
+            l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode,
+                                      snr_val[burst_id], toa_val[burst_id],
+                                      &l1s.toa_update, &l1s.toa_period_count
+                                   #if (FF_L1_FAST_DECODING == 1)
+                                      ,0
+                                   #endif
+                            );
+          }
+          else
+          {
+            l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode,
+                                      0, toa_val[burst_id],
+                                      &l1s.toa_update, &l1s.toa_period_count
+                                   #if (FF_L1_FAST_DECODING == 1)
+                                      ,0
+                                   #endif
+                            );
+          }
         }
         #endif
       }
@@ -1806,7 +1825,7 @@
 
         // Read control information.
         toa   = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_toa_gprs[ts]   & 0xffff;
-        pm    = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[ts]   & 0xffff);
+        pm    = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[ts]   & 0xffff)>>5;
         angle = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_angle_gprs[ts] & 0xffff;
         snr   = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_snr_gprs[ts]   & 0xffff;
 
@@ -1815,7 +1834,6 @@
         #endif
 
         l1_check_pm_error(pm,task);
-	pm = pm >> 5;
 
         #if TESTMODE
         // Test mode stats
@@ -1965,6 +1983,11 @@
     {
 
       l1pa_l1ps_com.transfer.dl_pwr_ctrl.crc_error      = crc_error;
+      /*
+       * FreeCalypso TCS211 reconstruction: the following line
+       * has been taken from the TSM30 source.
+       */
+      l1pa_l1ps_com.transfer.dl_pwr_ctrl.assignment_id  = l1ps.read_param.assignment_id;
 
       if(l1ps.read_param.pc_meas_chan)
       {