changeset 134:cedb53c5926d

l1_pwmgr.c: reconstruction complete, matches 20070608 object verbatim
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sat, 14 May 2016 17:56:48 +0000
parents e6611ca0d054
children 38b5d2381143
files chipsetsw/layer1/cfile/l1_pwmgr.c
diffstat 1 files changed, 4 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_pwmgr.c	Sat May 14 17:07:26 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_pwmgr.c	Sat May 14 17:56:48 2016 +0000
@@ -1796,18 +1796,11 @@
 #if L1_GPRS
   BOOL l1s_gauging_decision_with_PNP(void)
   {
-  #define TWO_SECONDS_IN_FRAME (UWORD16)(2000/4.615)
-  WORD32  time_to_next_gauging=0;  //changed to WORD32- sajal
-    // It's time to perform the next gauging
-  time_to_next_gauging = next_gauging_scheduled_for_PNP - l1s.actual_time.fn;
-  if (time_to_next_gauging < 0)
-  {
-    time_to_next_gauging += MAX_FN;
-  }
+    #define TWO_SECONDS_IN_FRAME (UWORD16)(2000/4.615)
 
-  if( (time_to_next_gauging == 0) || (time_to_next_gauging > TWO_SECONDS_IN_FRAME))
-  {
-
+    /* reconstructed TCS211 code */
+    if (l1s.actual_time.fn >= next_gauging_scheduled_for_PNP)
+    {
       next_gauging_scheduled_for_PNP = l1s.actual_time.fn + TWO_SECONDS_IN_FRAME;
       if (next_gauging_scheduled_for_PNP >= MAX_FN) next_gauging_scheduled_for_PNP -= MAX_FN;
       return (TRUE);