FreeCalypso > hg > fc-magnetite
annotate src/cs/layer1/p_cfile/l1p_cmpl.c @ 383:43dbedde9d80
doc/C1xx-Howto written
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Jan 2018 20:45:51 +0000 |
parents | 0740b5ff15f6 |
children |
rev | line source |
---|---|
302
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /************* Revision Controle System Header ************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * GSM Layer 1 software |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * L1P_CMPL.C |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * Filename l1p_cmpl.c |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * Copyright 2003 (C) Texas Instruments |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ************* Revision Controle System Header *************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #define L1P_CMPL_C |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include "l1_macro.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "l1_confg.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #if L1_GPRS |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #if (CODE_VERSION == SIMULATION) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 #include <string.h> |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 #include "l1_types.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #include "sys_types.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #include "l1_const.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #include "l1_time.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #include "l1_signa.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #include "l1tm_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #if (AUDIO_TASK == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include "l1audio_const.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include "l1audio_cust.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "l1audio_signa.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include "l1audio_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "l1audio_msgty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #if (L1_GTT == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #include "l1gtt_const.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "l1gtt_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #if (L1_MP3 == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #include "l1mp3_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #if (L1_MIDI == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #include "l1midi_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #include "l1_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #include "cust_os.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 #include "l1_msgty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #include "l1_varex.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 #include "l1_proto.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 #include "l1_tabs.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 #include "l1_trace.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 #if L2_L3_SIMUL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 #include "l2_l3.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 #include "hw_debug.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #include "l1p_cons.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #include "l1p_msgt.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 #include "l1p_deft.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 #include "l1p_vare.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 #include "l1p_sign.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 #include "l1tm_msgty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 #include "l1tm_signa.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #include "macs_def.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 #include "macs_cst.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 #include "sim_cons.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 #include "sim_def.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 extern T_hw FAR hw; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 #include <string.h> |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 #include "l1_types.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 #include "sys_types.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 #include "l1_const.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 #include "l1_time.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 #include "l1_signa.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 #include "l1tm_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 #if (AUDIO_TASK == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 #include "l1audio_const.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 #include "l1audio_cust.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 #include "l1audio_signa.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 #include "l1audio_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 #include "l1audio_msgty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 #if (L1_GTT == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 #include "l1gtt_const.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 #include "l1gtt_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 #if (L1_MP3 == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 #include "l1mp3_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 #if (L1_MIDI == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 #include "l1midi_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 #include "l1_defty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 #include "cust_os.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 #include "l1_msgty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 #include "l1_varex.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 #include "l1_proto.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 #include "l1_tabs.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 #include "l1_trace.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 #if L2_L3_SIMUL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 #include "l2_l3.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 #include "hw_debug.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 #include "l1p_cons.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 #include "l1p_msgt.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 #include "l1p_deft.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 #include "l1p_vare.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 #include "l1p_sign.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 #include "l1tm_msgty.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 #include "l1tm_signa.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 #include "macs_def.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 #include "macs_cst.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 #if(RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 #include "l1_rf61.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 #include "tpudrv61.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 #include "l1_ctl.h" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 /* Prototypes of external functions used in this file. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 void l1dmacro_synchro (UWORD32 when, UWORD32 value); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 void l1dmacro_offset (UWORD32 offset_value, WORD32 relative_time); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 void l1dmacro_rx_synth (UWORD16 arfcn); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 void l1dmacro_agc (UWORD16 arfcn,WORD8 gain, UWORD8 lna |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 ,UWORD8 if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 #if (L1_MADC_ON == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 void l1dmacro_rx_nb (UWORD16 arfcn, UWORD8 adc_active, UWORD8 csf_filter_choice |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 ,UWORD8 saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 #endif /* RF_FAM == 61*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 #else /* L1_MADC_ON == 1*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 void l1dmacro_rx_nb (UWORD16 arfcn); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 #endif /* L1_MADC_ON == 1*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 void l1dmacro_afc (UWORD16 afc_value, UWORD8 win_id); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 void l1dtpu_serv_rx_nb (UWORD16 radio_freq, WORD8 agc, UWORD8 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 UWORD32 synchro_serv,UWORD32 new_offset,BOOL change_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 UWORD8 adc_active, UWORD8 csf_filter_choice, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 UWORD8 if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 ,UWORD8 saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 void l1pdtpu_serv_rx_nb (UWORD16 radio_freq, WORD8 agc, BOOL lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 UWORD8 rx_id, UWORD32 offset_serv, UWORD8 num_rx, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 UWORD8 rx_group_id, BOOL rx_done_flag, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 UWORD8 adc_active, UWORD8 csf_filter_choice, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 UWORD8 if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 ,UWORD8 saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 #endif /* RF_FAM == 61*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 #if(RF_FAM != 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 void l1dtpu_serv_rx_nb (UWORD16 radio_freq, WORD8 agc, UWORD8 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 UWORD32 synchro_serv,UWORD32 new_offset,BOOL change_offset, UWORD8 adc_active); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 void l1pdtpu_serv_rx_nb (UWORD16 radio_freq, WORD8 agc, BOOL lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 UWORD8 rx_id, UWORD32 offset_serv, UWORD8 num_rx, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 UWORD8 rx_group_id, BOOL rx_done_flag,UWORD8 adc_active); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 void l1pdtpu_serv_tx (UWORD16 radio_freq, UWORD8 timing_advance, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 UWORD32 offset_serv, UWORD8 tx_id, UWORD8 num_tx, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 UWORD8 tx_group_id, UWORD8 switch_flag, BOOL burst_type, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 BOOL rx_flag,UWORD8 adc_active); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 UWORD8 l1pdtpu_interf_meas (UWORD16 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 WORD8 agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 UWORD8 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 UWORD8 meas_bitmap, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 UWORD32 offset_serv, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 UWORD16 win_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 UWORD8 synchro_ts |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 #if(RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 ,UWORD8 if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 void l1s_read_l3frm (UWORD8 pwr_level, API *info_address, UWORD32 task_rx); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 void l1ps_macs_read (UWORD8 pr_table[8]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 void l1ps_macs_ctrl (void); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 void l1ps_tmode_macs_ctrl (void); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 void l1pddsp_transfer_mslot_power (UWORD8 *txpwr, UWORD16 radio_freq, UWORD8 ul_bitmap); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 void l1pddsp_single_tx_block (UWORD8 burst_nb, UWORD8 *data, UWORD8 tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 UWORD16 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 void l1pddsp_idle_prach_data (BOOL polling, UWORD8 cs_type, UWORD16 channel_request_data, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 UWORD8 bsic, UWORD16 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 void l1pddsp_idle_prach_power (UWORD8 txpwr, UWORD16 radio_freq, UWORD8 ts); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 void l1pddsp_idle_rx_nb (UWORD8 burst_nb, UWORD8 tsq, UWORD16 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 UWORD8 timeslot_no, BOOL ptcch_dl, BOOL usf_interrupt); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 void l1pddsp_idle_rx_nb (UWORD8 burst_nb, UWORD8 tsq, UWORD16 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 UWORD8 timeslot_no, BOOL ptcch_dl); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 void l1pddsp_ul_ptcch_data (UWORD8 cs_type, UWORD16 channel_request_data, UWORD8 bsic, UWORD16 radio_freq, UWORD8 timeslot_no); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 void l1ps_tcr_ctrl (UWORD8 pm_position); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 void l1pd_afc (void); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 void l1pddsp_interf_meas_ctrl (UWORD8 nb_meas_req); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 void l1pddsp_meas_ctrl (UWORD8 nbmeas, UWORD8 pm_pos); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 void maca_power_control (UWORD8 assignment_id, BOOL crc_error, WORD8 bcch_level, UWORD16 *radio_freq, WORD8 *burst_level, UWORD8 *pch); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 WORD16 l1s_encode_rxlev (UWORD8 inlevel); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 void l1pctl_pagc_ctrl (WORD8 *agc, UWORD8 *lna_off, UWORD16 radio_freq,UWORD8 serving_cell); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 UWORD8 l1pctl_pagc_read (UWORD8 pm, UWORD16 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 void l1pctl_transfer_agc_ctrl (WORD8 *agc, UWORD8 *lna_off, UWORD16 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 void l1pctl_npc_agc_read (UWORD8 calibrated_IL[8], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 T_DB_DSP_TO_MCU_GPRS *pdsp_db_r_ptr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 T_NDB_MCU_DSP_GPRS *pdsp_ndb_ptr); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 void l1pctl_dpcma_agc_read (UWORD8 calibrated_IL[8], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 T_DB_DSP_TO_MCU_GPRS *pdsp_db_r_ptr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 T_NDB_MCU_DSP_GPRS *pdsp_ndb_ptr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 UWORD8 pr_table[8]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 void l1pctl_dpcmb_agc_read (UWORD8 calibrated_IL[8], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 T_DB_DSP_TO_MCU_GPRS *pdsp_db_r_ptr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 T_NDB_MCU_DSP_GPRS *pdsp_ndb_ptr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 UWORD8 pr_table[8]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 void l1ps_macs_header_decoding (UWORD8 rx_no, UWORD8 *tfi_result, UWORD8 *pr); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 void l1ps_update_read_set_parameters(void); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 void l1ps_bcch_meas_ctrl (UWORD8 ts); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 /* l1ps_ctrl_single() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 void l1ps_ctrl_single(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 UWORD16 radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 T_INPUT_LEVEL *IL_info_ptr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 UWORD16 dco_algo_ctl_nb = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 UWORD8 if_ctl = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 // By default we choose the hardware filter |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 UWORD8 csf_filter_choice = L1_SAIC_HARDWARE_FILTER; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 UWORD8 saic_flag=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 // needs to be defined for maca_power_control() function call |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 #define DL_pwr_ctrl l1pa_l1ps_com.transfer.dl_pwr_ctrl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 if((l1a_l1s_com.l1s_en_task[task] == TASK_ENABLED) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 !(l1a_l1s_com.task_param[task] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 // Catch ARFCN. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 // ************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 // Get ARFCN to be used for current control. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 radio_freq = l1a_l1s_com.dedic_set.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 #if (TRACE_TYPE==5) && FLOWCHART |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 trace_flowchart_dsp_tpu(dltsk_trace[task].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 if(burst_id == BURST_1) trace_flowchart_dsptx(dltsk_trace[task].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 if (l1pa_l1ps_com.transfer.single_block.activity & (SINGLE_DL | SINGLE_UL)) // trace only if a window is programmed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 trace_fct(CST_L1PS_CTRL_SINGLE, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 /* Program DSP for mulstislot operation... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 /* Downlink */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 if(l1pa_l1ps_com.transfer.single_block.activity & SINGLE_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 // Programs DSP. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 l1pddsp_idle_rx_nb(burst_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 l1pa_l1ps_com.transfer.aset->tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 FALSE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 FALSE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 l1pddsp_idle_rx_nb(burst_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 l1pa_l1ps_com.transfer.aset->tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 FALSE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 // Flag DSP programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 // Set "CTRL_RX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 l1s.dsp_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 /* Uplink */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 if(l1pa_l1ps_com.transfer.single_block.activity & SINGLE_UL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 // Pgme DSP for Single block TX on TS=3. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 l1pddsp_single_tx_block (burst_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 l1pa_l1ps_com.transfer.single_block.data_array, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 l1pa_l1ps_com.transfer.aset->tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 // TXPWR control needs to take into account ALPHA, GAMMA and C values, not only TXPWR MAX |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 // => maca_power_control() needs to be called |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 // Initialization of txpwr control values for all time slots |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 UWORD8 txpwr[8]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 UWORD8 i; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 // Call Uplink Transmit Power level algorithm |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 #if 0 /* LoCosto version */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 maca_power_control(l1pa_l1ps_com.transfer.aset->assignment_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 #else /* TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 maca_power_control(DL_pwr_ctrl.assignment_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 DL_pwr_ctrl.crc_error, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 DL_pwr_ctrl.bcch_level, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 DL_pwr_ctrl.radio_freq_tbl, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 DL_pwr_ctrl.burst_level, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 txpwr); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 for(i = 0; i < 8; i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr[i] = txpwr[i]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 // Pgme DSP for Transmit power on TS=3. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 l1pddsp_transfer_mslot_power(l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr, radio_freq, 0x80 >> 3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 // Flag DSP programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 // Set "CTRL_TX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 /* Program TPU for single slot operation... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 /* Downlink */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 if(l1pa_l1ps_com.transfer.single_block.activity & SINGLE_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 WORD8 agc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 UWORD8 lna_off; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 // Update AGC |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 l1pctl_transfer_agc_ctrl(&agc, &lna_off, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 // Locosto DCO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 cust_get_if_dco_ctl_algo(&dco_algo_ctl_nb, &if_ctl, (UWORD8) L1_IL_VALID, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 l1a_l1s_com.Scell_used_IL.input_level , |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 radio_freq, if_threshold); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 l1ddsp_load_dco_ctl_algo_nb(dco_algo_ctl_nb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 #if (L1_SAIC != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 // If SAIC is enabled, call the low level SAIC control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 // NOTE: l1a_l1s_com.Scell_used_IL.input_level is updated within |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 // the l1pctl_transfer_agc_ctrl above |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 csf_filter_choice = l1ctl_saic(l1a_l1s_com.Scell_used_IL.input_level,l1a_l1s_com.mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 ,task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 ,&saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 // tpu pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 l1pdtpu_serv_rx_nb(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 TRUE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 INACTIVE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 csf_filter_choice, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 ,saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 #endif /* RF_FAM == 61*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 #if (RF_FAM != 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 // tpu pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 #if (L1_SAIC != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 // If SAIC is enabled, call the low level SAIC control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 // NOTE: l1a_l1s_com.Scell_used_IL.input_level is updated within |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 // the l1pctl_transfer_agc_ctrl above |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 l1ctl_saic(l1a_l1s_com.Scell_used_IL.input_level,l1a_l1s_com.mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 ,task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 l1pdtpu_serv_rx_nb(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 TRUE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 INACTIVE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 // Set tpu window identifier for Synthesizer and |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
468 // according to last RX group position. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 l1s.tpu_win = l1_config.params.rx_synth_load_split + RX_SPLIT_TABLE[0]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 // Flag TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
472 // Set "CTRL_RX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 l1s.tpu_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 /* Uplink */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
479 if(l1pa_l1ps_com.transfer.single_block.activity & SINGLE_UL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
481 // Program single block UL slot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 // ****************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 l1pdtpu_serv_tx(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
484 l1pa_l1ps_com.transfer.aset->packet_ta.ta, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 3, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
487 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
488 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
489 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 TX_NB_BURST, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 l1pa_l1ps_com.transfer.single_block.activity & SINGLE_DL, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 INACTIVE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 // Set tpu window identifier for Synthesizer and |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 // according to last TX group position. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 l1s.tpu_win =(UWORD16)( (l1_config.params.rx_synth_load_split) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 ((UWORD16)3 * BP_SPLIT) + l1_config.params.tx_nb_load_split); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 // Flag TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 // Set "CTRL_TX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 l1s.tpu_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 RTTL1_FILL_UL_NB(task, l1pa_l1ps_com.transfer.aset->packet_ta.ta, l1s.applied_txpwr) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 /* General */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
510 /*===============*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
511 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 // Single block UL is now complete, reset its activity flag. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 l1pa_l1ps_com.transfer.single_block.activity &= SINGLE_UL_MASK; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 if(l1pa_l1ps_com.transfer.aset->allocated_tbf == SINGLE_BLOCK_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 // Single block UL is now complete. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 l1pa_l1ps_com.transfer.single_block.activity &= SINGLE_DL_MASK; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 } // End if(task enabled and semaphore false) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 // When the task is aborted, we must continue to make dummy |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 // DSP programming to avoid communication mismatch due |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
527 // to C/W/R pipelining. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
528 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
529 // Flag dummy DSP programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
530 // Set "CTRL_TX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
531 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
532 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
533 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
535 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 /* l1ps_ctrl_prach() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
537 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
538 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
539 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
540 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
541 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
542 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
544 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
545 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
546 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
548 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 void l1ps_ctrl_prach(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
553 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
554 UWORD16 radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
555 UWORD8 txpwr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 UWORD8 adc_active = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
557 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 // Get ARFCN to be used for current control. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 // ****************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
561 radio_freq = l1pa_l1ps_com.p_idle_param.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
562 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 // Get TXPWR value |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
564 txpwr = l1s.applied_txpwr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
565 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
567 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
569 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
570 trace_fct(CST_L1S_CTRL_RACH, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
571 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
572 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 #if (TRACE_TYPE==5) && FLOWCHART |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
574 trace_flowchart_dsp_tpu(dltsk_trace[task].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
578 // Whenever the USF status is unknown then the PRACH control execution |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
579 // has to be postponed until DSP USF interrupt fires. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
580 if (l1ps_macs_com.usf_status != USF_AWAITED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
582 #endif // FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
583 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
584 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
585 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
586 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
587 // TPU and DSP have to be programmed for transmission only if the USF is |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
588 // good otherwise this is not a valid opportunity. If there was no USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
589 // uncertainty then the test is void. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
590 if ( (l1ps_macs_com.usf_status != USF_IT_DSP) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
591 || (((l1ps_dsp_com.pdsp_ndb_ptr->d_usf_updated_gprs >> ((7-0)*2)) & 0x0003) == USF_GOOD)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
592 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 // Flags PRACH burst was controlled to TPU/DSP (not cancelled due to USF) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
594 l1pa_l1ps_com.pra_info.prach_controlled = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
595 #endif // FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
596 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
597 #if (CODE_VERSION!=SIMULATION) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
598 #if (TRACE_TYPE==2 ) || (TRACE_TYPE==3) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 L1_trace_string("PRA"); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
601 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
602 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
603 // Programs DSP for required task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
604 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
605 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
606 UWORD8 cs_type; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
607 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
608 if (l1pa_l1ps_com.access_burst_type == ACC_BURST_8) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
609 cs_type = CS_PAB8_TYPE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 cs_type = CS_PAB11_TYPE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
612 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
613 // ACCESS PRACH dsp control. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 l1pddsp_idle_prach_data(FALSE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 cs_type, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
616 l1pa_l1ps_com.pra_info.channel_request_data, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
617 l1a_l1s_com.Scell_info.bsic, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
618 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
620 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
621 l1pddsp_idle_prach_power(txpwr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
622 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
623 3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
624 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 // ADC measurement |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
626 // *************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
627 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
628 // check if during the RACH an ADC measurement must be performed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 if (l1a_l1s_com.adc_mode & ADC_EACH_RACH) // perform ADC on each burst |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
631 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 // Programs TPU for required task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
635 // tpu pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
636 l1dtpu_serv_tx_ra(radio_freq, l1s.tpu_offset, txpwr, adc_active); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
638 // Set tpu window identifier for Power meas if any. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
639 l1s.tpu_win = (3 * BP_SPLIT) + l1_config.params.tx_ra_load_split + l1_config.params.rx_synth_load_split; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
640 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
641 // Store frame number to report to L3 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 l1pa_l1ps_com.pra_info.fn_to_report = l1s.next_time.fn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
643 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
644 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
645 RTTL1_FILL_UL_AB(task,txpwr) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
646 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
647 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
648 // Flag DSP and TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
649 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
650 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
651 // Set "CTRL_TX" flag in the controle flag register. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
652 l1s.tpu_ctrl_reg |= CTRL_PRACH; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
653 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
654 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
655 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
656 }// if ((l1ps_macs_com.usf_status != USF_IT_DSP) || USF_GOOD) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
657 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
658 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
659 // PRACH has been cancelled because USF not FREE. Hence Read is skipped. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
660 l1pa_l1ps_com.pra_info.prach_controlled = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
661 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
662 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
663 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
664 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
665 } // if (l1ps_macs_com.usf_status != USF_AWAITED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
666 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
667 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
668 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
669 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
670 /* l1ps_ctrl_poll() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
671 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
672 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
673 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
674 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
675 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
676 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
677 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
678 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
679 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
680 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
681 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
682 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
683 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
684 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
685 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
686 void l1ps_ctrl_poll(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
687 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
688 UWORD16 radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
689 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
690 // Get ARFCN to be used for current control. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
691 // ****************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
692 if(l1a_l1s_com.l1s_en_task[SINGLE] == TASK_ENABLED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
693 radio_freq = l1a_l1s_com.dedic_set.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
694 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
695 radio_freq = l1pa_l1ps_com.p_idle_param.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
696 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
697 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
698 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
699 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
700 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
701 trace_fct(CST_L1PS_CTRL_POLL, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
702 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
703 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
704 #if (TRACE_TYPE==5) && FLOWCHART |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
705 trace_flowchart_dsp_tpu(dltsk_trace[task].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
706 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
707 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
708 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
709 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
710 #if (CODE_VERSION!=SIMULATION) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
711 #if (TRACE_TYPE==2 ) || (TRACE_TYPE==3) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
712 L1_trace_string("PRA"); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
713 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
714 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
715 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
716 // Programs DSP for required task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
717 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
718 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
719 UWORD8 cs_type; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
720 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
721 cs_type = l1pa_l1ps_com.poll_info.pol_resp_type; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
722 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
723 if ((cs_type == CS_PAB8_TYPE) || (cs_type == CS_PAB11_TYPE)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
724 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
725 // IDLE POLLING PRACH dsp control. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
726 l1pddsp_idle_prach_data(TRUE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
727 cs_type, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
728 l1pa_l1ps_com.poll_info.chan_req.prach_data[0], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
729 l1a_l1s_com.Scell_info.bsic, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
730 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
731 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
732 l1pddsp_idle_prach_power(l1s.applied_txpwr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
733 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
734 3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
735 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
736 // Programs TPU for required task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
737 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
738 // tpu pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
739 l1dtpu_serv_tx_ra(radio_freq, l1s.tpu_offset, l1s.applied_txpwr,INACTIVE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
740 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
741 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
742 RTTL1_FILL_UL_AB(task,l1s.applied_txpwr) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
743 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
744 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
745 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
746 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
747 UWORD8 tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
748 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
749 if(l1a_l1s_com.l1s_en_task[SINGLE] == TASK_ENABLED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
750 tsc = l1pa_l1ps_com.transfer.aset->tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
751 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
752 tsc = l1pa_l1ps_com.pccch.packet_chn_desc.tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
753 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
754 // Pgm DSP for Poll Response TX NB on TS=3. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
755 l1pddsp_single_tx_block (burst_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
756 l1pa_l1ps_com.poll_info.chan_req.cs1_data, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
757 tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
758 radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
759 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
760 // Pgm DSP for Transmit power. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
761 l1pddsp_transfer_mslot_power(l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr, radio_freq, 0x80>>3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
762 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
763 // Programs TPU for required task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
764 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
765 // tpu pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
766 l1dtpu_serv_tx_nb(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
767 l1pa_l1ps_com.poll_info.timing_advance, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
768 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
769 l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr[3],INACTIVE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
770 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
771 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
772 RTTL1_FILL_UL_NB(task, l1pa_l1ps_com.poll_info.timing_advance, l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr[3]) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
773 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
774 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
775 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
776 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
777 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
778 // Set tpu window identifier for Power meas if any. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
779 l1s.tpu_win = (3 * BP_SPLIT) + l1_config.params.tx_nb_load_split + l1_config.params.rx_synth_load_split; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
780 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
781 // Store frame number to report to L3 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
782 if (burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
783 l1pa_l1ps_com.poll_info.fn_to_report = l1s.next_time.fn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
784 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
785 // Flag DSP and TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
786 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
787 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
788 // Set "CTRL_TX" flag in the controle flag register. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
789 l1s.tpu_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
790 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
791 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
792 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
793 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
794 #if (MOVE_IN_INTERNAL_RAM == 0) // Must be followed by the pragma used to duplicate the funtion in internal RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
795 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
796 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
797 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
798 /* l1s_ctrl_pdtch() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
799 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
800 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
801 /* Description: This is the control function for Multislot Rx/Tx */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
802 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
803 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
804 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
805 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
806 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
807 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
808 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
809 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
810 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
811 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
812 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
813 void l1ps_ctrl_pdtch(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
814 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
815 if((l1a_l1s_com.l1s_en_task[task] == TASK_ENABLED) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
816 !(l1a_l1s_com.task_param[task] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
817 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
818 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
819 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
820 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
821 UWORD16 radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
822 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
823 // By default we choose the hardware filter |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
824 UWORD8 csf_filter_choice = L1_SAIC_HARDWARE_FILTER; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
825 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
826 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
827 UWORD8 saic_flag=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
828 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
829 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
830 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
831 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
832 #if (TRACE_TYPE==5) && FLOWCHART |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
833 trace_flowchart_dsp_tpu(dltsk_trace[PDTCH].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
834 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
835 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
836 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
837 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
838 // Catch channel description and ARFCN. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
839 // ************************************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
840 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
841 // Get ARFCN to be used for current control. This ARFCN comes from |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
842 // the HOPPING algorithm called just before calling this function. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
843 radio_freq = l1a_l1s_com.dedic_set.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
844 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
845 #if (TRACE_TYPE==5) // in simulation trace only one time by frame |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
846 trace_fct(CST_L1PS_CTRL_PDTCH, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
847 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
848 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
849 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
850 /* Program DSP for mulstislot operation... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
851 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
852 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
853 UWORD8 tx_allocation; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
854 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
855 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
856 if (l1_config.TestMode && (l1_config.tmode.tx_params.burst_data == 11)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
857 // Call dummy MACS for CMU200 loopback mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
858 l1ps_tmode_macs_ctrl(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
859 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
860 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
861 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
862 // Call MACS for Medium control, DATA control and RLC-MACS management |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
863 l1ps_macs_ctrl(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
864 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
865 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
866 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
867 if (l1ps_macs_com.usf_status != USF_AWAITED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
868 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
869 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
870 // Compute tx_allocation mixing NB and RA allocations. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
871 tx_allocation = l1ps_macs_com.tx_nb_allocation | l1ps_macs_com.tx_prach_allocation; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
872 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
873 // Pgme TXPWR only if any UL. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
874 if(tx_allocation) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
875 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
876 // Pgme DSP for Transmit power. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
877 // !!! Warning: This function must be called before l1pdtpu_serv_tx() |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
878 // !!! a_ctrl_abb_gprs is partly overwritten by l1pdtpu_serv_tx() |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
879 l1pddsp_transfer_mslot_power(l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr, radio_freq, tx_allocation); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
880 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
881 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
882 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
883 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
884 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
885 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
886 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
887 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
888 /* Program TPU for mulstislot operation... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
889 /**************************************************************************/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
890 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
891 WORD8 ts = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
892 UWORD8 rx_group_id = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
893 UWORD8 tx_group_id = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
894 BOOL pwr_programmed = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
895 UWORD8 bit_mask = 0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
896 WORD8 agc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
897 UWORD8 lna_off; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
898 BOOL rx_done_flag; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
899 BOOL adc_done = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
900 UWORD8 adc_active = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
901 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
902 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
903 UWORD16 dco_algo_ctl_nb = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
904 UWORD16 dco_algo_ctl_pw = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
905 UWORD8 if_ctl =0; //omaps00090550; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
906 UWORD8 tot_num_rx = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
907 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
908 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
909 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
910 // AGC and LNA_OFF processing |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
911 //--------------------------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
912 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
913 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
914 #if L1_EDA |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
915 if (l1ps_macs_com.usf_status != USF_AWAITED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
916 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
917 if (l1ps_macs_com.usf_status != USF_IT_DSP) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
918 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
919 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
920 // Same AGC is used for all timeslots |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
921 l1pctl_transfer_agc_ctrl(&agc, &lna_off, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
922 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
923 #if (L1_SAIC != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
924 // If SAIC is enabled, call the low level SAIC control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
925 // NOTE: l1a_l1s_com.Scell_used_IL.input_level is updated within |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
926 // the l1pctl_transfer_agc_ctrl above |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
927 csf_filter_choice = l1ctl_saic(l1a_l1s_com.Scell_used_IL.input_level,l1a_l1s_com.mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
928 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
929 ,task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
930 ,&saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
931 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
932 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
933 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
934 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
935 while(ts < 8) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
936 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
937 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
938 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
939 #if L1_EDA |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
940 //Depending on USF status got from DSP, RX allocation may change after |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
941 //receiving the USF interrupt due to USF status updates |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
942 if ((l1ps_macs_com.rx_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
943 && (l1ps_macs_com.usf_status != USF_AWAITED)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
944 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
945 if ((l1ps_macs_com.rx_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
946 && (l1ps_macs_com.usf_status != USF_IT_DSP)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
947 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
948 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
949 if(l1ps_macs_com.rx_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
950 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
951 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
952 // We have detected the 1st RX slot number for a new RX group. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
953 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
954 UWORD8 rx_id = ts; // Save 1st RX timeslot number. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
955 UWORD8 num_rx = 1; // 1 RX in the RX group for the moment. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
956 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
957 // Increment the RX group ID. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
958 rx_group_id++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
959 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
960 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
961 //Increment the total number of RX slots |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
962 tot_num_rx++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
963 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
964 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
965 // Increment TS. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
966 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
967 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
968 // Jump on next timeslot to keep looking for contiguous RX slots. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
969 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
970 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
971 // Look for more contiguous RX slots. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
972 while((l1ps_macs_com.rx_allocation & bit_mask) && (ts < 8)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
973 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
974 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
975 num_rx++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
976 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
977 tot_num_rx++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
978 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
979 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
980 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
981 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
982 // Check if more RX bursts follow |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
983 if((l1ps_macs_com.rx_allocation << (ts+1)) & 0xFF) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
984 rx_done_flag = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
985 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
986 rx_done_flag = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
987 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
988 #if (RF_FAM == 61) // Locosto DCO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
989 if(rx_group_id == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
990 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
991 cust_get_if_dco_ctl_algo(&dco_algo_ctl_nb, &if_ctl, (UWORD8) L1_IL_VALID, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
992 l1a_l1s_com.Scell_used_IL.input_level, radio_freq,if_threshold); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
993 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
994 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
995 if(rx_done_flag == TRUE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
996 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
997 //dco_algo_ctl has 0000 00ZL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
998 dco_algo_ctl_nb *= 0x55; // replicate 0000 00zL as ZLZL ZLZL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
999 // ZLZLZLZL >> 2*(4-tot_num_rx) where i is the tot_num_rx would produce the |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1000 // desired dco_algo_ctl_nb For Eg if tot_num_rx is 2 the desired pattern is |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1001 // 0000 ZLZL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1002 dco_algo_ctl_nb = dco_algo_ctl_nb >> (2*( 4 - tot_num_rx)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1003 l1ddsp_load_dco_ctl_algo_nb(dco_algo_ctl_nb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1004 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1005 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1006 // ADC measurement |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1007 // *************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1008 if (adc_done == FALSE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1009 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1010 // check if during the PDTCH burst an ADC measurement must be performed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1011 if (l1a_l1s_com.adc_mode & ADC_NEXT_TRAFFIC_DL) // perform ADC only one time |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1012 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1013 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1014 adc_done = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1015 l1a_l1s_com.adc_mode &= ADC_MASK_RESET_TRAFFIC; // reset in order to have only one ADC measurement in Traffic |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1016 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1017 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1018 if (l1a_l1s_com.adc_mode & ADC_EACH_TRAFFIC_DL) // perform ADC on each period bloc |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1019 if (l1s.actual_time.fn_mod104 == 10) //periodic with each PDTCH burst in frame 11 (frame with the lowest CPU load) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1020 if ((++l1a_l1s_com.adc_cpt)>=l1a_l1s_com.adc_traffic_period) // wait for the period |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1021 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1022 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1023 adc_done = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1024 l1a_l1s_com.adc_cpt = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1025 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1026 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1027 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1028 // update the TPU with the new TOA if necessary |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1029 if (rx_group_id == 1) // only if synchro performed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1030 l1ctl_update_TPU_with_toa(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1031 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1032 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1033 trace_fct(CST_L1PS_CTRL_PDTCH_DL_BURST0 + burst_id, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1034 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1035 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1036 // Program RX scenario. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1037 l1pdtpu_serv_rx_nb(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1038 agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1039 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1040 rx_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1041 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1042 num_rx, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1043 rx_group_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1044 rx_done_flag,adc_active |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1045 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1046 ,csf_filter_choice |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1047 ,if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1048 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1049 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1050 ,saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1051 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1052 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1053 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1054 adc_active = INACTIVE; // ADC performed only on the first RX burst |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1055 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1056 // Set tpu window identifier for Synthesizer and |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1057 // according to last RX group position. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1058 l1s.tpu_win = (l1_config.params.rx_synth_load_split) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1059 ((UWORD16)rx_id * BP_SPLIT) + RX_SPLIT_TABLE[num_rx-1]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1060 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1061 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1062 // Set "CTRL_RX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1063 l1s.tpu_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1064 l1s.dsp_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1065 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1066 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1067 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1068 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1069 if ((l1ps_macs_com.tx_nb_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1070 && (l1ps_macs_com.usf_status != USF_AWAITED)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1071 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1072 if(l1ps_macs_com.tx_nb_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1073 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1074 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1075 // We have detected the 1st TX NB slot number for a new TX group. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1076 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1077 UWORD8 tx_id = ts; // Save 1st TX timeslot number. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1078 UWORD8 num_tx = 1; // 1 RX in the TX group for the moment. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1079 UWORD8 switch_flag; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1080 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1081 // Increment the TX group ID. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1082 tx_group_id++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1083 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1084 // Increment TS. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1085 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1086 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1087 // Jump on next timeslot to keep looking for contiguous TX slots. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1088 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1089 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1090 // Look for more contiguous TX slots. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1091 while((l1ps_macs_com.tx_nb_allocation & bit_mask) && (ts < 8)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1092 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1093 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1094 num_tx++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1095 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1096 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1097 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1098 // Detect special case: TX NB followed by PRACH. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1099 if(l1ps_macs_com.tx_prach_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1100 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1101 switch_flag = 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1102 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1103 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1104 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1105 switch_flag = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1106 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1107 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1108 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1109 trace_fct(CST_L1PS_CTRL_PDTCH_UL, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1110 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1111 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1112 // Program TN NB scenario. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1113 l1pdtpu_serv_tx(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1114 l1pa_l1ps_com.transfer.aset->packet_ta.ta, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1115 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1116 tx_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1117 num_tx, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1118 tx_group_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1119 switch_flag, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1120 0, // Driver called for Normal Burst. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1121 TRUE,INACTIVE);// Flag RX in same frame as TX |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1122 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1123 // Set tpu window identifier for Synthesizer and |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1124 // according to last TX group position. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1125 // TX offset = tx_id * BP_SPLIT |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1126 // TX load = (num_tx-1) * BP_SPLIT + l1_config.params.tx_load_split |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1127 l1s.tpu_win = (l1_config.params.rx_synth_load_split) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1128 ((UWORD16)tx_id * BP_SPLIT) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1129 ((UWORD16)(num_tx -1) * BP_SPLIT) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1130 l1_config.params.tx_nb_load_split; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1131 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1132 // Set "CTRL_TX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1133 l1s.tpu_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1134 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1135 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1136 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1137 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1138 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1139 if ((l1ps_macs_com.tx_prach_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1140 && (l1ps_macs_com.usf_status != USF_AWAITED)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1141 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1142 if(l1ps_macs_com.tx_prach_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1143 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1144 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1145 // We have detected a TX RA. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1146 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1147 UWORD8 switch_flag; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1148 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1149 // Increment the TX group ID. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1150 tx_group_id++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1151 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1152 // Jump on next timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1153 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1154 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1155 // Detect special case: PRACH followed by TX NB. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1156 if(l1ps_macs_com.tx_nb_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1157 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1158 switch_flag = 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1159 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1160 // Detect special case: PRACH followed by PRACH |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1161 else if (l1ps_macs_com.tx_prach_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1162 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1163 // Solution with DSP patch supporting PRACH|PRACH |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1164 switch_flag = 2; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1165 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1166 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1167 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1168 switch_flag = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1169 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1170 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1171 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1172 trace_fct(CST_L1PS_CTRL_PDTCH_RA, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1173 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1174 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1175 // Program TX RA scenario. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1176 l1pdtpu_serv_tx(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1177 l1pa_l1ps_com.transfer.aset->packet_ta.ta, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1178 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1179 ts, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1180 1, // Driver is called for each PRACH. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1181 tx_group_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1182 switch_flag, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1183 TX_RA_BURST, // Driver called for PRACH Burst. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1184 TRUE,INACTIVE); // Flag RX in same frame as TX |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1185 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1186 // Set tpu window identifier for Synthesizer and |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1187 // according to last TX group position. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1188 // TX offset = ts * BP_SPLIT |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1189 // TX load = l1_config.params.tx_nb_load_split |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1190 // original value of TX load (RACH) replaced by TX NB to take into account TX_NB|PRACH with max. TA |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1191 l1s.tpu_win = (l1_config.params.rx_synth_load_split) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1192 ((UWORD16)ts * BP_SPLIT) + |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1193 l1_config.params.tx_nb_load_split; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1194 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1195 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1196 // Increment TS. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1197 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1198 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1199 // Set "CTRL_TX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1200 l1s.tpu_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1201 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1202 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1203 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1204 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1205 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1206 if ((l1ps_macs_com.pwr_allocation & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1207 && (pwr_programmed == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1208 && (l1ps_macs_com.usf_status != USF_AWAITED)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1209 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1210 if((l1ps_macs_com.pwr_allocation & bit_mask) && (pwr_programmed == 0)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1211 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1212 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1213 // We have detected a PWR allocation and no PWR programmed in current frame. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1214 if((l1pa_l1ps_com.transfer.aset->pc_meas_chan == FALSE) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1215 ((l1s.actual_time.t2 == 1) || (l1s.actual_time.t2 == 9) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1216 || (l1s.actual_time.t2 == 18))) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1217 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1218 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1219 trace_fct(CST_CTRL_PC_MEAS_CHAN, (UWORD32)(-1)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1220 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1221 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1222 // Measurement on the beacon (PC_MEAS_CHAN = 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1223 l1ps_bcch_meas_ctrl(ts); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1224 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1225 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1226 if(l1pa_l1ps_com.l1ps_en_meas & P_TCRMS_MEAS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1227 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1228 // Neighbour Measurement CTRL Phase |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1229 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1230 // Note: Test on l1s.forbid_meas can't be done from the fact that at this |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1231 // level, l1s.forbid_meas is not set. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1232 // l1ps_ctrl_pdtch is called before CTRL of FB26/SB26/SBCNF26. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1233 if(!((l1s.actual_time.t2 == 23) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1234 ((l1s.task_status[FB26].current_status != INACTIVE) || |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1235 (l1s.task_status[SB26].current_status != INACTIVE) || |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1236 (l1s.task_status[SBCNF26].current_status != INACTIVE)))&& |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1237 !(l1pa_l1ps_com.tcr_freq_list.new_list_present && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1238 ((l1pa_l1ps_com.tcr_freq_list.cres_meas_report == 0) || |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1239 (l1pa_l1ps_com.tcr_freq_list.cres_meas_report == 103)))) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1240 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1241 if(!(l1pa_l1ps_com.meas_param & P_TCRMS_MEAS)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1242 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1243 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1244 trace_fct(CST_CTRL_TCR_MEAS_1, (UWORD32)(-1)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1245 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1246 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1247 l1ps_tcr_ctrl((UWORD8)ts); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1248 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1249 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1250 } // End of CTRL PDTCH phase |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1251 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1252 // Increment TS. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1253 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1254 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1255 // Flag that a PWR as been programmed for current frame. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1256 pwr_programmed = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1257 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1258 // Jump on next timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1259 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1260 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1261 // Call PWR control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1262 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1263 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1264 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1265 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1266 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1267 // Increment TS. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1268 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1269 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1270 // Jump on next timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1271 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1272 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1273 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1274 } // End of "while(ts < 8)" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1275 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1276 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1277 if (l1ps_macs_com.usf_status != USF_AWAITED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1278 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1279 // Update of AFC |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1280 l1pd_afc(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1281 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1282 } // End if(task enabled and semaphore false) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1283 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1284 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1285 // When the task is aborted, we must continue to make dummy |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1286 // DSP programming to avoid communication mismatch due |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1287 // to C/W/R pipelining. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1288 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1289 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1290 trace_fct(CST_L1PS_CTRL_PDTCH_DUMMY, (UWORD32)(-1)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1291 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1292 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1293 // Flag dummy DSP programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1294 // Set "CTRL_TX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1295 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1296 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1297 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1298 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1299 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1300 #endif // MOVE_IN_INTERNAL_RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1301 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1302 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1303 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1304 /* l1s_read_single() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1305 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1306 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1307 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1308 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1309 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1310 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1311 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1312 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1313 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1314 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1315 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1316 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1317 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1318 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1319 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1320 void l1ps_read_single(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1321 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1322 if((l1a_l1s_com.l1s_en_task[task] == TASK_ENABLED) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1323 !(l1a_l1s_com.task_param[task] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1324 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1325 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1326 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1327 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1328 // Read param updating... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1329 if (l1ps.read_param.new_set == TRUE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1330 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1331 // If it's the first Read phase of the block (first of the new TBF) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1332 if (burst_id == BURST_1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1333 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1334 // Update the "read_param" structure |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1335 l1ps_update_read_set_parameters(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1336 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1337 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1338 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1339 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1340 /* READ TRANSMIT TASK RESULTS... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1341 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1342 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1343 l1_check_com_mismatch(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1344 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1345 // check PM error only in case of downlink single block |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1346 if(l1ps.read_param.allocated_tbf == SINGLE_BLOCK_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1347 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1348 UWORD32 pm; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1349 pm = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[0] & 0xffff) >> 5; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1350 l1_check_pm_error(pm,task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1351 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1352 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1353 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1354 // Two phase access: downlink PDCH reading |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1355 if((l1ps.read_param.allocated_tbf == TWO_PHASE_ACCESS)&& |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1356 (l1ps_dsp_com.pdsp_db_r_ptr->d_task_d_gprs & (0x80 >> 0))) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1357 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1358 UWORD8 IL_for_rxlev[8]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1359 UWORD8 pr_table[8]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1360 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1361 if (burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1362 l1ps_macs_header_decoding(0, &(IL_for_rxlev[0]), &(pr_table[0])); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1363 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1364 // Update AGC and extract IL for RXLEV |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1365 //------------------------------------ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1366 if (l1ps.read_param.dl_pwr_ctl.p0 == 255) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1367 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1368 // No power control mode AGC algorithm |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1369 l1pctl_npc_agc_read(IL_for_rxlev, l1ps_dsp_com.pdsp_db_r_ptr, l1ps_dsp_com.pdsp_ndb_ptr); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1370 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1371 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1372 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1373 // Downlink power control AGC algorithms |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1374 if (l1pa_l1ps_com.transfer.aset->dl_pwr_ctl.bts_pwr_ctl_mode == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1375 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1376 // BTS Power control mode A |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1377 l1pctl_dpcma_agc_read(IL_for_rxlev, l1ps_dsp_com.pdsp_db_r_ptr, l1ps_dsp_com.pdsp_ndb_ptr, pr_table); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1378 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1379 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1380 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1381 // BTS power control mode B |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1382 l1pctl_dpcmb_agc_read(IL_for_rxlev, l1ps_dsp_com.pdsp_db_r_ptr, l1ps_dsp_com.pdsp_ndb_ptr, pr_table); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1383 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1384 } // End of "AGC algorithm" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1385 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1386 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1387 #if (TRACE_TYPE!=0) && (TRACE_TYPE !=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1388 trace_fct(CST_L1PS_READ_SINGLE, l1a_l1s_com.Scell_info.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1389 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1390 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1391 // Read downlink DATA block from MCU/DSP interface. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1392 // ************************************************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1393 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1394 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1395 xSignalHeaderRec *msg; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1396 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1397 #if (TRACE_TYPE==5) // in simulation trace only the 4th burst |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1398 trace_fct(CST_L1PS_READ_SINGLE, l1a_l1s_com.Scell_info.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1399 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1400 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1401 if(l1ps.read_param.allocated_tbf == TWO_PHASE_ACCESS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1402 // 2 phase ACCESS. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1403 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1404 if((l1ps_dsp_com.pdsp_db_r_ptr->d_task_u_gprs & (0x80 >> 3)) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1405 (l1s.task_status[POLL].current_status == INACTIVE)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1406 // UL block sent... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1407 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1408 // Send confirmation msg to L3/MACA. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1409 msg = os_alloc_sig(sizeof(T_MPHP_SINGLE_BLOCK_CON)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1410 DEBUGMSG(status,NU_ALLOC_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1411 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1412 // Return "Single block" purpose. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1413 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->purpose = |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1414 l1pa_l1ps_com.transfer.aset->assignment_command; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1415 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->assignment_id = |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1416 l1pa_l1ps_com.transfer.aset->assignment_id; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1417 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1418 // Return status and CRC error (CRC error not applicable). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1419 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->status = SINGLE_UL_DONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1420 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->dl_error_flag = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1421 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1422 // MSG is sent to L1A to stop PCCCH or CCCH/BCCH reading. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1423 msg->SignalCode = L1P_SINGLE_BLOCK_CON; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1424 os_send_sig(msg, L1C1_QUEUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1425 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1426 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1427 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1428 if(l1ps_dsp_com.pdsp_db_r_ptr->d_task_d_gprs & (0x80 >> 0)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1429 // DL block received... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1430 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1431 UWORD16 pwr_level; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1432 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1433 #if (L1_FF_MULTIBAND == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1434 UWORD16 operative_radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1435 #endif /*(L1_FF_MULTIBAND == 1)*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1436 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1437 // this bloc doesn't compute the burst input level, so the last_input_level is used. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1438 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1439 #if (L1_FF_MULTIBAND == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1440 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1441 pwr_level = l1a_l1s_com.last_input_level[l1a_l1s_com.Scell_info.radio_freq].input_level; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1442 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1443 #else // L1_FF_MULTIBAND = 1 below |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1444 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1445 operative_radio_freq = |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1446 l1_multiband_radio_freq_convert_into_operative_radio_freq(l1a_l1s_com.Scell_info.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1447 pwr_level = l1a_l1s_com.last_input_level[operative_radio_freq].input_level; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1448 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1449 #endif // #if (L1_FF_MULTIBAND == 0) else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1450 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1451 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1452 // Read L3 frame block and send msg to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1453 l1s_read_l3frm(pwr_level, &(l1ps_dsp_com.pdsp_ndb_ptr->a_dd_gprs[0][0]), task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1454 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1455 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1456 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1457 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1458 // SYNCHRO task is not schedule if we are in the specific case: |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1459 // L1A is touching SYNCHRO parameters (tn_difference, dl_tn and dsp_scheduler_mode) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1460 // and leave L1A to go in HISR (L1S) in middle of the update (cf. BUG1339) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1461 if(l1a_l1s_com.task_param[SYNCHRO] == SEMAPHORE_RESET) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1462 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1463 //---------------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1464 // Synchro back |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1465 //---------------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1466 // Save the "timeslot difference" between new and old configuration |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1467 // in "tn_difference". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1468 // tn_difference -> loaded with the number of timeslot to shift. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1469 // dl_tn -> loaded with the new timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1470 l1a_l1s_com.tn_difference += l1pa_l1ps_com.transfer.single_block.dl_tn_to_restore - |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1471 l1a_l1s_com.dl_tn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1472 l1a_l1s_com.dl_tn = l1pa_l1ps_com.transfer.single_block.dl_tn_to_restore; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1473 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1474 // Select DSP Scheduler used in packet Idle (can be CCCH or PCCCH). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1475 if((l1a_l1s_com.l1s_en_task[ALLC] == TASK_ENABLED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1476 || (l1a_l1s_com.l1s_en_task[NP] == TASK_ENABLED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1477 || (l1a_l1s_com.l1s_en_task[EP] == TASK_ENABLED)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1478 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1479 // We are in CS Idle on CCCH. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1480 l1a_l1s_com.dsp_scheduler_mode = GSM_SCHEDULER; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1481 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1482 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1483 // Enable SYNCHRO task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1484 l1a_l1s_com.l1s_en_task[SYNCHRO] = TASK_ENABLED; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1485 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1486 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1487 //------------------ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1488 // Confirmation msg |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1489 //------------------ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1490 // Common part... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1491 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1492 // Send confirmation msg to L3/MACA. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1493 msg = os_alloc_sig(sizeof(T_MPHP_SINGLE_BLOCK_CON)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1494 DEBUGMSG(status,NU_ALLOC_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1495 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1496 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1497 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->purpose = |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1498 l1pa_l1ps_com.transfer.aset->assignment_command; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1499 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->assignment_id = |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1500 l1pa_l1ps_com.transfer.aset->assignment_id; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1501 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1502 msg->SignalCode = L1P_SINGLE_BLOCK_CON; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1503 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1504 // Disable SINGLE task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1505 l1s.task_status[task].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1506 l1a_l1s_com.l1s_en_task[task] = TASK_DISABLED; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1507 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1508 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1509 // Differentiated part... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1510 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1511 if(l1pa_l1ps_com.transfer.aset->allocated_tbf == SINGLE_BLOCK_UL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1512 // SINGLE UL task is complete. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1513 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1514 // Return status and CRC error (CRC error not applicable). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1515 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->status = SINGLE_UL_DONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1516 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->dl_error_flag = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1517 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1518 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1519 if(l1ps.read_param.allocated_tbf == SINGLE_BLOCK_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1520 // SINGLE DL task is complete. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1521 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1522 API *info_address; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1523 UWORD32 i,j; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1524 UWORD32 word32; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1525 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1526 info_address = &(l1ps_dsp_com.pdsp_ndb_ptr->a_dd_gprs[0][0]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1527 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1528 // Return status and CRC error |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1529 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->status = SINGLE_DL_DONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1530 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->dl_error_flag = ((*info_address & 0x0100) >> 8); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1531 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1532 // Download data from API to message. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1533 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1534 // Get 24 bytes info. from DSP: CS1 meaningful block is of size 12 UWORD16 data. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1535 // !!! WARNING: word32 type is for compatibility with chipset == 0. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1536 // Can be word16 if only chipset == 2 is used. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1537 for (j=0, i=0; i<12; i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1538 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1539 word32 = info_address[4 + i]; // Get info word, rem: skip info. header. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1540 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->data_array[j++] = (word32 & 0x000000ff); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1541 ((T_MPHP_SINGLE_BLOCK_CON *)(msg->SigP))->data_array[j++] = (word32 & 0x0000ff00) >> 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1542 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1543 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1544 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1545 // send message... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1546 os_send_sig(msg, L1C1_QUEUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1547 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1548 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1549 } // End else (!TWO_PHASE_ACCESS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1550 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1551 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1552 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1553 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1554 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1555 } // End if(task enabled and semaphore false) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1556 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1557 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1558 // When the task is aborted, we must continue to make dummy |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1559 // DSP/TPU programming to avoid communication mismatch due |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1560 // to C/W/R pipelining. Dummy MCU/DSP reading is also done. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1561 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1562 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1563 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1564 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1565 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1566 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1567 #if (MOVE_IN_INTERNAL_RAM == 0) // Must be followed by the pragma used to duplicate the funtion in internal RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1568 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1569 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1570 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1571 /* l1ps_read_pdtch() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1572 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1573 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1574 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1575 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1576 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1577 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1578 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1579 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1580 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1581 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1582 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1583 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1584 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1585 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1586 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1587 void l1ps_read_pdtch(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1588 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1589 if((l1a_l1s_com.l1s_en_task[task] == TASK_ENABLED) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1590 !(l1a_l1s_com.task_param[task] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1591 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1592 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1593 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1594 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1595 BOOL beacon; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1596 T_INPUT_LEVEL *IL_info_ptr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1597 UWORD16 radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1598 WORD8 ts = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1599 UWORD8 bit_mask = 0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1600 WORD8 bcch_level; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1601 UWORD8 rx_no = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1602 BOOL first_valid_block = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1603 BOOL crc_error = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1604 UWORD8 i; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1605 UWORD32 best_snr = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1606 UWORD32 best_angle = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1607 UWORD32 best_pm = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1608 UWORD8 IL_for_rxlev[8], pr_table[8]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1609 WORD16 best_rxlev_accu = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1610 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1611 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1612 static BOOL crc_error_tbl[8] = {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE}; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1613 static WORD16 rxlev_accu[8] = {0, 0, 0, 0, 0, 0, 0, 0}; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1614 static WORD8 burst_level[4] = {(WORD8)0x80, (WORD8)0x80, (WORD8)0x80, (WORD8)0x80}; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1615 static UWORD16 radio_freq_tbl[4]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1616 static UWORD32 toa_val[4] = {0, 0, 0, 0}; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1617 static UWORD32 snr_val[4] = {0, 0, 0, 0}; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1618 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1619 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1620 xSignalHeaderRec *msg; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1621 static UWORD32 tm_pm_fullres = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1622 static UWORD32 tm_snr = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1623 static UWORD32 tm_toa = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1624 static WORD16 tm_angle = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1625 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1626 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1627 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1628 #define burst_number l1ps_dsp_com.pdsp_db_r_ptr->d_burst_nb_gprs |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1629 #define DL_pwr_ctrl l1pa_l1ps_com.transfer.dl_pwr_ctrl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1630 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1631 // Read parameters updating |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1632 // ************************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1633 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1634 // *********** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1635 // * WARNING * |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1636 // *********** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1637 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1638 // Because of the STI implementation, the parameters under the "l1pa_l1ps_com.transfer.aset" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1639 // structure mustn't be used in the Read PDTCH functions |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1640 // This is due to the following case that may happen: |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1641 // |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1642 // C|W R | |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1643 // |C W R | |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1644 // | C W R| TBF 1 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1645 // | C W|R <--------------------------- (2) This "read phase" must use the TBF 1 parameters while "aset" has already been updated |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1646 //---------------------- so the read_param structure is used |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1647 // | C|W R <------------------------- (3) The read_param is updated with TBF 2 parameters |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1648 // | |C W R at the beguining of the first Read of TBF 2 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1649 // | | C W R TBF 2 so when (l1ps.read_param.new_set = TRUE and burst_id = BURST_1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1650 // | | C W R |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1651 // ^ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1652 // (1) TBF 2 starting time detected on this frame (no SYNCHRO change needed between TBF1 and TBF 2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1653 // --> aset parameters updated to TBF 2 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1654 // --> l1ps.read_param.new_set set to TRUE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1655 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1656 // If a new TBF has been enabled... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1657 if (l1ps.read_param.new_set == TRUE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1658 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1659 // If it's the first Read phase of the block (first of the new TBF) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1660 if (burst_id == BURST_1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1661 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1662 // Update the "read_param" structure |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1663 l1ps_update_read_set_parameters(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1664 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1665 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1666 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1667 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1668 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1669 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1670 l1_check_com_mismatch(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1671 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1672 radio_freq = l1a_l1s_com.dedic_set.radio_freq_dd; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1673 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1674 if(l1ps.read_param.pc_meas_chan) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1675 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1676 radio_freq_tbl[burst_number] = radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1677 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1678 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1679 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1680 radio_freq_tbl[burst_number] = l1a_l1s_com.Scell_info.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1681 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1682 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1683 if (radio_freq == l1a_l1s_com.Scell_info.radio_freq) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1684 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1685 beacon=1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1686 IL_info_ptr = &l1a_l1s_com.Scell_info.traffic_meas_beacon; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1687 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1688 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1689 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1690 beacon=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1691 IL_info_ptr = &l1a_l1s_com.Scell_info.traffic_meas; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1692 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1693 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1694 // Call maca_power_control() in order to get TXPWR value |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1695 if(l1ps_dsp_com.pdsp_db_r_ptr->d_burst_nb_gprs == 2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1696 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1697 UWORD8 txpwr[8]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1698 UWORD8 i; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1699 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1700 // Due to the CWR pipeleine, maca_power_control() has to be called before the |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1701 // CTRL of the first PDTCH i.e. in l1ps_ctrl_pdtch(). It means that crc_error, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1702 // radio_freq_tbl[], burst_level[] and bcch_level information are stored on |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1703 // burst4 of READ phase ("l1ps_ctrl_pdtch()") to be used on burst4 of CTRL phase. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1704 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1705 // Call Uplink Transmit Power level algorithm |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1706 #if 0 /* LoCosto version */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1707 maca_power_control(l1ps.read_param.assignment_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1708 #else /* TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1709 maca_power_control(DL_pwr_ctrl.assignment_id, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1710 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1711 DL_pwr_ctrl.crc_error, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1712 DL_pwr_ctrl.bcch_level, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1713 DL_pwr_ctrl.radio_freq_tbl, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1714 DL_pwr_ctrl.burst_level, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1715 txpwr); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1716 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1717 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1718 if(!l1_config.TestMode) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1719 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1720 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1721 for(i = 0; i < 8; i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1722 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1723 l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr[i] = txpwr[i]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1724 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1725 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1726 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1727 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1728 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1729 if(l1ps_dsp_com.pdsp_db_r_ptr->d_burst_nb_gprs == 3) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1730 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1731 /* Complete PDTCH DL block has been processed by DSP */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1732 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1733 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1734 #if (TRACE_TYPE == 5) // in simulation trace only the latest burst |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1735 trace_fct(CST_L1PS_READ_PDTCH, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1736 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1737 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1738 // Call MACS... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1739 l1ps_macs_read(pr_table); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1740 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1741 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1742 // Update AGC and extract IL for RXLEV |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1743 //------------------------------------ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1744 if (l1ps.read_param.dl_pwr_ctl.p0 == 255) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1745 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1746 // No power control mode AGC algorithm |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1747 l1pctl_npc_agc_read(IL_for_rxlev, l1ps_dsp_com.pdsp_db_r_ptr, l1ps_dsp_com.pdsp_ndb_ptr); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1748 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1749 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1750 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1751 // Downlink power control AGC algorithms |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1752 if (l1ps.read_param.dl_pwr_ctl.bts_pwr_ctl_mode == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1753 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1754 // BTS Power control mode A |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1755 l1pctl_dpcma_agc_read(IL_for_rxlev, l1ps_dsp_com.pdsp_db_r_ptr, l1ps_dsp_com.pdsp_ndb_ptr, pr_table); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1756 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1757 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1758 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1759 // BTS power control mode B |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1760 l1pctl_dpcmb_agc_read(IL_for_rxlev, l1ps_dsp_com.pdsp_db_r_ptr, l1ps_dsp_com.pdsp_ndb_ptr, pr_table); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1761 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1762 } // End of "AGC algorithm" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1763 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1764 // TOA algorithm is called with toa/snr pair from last block (N-1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1765 // Feed TOA histogram with values from good bursts (crc_error = FALSE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1766 // otherwise input snr = 0. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1767 #if (TOA_ALGO != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1768 // Good block, TOA from TS=0 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1769 #if (TOA_ALGO == 2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1770 if(l1s.toa_var.toa_snr_mask == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1771 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1772 if(l1s.toa_snr_mask == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1773 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1774 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1775 #if (TOA_ALGO == 2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1776 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1777 UWORD32 snr_temp; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1778 snr_temp = (crc_error_tbl[0] == FALSE) ? snr_val[burst_id] : 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1779 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa_val[burst_id]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1780 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1781 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1782 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1783 /* FreeCalypso TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1784 if (crc_error_tbl[0] == FALSE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1785 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1786 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1787 snr_val[burst_id], toa_val[burst_id], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1788 &l1s.toa_update, &l1s.toa_period_count |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1789 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1790 ,0 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1791 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1792 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1793 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1794 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1795 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1796 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1797 0, toa_val[burst_id], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1798 &l1s.toa_update, &l1s.toa_period_count |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1799 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1800 ,0 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1801 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1802 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1803 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1804 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1805 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1806 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1807 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1808 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1809 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1810 /* Read burst demodulation info for control algos */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1811 /* Use all burst results to feed the algos. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1812 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1813 while(ts < 8) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1814 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1815 if(l1ps_dsp_com.pdsp_db_r_ptr->d_task_d_gprs & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1816 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1817 UWORD32 toa; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1818 UWORD32 pm; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1819 UWORD32 angle; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1820 UWORD32 snr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1821 WORD8 rxlev; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1822 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1823 // Read control results and feed control algorithms. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1824 // ************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1825 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1826 // Read control information. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1827 toa = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_toa_gprs[ts] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1828 pm = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[ts] & 0xffff)>>5; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1829 angle = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_angle_gprs[ts] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1830 snr = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_snr_gprs[ts] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1831 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1832 #if (TRACE_TYPE != 0) && (TRACE_TYPE != 5) // for debug trace all bursts |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1833 trace_fct(CST_L1PS_READ_PDTCH_BURST, (UWORD32)(-1)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1834 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1835 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1836 l1_check_pm_error(pm,task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1837 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1838 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1839 // Test mode stats |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1840 if (l1_config.TestMode) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1841 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1842 if (bit_mask & l1_config.tmode.stats_config.stat_gprs_slots) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1843 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1844 tm_pm_fullres += (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[ts] & 0xffff); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1845 tm_snr += snr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1846 tm_toa += toa; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1847 tm_angle += (WORD16) angle; // signed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1848 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1849 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1850 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1851 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1852 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1853 RTTL1_FILL_DL_BURST(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev[ts]) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1854 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1855 #if 0 //(TRACE_TYPE == 1) || (TRACE_TYPE == 4) // TCS211 reconstruction |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1856 l1_trace_burst_param(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev[ts]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1857 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1858 #if (BURST_PARAM_LOG_ENABLE == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1859 l1_log_burst_param(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev[ts]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1860 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1861 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1862 //Look for the pairs angle, snr with the maximum snr |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1863 if (snr > best_snr) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1864 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1865 best_snr = snr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1866 best_angle = angle; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1867 best_pm = pm; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1868 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1869 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1870 // store toa value from first TS |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1871 if (ts==0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1872 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1873 toa_val[burst_id] = toa; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1874 snr_val[burst_id] = snr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1875 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1876 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1877 // Store Received Signal Level to be used in Uplink Transmit Power Algorithm. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1878 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1879 // Compute RXLEV |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1880 rxlev = l1s_encode_rxlev(IL_for_rxlev[ts]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1881 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1882 // Find first correct PDTCH, save RXLEV and CRC |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1883 if(!crc_error_tbl[ts] && first_valid_block) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1884 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1885 if(l1ps.read_param.pc_meas_chan) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1886 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1887 burst_level[burst_number] = rxlev; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1888 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1889 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1890 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1891 burst_level[burst_number] = (WORD8)0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1892 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1893 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1894 // Measures on first valid block have been performed. Reset flag. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1895 first_valid_block = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1896 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1897 // Save crc_error |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1898 crc_error = crc_error_tbl[ts]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1899 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1900 } // End of measurements storage |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1901 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1902 // If All PDTCH are incorrect (bad CRC) save RXLEV and CRC of the best PDTCH |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1903 if(first_valid_block) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1904 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1905 rxlev_accu[ts] += rxlev; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1906 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1907 if(rxlev_accu[ts] > best_rxlev_accu) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1908 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1909 best_rxlev_accu = rxlev_accu[ts]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1910 crc_error = crc_error_tbl[ts]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1911 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1912 if(l1ps.read_param.pc_meas_chan) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1913 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1914 burst_level[burst_number] = rxlev; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1915 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1916 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1917 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1918 burst_level[burst_number] = (WORD8)0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1919 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1920 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1921 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1922 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1923 // Determine first valid block to be used in next radio block |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1924 if(l1ps_dsp_com.pdsp_db_r_ptr->d_burst_nb_gprs == 3) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1925 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1926 /* Complete PDTCH DL block has been processed by DSP */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1927 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1928 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1929 crc_error_tbl[ts] = ((l1ps_dsp_com.pdsp_ndb_ptr->a_dd_gprs[rx_no][0] & 0x0100) >> 8); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1930 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1931 // Increment Rx burst number |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1932 rx_no++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1933 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1934 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1935 #if TRACE_TYPE==3 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1936 stats_samples_nb(toa,pm,angle,snr,burst_id,task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1937 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1938 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1939 } // End of if(l1ps_dsp_com.pdsp_db_r_ptr->d_task_d_gprs & bit_mask) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1940 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1941 // Increment timeslot |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1942 ts++; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1943 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1944 // Shift Mask. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1945 bit_mask >>= 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1946 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1947 } // End of while(ts < 8) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1948 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1949 // AFC control algorithm is called with values retrieved from |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1950 // burst with max. snr |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1951 // AFC algorithm is called on bursts 0 and 2: this is sufficient to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1952 // have a correct behavior and this permits to gain CPU |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1953 // Update AFC: Call AFC control function (KALMAN filter). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1954 #if AFC_ALGO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1955 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1956 if (l1_config.afc_enable) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1957 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1958 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1959 if((burst_id == 0) || (burst_id == 2)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1960 #if (VCXO_ALGO == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1961 l1s.afc = l1ctl_afc(AFC_CLOSED_LOOP, &l1s.afc_frame_count, (WORD16)best_angle, best_snr, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1962 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1963 l1s.afc = l1ctl_afc(AFC_CLOSED_LOOP, &l1s.afc_frame_count, (WORD16)best_angle, best_snr, radio_freq,l1a_l1s_com.mode); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1964 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1965 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1966 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1967 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1968 #if (TRACE_TYPE == 1)||(TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1969 if (trace_info.current_config->l1_dyn_trace & 1<<L1_DYN_TRACE_CONDENSED_PDTCH) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1970 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1971 if ((l1pa_l1ps_com.tcr_freq_list.ms_ctrl_dd != 0) || |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1972 ((l1ps.pc_meas_chan_ctrl == TRUE) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1973 ((l1s.actual_time.t2 == 3) || (l1s.actual_time.t2 == 11) || |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1974 (l1s.actual_time.t2 == 20)))) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1975 trace_info.pdtch_trace.blk_status |= 0x80 >> burst_id; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1976 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1977 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1978 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1979 if(l1ps_dsp_com.pdsp_db_r_ptr->d_burst_nb_gprs == 3) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1980 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1981 /* Complete PDTCH DL block has been processed by DSP */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1982 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1983 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1984 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1985 l1pa_l1ps_com.transfer.dl_pwr_ctrl.crc_error = crc_error; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1986 /* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1987 * FreeCalypso TCS211 reconstruction: the following line |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1988 * has been taken from the TSM30 source. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1989 */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1990 l1pa_l1ps_com.transfer.dl_pwr_ctrl.assignment_id = l1ps.read_param.assignment_id; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1991 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1992 if(l1ps.read_param.pc_meas_chan) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1993 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1994 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1995 // Due to the CWR pipeleine, maca_power_control() has to be called before the |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1996 // CTRL of the first PDTCH i.e. in l1ps_ctrl_pdtch(). It means that crc_error, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1997 // radio_freq_tbl[], burst_level[] and bcch_level information are stored on |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1998 // burst4 of READ phase to be used on burst4 of CTRL phase. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1999 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2000 l1pa_l1ps_com.transfer.dl_pwr_ctrl.bcch_level = (WORD8)0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2001 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2002 for(i = 0; i < 4; i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2003 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2004 l1pa_l1ps_com.transfer.dl_pwr_ctrl.radio_freq_tbl[i] = radio_freq_tbl[i]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2005 l1pa_l1ps_com.transfer.dl_pwr_ctrl.burst_level[i] = burst_level[i]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2006 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2007 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2008 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2009 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2010 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2011 // Measures have been performed on BCCH Serving Cell. "burst_level" table is |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2012 // not applicable. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2013 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2014 // Download measures made on BCCH Serving Cell. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2015 l1pa_l1ps_com.transfer.dl_pwr_ctrl.bcch_level = l1pa_l1ps_com.tcr_freq_list.beacon_meas; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2016 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2017 for(i = 0; i < 4; i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2018 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2019 l1pa_l1ps_com.transfer.dl_pwr_ctrl.radio_freq_tbl[i] = radio_freq_tbl[i]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2020 l1pa_l1ps_com.transfer.dl_pwr_ctrl.burst_level[i] = (WORD8)0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2021 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2022 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2023 // Measures on BCCH Serving Cell are only performed every 40ms while |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2024 // maca_power_control() is called every 20ms. "beacon_meas" must then |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2025 // be set to invalid (0x80) until next Serving Cell measure. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2026 l1pa_l1ps_com.tcr_freq_list.beacon_meas = (WORD8)0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2027 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2028 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2029 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2030 #if TESTMODE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2031 // Test mode stats |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2032 if (l1_config.TestMode) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2033 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2034 // Allocate result message. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2035 msg = os_alloc_sig(sizeof(T_TMODE_PDTCH_INFO)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2036 DEBUGMSG(status,NU_ALLOC_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2037 msg->SignalCode = TMODE_PDTCH_INFO; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2038 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2039 ((T_TMODE_PDTCH_INFO *)(msg->SigP))->pm_fullres = tm_pm_fullres; // F26.6 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2040 ((T_TMODE_PDTCH_INFO *)(msg->SigP))->snr = tm_snr; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2041 ((T_TMODE_PDTCH_INFO *)(msg->SigP))->toa = tm_toa; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2042 ((T_TMODE_PDTCH_INFO *)(msg->SigP))->angle = tm_angle; // signed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2043 for (i=0;i<8;i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2044 ((T_TMODE_PDTCH_INFO *)(msg->SigP))->crc_error_tbl[i] = crc_error_tbl[i]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2045 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2046 // send TMODE_TCH_INFO message... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2047 os_send_sig(msg, L1C1_QUEUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2048 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2049 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2050 // reset static TM variables for stats collection |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2051 tm_pm_fullres = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2052 tm_snr = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2053 tm_toa = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2054 tm_angle = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2055 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2056 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2057 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2058 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2059 } //end of test "if((en_task) && !(task_param))" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2060 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2061 // End of task -> task must become INACTIVE. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2062 // PDTCH can be pipelined and therefore must stay active if |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2063 // it has already reentered the flow. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2064 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2065 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2066 if(l1s.task_status[task].current_status == RE_ENTERED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2067 l1s.task_status[task].current_status = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2068 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2069 l1s.task_status[task].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2070 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2071 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2072 #if 0 /* FreeCalypso TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2073 l1ddsp_read_iq_dump(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2074 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2075 // Flag the use of the MCU/DSP dual page read interface. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2076 // ****************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2077 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2078 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2079 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2080 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2081 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2082 #endif // MOVE_IN_INTERNAL_RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2083 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2084 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2085 /* l1ps_read_pra_result() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2086 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2087 /* Parameters : */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2088 /* Return : */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2089 /* Functionality : */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2090 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2091 void l1ps_read_pra_result(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2092 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2093 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2094 /* READ TRANSMIT TASK RESULTS... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2095 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2096 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2097 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2098 /* Packet Access task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2099 /*---------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2100 // Rem: confirmation message is sent at "CTRL" to be able to give FN%42432. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2101 BOOL confirm_flag = TRUE; // Default is: confirmation message is sent. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2102 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2103 // Desactivate the PRACH task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2104 l1s.task_status[task].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2105 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2106 l1_check_com_mismatch(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2107 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2108 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2109 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2110 trace_fct(CST_L1PS_READ_PRA, l1pa_l1ps_com.p_idle_param.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2111 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2112 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2113 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2114 // Check PRACH was controlled |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2115 if (l1pa_l1ps_com.pra_info.prach_controlled) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2116 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2117 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2118 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2119 // Check USF in case of Dynamic Allocation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2120 if(l1pa_l1ps_com.pra_info.prach_alloc != FIX_PRACH_ALLOC) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2121 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2122 API cs_type = l1ps_dsp_com.pdsp_ndb_ptr->a_du_gprs[0][0]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2123 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2124 if(cs_type != CS_NONE_TYPE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2125 confirm_flag = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2126 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2127 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2128 if (confirm_flag == TRUE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2129 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2130 // Send confirmation msg to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2131 // ****************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2132 // For ACCESS phase, a confirmation msg is sent to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2133 xSignalHeaderRec *msg; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2134 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2135 // send L1C_RA_DONE to L1A... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2136 msg = os_alloc_sig(sizeof(T_MPHP_RA_CON)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2137 DEBUGMSG(status,NU_ALLOC_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2138 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2139 ((T_MPHP_RA_CON *)(msg->SigP))->fn = l1pa_l1ps_com.pra_info.fn_to_report; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2140 ((T_MPHP_RA_CON *)(msg->SigP))->channel_request_data = l1pa_l1ps_com.pra_info.channel_request_data; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2141 msg->SignalCode = L1P_RA_DONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2142 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2143 os_send_sig(msg, L1C1_QUEUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2144 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2145 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2146 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2147 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2148 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2149 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2150 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2151 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2152 } // if (l1pa_l1ps_com.pra_info.prach_controlled) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2153 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2154 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2155 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2156 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2157 /* l1ps_read_poll_result() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2158 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2159 /* Parameters : */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2160 /* Return : */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2161 /* Functionality : */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2162 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2163 void l1ps_read_poll_result(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2164 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2165 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2166 /* READ TRANSMIT TASK RESULTS... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2167 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2168 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2169 l1_check_com_mismatch(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2170 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2171 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) // in debug trace all reads |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2172 trace_fct(CST_L1PS_READ_POLL, l1pa_l1ps_com.p_idle_param.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2173 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2174 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2175 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2176 /* POLL task (4xPRACH) upon packet queueing notification. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2177 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2178 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2179 // Deactivate the PRACH task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2180 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2181 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2182 // POLL is a 'one shot' task --> disable task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2183 l1a_l1s_com.l1s_en_task[task] = TASK_DISABLED; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2184 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2185 l1s.task_status[task].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2186 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2187 #if (TRACE_TYPE==5) // in simulation trace only the latest burst |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2188 trace_fct(CST_L1PS_READ_POLL, l1pa_l1ps_com.p_idle_param.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2189 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2190 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2191 // Send confirmation msg to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2192 // ****************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2193 // For PACKET POLLING, a confirmation msg is sent to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2194 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2195 xSignalHeaderRec *msg; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2196 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2197 // send L1C_RA_DONE to L1A... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2198 msg = os_alloc_sig(sizeof(T_MPHP_POLLING_IND)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2199 DEBUGMSG(status,NU_ALLOC_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2200 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2201 ((T_MPHP_POLLING_IND *)(msg->SigP))->fn = l1pa_l1ps_com.poll_info.fn_to_report; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2202 msg->SignalCode = L1P_POLL_DONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2203 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2204 os_send_sig(msg, L1C1_QUEUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2205 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2206 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2207 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2208 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2209 #if 0 /* FreeCalypso TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2210 l1ddsp_read_iq_dump(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2211 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2212 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2213 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2214 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2215 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2216 #if !((MOVE_IN_INTERNAL_RAM == 1) && (GSM_IDLE_RAM !=0)) // MOVE TO INTERNAL MEM IN CASE GSM_IDLE_RAM enabled |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2217 //#pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_START // KEEP IN EXTERNAL MEM otherwise |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2218 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2219 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2220 /* l1ps_ctrl_snb_dl() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2221 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2222 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2223 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2224 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2225 /* This function is a "COMPLEX" function used by the L1S */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2226 /* packet serving cell normal burst reading tasks: PNP, */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2227 /* PEP, PALLC. This function is the control function for */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2228 /* reading a normal burst on the packet serving cell. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2229 /* It programs the DSP and the TPU for reading a */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2230 /* normal burst. This function flags the reading of the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2231 /* Packet Normal paging burst which flag is used in */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2232 /* measurement manager procedure. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2233 /* Here below is a summary of the execution: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2234 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2235 /* - If SEMAPHORE(task) is low. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2236 /* - Catch ARFCN and set CIPHERING reduced frame */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2237 /* number. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2238 /* - Traces and debug. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2239 /* - Programs DSP for required task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2240 /* - Programs TPU for required task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2241 /* - Flag the reading of a Packet Normal Paging */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2242 /* burst. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2243 /* - Flag DSP and TPU programmation. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2244 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2245 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2246 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2247 /* "l1a_l1s_com.task_param" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2248 /* task semaphore bit register. Used to skip */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2249 /* the body of this function if L1A has changed or */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2250 /* is changing some of the task parameters. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2251 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2252 /* "task" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2253 /* PNP, Packet Normal paging reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2254 /* PEP, Packet Extended paging reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2255 /* PALLC, All Packet serving cell PCCCH reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2256 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2257 /* "burst_id" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2258 /* BURST_1, 1st burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2259 /* BURST_2, 2nd burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2260 /* BURST_3, 3rd burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2261 /* BURST_4, 4th burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2262 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2263 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2264 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2265 /* "l1a_l1s_com.Scell_info" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2266 /* Serving cell information structure. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2267 /* .radio_freq, serving cell beacon frequency. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2268 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2269 /* "l1s.afc" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2270 /* current AFC value to be applied for the given task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2271 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2272 /* "l1s.tpu_offset" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2273 /* value for the TPU SYNCHRO and OFFSET registers */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2274 /* for current serving cell setting. It is used here */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2275 /* to refresh the TPU SYNCHRO and OFFSET registers */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2276 /* with a corrected (time tracking of the serving) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2277 /* value prior to reading a serving cell normal burst. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2278 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2279 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2280 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2281 /* "pnp_ctrl" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2282 /* Flag set when a packet normal paging burst reading */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2283 /* is controled. This flag is used by the packet */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2284 /* measurement manager procedure, at the end of L1S, */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2285 /* in order to scheduling the neighbor cell */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2286 /* measurements. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2287 /* -> set to 1. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2288 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2289 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2290 /* "l1s.tpu_ctrl_reg" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2291 /* bit register used to know at the end of L1S if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2292 /* something has been programmed on the MCU/TPU com. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2293 /* This is used mainly to swap then the com. page at */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2294 /* the end of a control frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2295 /* -> set CTRL_RX bit in the register. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2296 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2297 /* "l1s.dsp_ctrl_reg" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2298 /* bit register used to know at the end of L1S if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2299 /* something has been programmed on the MCU/DSP com. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2300 /* This is used mainly to swap then the com. page at */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2301 /* the end of a control frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2302 /* -> set CTRL_RX bit in the register. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2303 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2304 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2305 void l1ps_ctrl_snb_dl(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2306 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2307 UWORD16 Scell_radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2308 UWORD8 tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2309 WORD8 agc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2310 UWORD8 lna_off; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2311 UWORD8 adc_active = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2312 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2313 UWORD16 dco_algo_ctl_nb = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2314 UWORD8 if_ctl = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2315 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2316 // By default we choose the hardware filter |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2317 UWORD8 csf_filter_choice = L1_SAIC_HARDWARE_FILTER; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2318 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2319 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2320 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2321 UWORD8 saic_flag = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2322 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2323 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2324 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2325 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2326 BOOL fast_decoding_authorized = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2327 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2328 if ( (burst_id == BURST_1) && (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_FORBIDDEN) ) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2329 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2330 l1a_apihisr_com.fast_decoding.status = C_FAST_DECODING_NONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2331 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2332 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2333 fast_decoding_authorized = l1s_check_fast_decoding_authorized(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2334 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2335 if ( fast_decoding_authorized && l1s_check_deferred_control(task,burst_id) ) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2336 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2337 /* Control is deferred until the upcoming fast decoding IT */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2338 return; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2339 } /* if (fast_decoding_authorized)*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2340 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2341 /* In all other cases, control must be performed now. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2342 #endif /* FF_L1_FAST_DECODING == 1 */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2343 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2344 if(!(l1a_l1s_com.task_param[task] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2345 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2346 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2347 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2348 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2349 Scell_radio_freq = l1a_l1s_com.Scell_info.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2350 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2351 // Catch training sequence code from serving cell BCC (part of BSIC). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2352 tsc = l1pa_l1ps_com.pccch.packet_chn_desc.tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2353 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2354 // Packet PAGC Algorithm |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2355 // ********************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2356 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2357 // for PCCCH serving blocks (PPCH, PEPCH, all PCCCH) we use |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2358 // PAGC algorithm. Reference is serving cell. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2359 l1pctl_pagc_ctrl(&agc, &lna_off, l1pa_l1ps_com.p_idle_param.radio_freq,TRUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2360 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2361 #if(RF_FAM == 61) // Locosto DCO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2362 cust_get_if_dco_ctl_algo(&dco_algo_ctl_nb, &if_ctl, (UWORD8) L1_IL_VALID , |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2363 l1a_l1s_com.Scell_used_IL.input_level, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2364 l1pa_l1ps_com.p_idle_param.radio_freq, if_threshold); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2365 l1ddsp_load_dco_ctl_algo_nb(dco_algo_ctl_nb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2366 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2367 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2368 #if (L1_SAIC != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2369 // If SAIC is enabled, call the low level SAIC control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2370 // NOTE: l1a_l1s_com.Scell_used_IL.input_level is updated within |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2371 // the function l1pctl_pagc_ctrl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2372 csf_filter_choice = l1ctl_saic(l1a_l1s_com.Scell_used_IL.input_level,l1a_l1s_com.mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2373 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2374 ,task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2375 ,&saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2376 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2377 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2378 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2379 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2380 // Debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2381 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2382 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2383 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2384 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2385 l1ddsp_load_fast_dec_task(task,burst_id); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2386 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2387 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2388 // Programs DSP Rx Packet Idle burst, still on Timeslot number = 0 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2389 // due to previous synchro. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2390 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2391 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2392 BOOL usf_it = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2393 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2394 // Force IT USF interrupt during PCCCH reorg for Fast USF usage during |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2395 // Packet Access. Switch to PA could happen any time during PCCCH reorg. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2396 // Only relevant for RBN%3 = 0 and 1 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2397 if (l1a_l1s_com.l1s_en_task[PALLC] == TASK_ENABLED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2398 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2399 if (/*(l1s.next_time.fn_mod13 >= 0) && omaps00090550*/(l1s.next_time.fn_mod13 <= 7)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2400 usf_it = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2401 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2402 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2403 l1pddsp_idle_rx_nb(burst_id, tsc, l1pa_l1ps_com.p_idle_param.radio_freq, 0, FALSE, usf_it); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2404 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2405 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2406 l1pddsp_idle_rx_nb(burst_id, tsc, l1pa_l1ps_com.p_idle_param.radio_freq, 0, FALSE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2407 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2408 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2409 // ADC measurement |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2410 // *************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2411 // check if during the 1st burst of the bloc an ADC measurement must be performed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2412 if ((burst_id == BURST_1) && (task == PNP)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2413 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2414 if (l1a_l1s_com.l1s_en_task[PALLC] == TASK_DISABLED) // no reorg mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2415 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2416 if (l1a_l1s_com.adc_mode & ADC_NEXT_NORM_PAGING) // perform ADC only one time |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2417 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2418 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2419 l1a_l1s_com.adc_mode &= ADC_MASK_RESET_IDLE; // reset in order to have only one ADC measurement in Idle |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2420 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2421 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2422 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2423 if (l1a_l1s_com.adc_mode & ADC_EACH_NORM_PAGING) // perform ADC on each "period" x bloc |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2424 if ((++l1a_l1s_com.adc_cpt)>=l1a_l1s_com.adc_idle_period) // wait for the period |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2425 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2426 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2427 l1a_l1s_com.adc_cpt = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2428 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2429 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2430 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2431 else // ADC measurement in reorg mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2432 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2433 if (l1a_l1s_com.adc_mode & ADC_NEXT_NORM_PAGING_REORG) // perform ADC only one time |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2434 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2435 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2436 l1a_l1s_com.adc_mode &= ADC_MASK_RESET_IDLE; // reset in order to have only one ADC measurement in Idle |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2437 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2438 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2439 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2440 if (l1a_l1s_com.adc_mode & ADC_EACH_NORM_PAGING_REORG) // perform ADC on each "period" x bloc |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2441 if ((++l1a_l1s_com.adc_cpt)>=l1a_l1s_com.adc_idle_period) // wait for the period |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2442 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2443 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2444 l1a_l1s_com.adc_cpt = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2445 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2446 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2447 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2448 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2449 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2450 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2451 trace_fct(CST_L1PS_CTRL_SNB_DL, -1); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2452 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2453 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2454 // Programs TPU for required task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2455 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2456 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2457 // update the TPU with the new TOA if necessary |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2458 l1ctl_update_TPU_with_toa(); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2459 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2460 // tpu pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2461 l1dtpu_serv_rx_nb(l1pa_l1ps_com.p_idle_param.radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2462 agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2463 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2464 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2465 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2466 FALSE,adc_active |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2467 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2468 ,csf_filter_choice |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2469 ,if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2470 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2471 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2472 ,saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2473 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2474 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2475 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2476 // Increment tpu window identifier. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2477 l1s.tpu_win += (l1_config.params.rx_synth_load_split + RX_LOAD); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2478 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2479 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2480 // Flag the reading of a Normal Packet Paging burst. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2481 // ************************************************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2482 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2483 // Set PNP controlled flag, used in l1s_meas_manager() to generate measurement only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2484 // if we are not receiving a PPCH. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2485 if((task == PNP) || (task == PEP) || (task == PALLC)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2486 l1pa_l1ps_com.cr_freq_list.pnp_ctrl = burst_id + 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2487 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2488 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2489 // Flag DSP and TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2490 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2491 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2492 // Set "CTRL_RX" flag in the controle flag register. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2493 l1s.tpu_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2494 l1s.dsp_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2495 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2496 } // end of procedure |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2497 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2498 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2499 /* l1ps_read_nb_dl() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2500 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2501 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2502 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2503 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2504 /* This function is a "COMPLEX" function used by the L1S */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2505 /* tasks: PNP,PEP,PALLC. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2506 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2507 /* Here is a summary of the execution: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2508 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2509 /* - If SEMAPHORE(task) is low and task still enabled. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2510 /* - Traces and debug. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2511 /* - Read control results and feed control algo. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2512 /* - Read DL DATA block from MCU/DSP interface. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2513 /* - Disactivate task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2514 /* - Flag the use of the MCU/DSP dual page read */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2515 /* interface. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2516 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2517 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2518 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2519 /* "task" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2520 /* PNP, Packet Normal paging reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2521 /* PEP, Packet Extended paging reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2522 /* PALLC, All packet serving cell PCCCH reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2523 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2524 /* "burst_id" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2525 /* BURST_1, 1st burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2526 /* BURST_2, 2nd burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2527 /* BURST_3, 3rd burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2528 /* BURST_4, 4th burst of the task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2529 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2530 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2531 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2532 /* "l1pa_l1ps_com.task_param[NBR_DL_L1S_TASKS]" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2533 /* packet task semaphore table. Used to skip */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2534 /* the body of this function if L1A has changed or */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2535 /* is changing some of the task parameters. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2536 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2537 /* "l1a_l1s_com.l1s_en_task[NBR_DL_L1S_TASKS]" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2538 /* L1S task enable. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2539 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2540 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2541 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2542 /* "l1s.task_status[task].current_status" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2543 /* current task status. It must be reset (INACTIVE) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2544 /* when the task is completed. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2545 /* -> disactivate task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2546 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2547 /* "l1s_dsp_com.dsp_r_page_used" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2548 /* Flag used by the function which closes L1S */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2549 /* execution ("l1s_end_manager()") to know if the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2550 /* MCU/DSP read page must be switched. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2551 /* -> Set to 1. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2552 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2553 /* Use of MCU/DSP interface: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2554 /* ------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2555 /* "l1s_dsp_com.dsp_ndb_ptr" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2556 /* pointer to the non double buffered part (NDB) of */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2557 /* the MCU/DSP interface. This part is R/W for both */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2558 /* DSP and MCU. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2559 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2560 /* "l1s_dsp_com.dsp_db_r_ptr" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2561 /* pointer to the double buffered part (DB) of the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2562 /* MCU/DSP interface. This pointer points to the READ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2563 /* page. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2564 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2565 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2566 void l1ps_read_nb_dl(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2567 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2568 UWORD32 toa=0; //omaps00090550 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2569 UWORD32 pm=0; //omaps00090550; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2570 UWORD32 angle =0; //omaps00090550 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2571 UWORD32 snr =0; //omaps00090550 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2572 BOOL en_task; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2573 BOOL task_param; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2574 UWORD16 scell_radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2575 static UWORD16 pwr_level; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2576 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2577 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2578 UWORD8 skipped_bursts = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2579 BOOL fast_decoding_authorized = l1s_check_fast_decoding_authorized(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2580 BOOL fast_decoded = (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_COMPLETE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2581 if (fast_decoded) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2582 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2583 skipped_bursts = BURST_4 - burst_id; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2584 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2585 #endif /* if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2586 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2587 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2588 /* READ SERVING CELL RECEIVE TASK RESULTS... */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2589 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2590 /* Rem: only a partial result is present in the mcu<-dsp */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2591 /* communication buffer. The DATA BLOCK content itself is */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2592 /* in the last comm. (BURST_4) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2593 /*--------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2594 // Get "enable" task flag and "synchro semaphore" for current task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2595 en_task = l1a_l1s_com.l1s_en_task[task]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2596 task_param = l1a_l1s_com.task_param[task]; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2597 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2598 if((en_task) && !(task_param)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2599 // Check the task semaphore and the task enable bit. The reading |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2600 // task body is executed only when the task semaphore is 0 and the |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2601 // task is still enabled. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2602 // The semaphore can be set to 1 whenever L1A makes some changes |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2603 // to the task parameters. The task can be disabled by L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2604 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2605 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2606 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2607 l1_check_com_mismatch(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2608 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2609 // Read control results and feed control algorithms. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2610 // ************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2611 if ((task != PBCCHN_TRAN) && (task != PBCCHN_IDLE)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2612 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2613 // From the fact that PBCCHS can be read in CS mode, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2614 // Idle mode and Packet Idle mode, a check on the current active DSP scheduler mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2615 // has to be performed. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2616 // Read control information. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2617 // We keep compatibility with (chipset == 0) imply mask with 0xffff. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2618 // If only (chipset == 2) is used, mask can be removed. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2619 if (l1a_l1s_com.dsp_scheduler_mode == GSM_SCHEDULER) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2620 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2621 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2622 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff) >> 5; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2623 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2624 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2625 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2626 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2627 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2628 toa = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_toa_gprs[0] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2629 pm = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[0] & 0xffff)>>5; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2630 angle = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_angle_gprs[0] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2631 snr = l1ps_dsp_com.pdsp_db_r_ptr->a_burst_snr_gprs[0] & 0xffff; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2632 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2633 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2634 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2635 trace_fct(CST_L1PS_READ_NB_DL, -1); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2636 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2637 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2638 l1_check_pm_error(pm,task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2639 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2640 // Update AGC: Call PAGC algorithm |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2641 l1a_l1s_com.Scell_IL_for_rxlev = l1pctl_pagc_read((UWORD8)pm, l1pa_l1ps_com.p_idle_param.radio_freq_dd); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2642 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2643 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2644 if (skipped_bursts>0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2645 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2646 l1ctl_pagc_missing_bursts(skipped_bursts); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2647 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2648 #endif /* if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2649 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2650 // Update AFC: Call AFC control function (KALMAN filter). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2651 #if AFC_ALGO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2652 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2653 WORD16 old_afc = l1s.afc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2654 WORD16 old_count= l1s.afc_frame_count; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2655 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2656 scell_radio_freq = l1a_l1s_com.Scell_info.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2657 #if (VCXO_ALGO==0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2658 l1s.afc = l1ctl_afc(AFC_CLOSED_LOOP, &l1s.afc_frame_count, (WORD16)angle, snr, scell_radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2659 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2660 l1s.afc = l1ctl_afc(AFC_CLOSED_LOOP, &l1s.afc_frame_count, (WORD16)angle, snr, scell_radio_freq,l1a_l1s_com.mode); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2661 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2662 #if L2_L3_SIMUL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2663 #if (DEBUG_TRACE == BUFFER_TRACE_AFC_OPEN) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2664 buffer_trace (4,(WORD16)angle,old_count,old_afc,l1s.afc); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2665 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2666 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2667 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2668 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2669 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2670 // Feed TOA histogram only when the TOA result is used in the task CTRL function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2671 if (task != PBCCHS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2672 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2673 //Feed TOA histogram. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2674 #if (TOA_ALGO != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2675 #if (TOA_ALGO == 2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2676 if(l1s.toa_var.toa_snr_mask == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2677 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2678 if(l1s.toa_snr_mask == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2679 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2680 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2681 #if (TOA_ALGO == 2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2682 UWORD32 snr_temp; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2683 snr_temp = (l1a_l1s_com.Scell_IL_for_rxlev < IL_FOR_RXLEV_SNR) ? snr: 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2684 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2685 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2686 /* FreeCalypso TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2687 if (l1a_l1s_com.Scell_IL_for_rxlev < IL_FOR_RXLEV_SNR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2688 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2689 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr, toa, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2690 &l1s.toa_update, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2691 &l1s.toa_period_count |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2692 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2693 ,0 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2694 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2695 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2696 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2697 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2698 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2699 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, 0, toa, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2700 &l1s.toa_update, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2701 &l1s.toa_period_count |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2702 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2703 ,0 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2704 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2705 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2706 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2707 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2708 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2709 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2710 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2711 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2712 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2713 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2714 RTTL1_FILL_DL_BURST(angle, snr, l1s.afc, task, pm, toa, l1a_l1s_com.Scell_IL_for_rxlev + l1a_l1s_com.Scell_info.pb) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2715 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2716 #if 0 //(TRACE_TYPE == 1) || (TRACE_TYPE == 4) // TCS211 reconstruction |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2717 l1_trace_burst_param(angle, snr, l1s.afc, task, pm, toa, l1a_l1s_com.Scell_IL_for_rxlev + l1a_l1s_com.Scell_info.pb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2718 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2719 #if (BURST_PARAM_LOG_ENABLE == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2720 l1_log_burst_param(angle, snr, l1s.afc, task, pm, toa, l1a_l1s_com.Scell_IL_for_rxlev + l1a_l1s_com.Scell_info.pb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2721 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2722 // compute the Data bloc Power. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2723 // ****************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2724 if(burst_id == BURST_1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2725 pwr_level = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2726 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2727 // add the burst power |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2728 pwr_level += l1a_l1s_com.Scell_IL_for_rxlev; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2729 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2730 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2731 // Read downlink DATA block from MCU/DSP interface. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2732 // ************************************************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2733 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2734 /* Perform the reporting if |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2735 - Burst is the 4th one (whether CRC is ok or not) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2736 - Fast decoding enabled and CRC already ok |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2737 */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2738 if ( (burst_id == BURST_4) || fast_decoded ) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2739 #else /* #if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2740 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2741 #endif /* FF_L1_FAST_DECODING */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2742 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2743 #if (TRACE_TYPE==2 ) || (TRACE_TYPE==3) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2744 uart_trace(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2745 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2746 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2747 /* Data power block = pwr_level / (nb of bursts)*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2748 pwr_level = pwr_level / (burst_id + 1); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2749 #else /* #if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2750 // the data power bloc = pwr_level/4. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2751 pwr_level = pwr_level >> 2; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2752 #endif /* #if (FF_L1_FAST_DECODING == 1) #else*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2753 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2754 // Read L3 frame block and send msg to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2755 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2756 if(!fast_decoding_authorized) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2757 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2758 /* When fast decoding wasn't used, burst_id is undefined (for the trace) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2759 l1a_l1s_com.last_fast_decoding = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2760 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2761 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2762 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2763 l1a_l1s_com.last_fast_decoding = burst_id + 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2764 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2765 #endif /* #if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2766 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2767 // Read L3 frame block and send msg to L1A. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2768 if (l1a_l1s_com.dsp_scheduler_mode == GSM_SCHEDULER) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2769 l1s_read_l3frm(pwr_level,&(l1s_dsp_com.dsp_ndb_ptr->a_cd[0]), task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2770 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2771 l1s_read_l3frm(pwr_level,&(l1ps_dsp_com.pdsp_ndb_ptr->a_dd_gprs[0][0]), task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2772 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2773 } // End if... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2774 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2775 } //end of test "if((en_task) && !(task_param))" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2776 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2777 // Disactivate task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2778 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2779 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2780 // End of task -> task must become INACTIVE. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2781 // Rem: some TASKS (PALLC, PNP (with SPLIT > M)) can be pipelined and therefore |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2782 // must stay active if they have already reentered the flow. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2783 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2784 /*------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2785 /* Perform the reporting if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2786 /* - Burst is the 4th one (whether CRC is ok or not) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2787 /* - Fast decoding enabled and CRC already ok */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2788 /*------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2789 if ( (burst_id == BURST_4) || fast_decoded ) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2790 #else /* #if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2791 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2792 #endif /* #if (FF_L1_FAST_DECODING == 1) #else*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2793 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2794 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2795 if(task == PNP) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2796 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2797 if (l1a_apihisr_com.fast_decoding.contiguous_decoding == TRUE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2798 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2799 /* A new block has started, a new fast API IT is expected */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2800 l1a_apihisr_com.fast_decoding.contiguous_decoding = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2801 l1a_apihisr_com.fast_decoding.status = C_FAST_DECODING_AWAITED; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2802 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2803 else if(task == l1a_apihisr_com.fast_decoding.task) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2804 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2805 /* Reset decoding status */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2806 l1a_apihisr_com.fast_decoding.status = C_FAST_DECODING_NONE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2807 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2808 } /*task == PNP */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2809 #endif /* #if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2810 if(l1s.task_status[task].current_status == RE_ENTERED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2811 l1s.task_status[task].current_status = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2812 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2813 l1s.task_status[task].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2814 #if (FF_L1_FAST_DECODING == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2815 if (burst_id != BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2816 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2817 l1s_clean_mftab(task, burst_id + 3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2818 if(l1s.frame_count == (4 -burst_id)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2819 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2820 l1s.frame_count = 1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2821 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2822 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2823 #endif /* #if (FF_L1_FAST_DECODING == 1) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2824 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2825 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2826 #if 0 /* FreeCalypso TCS211 reconstruction */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2827 l1ddsp_read_iq_dump(task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2828 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2829 // Flag the use of the MCU/DSP dual page read interface. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2830 // ****************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2831 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2832 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2833 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2834 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2835 } // end of procedure |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2836 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2837 //#pragma GSM_IDLE_DUPLICATE_FOR_INTERNAL_RAM_END // KEEP IN EXTERNAL MEM otherwise |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2838 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2839 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2840 /* l1ps_ctrl_pbcch() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2841 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2842 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2843 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2844 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2845 /* This function is a "COMPLEX" function used by the L1S */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2846 /* tasks: neighbor cell PBCCH. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2847 /* This function is the control function */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2848 /* for reading a PBCCH burst on the neighbor cell. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2849 /* This control function: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2850 /* a) shifts the OFFSET register to match the normal */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2851 /* burst received task with the PBCCH timeslot number.*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2852 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2853 /* b) programs a normal burst reading and restores the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2854 /* OFFSET to the serving cell timeslot. On the last */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2855 /* control (4th burst), the SYNCHRO/OFFSET registers */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2856 /* are shifted back to the normal idle mode PCCH */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2857 /* reading setting. Here is a summary of the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2858 /* execution: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2859 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2860 /* - If SEMAPHORE(task) is low. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2861 /* - Traces and debug. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2862 /* - Programs DSP for PBCCH task, reading 1 burst. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2863 /* - Programs TPU for PBCCH task, reading 1 burst. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2864 /* - Shift TPU SYNCHRO/OFFSET registers back to the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2865 /* PACKET PAGING TASK timeslot. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2866 /* - Flag DSP and TPU programmation. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2867 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2868 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2869 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2870 /* "task" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2871 /* PBCCH_TRA or PBCCH_IDLE or PBCCHS */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2872 /* Serving Cell PBCCH reading task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2873 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2874 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2875 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2876 /* "l1pa_l1ps_com.pbcch " */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2877 /* Neigh/serv Cell PBCCH description structure. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2878 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2879 /* "l1a_l1s_com.Scell_info.radio_freq" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2880 /* BSIC of the serving cell. It is used here to pass */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2881 /* the training sequence number (part of BSIC) to the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2882 /* DSP. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2883 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2884 /* "l1a_l1s_com.offset_tn0" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2885 /* value to load in the OFFSET register to shift then */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2886 /* any receive task to the timeslot 0 of the neighbor */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2887 /* cell or PBCCH timeslot number . */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2888 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2889 /* "l1s.tpu_offset" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2890 /* value for the TPU SYNCHRO and OFFSET registers */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2891 /* for current serving cell setting. It is used here */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2892 /* at the end of the PBCCH task controls to restore */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2893 /* the SYNCHRO/OFFSET registers to the normal setting */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2894 /* in idle mode. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2895 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2896 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2897 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2898 /* "l1s.actual_time, l1s.next_time" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2899 /* frame number and derived numbers for current frame */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2900 /* and next frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2901 /* -> update to cope with side effect due to synchro. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2902 /* changes/restores. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2903 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2904 /* "l1s.tpu_ctrl_reg" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2905 /* bit register used to know at the end of L1S if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2906 /* something has been programmed on the MCU/TPU com. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2907 /* This is used mainly to swap then the com. page at */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2908 /* the end of a control frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2909 /* -> set CTRL_RX bit in the register. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2910 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2911 /* "l1s.dsp_ctrl_reg" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2912 /* bit register used to know at the end of L1S if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2913 /* something has been programmed on the MCU/DSP com. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2914 /* This is used mainly to swap then the com. page at */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2915 /* the end of a control frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2916 /* -> set CTRL_RX bit in the register. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2917 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2918 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2919 void l1ps_ctrl_pbcch(UWORD8 task, UWORD8 burst_id) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2920 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2921 UWORD16 rx_radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2922 UWORD32 offset_pbcch; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2923 WORD8 agc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2924 UWORD8 lna_off; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2925 UWORD32 dsp_task; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2926 UWORD8 tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2927 UWORD8 serving_cell; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2928 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2929 UWORD16 dco_algo_ctl_nb=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2930 UWORD8 if_ctl = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2931 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2932 // By default we choose the hardware filter |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2933 UWORD8 csf_filter_choice = L1_SAIC_HARDWARE_FILTER; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2934 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2935 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2936 UWORD8 saic_flag=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2937 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2938 static WORD32 new_tpu_offset; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2939 static BOOL change_synchro; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2940 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2941 #define PbcchS l1pa_l1ps_com.pbcchs |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2942 #define PbcchN l1pa_l1ps_com.pbcchn |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2943 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2944 #if (CODE_VERSION == SIMULATION) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2945 UWORD32 tpu_w_page; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2946 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2947 if (hw.tpu_r_page==0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2948 tpu_w_page=1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2949 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2950 tpu_w_page=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2951 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2952 hw.rx_id[tpu_w_page][0]=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2953 hw.num_rx[tpu_w_page][0]=1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2954 hw.rx_group_id[tpu_w_page]=1; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2955 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2956 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2957 if (task == PBCCHS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2958 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2959 tsc = PbcchS.packet_chn_desc.tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2960 offset_pbcch = (PbcchS.tn_pbcch * TN_WIDTH); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2961 serving_cell = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2962 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2963 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2964 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2965 tsc = PbcchN.packet_chn_desc.tsc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2966 offset_pbcch = PbcchN.time_alignmt; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2967 serving_cell = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2968 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2969 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2970 if((l1a_l1s_com.l1s_en_task[task] == TASK_ENABLED) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2971 !(l1a_l1s_com.task_param[task] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2972 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2973 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2974 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2975 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2976 // Get ARFCN to be used for current control. Output of the hopping algorithm. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2977 rx_radio_freq = l1pa_l1ps_com.p_idle_param.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2978 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2979 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2980 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2981 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2982 #if (TRACE_TYPE==5) && FLOWCHART |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2983 trace_flowchart_dsp_tpu(dltsk_trace[task].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2984 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2985 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2986 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2987 if (task == PBCCHS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2988 trace_fct(CST_L1PS_CTRL_PBCCHS, l1a_l1s_com.Scell_info.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2989 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2990 trace_fct(CST_L1PS_CTRL_PBCCHN, PbcchN.bcch_carrier); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2991 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2992 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2993 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2994 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2995 // Programs DSP for PBCCHN task according to the DSP scheduler used |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2996 // ***************************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2997 switch(l1a_l1s_com.dsp_scheduler_mode) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2998 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2999 // dsp pgm is made using GSM scheduler... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3000 case GSM_SCHEDULER: |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3001 dsp_task = l1s_swap_iq_dl(rx_radio_freq, task); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3002 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3003 // dsp pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3004 l1ddsp_load_rx_task(dsp_task,burst_id,tsc); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3005 break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3006 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3007 // dsp pgm is made using GPRS scheduler... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3008 case GPRS_SCHEDULER: |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3009 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3010 l1pddsp_idle_rx_nb(burst_id,tsc,rx_radio_freq,0,FALSE,FALSE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3011 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3012 l1pddsp_idle_rx_nb(burst_id,tsc,rx_radio_freq,0,FALSE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3013 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3014 break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3015 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3016 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3017 // Check if "Synchro" change is needed. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3018 // ************************************* |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3019 // If so the synchro is changed by 4 timeslots. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3020 if(burst_id == BURST_1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3021 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3022 if (task == PBCCHS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3023 change_synchro = PbcchS.change_synchro; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3024 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3025 change_synchro = PbcchN.change_synchro; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3026 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3027 if(change_synchro) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3028 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3029 // compute TPU offset for "current timeslot + 4 timeslot" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3030 new_tpu_offset = l1s.tpu_offset + (4 * TN_WIDTH); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3031 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3032 if(new_tpu_offset >= TPU_CLOCK_RANGE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3033 new_tpu_offset -= TPU_CLOCK_RANGE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3034 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3035 // Slide synchro to match current timeslot + 4 timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3036 l1dmacro_synchro(SWITCH_TIME, new_tpu_offset); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3037 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3038 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3039 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3040 new_tpu_offset = l1s.tpu_offset; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3041 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3042 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3043 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3044 // TPU pgm... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3045 //----------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3046 offset_pbcch += new_tpu_offset; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3047 if (offset_pbcch >= TPU_CLOCK_RANGE) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3048 offset_pbcch -= TPU_CLOCK_RANGE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3049 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3050 // add for debug TPU simu |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3051 #if (CODE_VERSION == SIMULATION) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3052 if (task == PBCCHS) // PBCCH serving, compute Ts related to the L1 synchro on the serving |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3053 hw.rx_id[tpu_w_page][0]=((TPU_CLOCK_RANGE-new_tpu_offset+offset_pbcch)%TPU_CLOCK_RANGE)/TN_WIDTH; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3054 else // PBCCH Neighbor -> special value for PBCCHN detection in the DSP task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3055 hw.rx_id[tpu_w_page][0]=10; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3056 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3057 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3058 // agc is set with the input_level computed from PAGC algo |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3059 l1pctl_pagc_ctrl(&agc, &lna_off, rx_radio_freq, serving_cell); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3060 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3061 #if(RF_FAM == 61) // Locosto DCO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3062 cust_get_if_dco_ctl_algo(&dco_algo_ctl_nb, &if_ctl, (UWORD8) L1_IL_VALID , |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3063 l1a_l1s_com.Scell_used_IL.input_level , rx_radio_freq, if_threshold); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3064 l1ddsp_load_dco_ctl_algo_nb(dco_algo_ctl_nb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3065 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3066 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3067 #if (L1_SAIC != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3068 // If SAIC is enabled, call the low level SAIC control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3069 // NOTE: l1a_l1s_com.Scell_used_IL.input_level is updated within |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3070 // l1pctl_pagc_ctrl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3071 if(task == PBCCHS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3072 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3073 // Call SAIC only for PBCCHS, not for PBCCHN_TRAN or PBCCHN_IDLE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3074 csf_filter_choice = l1ctl_saic(l1a_l1s_com.Scell_used_IL.input_level,l1a_l1s_com.mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3075 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3076 ,task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3077 ,&saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3078 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3079 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3080 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3081 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3082 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3083 l1dmacro_offset (offset_pbcch, l1_config.params.rx_change_offset_time); // Slide offset to cope with PBCCHN in the new sychro. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3084 l1dmacro_rx_synth(rx_radio_freq); // load SYNTH. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3085 l1dmacro_agc (rx_radio_freq,agc, lna_off |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3086 #if(RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3087 ,if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3088 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3089 ); // load AGC. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3090 #if (L1_MADC_ON == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3091 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3092 l1dmacro_rx_nb (rx_radio_freq,INACTIVE, csf_filter_choice |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3093 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3094 ,saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3095 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3096 ); // RX window for NB. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3097 #endif /* RF_FAM == 61*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3098 #else /* L1_MADC_ON == 1*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3099 l1dmacro_rx_nb (rx_radio_freq); // RX window for NB. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3100 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3101 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3102 if (task == PBCCHS) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3103 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3104 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3105 l1ddsp_load_afc(l1s.afc); // Loading the afc value in DB,Flag the presence of a new afc value to send |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3106 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3107 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3108 l1dtpu_load_afc(l1s.afc); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3109 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3110 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3111 l1dmacro_offset (new_tpu_offset, IMM); // Restore offset. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3112 } // End if(task enabled and semaphore false) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3113 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3114 // Remark: |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3115 //-------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3116 // When the task is aborted, we must continue to make dummy |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3117 // DSP programming to avoid communication mismatch due |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3118 // to C/W/R pipelining. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3119 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3120 // We must also ensure the Synchro back since synchro change has surely be done |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3121 // in the 1st CTRL phase. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3122 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3123 // Shift TPU SYNCHRO/OFFSET registers back to the default timeslot (normally PCCCH one). |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3124 // ************************************************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3125 // When the PBCCHN or PBCCHS reading control is completed , |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3126 // the SYNCHRO/OFFSET registers are shifted back to the normal idle |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3127 // setting used for PCCH reading on the serving cell. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3128 // Check if "Synchro" change was needed. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3129 // If so the synchro is changed to recover normal synchro. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3130 if(burst_id == BURST_4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3131 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3132 if(change_synchro) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3133 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3134 // Slide synchro back to mach current serving timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3135 l1dmacro_synchro(SWITCH_TIME, l1s.tpu_offset); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3136 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3137 // Increment frame number. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3138 l1s.actual_time = l1s.next_time; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3139 l1s.next_time = l1s.next_plus_time; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3140 l1s_increment_time(&(l1s.next_plus_time), 1); // Increment "next_plus time". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3141 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3142 l1s.tpu_ctrl_reg |= CTRL_SYCB; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3143 l1s.dsp_ctrl_reg |= CTRL_SYNC; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3144 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3145 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3146 trace_fct(CST_L1S_ADJUST_TIME, -1); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3147 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3148 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3149 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3150 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3151 // Flag DSP and TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3152 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3153 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3154 // Set "CTRL_RX" flag in the controle flag register. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3155 l1s.tpu_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3156 l1s.dsp_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3157 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3158 // This task is not compatible with Neigh. Measurement. Store task length |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3159 // in "forbid_meas" to indicate when the task will last. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3160 if((burst_id == BURST_1) && (task != PBCCHN_IDLE)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3161 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3162 // In PBCCHN_IDLE task, l1s.forbid_meas is set by the AGC ctrl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3163 l1s.forbid_meas = TASK_ROM_MFTAB[task].size; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3164 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3165 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3166 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3167 #if (MOVE_IN_INTERNAL_RAM == 0) // Must be followed by the pragma used to duplicate the funtion in internal RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3168 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3169 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3170 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3171 /* l1ps_ctrl_ptcch() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3172 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3173 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3174 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3175 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3176 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3177 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3178 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3179 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3180 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3181 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3182 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3183 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3184 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3185 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3186 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3187 void l1ps_ctrl_ptcch(UWORD8 param1, UWORD8 param2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3188 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3189 UWORD16 radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3190 UWORD8 burst_nb; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3191 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3192 UWORD16 dco_algo_ctl_nb = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3193 UWORD8 if_ctl = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3194 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3195 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3196 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3197 UWORD8 saic_flag=0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3198 #endif /* NEW_SNR_THRESHOLD*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3199 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3200 if(!(l1a_l1s_com.task_param[PTCCH] == SEMAPHORE_SET)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3201 // Check the task semaphore. The control body is executed only |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3202 // when the task semaphore is 0. This semaphore can be set to |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3203 // 1 whenever L1A makes some changes to the task parameters. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3204 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3205 WORD8 ts; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3206 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3207 radio_freq = l1pa_l1ps_com.transfer.ptcch.radio_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3208 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3209 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3210 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3211 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3212 if(l1pa_l1ps_com.transfer.ptcch.activity && (PTCCH_DL || PTCCH_UL ) == 0) // trace only if a window is programmed. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3213 trace_fct(CST_L1PS_CTRL_PTCCH_EMPTY, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3214 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3215 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3216 #if (TRACE_TYPE==5) && FLOWCHART |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3217 trace_flowchart_dsp_tpu(dltsk_trace[PTCCH].name); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3218 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3219 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3220 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3221 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3222 switch (l1s.next_time.fn_mod104) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3223 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3224 case 12: burst_nb=0; break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3225 case 38: burst_nb=1; break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3226 case 64: burst_nb=2; break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3227 case 90: burst_nb=3; break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3228 default: burst_nb=0; break; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3229 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3230 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3231 // Compute timeslot number referenced to current camp timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3232 ts = l1pa_l1ps_com.transfer.aset->packet_ta.ta_tn - l1a_l1s_com.dl_tn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3233 if(ts < 0) ts += 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3234 else if(ts >= 8) ts -= 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3235 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3236 if(l1pa_l1ps_com.transfer.ptcch.activity & PTCCH_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3237 // PTCCH DL activity bit is set: PTCCH DL programmation is required. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3238 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3239 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3240 trace_fct(CST_L1PS_CTRL_PTCCH_DL_BURST0 + burst_nb, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3241 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3242 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3243 // Programs DSP for PTCCH/DL. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3244 // *************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3245 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3246 #if FF_L1_IT_DSP_USF |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3247 l1pddsp_idle_rx_nb(burst_nb, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3248 l1pa_l1ps_com.transfer.aset->tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3249 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3250 ts, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3251 TRUE, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3252 FALSE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3253 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3254 l1pddsp_idle_rx_nb(burst_nb, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3255 l1pa_l1ps_com.transfer.aset->tsc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3256 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3257 ts, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3258 TRUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3259 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3260 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3261 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3262 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3263 // Programs TPU for PTCCH/DL task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3264 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3265 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3266 WORD8 agc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3267 UWORD8 lna_off; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3268 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3269 // AGC updating |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3270 //------------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3271 l1pctl_pagc_ctrl(&agc, &lna_off, radio_freq,TRUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3272 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3273 #if(RF_FAM == 61) // Locosto DCO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3274 cust_get_if_dco_ctl_algo(&dco_algo_ctl_nb, &if_ctl, (UWORD8) L1_IL_VALID, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3275 l1a_l1s_com.Scell_used_IL.input_level , radio_freq, if_threshold); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3276 l1ddsp_load_dco_ctl_algo_nb(dco_algo_ctl_nb); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3277 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3278 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3279 #if (L1_SAIC != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3280 // If SAIC is enabled, call the low level SAIC control function |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3281 // NOTE: l1a_l1s_com.Scell_used_IL.input_level is updated within |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3282 // the function l1pctl_pagc_ctrl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3283 l1ctl_saic(l1a_l1s_com.Scell_used_IL.input_level,l1a_l1s_com.mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3284 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3285 ,PTCCH |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3286 ,&saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3287 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3288 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3289 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3290 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3291 // Compute timeslot number referenced to current camp timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3292 // Rem: COULD BE DONE ASYNCHRONOUSLY changing ta_tn definition!!! |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3293 ts = l1pa_l1ps_com.transfer.aset->packet_ta.ta_tn - l1a_l1s_com.dl_tn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3294 if(ts < 0) ts += 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3295 else if(ts >= 8) ts -= 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3296 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3297 // Program RX Normal Burst scenario. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3298 l1pdtpu_serv_rx_nb(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3299 agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3300 lna_off, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3301 ts, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3302 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3303 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3304 1, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3305 TRUE,INACTIVE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3306 #if(RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3307 ,L1_SAIC_HARDWARE_FILTER |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3308 ,if_ctl |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3309 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3310 #if (NEW_SNR_THRESHOLD == 1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3311 ,saic_flag |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3312 #endif /* NEW_SNR_THRESHOLD */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3313 ); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3314 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3315 // Set "CTRL_RX" flag in the controle flag registers. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3316 l1s.tpu_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3317 l1s.dsp_ctrl_reg |= CTRL_RX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3318 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3319 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3320 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3321 if(l1pa_l1ps_com.transfer.ptcch.activity & PTCCH_UL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3322 // PTCCH UL activity bit is set: PTCCH UL programmation required. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3323 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3324 UWORD8 adc_active = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3325 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3326 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3327 trace_fct(CST_L1PS_CTRL_PTCCH_UL, radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3328 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3329 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3330 // Programs DSP for PTCCH/UL. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3331 // *************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3332 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3333 UWORD8 cs_type; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3334 UWORD16 ptcch_ul_data; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3335 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3336 // Access burst type ? |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3337 if (l1pa_l1ps_com.access_burst_type == ACC_BURST_8) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3338 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3339 // PRACH 8 bits: data = (0111 1111)b |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3340 cs_type = CS_PAB8_TYPE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3341 ptcch_ul_data = 0x7F; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3342 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3343 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3344 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3345 // PRACH 11 bits: data = (111 1111 1111)b |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3346 cs_type = CS_PAB11_TYPE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3347 ptcch_ul_data = 0x7FF; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3348 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3349 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3350 // "As" IDLE POLLING PRACH dsp control. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3351 l1pddsp_ul_ptcch_data(cs_type, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3352 ptcch_ul_data, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3353 l1a_l1s_com.Scell_info.bsic, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3354 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3355 ts+3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3356 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3357 l1pddsp_idle_prach_power(l1s.applied_txpwr, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3358 radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3359 ts+3); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3360 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3361 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3362 // ADC measurement |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3363 // *************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3364 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3365 // check if during the SACCH burst an ADC measurement must be performed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3366 if (l1a_l1s_com.adc_mode & ADC_NEXT_TRAFFIC_UL) // perform ADC only one time |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3367 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3368 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3369 l1a_l1s_com.adc_mode &= ADC_MASK_RESET_TRAFFIC; // reset in order to have only one ADC measurement in Traffic |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3370 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3371 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3372 if (l1a_l1s_com.adc_mode & ADC_EACH_TRAFFIC_UL) // perform ADC on each period bloc |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3373 if ((++l1a_l1s_com.adc_cpt)>=l1a_l1s_com.adc_traffic_period) // wait for the period |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3374 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3375 adc_active = ACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3376 l1a_l1s_com.adc_cpt = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3377 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3378 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3379 // Programs TPU for PTCCH/UL task. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3380 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3381 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3382 // Program TX RA scenario. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3383 l1pdtpu_serv_tx(radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3384 0, // TA=0. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3385 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3386 ts+3, // tx_id. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3387 1, // 1 PRACH. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3388 1, // tx_group_id. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3389 0, // No switch NB->RA |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3390 1, // Driver called for PRACH Burst. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3391 l1pa_l1ps_com.transfer.ptcch.activity & PTCCH_DL,adc_active); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3392 // Flag RX in same frame as TX |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3393 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3394 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3395 // PTCCH/UL has been executed, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3396 // -> PTCCH/DL is then requested for schedule. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3397 // -> PTCCH/UL activity flag must be reset. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3398 l1pa_l1ps_com.transfer.ptcch.request_dl = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3399 l1pa_l1ps_com.transfer.ptcch.activity ^= PTCCH_UL; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3400 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3401 // Set "CTRL_TX" flag in the controle flag register. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3402 l1s.tpu_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3403 l1s.dsp_ctrl_reg |= CTRL_TX; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3404 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3405 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3406 RTTL1_FILL_UL_AB(PTCCH,l1s.applied_txpwr) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3407 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3408 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3409 } // End of PTCCH UL programmation |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3410 } // End of if(...semaphore...) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3411 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3412 // This task is not compatible with Neigh. Measurement. Store task length |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3413 // in "forbid_meas" to indicate when the task will last. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3414 l1s.forbid_meas = TASK_ROM_MFTAB[PTCCH].size; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3415 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3416 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3417 #endif // MOVE_IN_INTERNAL_RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3418 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3419 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3420 #if (MOVE_IN_INTERNAL_RAM == 0) // Must be followed by the pragma used to duplicate the funtion in internal RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3421 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3422 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3423 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3424 /* l1s_read_ptcch() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3425 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3426 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3427 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3428 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3429 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3430 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3431 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3432 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3433 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3434 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3435 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3436 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3437 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3438 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3439 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3440 void l1ps_read_ptcch(UWORD8 param1, UWORD8 param2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3441 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3442 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3443 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3444 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3445 l1_check_com_mismatch(PTCCH); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3446 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3447 if(l1pa_l1ps_com.transfer.ptcch.activity & PTCCH_DL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3448 // PTCCH/DL has been executed, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3449 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3450 UWORD32 pm; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3451 WORD8 ts; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3452 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3453 // Compute timeslot number referenced to current camp timeslot. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3454 ts = l1pa_l1ps_com.transfer.aset->packet_ta.ta_tn - l1a_l1s_com.dl_tn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3455 if(ts < 0) ts += 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3456 else if(ts >= 8) ts -= 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3457 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3458 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3459 trace_fct(CST_L1PS_READ_PTCCH_DL, l1pa_l1ps_com.transfer.ptcch.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3460 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3461 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3462 // Read control results and feed control algorithms. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3463 // ************************************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3464 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3465 // Read control information. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3466 pm = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[ts] & 0xffff) >> 5; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3467 l1_check_pm_error(pm,PTCCH); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3468 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3469 if(l1s.actual_time.fn_mod104 == 91) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3470 // Read PTCCH/DL data block from DSP/MCU interface, a_dd_md_gprs[]. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3471 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3472 BOOL crc; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3473 UWORD8 ordered_ta; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3474 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3475 crc = (l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[0] & 0x0100) >> 8; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3476 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3477 if(!crc) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3478 // Block correct, we extract new TA... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3479 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3480 UWORD8 word_position = 4+ (l1pa_l1ps_com.transfer.aset->packet_ta.ta_index >> 1); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3481 UWORD8 byte_position = l1pa_l1ps_com.transfer.aset->packet_ta.ta_index & 0x01; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3482 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3483 // Download ordered TA... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3484 // IF byte_position |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3485 // Upper byte contains TA... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3486 // ELSE |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3487 // Lower byte contains TA... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3488 // (see GSM04.04) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3489 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3490 ordered_ta = (l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[word_position] >> (8*byte_position)) & 0x7f; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3491 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3492 if (ordered_ta < 64) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3493 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3494 // PTCCH/DL contains a valid TA for MS: update TA |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3495 l1pa_l1ps_com.transfer.aset->packet_ta.ta = ordered_ta; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3496 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3497 // PTCCH/DL activity bit must reset when new TA has been successfully received. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3498 l1pa_l1ps_com.transfer.ptcch.activity ^= PTCCH_DL; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3499 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3500 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3501 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3502 #if ((TRACE_TYPE == 1) || (TRACE_TYPE == 4)) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3503 if (trace_info.current_config->l1_dyn_trace & 1<<L1_DYN_TRACE_DL_PTCCH) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3504 // whatever the value is, trace it |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3505 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3506 Trace_dl_ptcch(ordered_ta, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3507 crc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3508 l1pa_l1ps_com.transfer.aset->packet_ta.ta_index, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3509 l1pa_l1ps_com.transfer.aset->packet_ta.ta_tn, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3510 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[4], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3511 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[5], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3512 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[6], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3513 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[7], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3514 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[8], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3515 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[9], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3516 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[10], |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3517 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[11]); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3518 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3519 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3520 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3521 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3522 RTTL1_FILL_DL_PTCCH(crc, ordered_ta) // Replace with ordered TA |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3523 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3524 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3525 // Reset CS type. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3526 l1ps_dsp_com.pdsp_ndb_ptr->a_dd_md_gprs[0] = CS_NONE_TYPE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3527 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3528 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3529 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3530 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3531 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3532 trace_fct(CST_L1PS_READ_PTCCH_UL, l1pa_l1ps_com.transfer.ptcch.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3533 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3534 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3535 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3536 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3537 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3538 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3539 // End of task -> task must become INACTIVE. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3540 l1s.task_status[PTCCH].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3541 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3542 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3543 #endif // MOVE_IN_INTERNAL_RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3544 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3545 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3546 #if (MOVE_IN_INTERNAL_RAM == 0) // Must be followed by the pragma used to duplicate the funtion in internal RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3547 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3548 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3549 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3550 /* l1ps_ctrl_itmeas() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3551 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3552 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3553 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3554 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3555 /* This function is a "COMPLEX" function used by the L1S */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3556 /* task ITMEAS. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3557 /* This function is the control function for measuring */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3558 /* the signal strength on several specified timeslots (on*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3559 /* which it's possible according to the multi-slot class)*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3560 /* of an indicated carrier. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3561 /* It programs the DSP and the TPU for doing these */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3562 /* measurements */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3563 /* Here below is a summary of the execution: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3564 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3565 /* - If SEMAPHORE(task) is low. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3566 /* - Traces and debug. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3567 /* - Determines on which timeslots measurements can */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3568 /* be done */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3569 /* - Programs DSP for required task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3570 /* - Programs TPU for required task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3571 /* - Flag DSP and TPU programmation. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3572 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3573 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3574 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3575 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3576 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3577 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3578 /* "l1pa_l1ps_com.itmeas" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3579 /* Interference measurement parameters structure */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3580 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3581 /* "l1a_l1s_com.dl_tn" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3582 /* Timeslot on which L1 is synchronized */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3583 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3584 /* "l1pa_l1ps_com.transfer.aset->multislot_class" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3585 /* Multi-slot class in Packet transfer */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3586 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3587 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3588 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3589 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3590 /* "l1s.tpu_ctrl_reg" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3591 /* bit register used to know at the end of L1S if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3592 /* something has been programmed on the MCU/TPU com. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3593 /* This is used mainly to swap then the com. page at */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3594 /* the end of a control frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3595 /* -> set CTRL_RX bit in the register. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3596 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3597 /* "l1s.dsp_ctrl_reg" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3598 /* bit register used to know at the end of L1S if */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3599 /* something has been programmed on the MCU/DSP com. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3600 /* This is used mainly to swap then the com. page at */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3601 /* the end of a control frame. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3602 /* -> set CTRL_RX bit in the register. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3603 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3604 void l1ps_ctrl_itmeas(UWORD8 param1, UWORD8 param2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3605 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3606 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3607 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3608 UWORD16 dco_algo_ctl_pw = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3609 UWORD8 if_ctl = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3610 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3611 UWORD8 ts = 0; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3612 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3613 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3614 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3615 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3616 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3617 #if (TRACE_TYPE==5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3618 trace_fct(CST_L1PS_CTRL_ITMEAS, l1pa_l1ps_com.itmeas.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3619 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3620 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3621 // Timeslots selection |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3622 // ******************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3623 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3624 // Packet transfer mode <-> PDTCH task enabled: condition to check !!!! |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3625 //--------------------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3626 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3627 // Timeslots already selected in l1p_asyn.c |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3628 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3629 // Packet idle mode |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3630 //----------------- |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3631 if (l1a_l1s_com.l1s_en_task[PDTCH] == TASK_DISABLED) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3632 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3633 // If a RX has been programmed on this frame |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3634 if (l1s.dsp_ctrl_reg & CTRL_RX) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3635 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3636 // The pre-processed bitmap with Rx taken into account is taken |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3637 l1pa_l1ps_com.itmeas.meas_bitmap = l1pa_l1ps_com.itmeas.idle_tn_rx; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3638 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3639 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3640 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3641 // The pre-processed bitmap without Rx taken into account is taken |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3642 l1pa_l1ps_com.itmeas.meas_bitmap = l1pa_l1ps_com.itmeas.idle_tn_no_rx; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3643 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3644 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3645 } // End if 'packet idle mode' |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3646 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3647 l1pa_l1ps_com.itmeas.dsp_r_page_switch_req = FALSE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3648 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3649 // If some measurements can be done |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3650 if (l1pa_l1ps_com.itmeas.meas_bitmap != 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3651 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3652 UWORD8 nbmeas; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3653 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3654 // DSP read page switched or not during the ITMEAS read phase ? |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3655 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3656 if (l1s.dsp_ctrl_reg == NO_CTRL) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3657 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3658 // A control task hasn't already been done in this frame --> Read page switch |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3659 l1pa_l1ps_com.itmeas.dsp_r_page_switch_req = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3660 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3661 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3662 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3663 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3664 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3665 trace_fct(CST_L1PS_CTRL_ITMEAS, l1pa_l1ps_com.itmeas.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3666 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3667 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3668 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3669 #if(RF_FAM == 61) // Locosto DCO |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3670 #if (PWMEAS_IF_MODE_FORCE == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3671 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_INVALID , |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3672 0, l1pa_l1ps_com.itmeas.radio_freq, if_threshold); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3673 #else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3674 if_ctl = IF_120KHZ_DSP; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3675 dco_algo_ctl_pw = DCO_IF_0KHZ; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3676 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3677 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3678 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3679 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3680 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3681 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3682 // Program TPU |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3683 // ************ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3684 #if (RF_FAM != 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3685 nbmeas = l1pdtpu_interf_meas(l1pa_l1ps_com.itmeas.radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3686 l1_config.params.high_agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3687 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3688 l1pa_l1ps_com.itmeas.meas_bitmap, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3689 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3690 l1s.tpu_win, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3691 l1a_l1s_com.dl_tn); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3692 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3693 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3694 #if (RF_FAM == 61) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3695 nbmeas = l1pdtpu_interf_meas(l1pa_l1ps_com.itmeas.radio_freq, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3696 l1_config.params.high_agc, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3697 0, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3698 l1pa_l1ps_com.itmeas.meas_bitmap, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3699 l1s.tpu_offset, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3700 l1s.tpu_win, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3701 l1a_l1s_com.dl_tn, |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3702 if_ctl); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3703 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3704 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3705 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3706 // Program DSP |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3707 // ************ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3708 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3709 l1pddsp_interf_meas_ctrl(nbmeas); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3710 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3711 #if(RF_FAM == 61) // TBD |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3712 // Reproduce the DCO control for all the power measurement |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3713 dco_algo_ctl_pw = dco_algo_ctl_pw * 0x55; // Replicate ZLZLZLZL |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3714 dco_algo_ctl_pw = dco_algo_ctl_pw >> (2*(4 - nbmeas)); // reduce to ZLs of Nbr |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3715 if(l1s.tcr_prog_done==1) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3716 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3717 dco_algo_ctl_pw=((dco_algo_ctl_pw<<2)|(l1s_dsp_com.dsp_db_common_w_ptr->d_dco_algo_ctrl_pw&0x3)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3718 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3719 l1ddsp_load_dco_ctl_algo_pw(dco_algo_ctl_pw); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3720 // of Meas Programmed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3721 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3722 // Flag DSP and TPU programmation. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3723 // ******************************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3724 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3725 // Set "CTRL_RX" flag in the controle flag register. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3726 l1s.tpu_ctrl_reg |= CTRL_MS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3727 l1s.dsp_ctrl_reg |= CTRL_MS; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3728 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3729 } // End if 'nbmeas != 0' |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3730 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3731 // This task is not compatible with Neigh. Measurement. Store task length |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3732 // in "forbid_meas" to indicate when the task will last. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3733 // Rem: Only FB51 task starts from this ctrl function. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3734 l1s.forbid_meas = TASK_ROM_MFTAB[ITMEAS].size; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3735 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3736 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3737 #endif // MOVE_IN_INTERNAL_RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3738 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3739 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3740 #if (MOVE_IN_INTERNAL_RAM == 0) // Must be followed by the pragma used to duplicate the funtion in internal RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3741 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3742 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3743 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3744 /* l1ps_read_itmeas() */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3745 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3746 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3747 /* Description: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3748 /* ------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3749 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3750 /* This function is a "COMPLEX" function used for the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3751 /* L1S ITMEAS task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3752 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3753 /* Here is a summary of the execution: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3754 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3755 /* - If SEMAPHORE(task) is low and task still enabled. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3756 /* - Traces and debug. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3757 /* - Read interference measurement results in NDB */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3758 /* - Fill and send reporting message */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3759 /* - Disactivate task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3760 /* - Flag the use of the MCU/DSP dual page read */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3761 /* interface if needed. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3762 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3763 /* Input parameters: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3764 /* ----------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3765 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3766 /* Input parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3767 /* ------------------------------ */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3768 /* "l1pa_l1ps_com.itmeas" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3769 /* Interference measurement parameters structure */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3770 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3771 /* Modified parameters from globals: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3772 /* --------------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3773 /* "l1s.task_status[task].current_status" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3774 /* current task status. It must be reset (INACTIVE) */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3775 /* when the task is completed. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3776 /* -> disactivate task. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3777 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3778 /* "l1s_dsp_com.dsp_r_page_used" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3779 /* Flag used by the function which closes L1S */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3780 /* execution ("l1s_end_manager()") to know if the */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3781 /* MCU/DSP read page must be switched. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3782 /* -> Set to 1 only if no other task was controlled */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3783 /* in the same frame as ITMEAS */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3784 /* */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3785 /* Use of MCU/DSP interface: */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3786 /* ------------------------- */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3787 /* "l1s_dsp_com.dsp_ndb_ptr" */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3788 /* pointer to the non double buffered part (NDB) of */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3789 /* the MCU/DSP interface. This part is R/W for both */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3790 /* DSP and MCU. */ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3791 /*-------------------------------------------------------*/ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3792 void l1ps_read_itmeas(UWORD8 param1, UWORD8 param2) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3793 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3794 xSignalHeaderRec *msg; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3795 UWORD8 i; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3796 WORD8 delta1_freq, delta2_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3797 UWORD16 g_magic; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3798 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3799 if(!(l1a_l1s_com.task_param[ITMEAS]) && |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3800 (l1a_l1s_com.l1s_en_task[ITMEAS])) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3801 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3802 // Traces and debug. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3803 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3804 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3805 #if (TRACE_TYPE!=0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3806 trace_fct(CST_L1PS_READ_ITMEAS, l1pa_l1ps_com.itmeas.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3807 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3808 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3809 // Allocate result message. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3810 // ************************ |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3811 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3812 msg = os_alloc_sig(sizeof(T_L1P_ITMEAS_IND)); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3813 DEBUGMSG(status,NU_ALLOC_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3814 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3815 // Fill msg signal code |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3816 msg->SignalCode = L1P_ITMEAS_IND; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3817 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3818 // Fill msg contents |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3819 // ****************** |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3820 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3821 ((T_L1P_ITMEAS_IND *)(msg->SigP))->fn = l1s.actual_time.fn; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3822 // Report measurement bitmap |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3823 ((T_L1P_ITMEAS_IND *)(msg->SigP))->meas_bitmap = l1pa_l1ps_com.itmeas.meas_bitmap; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3824 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3825 // Read result from DSP |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3826 g_magic = l1ctl_get_g_magic(l1pa_l1ps_com.itmeas.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3827 delta1_freq = l1ctl_encode_delta1(l1pa_l1ps_com.itmeas.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3828 delta2_freq = l1ctl_encode_delta2(l1pa_l1ps_com.itmeas.radio_freq); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3829 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3830 for (i = 0; i < 8; i++) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3831 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3832 UWORD8 pm; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3833 WORD16 IL_for_rxlev; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3834 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3835 pm = (l1ps_dsp_com.pdsp_ndb_ptr->a_interf_meas_gprs[i] & 0xffff) >> 5; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3836 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3837 // IL processing |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3838 if (pm == 0) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3839 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3840 ((T_L1P_ITMEAS_IND *)(msg->SigP))->rxlev[i] = (WORD8)0x80; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3841 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3842 else |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3843 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3844 IL_for_rxlev = -(pm - (l1_config.params.high_agc << 1) - g_magic) - delta1_freq - delta2_freq; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3845 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3846 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3847 ((T_L1P_ITMEAS_IND *)(msg->SigP))->rxlev[i] = l1s_encode_rxlev(IL_for_rxlev); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3848 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3849 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3850 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3851 // If the Read phase is done during fn_mod26 = 13 --> measurements have been done |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3852 // during a PTCCH frame |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3853 if (l1s.actual_time.t2 == 13) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3854 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3855 ((T_L1P_ITMEAS_IND *)(msg->SigP))->position = PTCCH_FRAME; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3856 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3857 else // Measurements done during a search frame |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3858 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3859 ((T_L1P_ITMEAS_IND *)(msg->SigP))->position = SEARCH_FRAME; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3860 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3861 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3862 // send message... |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3863 os_send_sig(msg, L1C1_QUEUE); |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3864 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3865 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3866 // ITMEAS is a 'one shot' task --> disable task |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3867 l1a_l1s_com.l1s_en_task[ITMEAS] = TASK_DISABLED; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3868 } // End if "task enabled and semaphore false" |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3869 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3870 // End of task -> task must become INACTIVE. |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3871 l1s.task_status[ITMEAS].current_status = INACTIVE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3872 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3873 // Switch DSP read page if needed |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3874 if(l1pa_l1ps_com.itmeas.dsp_r_page_switch_req) |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3875 { |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3876 // Set flag used to change the read page at the end of "l1_synch". |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3877 l1s_dsp_com.dsp_r_page_used = TRUE; |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3878 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3879 } |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3880 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3881 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3882 #endif // MOVE_IN_INTERNAL_RAM |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3883 |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3884 //#pragma DUPLICATE_FOR_INTERNAL_RAM_START |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3885 #endif |
0740b5ff15f6
reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3886 //#pragma DUPLICATE_FOR_INTERNAL_RAM_END |