FreeCalypso > hg > tcs211-l1-reconst
annotate chipsetsw/layer1/tm_cfile/l1tm_stats.c @ 313:0388ecc384d6
l1p_ctl.c: l1pctl_npc_agc_read() reconstructed
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 03 Oct 2017 08:11:02 +0000 |
parents | f8f7024caae3 |
children |
rev | line source |
---|---|
240
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
1 /************* Revision Controle System Header ************* |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
2 * GSM Layer 1 software |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
3 * L1TM_STAT.C |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
4 * |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
5 * Filename l1tm_stats.c |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
6 * Copyright 2003 (C) Texas Instruments |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
7 * |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
8 ************* Revision Controle System Header *************/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
9 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
10 #include "l1_macro.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
11 #include "l1_confg.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
12 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
13 #if TESTMODE |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
14 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
15 #include <string.h> |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
16 #include "l1_types.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
17 #include "sys_types.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
18 #include "l1_const.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
19 #include "l1_time.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
20 #include "l1_signa.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
21 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
22 #include "l1tm_defty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
23 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
24 #if (AUDIO_TASK == 1) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
25 #include "l1audio_const.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
26 #include "l1audio_cust.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
27 #include "l1audio_defty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
28 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
29 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
30 #if (L1_GTT == 1) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
31 #include "l1gtt_const.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
32 #include "l1gtt_defty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
33 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
34 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
35 #if (L1_MP3 == 1) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
36 #include "l1mp3_defty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
37 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
38 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
39 #if (L1_MIDI == 1) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
40 #include "l1midi_defty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
41 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
42 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
43 #include "l1_defty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
44 #include "cust_os.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
45 #include "l1_msgty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
46 #include "l1_varex.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
47 #include "l1_proto.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
48 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
49 #include "l1tm_msgty.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
50 #include "l1tm_varex.h" |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
51 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
52 /***********************************************************************/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
53 /* TESTMODE 3.X */ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
54 /***********************************************************************/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
55 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
56 /* External function prototypes */ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
57 /*------------------------------*/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
58 void l1tm_stats_read(T_TM_RETURN *tm_return, WORD16 type, UWORD16 bitmask); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
59 void l1a_tmode_send_ul_msg(T_TM_RETURN *tm_ret); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
60 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
61 /* Internal function prototypes */ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
62 /*------------------------------*/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
63 void l1tm_stats_compute(UWORD32 pm, UWORD32 toa, UWORD32 snr, WORD16 angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
64 void l1tm_stats_auto_result_reset_loops(void); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
65 void l1tm_reset_rx_stats(void); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
66 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
67 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
68 void l1tm_stats_fb_confirm (T_TMODE_FB_CON *prim, WORD32 test) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
69 // loop management done in L1A state machine |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
70 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
71 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
72 l1tm.tmode_stats.loop_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
73 l1tm.tmode_stats.flag_recent = prim->fb_flag; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
74 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
75 if (prim->fb_flag) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
76 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
77 l1tm.tmode_stats.flag_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
78 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
79 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
80 if (prim->fb_flag) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
81 // We only save stats from a SUCCESS (including PM) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
82 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
83 #if (TOA_ALGO == 2) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
84 l1tm_stats_compute(prim->pm_fullres, ((prim->toa)<<2), prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
85 #else |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
86 l1tm_stats_compute(prim->pm_fullres, prim->toa, prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
87 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
88 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
89 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
90 l1tm_stats_auto_result_reset_loops(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
91 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
92 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
93 void l1tm_stats_sb_confirm (T_TMODE_NCELL_SYNC_IND *prim, WORD32 test) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
94 // loop management done in L1A state machine |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
95 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
96 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
97 l1tm.tmode_stats.loop_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
98 l1tm.tmode_stats.flag_recent = prim->sb_flag; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
99 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
100 if (prim->sb_flag) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
101 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
102 l1tm.tmode_stats.flag_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
103 l1tm.tmode_stats.bsic = prim->bsic; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
104 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
105 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
106 if (prim->sb_flag) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
107 // we only save stats from a SUCCESS (including PM) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
108 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
109 #if (TOA_ALGO == 2) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
110 l1tm_stats_compute(prim->pm_fullres, ((prim->toa)<<2), prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
111 #else |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
112 l1tm_stats_compute(prim->pm_fullres, prim->toa, prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
113 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
114 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
115 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
116 l1tm_stats_auto_result_reset_loops(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
117 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
118 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
119 void l1tm_stats_bcch_confirm (T_TMODE_BCCHS_CON *prim) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
120 // loop management done here after stats management |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
121 // (the only stat is pass/fail) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
122 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
123 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
124 l1tm.tmode_stats.loop_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
125 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
126 if (prim->error_flag == FALSE) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
127 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
128 l1tm.tmode_stats.flag_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
129 l1tm.tmode_stats.flag_recent = 1; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
130 l1tm.tmode_stats.bsic = l1a_l1s_com.Scell_info.bsic; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
131 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
132 else |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
133 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
134 l1tm.tmode_stats.flag_recent = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
135 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
136 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
137 l1tm_stats_auto_result_reset_loops(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
138 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
139 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
140 void l1tm_stats_tch_confirm (T_TMODE_TCH_INFO *prim) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
141 // loop management and stats management done here |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
142 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
143 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
144 // Update statistics only if downlink task enabled: DL-only or DL+UL |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
145 if((l1_config.tmode.rf_params.down_up & TMODE_DOWNLINK) && |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
146 l1_config.tmode.rf_params.tmode_continuous == TM_NO_CONTINUOUS) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
147 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
148 l1tm.tmode_stats.loop_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
149 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
150 // TCH statistics are based on (accumulated) bit errors |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
151 // Stats are computed independently from the RXQUAL |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
152 // Discard first 2 blocks of TCH => always wrong if start not on block boundary |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
153 if (l1tm.tmode_stats.loop_count > 2) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
154 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
155 l1tm.tmode_stats.qual_acc_full += prim->qual_full; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
156 l1tm.tmode_stats.qual_nbr_meas_full += prim->qual_nbr_meas_full; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
157 // fixed point unsigned F9.7 format |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
158 l1tm.tmode_stats.flag_count = (WORD32)(((l1tm.tmode_stats.qual_acc_full * 100)<<8)/(l1tm.tmode_stats.qual_nbr_meas_full)); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
159 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
160 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
161 l1tm.tmode_stats.flag_recent = 1; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
162 l1tm.tmode_stats.bsic = l1a_l1s_com.Scell_info.bsic; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
163 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
164 l1tm_stats_compute(prim->pm_fullres, prim->toa, prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
165 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
166 l1tm_stats_auto_result_reset_loops(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
167 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
168 } // end if DL-only or DL+UL |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
169 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
170 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
171 void l1tm_stats_mon_confirm (T_TMODE_FB_CON *prim) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
172 // loop management done in L1A state machine |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
173 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
174 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
175 l1tm.tmode_stats.loop_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
176 l1tm.tmode_stats.flag_recent = prim->fb_flag; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
177 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
178 if (prim->fb_flag) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
179 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
180 l1tm.tmode_stats.flag_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
181 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
182 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
183 if (prim->fb_flag) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
184 // we only save stats from a SUCCESS (including PM) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
185 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
186 l1tm_stats_compute(prim->pm_fullres, prim->toa, prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
187 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
188 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
189 l1tm_stats_auto_result_reset_loops(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
190 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
191 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
192 /*void l1tm_stats_ra_confirm (T_TMODE_RA_DONE *prim) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
193 // this function is only called when the RACH test is done |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
194 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
195 //l1tm.tmode_stats.fn = prim->fn; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
196 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
197 l1tm.tmode_state.dedicated_active = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
198 }*/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
199 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
200 void l1tm_stats_full_list_meas_confirm(T_TMODE_RXLEV_REQ *prim) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
201 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
202 T_TM_RETURN tm_ret; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
203 WORD16 stats_type = 2; // recent stats |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
204 UWORD16 stats_bitmask = 0x0003; // for power measurement force rxlev and pm |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
205 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
206 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
207 l1tm.tmode_stats.rssi_recent = prim->power_array->accum_power_result; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
208 l1tm_stats_read(&tm_ret, stats_type, stats_bitmask); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
209 // above function sets tm_ret.status, tm_ret.result[], tm_ret.index, tm_ret.size |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
210 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
211 #if (ETM_PROTOCOL == 1) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
212 tm_ret.mid = ETM_RF; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
213 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
214 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
215 tm_ret.cid = STATS_READ; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
216 l1a_tmode_send_ul_msg(&tm_ret); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
217 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
218 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
219 #if L1_GPRS |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
220 void l1tm_stats_pdtch_confirm (T_TMODE_PDTCH_INFO *prim) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
221 // loop management and stats management done here |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
222 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
223 UWORD8 ts; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
224 UWORD8 bit_map = 0x80; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
225 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
226 l1tm.tmode_stats.loop_count++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
227 l1tm.tmode_stats.bsic = l1a_l1s_com.Scell_info.bsic; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
228 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
229 // count the number of successes over all time slots allocated for stats within one block |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
230 for (ts=0;ts<8;ts++) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
231 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
232 if (bit_map & l1_config.tmode.stats_config.stat_gprs_slots) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
233 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
234 // if crc_error[ts]=FALSE the block is decoded successfully |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
235 if (!prim->crc_error_tbl[ts]) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
236 l1tm.tmode_stats.flag_count ++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
237 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
238 bit_map>>=1; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
239 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
240 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
241 // TM stats are collected over one block (4 frames) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
242 l1tm_stats_compute(prim->pm_fullres, prim->toa, prim->snr, prim->angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
243 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
244 l1tm_stats_auto_result_reset_loops(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
245 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
246 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
247 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
248 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
249 void l1tm_stats_compute(UWORD32 pm, UWORD32 toa, UWORD32 snr, WORD16 angle) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
250 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
251 // PM STATS |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
252 l1tm.tmode_stats.pm_recent = pm; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
253 l1tm.tmode_stats.pm_sum += pm; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
254 l1tm.tmode_stats.pm_sq_sum += (pm*pm); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
255 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
256 // TOA STATS |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
257 l1tm.tmode_stats.toa_recent = toa; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
258 l1tm.tmode_stats.toa_sum += toa; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
259 l1tm.tmode_stats.toa_sq_sum += (toa*toa); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
260 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
261 // ANGLE STATS |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
262 l1tm.tmode_stats.angle_recent = angle; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
263 l1tm.tmode_stats.angle_sum += angle; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
264 l1tm.tmode_stats.angle_sq_sum += (angle*angle); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
265 if (angle < l1tm.tmode_stats.angle_min ) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
266 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
267 l1tm.tmode_stats.angle_min = angle; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
268 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
269 if (angle > l1tm.tmode_stats.angle_max ) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
270 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
271 l1tm.tmode_stats.angle_max = angle; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
272 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
273 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
274 // SNR STATS |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
275 l1tm.tmode_stats.snr_recent = snr; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
276 l1tm.tmode_stats.snr_sum += snr; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
277 l1tm.tmode_stats.snr_sq_sum += (snr*snr); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
278 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
279 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
280 void l1tm_stats_auto_result_reset_loops(void) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
281 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
282 T_TM_RETURN tm_ret; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
283 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
284 if (l1_config.tmode.stats_config.auto_result_loops) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
285 { |
242
f8f7024caae3
l1tm_stats.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents:
241
diff
changeset
|
286 if ( (l1tm.tmode_stats.loop_count % l1_config.tmode.stats_config.auto_result_loops) == 0) |
240
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
287 // time to report current stats. call l1tm_stats_read |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
288 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
289 l1tm_stats_read(&tm_ret, l1_config.tmode.stats_config.stat_type, l1_config.tmode.stats_config.stat_bitmask); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
290 // above function sets tm_ret.status, tm_ret.result[], tm_ret.index, tm_ret.size |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
291 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
292 #if (ETM_PROTOCOL == 1) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
293 tm_ret.mid = ETM_RF; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
294 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
295 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
296 tm_ret.cid = STATS_READ; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
297 l1a_tmode_send_ul_msg(&tm_ret); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
298 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
299 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
300 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
301 if (l1_config.tmode.stats_config.auto_reset_loops) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
302 { |
242
f8f7024caae3
l1tm_stats.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents:
241
diff
changeset
|
303 if ((l1tm.tmode_stats.loop_count % l1_config.tmode.stats_config.auto_reset_loops) == 0) |
240
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
304 // time to reset stats. |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
305 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
306 l1tm_reset_rx_stats(); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
307 // resets stats accumulators and success/runs counters but not master loop counter for task. |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
308 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
309 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
310 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
311 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
312 /**************************************************************************** |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
313 Function: l1tm_is_rx_counter_done |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
314 Input: none |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
315 Output: 1 = done; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
316 0 = not done. |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
317 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
318 Checks to see if the RX loop should be stopped, and increments counter. |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
319 This counter is used in all RX functions. |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
320 *****************************************************************************/ |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
321 BOOL l1tm_is_rx_counter_done(void) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
322 // another T_TM_RETURN allocated here for auto acknowledge of rf_enable operation. |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
323 // to help save stack we could pass in a pointer to the tm_return structure, |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
324 // then save the current values |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
325 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
326 T_TM_RETURN_ABBREV tm_ret; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
327 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
328 if (l1_config.tmode.stats_config.num_loops != 0) // 0 = infinite loop |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
329 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
330 l1tm.tmode_state.rx_counter++; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
331 if (l1tm.tmode_state.rx_counter >= l1_config.tmode.stats_config.num_loops) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
332 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
333 // acknowledge end of RF_ENABLE operation |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
334 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
335 tm_ret.cid = RF_ENABLE; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
336 tm_ret.index = 0; // No index value is sent |
242
f8f7024caae3
l1tm_stats.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents:
241
diff
changeset
|
337 tm_ret.status = E_FINISHED; |
240
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
338 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
339 tm_ret.size = 1; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
340 tm_ret.result[0] = 1; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
341 l1a_tmode_send_ul_msg((T_TM_RETURN *) &tm_ret); |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
342 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
343 return 1; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
344 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
345 else |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
346 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
347 return 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
348 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
349 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
350 else // infinite loop |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
351 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
352 return 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
353 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
354 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
355 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
356 void l1tm_reset_rx_state(void) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
357 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
358 l1tm.tmode_state.rx_counter = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
359 l1tm.tmode_state.num_bcchs = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
360 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
361 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
362 void l1tm_reset_rx_stats(void) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
363 { |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
364 UWORD32 i; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
365 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
366 l1tm.tmode_stats.toa_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
367 l1tm.tmode_stats.toa_sq_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
368 l1tm.tmode_stats.toa_recent = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
369 l1tm.tmode_stats.rssi_recent = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
370 l1tm.tmode_stats.pm_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
371 l1tm.tmode_stats.pm_sq_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
372 l1tm.tmode_stats.pm_recent = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
373 l1tm.tmode_stats.angle_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
374 l1tm.tmode_stats.angle_sq_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
375 l1tm.tmode_stats.angle_min = +32767; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
376 l1tm.tmode_stats.angle_max = -32768; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
377 l1tm.tmode_stats.angle_recent = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
378 l1tm.tmode_stats.snr_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
379 l1tm.tmode_stats.snr_sq_sum = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
380 l1tm.tmode_stats.snr_recent = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
381 l1tm.tmode_stats.loop_count = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
382 l1tm.tmode_stats.flag_count = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
383 l1tm.tmode_stats.fn = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
384 l1tm.tmode_stats.bsic = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
385 l1tm.tmode_stats.qual_acc_full = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
386 l1tm.tmode_stats.qual_nbr_meas_full = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
387 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
388 for (i=0;i<4;i++) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
389 l1tm.tmode_stats.rssi_fifo[i] = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
390 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
391 #if L1_GPRS |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
392 l1tm.tmode_stats.nb_dl_pdtch_slots = 0; |
241
1b48892cee25
l1tm_stats.c: passes compilation, but doesn't match yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
240
diff
changeset
|
393 #if 0 /* FreeCalypso TCS211 reconstruction: LoCosto-ism removed */ |
240
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
394 // Stats Bler |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
395 l1tm.tmode_stats.bler_total_blocks = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
396 for (i=0;i<4;i++) |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
397 l1tm.tmode_stats.bler_crc[i] = 0; |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
398 #endif |
241
1b48892cee25
l1tm_stats.c: passes compilation, but doesn't match yet
Mychaela Falconia <falcon@freecalypso.org>
parents:
240
diff
changeset
|
399 #endif |
240
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
400 } |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
401 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
402 |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
403 #endif |
2fe45f9bebf8
l1tm_stats.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
404 |