FreeCalypso > hg > tcs211-l1-reconst
changeset 238:17b2be4a3964
l1tm_func.c: l1tm_stats_read() reconstructed
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 15 Jan 2017 08:33:57 +0000 |
parents | 8a351ce20c81 |
children | a2b95b81c81f |
files | chipsetsw/layer1/tm_cfile/l1tm_func.c |
diffstat | 1 files changed, 15 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/chipsetsw/layer1/tm_cfile/l1tm_func.c Sun Jan 15 07:35:46 2017 +0000 +++ b/chipsetsw/layer1/tm_cfile/l1tm_func.c Sun Jan 15 08:33:57 2017 +0000 @@ -1996,7 +1996,11 @@ WORD32 count; WORD32 runs = l1tm.tmode_stats.loop_count; - #if L1_GPRS + /* + * FreeCalypso TCS211 reconstruction: the following automatic var + * is for the BLER code we have conditioned out below. + */ + #if 0 //L1_GPRS volatile UWORD16 value_array_unsigned_short[4]; #endif @@ -2042,7 +2046,7 @@ if (bitmask & DSP_PM) { if (count) - value_unsigned_short = (UWORD16)(l1tm.tmode_stats.pm_sum) / count; //omaps00090550 + value_unsigned_short = l1tm.tmode_stats.pm_sum / count; else value_unsigned_short = 0; memcpy(&tm_return->result[offset], (UWORD8 *) &value_unsigned_short, 2); offset+=2; @@ -2051,7 +2055,7 @@ if (bitmask & ANGLE_MEAN) { if (count) // non-zero - value_signed_int = (UWORD16)(l1tm.tmode_stats.angle_sum) / count; //omaps00090550 + value_signed_int = l1tm.tmode_stats.angle_sum / count; else value_signed_int = 0; memcpy(&tm_return->result[offset], (UWORD8 *) &value_signed_int, 4); offset+=4; @@ -2062,26 +2066,8 @@ // VAR[X] = E[X^2] - (E[X])^2 if (count) // non-zero { - UWORD32 u32dvsor ; - temp_U32 = l1tm.tmode_stats.angle_sum; - u32dvsor = (temp_U32 /(UWORD32)count); - temp_U32= u32dvsor; - u32dvsor *= (temp_U32); - u32dvsor *= (temp_U32); - value_unsigned_int = l1tm.tmode_stats.angle_sq_sum / (UWORD32)count - u32dvsor; - // temp_U32 = (UWORD16)(l1tm.tmode_stats.angle_sum) / (count); //omaps00090550 - // u32dvsor = count -((temp_U32) * (temp_U32 )) ; - - // value_unsigned_int = (UWORD16)l1tm.tmode_stats.angle_sq_sum / u32dvsor ; //omaps00090550 - - /* temp_U32 = l1tm.tmode_stats.angle_sum / count; value_unsigned_int = l1tm.tmode_stats.angle_sq_sum / count - (temp_U32)*(temp_U32); - */ - - - - } else value_unsigned_int = 0; memcpy(&tm_return->result[offset], (UWORD8 *) &value_unsigned_int, 4); @@ -2105,7 +2091,7 @@ if (bitmask & SNR_MEAN) { if (count) // non-zero - value_unsigned_int = (UWORD16)(l1tm.tmode_stats.snr_sum) / count; //omaps00090550 + value_unsigned_int = l1tm.tmode_stats.snr_sum / count; else value_unsigned_int = 0; memcpy(&tm_return->result[offset], (UWORD8 *) &value_unsigned_int, 4); offset+=4; @@ -2115,14 +2101,9 @@ { if (count) // non-zero { - UWORD32 u32dvsor ; - temp_U32 = l1tm.tmode_stats.angle_sum; - u32dvsor = (temp_U32 /(UWORD32)count); - temp_U32= u32dvsor; - u32dvsor *= (temp_U32); - u32dvsor *= (temp_U32); - value_unsigned_int = l1tm.tmode_stats.angle_sq_sum / (UWORD32)count - u32dvsor; - + temp_U32 = l1tm.tmode_stats.snr_sum / count; + value_unsigned_int = l1tm.tmode_stats.snr_sq_sum / count - + temp_U32 * temp_U32; } else value_unsigned_int = 0; @@ -2133,7 +2114,7 @@ if (bitmask & TOA_MEAN) { if (count) // non-zero - value_unsigned_int = (UWORD16)(l1tm.tmode_stats.toa_sum) / count; //omaps00090550 + value_unsigned_int = l1tm.tmode_stats.toa_sum / count; else value_unsigned_int = 0; memcpy(&tm_return->result[offset], (UWORD8 *) &value_unsigned_int, 4); offset+=4; @@ -2143,14 +2124,9 @@ { if (count) // non-zero { - UWORD32 u32dvsor ; - temp_U32 = l1tm.tmode_stats.angle_sum; - u32dvsor = (temp_U32 /(UWORD32)count); - temp_U32= u32dvsor; - u32dvsor *= (temp_U32); - u32dvsor *= (temp_U32); - value_unsigned_int = l1tm.tmode_stats.angle_sq_sum / (UWORD32)count - u32dvsor; - + temp_U32 = l1tm.tmode_stats.toa_sum / count; + value_unsigned_int = l1tm.tmode_stats.toa_sq_sum / count - + temp_U32 * temp_U32; } else value_unsigned_int = 0; memcpy(&tm_return->result[offset], (UWORD8 *) &value_unsigned_int, 4);