diff chipsetsw/layer1/cfile/l1_pwmgr.c @ 125:813c4bb83603

l1_pwmgr.c: l1ctl_gauging() reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Fri, 13 May 2016 07:38:14 +0000
parents 190c68fa5689
children c0a6b2f9723b
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_pwmgr.c	Thu May 12 03:10:45 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_pwmgr.c	Fri May 13 07:38:14 2016 +0000
@@ -1076,7 +1076,7 @@
     static UWORD8  nb_gaug;                // number of gauging in ACQUIS
     static UWORD8  idx,i;                  // index
     static UWORD32 root, frac;             // ratio of HF and LF average
-    UWORD32 sumLF=0 , sumHF=0;                  // sum of HF and LF counts
+    UWORD32 sumLF, sumHF;                  // sum of HF and LF counts
     double nbHF_theo;
 
 
@@ -1133,15 +1133,21 @@
 
 
         // allow [-500ppm,+100ppm] derive on 32Khz at startup.
-// Commenting section below for OMAPS00148004
-       /* if ( 
+#if 0	/* really old code, apparently */
+       if ( 
              (root > l1s.pw_mgr.c_clk_min || 
              (root == l1s.pw_mgr.c_clk_min &&
               frac >= l1s.pw_mgr.c_clk_init_min) ) &&
              (root < l1s.pw_mgr.c_clk_max || 
              (root == l1s.pw_mgr.c_clk_max &&
               frac <= l1s.pw_mgr.c_clk_init_max ) )
-			  */
+#elif 1	/* TCS211 reconstruction */
+       if (
+             (root == l1s.pw_mgr.c_clk_min &&
+                frac >= l1s.pw_mgr.c_clk_init_min ) ||
+             (root == l1s.pw_mgr.c_clk_max &&
+                frac <= l1s.pw_mgr.c_clk_init_max )
+#else	/* LoCosto code */
 	       if (
 	             (  l1s.pw_mgr.c_clk_min == l1s.pw_mgr.c_clk_max &&
 	                frac >= l1s.pw_mgr.c_clk_init_min &&
@@ -1154,6 +1160,7 @@
                   root < l1s.pw_mgr.c_clk_max ) ||
                  (root == l1s.pw_mgr.c_clk_max &&
                   frac <= l1s.pw_mgr.c_clk_init_max ) ) )
+#endif
 	   )
         {
           l1s.pw_mgr.histo[idx  ][0] = nb_32khz; // init histo with the number of 32kHz
@@ -1274,10 +1281,12 @@
     // WARNING WARNING, this case gauging_state == UPDATE modify the algo.
     // In case of trace the parameter root and frac are refresh.
     // it is not the case if no trace and it seems there is  mistake
+  #if 0	/* FreeCalypso TCS211 reconstruction */
     if (gauging_state == UPDATE)
     {
       RATIO2(sumHF,sumLF,root,frac);
     }
+  #endif
     //End of Warning.
     l1s.pw_mgr.hf = nb_hf ;
     l1s.pw_mgr.root = root ;