# HG changeset patch # User Mychaela Falconia # Date 1463248608 0 # Node ID cedb53c5926d022d6f3650034337b5669ec9111a # Parent e6611ca0d0545fb836047d12fc9f9a0b541299d6 l1_pwmgr.c: reconstruction complete, matches 20070608 object verbatim diff -r e6611ca0d054 -r cedb53c5926d chipsetsw/layer1/cfile/l1_pwmgr.c --- 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);