# HG changeset patch # User Mychaela Falconia # Date 1463125094 0 # Node ID 813c4bb836035e2fff19d05b833da64a2e2f1835 # Parent 190c68fa568914d09310cec202abff0a999da07a l1_pwmgr.c: l1ctl_gauging() reconstructed diff -r 190c68fa5689 -r 813c4bb83603 chipsetsw/layer1/cfile/l1_pwmgr.c --- 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 ;