FreeCalypso > hg > tcs211-l1-reconst
annotate chipsetsw/layer1/cfile/l1_afunc.c @ 215:fd96174924df
l1tm_async.c passes compilation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 Jan 2017 19:59:33 +0000 |
parents | 1bec6419cd32 |
children |
rev | line source |
---|---|
32
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1 /************* Revision Controle System Header ************* |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
2 * GSM Layer 1 software |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
3 * L1_AFUNC.C |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
4 * |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
5 * Filename l1_afunc.c |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
6 * Copyright 2003 (C) Texas Instruments |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
7 * |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
8 ************* Revision Controle System Header *************/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
9 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
10 #define L1_AFUNC_C |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
11 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
12 #include "l1_macro.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
13 #include "l1_confg.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
14 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
15 #if (CODE_VERSION == SIMULATION) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
16 #include <string.h> |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
17 #include "l1_types.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
18 #include "sys_types.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
19 #include "l1_const.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
20 #include "l1_signa.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
21 #if TESTMODE |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
22 #include "l1tm_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
23 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
24 #if (AUDIO_TASK == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
25 #include "l1audio_const.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
26 #include "l1audio_cust.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
27 #include "l1audio_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
28 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
29 #if (L1_GTT == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
30 #include "l1gtt_const.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
31 #include "l1gtt_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
32 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
33 #if (L1_MIDI == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
34 #include "l1midi_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
35 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
36 #if (L1_MP3 == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
37 #include "l1mp3_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
38 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
39 //ADDED FOR AAC |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
40 #if (L1_AAC == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
41 #include "l1aac_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
42 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
43 #include "l1_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
44 #include "cust_os.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
45 #include "l1_msgty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
46 #include "l1_varex.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
47 #include "l1_proto.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
48 #include "l1_tabs.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
49 #include "l1_time.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
50 #if L1_GPRS |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
51 #include "l1p_cons.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
52 #include "l1p_msgt.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
53 #include "l1p_deft.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
54 #include "l1p_vare.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
55 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
56 #else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
57 #include <string.h> |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
58 #include "l1_types.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
59 #include "sys_types.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
60 #include "l1_const.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
61 #include "l1_signa.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
62 #include "l1_time.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
63 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
64 #if TESTMODE |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
65 #include "l1tm_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
66 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
67 #if (AUDIO_TASK == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
68 #include "l1audio_const.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
69 #include "l1audio_cust.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
70 #include "l1audio_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
71 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
72 #if (L1_GTT == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
73 #include "l1gtt_const.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
74 #include "l1gtt_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
75 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
76 #if (L1_MP3 == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
77 #include "l1mp3_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
78 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
79 #if (L1_MIDI == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
80 #include "l1midi_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
81 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
82 //ADDED FOR AAC |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
83 #if (L1_AAC == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
84 #include "l1aac_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
85 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
86 #include "l1_defty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
87 #include "cust_os.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
88 #include "l1_msgty.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
89 #include "l1_varex.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
90 #include "l1_proto.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
91 #include "l1_tabs.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
92 #if L1_GPRS |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
93 #include "l1p_cons.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
94 #include "l1p_msgt.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
95 #include "l1p_deft.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
96 #include "l1p_vare.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
97 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
98 #if (GSM_IDLE_RAM > 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
99 #if (OP_L1_STANDALONE == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
100 #include "csmi_simul.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
101 #else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
102 #include "csmi/csmi.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
103 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
104 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
105 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
106 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
107 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
108 #if (OP_L1_STANDALONE == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
109 #if (ANLG_FAM == 11) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
110 #include "bspTwl3029_Madc.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
111 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
112 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
113 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
114 #if (L1_MADC_ON == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
115 #if (OP_L1_STANDALONE == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
116 #if (RF_FAM == 61) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
117 #include "drp_api.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
118 #include "l1_rf61.h" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
119 #include <string.h> |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
120 extern T_DRP_SRM_API* drp_srm_api; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
121 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
122 #if (ANLG_FAM == 11) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
123 BspTwl3029_MadcResults l1_madc_results; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
124 void l1a_madc_callback(void); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
125 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
126 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
127 #endif //L1_MADC_ON |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
128 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
129 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
130 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
131 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
132 /* l1a_reset_ba_list() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
133 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
134 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
135 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
136 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
137 /* This function resets the BA list content. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
138 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
139 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
140 void l1a_reset_ba_list() |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
141 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
142 UWORD8 i; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
143 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
144 // Rem: this reset function do not touch the "ba_id", "nbr_carrier" and |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
145 // "radio_freq" fields. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
146 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
147 //!!! remove this initialization when BA list handling changed for dedic mode |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
148 if(l1a_l1s_com.mode != I_MODE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
149 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
150 l1a_l1s_com.ba_list.next_to_ctrl = 0; // Carrier for next power measurement control. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
151 l1a_l1s_com.ba_list.next_to_read = 0; // Carrier for next power measurement result. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
152 l1a_l1s_com.ba_list.first_index = 0; // First BA index measured in current session. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
153 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
154 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
155 // Reset of "ms_ctrl, ms_ctrl_d, msctrl_dd" is done at L1 startup |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
156 // and when SYNCHRO task is executed. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
157 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
158 l1a_l1s_com.ba_list.np_ctrl = 0; // PCH burst number. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
159 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
160 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
161 for(i=0; i<C_BA_PM_MEAS; i++) // 2 measurements / PCH frame... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
162 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
163 l1a_l1s_com.ba_list.used_il [i] = l1_config.params.il_min; // IL used in CTRL phase for AGC setting. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
164 l1a_l1s_com.ba_list.used_il_d [i] = l1_config.params.il_min; // ... 1 frame delay. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
165 l1a_l1s_com.ba_list.used_il_dd[i] = l1_config.params.il_min; // ... 2 frames delay, used in READ phase. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
166 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
167 l1a_l1s_com.ba_list.used_lna [i] = FALSE; // LNA used in CTRL phase for AGC setting. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
168 l1a_l1s_com.ba_list.used_lna_d [i] = FALSE; // ... 1 frame delay. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
169 l1a_l1s_com.ba_list.used_lna_dd[i] = FALSE; // ... 2 frames delay, used in READ phase. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
170 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
171 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
172 for(i=0; i<32+1; i++) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
173 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
174 l1a_l1s_com.ba_list.A[i].acc = 0; // Reset IL accumulation. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
175 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
176 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
177 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
178 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
179 /* l1a_reset_full_list() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
180 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
181 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
182 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
183 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
184 /* This function resets the FULL list content. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
185 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
186 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
187 void l1a_reset_full_list() |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
188 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
189 UWORD16 i; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
190 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
191 // Init power measurement multi_session process |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
192 l1a_l1s_com.full_list.meas_1st_pass_ctrl = 1; // Set 1st pass flag for power measurement session in ctrl. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
193 l1a_l1s_com.full_list.meas_1st_pass_read = 1; // Set 1st pass flag for power measurement session in read. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
194 l1a_l1s_com.full_list.nbr_sat_carrier_ctrl = 0; // Clear number of saturated carrier in ctrl. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
195 l1a_l1s_com.full_list.nbr_sat_carrier_read = 0; // Clear number of saturated carrier in read. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
196 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
197 // Set global parameters for full list measurement. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
198 l1a_l1s_com.full_list.next_to_ctrl = 0; // Set next carrier to control to 1st one. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
199 l1a_l1s_com.full_list.next_to_read = 0; // Set next carrier to control to 1st one. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
200 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
201 // Reset Pipeline |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
202 // Note: l1a_l1s_com.full_list.ms_ctrl_d is reset at the end of l1_meas_manager() |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
203 l1a_l1s_com.full_list.ms_ctrl_dd = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
204 l1a_l1s_com.full_list.ms_ctrl_d = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
205 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
206 // Reset the FULL LIST. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
207 #if (L1_FF_MULTIBAND == 0) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
208 for(i=0; i<l1_config.std.nbmax_carrier; i++) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
209 #else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
210 for(i=0; i< NBMAX_CARRIER; i++) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
211 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
212 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
213 l1a_l1s_com.full_list.sat_flag[i] = 0; // Reset sat_flag |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
214 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
215 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
216 #if L1_GPRS |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
217 // Reset PPCH burst ctrl indication |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
218 l1pa_l1ps_com.cr_freq_list.pnp_ctrl = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
219 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
220 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
221 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
222 #if ((L1_EOTD == 1) && (L1_EOTD_QBIT_ACC == 1)) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
223 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
224 /* l1a_add_time_delta() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
225 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
226 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
227 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
228 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
229 /* This function shifts a given cell timing (given as a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
230 /* couple [time_alignmt, fn_offset]) by adding */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
231 /* a specified new time_alignmt offset (+ve or -ve */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
232 /* between -4999 and +4999 qb) */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
233 /* to that timing. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
234 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
235 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
236 void l1a_add_time_delta(UWORD32 * time_alignmt, UWORD32 * fn_offset, WORD32 delta) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
237 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
238 WORD32 new_time_alignmt = *time_alignmt + delta; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
239 UWORD32 new_fn_offset = *fn_offset; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
240 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
241 if(new_time_alignmt < 0) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
242 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
243 new_time_alignmt += TPU_CLOCK_RANGE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
244 new_fn_offset = (new_fn_offset + 1) % MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
245 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
246 else if(new_time_alignmt >= TPU_CLOCK_RANGE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
247 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
248 new_time_alignmt -= TPU_CLOCK_RANGE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
249 new_fn_offset = (new_fn_offset - 1 + MAX_FN) % MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
250 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
251 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
252 *time_alignmt = new_time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
253 *fn_offset = new_fn_offset; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
254 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
255 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
256 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
257 /* l1a_compensate_sync_ind() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
258 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
259 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
260 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
261 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
262 /* Attempts to modify the time_alignmt and fn_offset */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
263 /* fields of an MPHC_NCELL_SYNC_IND message based on */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
264 /* E-OTD cross-correlation information in order to */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
265 /* post-correct the result. This can be used to form a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
266 /* quater-bit alignment with slow drifting neighbours */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
267 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
268 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
269 void l1a_compensate_sync_ind(T_MPHC_NCELL_SYNC_IND * msg) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
270 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
271 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
272 // This process can only be applied to SBCONF messages |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
273 // with good SCH decodes and valid EOTD results. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
274 // |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
275 // a_eotd_crosscor [0] [1] [2] [3] [4] [5] [6] [7] [8] |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
276 // |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
277 // <------ Peak Range -----> |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
278 // |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
279 // As long as the cross-correlation peak lies in the range |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
280 // [1] to [7] then we can examine the slope of the correlation |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
281 // points on either side of the peak in order to perform a |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
282 // positive or negative QB shift. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
283 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
284 if((msg->sb_flag) && (msg->eotd_data_valid)) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
285 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
286 WORD16 peak_index = msg->d_eotd_max - msg->d_eotd_first; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
287 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
288 if((peak_index >= 1) && (peak_index <= 7)) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
289 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
290 UWORD32 a_power[9]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
291 UWORD32 pre_power, post_power, thresh_power; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
292 UWORD32 i; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
293 WORD32 shift = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
294 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
295 // Calculate the normalised power of the cross-correlation samples |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
296 // in a_eotd_crosscor. This could be improved to only calculate |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
297 // the terms for [peak_index-1] [peak_index] [peak_index+1] if |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
298 // the algorithm proves viable in the long term. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
299 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
300 // Normalised power[i] = real[i]^2 + imag[i]^2 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
301 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
302 for(i=0; i<9; ++i) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
303 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
304 // |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
305 // Awkward looking code to square values as our compiler / assembler |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
306 // gets the following construct wrong. Very strange... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
307 // |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
308 // UWORD32 real = ... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
309 // real *= real; <-- Assembler allocates registers incorrectly here |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
310 // |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
311 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
312 UWORD32 real = msg->a_eotd_crosscor[2*i] * msg->a_eotd_crosscor[2*i]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
313 UWORD32 imag = msg->a_eotd_crosscor[(2*i)+1] * msg->a_eotd_crosscor[(2*i)+1]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
314 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
315 // Sum of the squares... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
316 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
317 a_power[i] = real + imag; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
318 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
319 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
320 // By inspection of practical examples, it appears that (peak power/3) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
321 // is a good threshold on which to compare the shape of the slope. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
322 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
323 thresh_power = a_power[peak_index] / 3; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
324 pre_power = a_power[peak_index-1]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
325 post_power = a_power[peak_index+1]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
326 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
327 // Decision on whether the gradient of the slope of the crosscor points |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
328 // on either side of the peak is large enough to cause a (max) +/- 1QB shift |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
329 // to the time_alignmt field. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
330 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
331 if( (pre_power < thresh_power) && (post_power > thresh_power) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
332 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
333 // Right skew on the cross corrrelation - shift time_alignmt |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
334 // to be one greater |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
335 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
336 shift = 1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
337 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
338 else if ( (pre_power > thresh_power) && (post_power < thresh_power) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
339 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
340 // Left skew on the cross correlation - shift time_alignmt |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
341 // to be one less |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
342 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
343 shift = -1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
344 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
345 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
346 l1a_add_time_delta( &(msg->time_alignmt), |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
347 &(msg->fn_offset), |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
348 shift ); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
349 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
350 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
351 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
352 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
353 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
354 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
355 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
356 /* l1a_add_time_for_nb() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
357 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
358 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
359 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
360 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
361 /* This function shift a given cell timing (given as a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
362 /* couple [time_alignmt, fn_offset]) by adding */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
363 /* "SB_MARGIN - NB_MARGIN" */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
364 /* to that timing. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
365 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
366 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
367 void l1a_add_time_for_nb(UWORD32 *time_alignmt, UWORD32 *fn_offset) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
368 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
369 // Add "SB_MARGIN - NB_MARGIN" qbit to "fn_offset" and "time_alignmt". |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
370 // Pay attention to the modulos. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
371 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
372 *time_alignmt += (SB_MARGIN - NB_MARGIN); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
373 if(*time_alignmt >= TPU_CLOCK_RANGE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
374 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
375 *time_alignmt -= TPU_CLOCK_RANGE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
376 *fn_offset = (*fn_offset + MAX_FN - 1) % MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
377 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
378 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
379 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
380 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
381 /* l1a_add_timeslot() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
382 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
383 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
384 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
385 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
386 /* This function shift a given cell timing (given as a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
387 /* couple [time_alignmt, fn_offset]) by adding a number */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
388 /* of TIMESLOT (given as "tn") to that timing. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
389 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
390 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
391 void l1a_add_timeslot(UWORD32 *time_alignmt, UWORD32 *fn_offset, UWORD8 tn) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
392 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
393 // Add "tn" timeslot to "fn_offset" and "time_alignmt". |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
394 // Pay attention to the modulos. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
395 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
396 *time_alignmt += tn * BP_DURATION; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
397 if(*time_alignmt >= TPU_CLOCK_RANGE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
398 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
399 *time_alignmt -= TPU_CLOCK_RANGE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
400 *fn_offset = (*fn_offset + MAX_FN - 1) % MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
401 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
402 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
403 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
404 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
405 /* l1a_sub_time_for_nb() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
406 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
407 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
408 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
409 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
410 /* This function shift a given cell timing (given as a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
411 /* couple [time_alignmt, fn_offset]) by substacting */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
412 /* "SB_MARGIN - NB_MARGIN" */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
413 /* to that timing. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
414 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
415 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
416 void l1a_sub_time_for_nb(UWORD32 *time_alignmt, UWORD32 *fn_offset) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
417 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
418 WORD32 new_time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
419 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
420 // Sub "SB_MARGIN - NB_MARGIN" qbit to "fn_offset" and "time_alignmt". |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
421 // Pay attention to the modulos. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
422 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
423 new_time_alignmt = *time_alignmt - (SB_MARGIN - NB_MARGIN); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
424 if(new_time_alignmt < 0) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
425 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
426 new_time_alignmt += TPU_CLOCK_RANGE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
427 *fn_offset = (*fn_offset + 1) % MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
428 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
429 *time_alignmt = new_time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
430 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
431 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
432 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
433 /* l1a_sub_timeslot() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
434 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
435 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
436 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
437 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
438 /* This function shift a given cell timing (given as a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
439 /* couple [time_alignmt, fn_offset]) by substracting a */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
440 /* number of TIMESLOT (given as "tn") to that timing. */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
441 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
442 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
443 void l1a_sub_timeslot(UWORD32 *time_alignmt, UWORD32 *fn_offset, UWORD8 tn) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
444 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
445 WORD32 new_time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
446 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
447 // Sub "tn" timeslot to "fn_offset" and "time_alignmt". |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
448 // Pay attention to the modulos. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
449 new_time_alignmt = *time_alignmt - (tn * BP_DURATION); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
450 if(new_time_alignmt < 0) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
451 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
452 new_time_alignmt += TPU_CLOCK_RANGE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
453 *fn_offset = (*fn_offset + 1) % MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
454 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
455 *time_alignmt = new_time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
456 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
457 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
458 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
459 /* l1a_correct_timing() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
460 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
461 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
462 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
463 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
464 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
465 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
466 #if (L1_12NEIGH == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
467 void l1a_correct_timing (UWORD8 neigh_id,UWORD32 time_alignmt,UWORD32 fn_offset) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
468 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
469 // Save timing information in case of future handovers. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
470 l1a_l1s_com.nsync.list[neigh_id].time_alignmt_mem = time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
471 l1a_l1s_com.nsync.list[neigh_id].fn_offset_mem = fn_offset; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
472 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
473 // Sub the serving cell timeslot number to the Neigh./Serving timing |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
474 // difference to format it for L1S use. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
475 l1a_sub_timeslot(&time_alignmt, &fn_offset, l1a_l1s_com.dl_tn); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
476 l1a_sub_time_for_nb(&time_alignmt, &fn_offset); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
477 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
478 // Save neighbor information in the neighbor confirmation cell structure. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
479 l1a_l1s_com.nsync.list[neigh_id].time_alignmt = time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
480 l1a_l1s_com.nsync.list[neigh_id].fn_offset = fn_offset; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
481 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
482 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
483 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
484 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
485 /* l1a_compute_Eotd_data() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
486 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
487 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
488 /* Description: */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
489 /* ------------ */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
490 /* */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
491 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
492 #if ((L1_12NEIGH ==1) && (L1_EOTD == 1)) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
493 void l1a_compute_Eotd_data( UWORD8 *first_scell, UWORD8 neigh_id, UWORD32 SignalCode, xSignalHeaderRec *msg) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
494 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
495 WORD32 ta_sb_neigh; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
496 UWORD32 fn_sb_neigh; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
497 WORD16 d_eotd_first; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
498 WORD32 toa_correction; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
499 UWORD32 timetag; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
500 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
501 // SB case ..... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
502 if (SignalCode == L1C_SB_INFO) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
503 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
504 fn_sb_neigh = ((T_L1C_SB_INFO *)(msg->SigP))->fn_sb_neigh; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
505 d_eotd_first= ((T_L1C_SB_INFO *)(msg->SigP))->d_eotd_first; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
506 toa_correction = ((T_L1C_SB_INFO *)(msg->SigP))->toa_correction; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
507 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
508 // SBCONF case ..... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
509 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
510 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
511 fn_sb_neigh = ((T_L1C_SBCONF_INFO *)(msg->SigP))->fn_sb_neigh; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
512 d_eotd_first= ((T_L1C_SBCONF_INFO *)(msg->SigP))->d_eotd_first; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
513 toa_correction = ((T_L1C_SBCONF_INFO *)(msg->SigP))->toa_correction; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
514 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
515 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
516 // compute the true Serving/Neighbor time difference. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
517 // 1) update time_alignmt with (23bit - d_eotd_first) delta |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
518 // 2) Add the serving cell timeslot number to the Serving/Neighbor time difference. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
519 ta_sb_neigh = l1a_l1s_com.nsync.list[neigh_id].time_alignmt; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
520 ta_sb_neigh += (d_eotd_first - (23))*4 + |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
521 (l1a_l1s_com.dl_tn * 625); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
522 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
523 // for Serving cell, timetag reference is 0 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
524 if (*first_scell == TRUE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
525 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
526 l1a_l1s_com.nsync.fn_sb_serv = fn_sb_neigh; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
527 l1a_l1s_com.nsync.ta_sb_serv = ta_sb_neigh; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
528 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
529 timetag = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
530 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
531 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
532 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
533 UWORD32 delta_fn; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
534 WORD32 delta_qbit; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
535 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
536 delta_fn = (fn_sb_neigh - l1a_l1s_com.nsync.fn_sb_serv + MAX_FN)%MAX_FN; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
537 delta_qbit = ta_sb_neigh - l1a_l1s_com.nsync.ta_sb_serv; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
538 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
539 // Set timetag |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
540 timetag = (delta_fn*5000) + (WORD32)(delta_qbit) + toa_correction; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
541 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
542 #if (CODE_VERSION == SIMULATION) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
543 #if (TRACE_TYPE==5) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
544 ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->delta_fn = delta_fn; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
545 ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->delta_qbit = delta_qbit; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
546 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
547 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
548 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
549 // Set timetag |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
550 ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->timetag = timetag; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
551 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
552 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
553 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
554 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
555 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
556 /* l1a_get_free_dedic_set() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
557 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
558 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
559 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
560 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
561 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
562 T_DEDIC_SET *l1a_get_free_dedic_set() |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
563 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
564 T_DEDIC_SET *fset; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
565 UWORD8 i; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
566 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
567 // Get free set pointer. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
568 if(l1a_l1s_com.dedic_set.aset == &(l1a_l1s_com.dedic_set.set[0])) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
569 fset = &(l1a_l1s_com.dedic_set.set[1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
570 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
571 fset = &(l1a_l1s_com.dedic_set.set[0]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
572 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
573 // Clear free set. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
574 fset->achan_ptr = NULL; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
575 fset->chan1.desc.channel_type = INVALID_CHANNEL; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
576 fset->chan1.desc_bef_sti.channel_type = INVALID_CHANNEL; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
577 fset->chan2.desc.channel_type = INVALID_CHANNEL; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
578 fset->chan2.desc_bef_sti.channel_type = INVALID_CHANNEL; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
579 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
580 fset->ma.alist_ptr = NULL; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
581 fset->ma.freq_list.rf_chan_cnt = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
582 fset->ma.freq_list_bef_sti.rf_chan_cnt = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
583 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
584 // Starting time. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
585 fset->serv_sti_fn = -1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
586 fset->neig_sti_fn = -1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
587 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
588 // Frequency redefinition flag. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
589 fset->freq_redef_flag = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
590 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
591 // Timing Advance |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
592 fset->timing_advance = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
593 fset->new_timing_advance = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
594 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
595 // TXPWR |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
596 fset->new_target_txpwr = NO_TXPWR; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
597 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
598 // Cell Information |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
599 l1a_reset_cell_info(&(fset->cell_desc)); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
600 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
601 // Cipering. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
602 fset->a5mode = 0; // Ciphering OFF. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
603 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
604 // Clear O&M test variables. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
605 fset->dai_mode = 0; // No DAI test. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
606 fset->chan1.tch_loop = 0; // No TCH loop on chan1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
607 fset->chan2.tch_loop = 0; // No TCH loop on chan2. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
608 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
609 // For handover... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
610 fset->ho_acc = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
611 fset->ho_acc_to_send = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
612 fset->t3124 = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
613 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
614 #if ((REL99 == 1) && (FF_BHO == 1)) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
615 // For blind handover... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
616 fset->report_time_diff = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
617 fset->nci = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
618 fset->report_time_diff = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
619 fset->real_time_difference = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
620 fset->HO_SignalCode = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
621 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
622 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
623 // Reset DPAGC fifo |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
624 for(i=0;i<DPAGC_FIFO_LEN;i++) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
625 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
626 fset->G_all[i] = 200; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
627 fset->G_DTX[i] = 200; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
628 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
629 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
630 // Reset DTX_ALLOWED field. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
631 fset->dtx_allowed = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
632 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
633 #if IDS |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
634 // clear ids_mode: default value = speech mode |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
635 fset->ids_mode = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
636 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
637 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
638 #if (AMR == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
639 // Clear the AMR ver 1.0 network settings |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
640 fset->amr_configuration.noise_suppression_bit = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
641 fset->amr_configuration.initial_codec_mode_indicator = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
642 fset->amr_configuration.initial_codec_mode = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
643 fset->amr_configuration.active_codec_set = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
644 fset->amr_configuration.threshold[0] = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
645 fset->amr_configuration.threshold[1] = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
646 fset->amr_configuration.threshold[2] = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
647 fset->amr_configuration.hysteresis[0] = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
648 fset->amr_configuration.hysteresis[1] = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
649 fset->amr_configuration.hysteresis[2] = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
650 fset->cmip = C_AMR_CMIP_DEFAULT; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
651 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
652 return(fset); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
653 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
654 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
655 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
656 /* l1a_fill_bef_sti_param() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
657 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
658 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
659 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
660 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
661 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
662 void l1a_fill_bef_sti_param(T_DEDIC_SET *set_ptr, BOOL start_time_present) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
663 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
664 if(start_time_present == TRUE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
665 // There is a STARTING TIME field... |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
666 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
667 if((set_ptr->ma.freq_list_bef_sti.rf_chan_cnt != 0) || |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
668 (set_ptr->chan1.desc_bef_sti.channel_type != INVALID_CHANNEL) || |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
669 (set_ptr->chan2.desc_bef_sti.channel_type != INVALID_CHANNEL)) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
670 // There is at least one "bef_sti" parameter given for this channel. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
671 // Other empty parameters must be filled with the according "AFTER STARTING TIME" parameters. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
672 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
673 // Fill "chan1.desc_bef_sti" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
674 if(set_ptr->chan1.desc_bef_sti.channel_type == INVALID_CHANNEL) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
675 set_ptr->chan1.desc_bef_sti = set_ptr->chan1.desc; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
676 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
677 // Fill "chan2.desc_bef_sti" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
678 if(set_ptr->chan2.desc_bef_sti.channel_type == INVALID_CHANNEL) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
679 set_ptr->chan2.desc_bef_sti = set_ptr->chan2.desc; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
680 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
681 // Fill "freq_list_bef_sti" |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
682 if(set_ptr->ma.freq_list_bef_sti.rf_chan_cnt == 0) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
683 set_ptr->ma.freq_list_bef_sti = set_ptr->ma.freq_list; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
684 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
685 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
686 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
687 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
688 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
689 /* l1a_decode_starting_time() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
690 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
691 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
692 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
693 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
694 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
695 WORD32 l1a_decode_starting_time(T_STARTING_TIME coded_starting_time) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
696 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
697 WORD32 starting_time; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
698 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
699 if(coded_starting_time.start_time_present == TRUE ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
700 // A starting time is present. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
701 // --------------------------- |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
702 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
703 WORD32 tp1 = coded_starting_time.start_time.n32; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
704 WORD32 t2 = coded_starting_time.start_time.n26; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
705 WORD32 t3 = coded_starting_time.start_time.n51; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
706 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
707 // Compute STI. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
708 starting_time = 51*((26 + t3 - t2) % 26) + t3 + (51*26*tp1) ; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
709 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
710 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
711 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
712 starting_time = -1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
713 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
714 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
715 return(starting_time); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
716 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
717 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
718 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
719 /* l1a_reset_cell_info() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
720 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
721 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
722 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
723 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
724 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
725 void l1a_reset_cell_info(T_CELL_INFO *cell_info) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
726 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
727 cell_info->bsic = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
728 cell_info->fn_offset = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
729 cell_info->time_alignmt = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
730 cell_info->meas.acc = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
731 cell_info->meas.nbr_meas = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
732 cell_info->attempt_count = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
733 cell_info->si_bit_map = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
734 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
735 cell_info->traffic_meas.input_level = l1_config.params.il_min; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
736 cell_info->traffic_meas_beacon.input_level = l1_config.params.il_min; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
737 cell_info->traffic_meas.lna_off = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
738 cell_info->traffic_meas_beacon.lna_off = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
739 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
740 cell_info->buff_beacon[0] = cell_info->buff_beacon[1] = cell_info->buff_beacon[2] = |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
741 cell_info->buff_beacon[3] = l1_config.params.il_min; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
742 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
743 #if L1_GPRS |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
744 cell_info->transfer_meas.input_level = l1_config.params.il_min; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
745 cell_info->transfer_meas.lna_off = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
746 cell_info->pb = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
747 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
748 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
749 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
750 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
751 /* l1a_send_confirmation() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
752 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
753 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
754 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
755 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
756 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
757 void l1a_send_confirmation(UWORD32 SignalCode, UWORD8 queue_type) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
758 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
759 xSignalHeaderRec *msg; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
760 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
761 msg = os_alloc_sig(0); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
762 DEBUGMSG(status,NU_ALLOC_ERR) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
763 msg->SignalCode = (int)SignalCode; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
764 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
765 #if (TRACE_TYPE==1) || (TRACE_TYPE==4) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
766 l1_trace_message(msg); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
767 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
768 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
769 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
770 #if (OP_L1_STANDALONE == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
771 os_send_sig(msg, queue_type); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
772 #else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
773 os_send_sig(msg, ((T_ENUM_OS_QUEUE)queue_type)); //omaps00090550 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
774 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
775 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
776 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
777 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
778 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
779 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
780 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
781 /* l1a_send_result() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
782 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
783 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
784 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
785 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
786 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
787 void l1a_send_result(UWORD32 SignalCode, xSignalHeaderRec *msg, UWORD8 queue) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
788 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
789 // Set flag to avoid the FREE(msg) in L1ASYNC. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
790 l1a.l1_msg_forwarded = TRUE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
791 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
792 msg->SignalCode = (int)SignalCode; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
793 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
794 // May not be necessary -> to check |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
795 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
796 #if (GSM_IDLE_RAM > 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
797 if (!READ_TRAFFIC_CONT_STATE) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
798 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
799 CSMI_TrafficControllerOn(); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
800 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
801 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
802 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
803 #if (TRACE_TYPE==1) || (TRACE_TYPE==4) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
804 l1_trace_message(msg); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
805 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
806 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
807 #if (OP_L1_STANDALONE == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
808 os_send_sig(msg, queue); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
809 #else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
810 os_send_sig(msg, ((T_ENUM_OS_QUEUE)queue)); //omaps00090550 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
811 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
812 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
813 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
814 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
815 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
816 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
817 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
818 /* l1a_encode_rxqual() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
819 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
820 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
821 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
822 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
823 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
824 UWORD8 l1a_encode_rxqual (UWORD32 inlevel) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
825 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
826 enum qual_thr |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
827 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
828 thr_0_2 = 4, |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
829 thr_0_4 = 8, |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
830 thr_0_8 = 16, |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
831 thr_1_6 = 32, |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
832 thr_3_2 = 64, |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
833 thr_6_4 = 128, |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
834 thr_12_8 = 256 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
835 }; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
836 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
837 UWORD8 rxqual; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
838 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
839 if (inlevel < thr_0_2) rxqual = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
840 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
841 if (inlevel < thr_0_4) rxqual = 1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
842 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
843 if (inlevel < thr_0_8) rxqual = 2; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
844 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
845 if (inlevel < thr_1_6) rxqual = 3; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
846 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
847 if (inlevel < thr_3_2) rxqual = 4; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
848 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
849 if (inlevel < thr_6_4) rxqual = 5; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
850 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
851 if (inlevel < thr_12_8) rxqual = 6; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
852 else rxqual = 7; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
853 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
854 return((UWORD8) rxqual); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
855 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
856 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
857 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
858 /* l1a_report_failling_ncell_sync() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
859 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
860 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
861 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
862 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
863 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
864 void l1a_report_failling_ncell_sync(UWORD32 SignalCode, UWORD8 neigh_id) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
865 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
866 xSignalHeaderRec *msg; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
867 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
868 // Send MPHC_NCELL_SYNC_IND message to L3 with a FAILLURE indication. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
869 msg = os_alloc_sig(sizeof(T_MPHC_NCELL_SYNC_IND)); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
870 DEBUGMSG(status,NU_ALLOC_ERR) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
871 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
872 msg->SignalCode = SignalCode; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
873 ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP))->sb_flag = FALSE; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
874 ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP))->radio_freq = l1a_l1s_com.nsync.list[neigh_id].radio_freq; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
875 ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP))->bsic = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
876 ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP))->fn_offset = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
877 ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP))->time_alignmt = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
878 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
879 // For trace/debug only |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
880 ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP))->neigh_id = neigh_id; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
881 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
882 #if (TRACE_TYPE==1) || (TRACE_TYPE==4) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
883 l1_trace_message(msg); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
884 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
885 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
886 os_send_sig(msg, RRM1_QUEUE); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
887 DEBUGMSG(status,NU_SEND_QUEUE_ERR) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
888 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
889 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
890 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
891 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
892 /* l1a_clip_txpwr() */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
893 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
894 /* Parameters : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
895 /* Return : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
896 /* Functionality : */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
897 /*-------------------------------------------------------*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
898 #if (L1_FF_MULTIBAND == 0) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
899 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
900 UWORD8 l1a_clip_txpwr (UWORD8 supplied_txpwr, UWORD16 radio_freq) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
901 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
902 #define txpwr_to_compare(pwr) ((pwr<=l1_config.std.txpwr_turning_point)? pwr+32:pwr) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
903 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
904 switch(l1_config.std.id) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
905 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
906 case GSM: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
907 case GSM_E: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
908 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
909 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
910 if ( supplied_txpwr < MIN_TXPWR_GSM[l1a_l1s_com.powerclass_band1]) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
911 return(MIN_TXPWR_GSM[l1a_l1s_com.powerclass_band1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
912 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
913 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
914 if ( supplied_txpwr > l1_config.std.max_txpwr_band1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
915 return(l1_config.std.max_txpwr_band1); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
916 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
917 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
918 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
919 case PCS1900: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
920 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
921 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
922 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
923 txpwr_to_compare(MIN_TXPWR_PCS[l1a_l1s_com.powerclass_band1]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
924 return(MIN_TXPWR_PCS[l1a_l1s_com.powerclass_band1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
925 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
926 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
927 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
928 txpwr_to_compare(l1_config.std.max_txpwr_band1) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
929 return(l1_config.std.max_txpwr_band1); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
930 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
931 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
932 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
933 case DCS1800: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
934 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
935 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
936 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
937 txpwr_to_compare(MIN_TXPWR_DCS[l1a_l1s_com.powerclass_band1]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
938 return(MIN_TXPWR_DCS[l1a_l1s_com.powerclass_band1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
939 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
940 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
941 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
942 txpwr_to_compare(l1_config.std.max_txpwr_band1) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
943 return(l1_config.std.max_txpwr_band1); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
944 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
945 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
946 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
947 case GSM850: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
948 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
949 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
950 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
951 txpwr_to_compare(MIN_TXPWR_GSM850[l1a_l1s_com.powerclass_band1]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
952 return(MIN_TXPWR_GSM850[l1a_l1s_com.powerclass_band1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
953 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
954 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
955 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
956 txpwr_to_compare(l1_config.std.max_txpwr_band1) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
957 return(l1_config.std.max_txpwr_band1); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
958 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
959 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
960 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
961 case DUAL: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
962 case DUALEXT: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
963 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
964 // Test which Band is used: GSM or DCS 1800 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
965 if (radio_freq >= l1_config.std.first_radio_freq_band2) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
966 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
967 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
968 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
969 txpwr_to_compare(MIN_TXPWR_DCS[l1a_l1s_com.powerclass_band2]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
970 return(MIN_TXPWR_DCS[l1a_l1s_com.powerclass_band2]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
971 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
972 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
973 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
974 txpwr_to_compare(l1_config.std.max_txpwr_band2) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
975 return(l1_config.std.max_txpwr_band2); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
976 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
977 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
978 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
979 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
980 if ( supplied_txpwr < MIN_TXPWR_GSM[l1a_l1s_com.powerclass_band1]) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
981 return(MIN_TXPWR_GSM[l1a_l1s_com.powerclass_band1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
982 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
983 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
984 if ( supplied_txpwr > l1_config.std.max_txpwr_band1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
985 return(l1_config.std.max_txpwr_band1); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
986 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
987 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
988 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
989 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
990 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
991 case DUAL_US: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
992 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
993 // Test which Band is used: GSM 850 or PCS1900 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
994 if (radio_freq >= l1_config.std.first_radio_freq_band2) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
995 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
996 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
997 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
998 txpwr_to_compare(MIN_TXPWR_PCS[l1a_l1s_com.powerclass_band2]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
999 return(MIN_TXPWR_PCS[l1a_l1s_com.powerclass_band2]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1000 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1001 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1002 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1003 txpwr_to_compare(l1_config.std.max_txpwr_band2) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1004 return(l1_config.std.max_txpwr_band2); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1005 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1006 else |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1007 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1008 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1009 if ( supplied_txpwr < MIN_TXPWR_GSM850[l1a_l1s_com.powerclass_band1]) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1010 return(MIN_TXPWR_GSM850[l1a_l1s_com.powerclass_band1]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1011 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1012 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1013 if ( supplied_txpwr > l1_config.std.max_txpwr_band1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1014 return(l1_config.std.max_txpwr_band1); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1015 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1016 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1017 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1018 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1019 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1020 default: // should never occur |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1021 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1022 return(supplied_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1023 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1024 // omaps00090550 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1025 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1026 return(supplied_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1027 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1028 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1029 #else /*L1_FF_MULTIBAND = 1 below */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1030 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1031 UWORD8 l1a_clip_txpwr (UWORD8 supplied_txpwr, UWORD16 radio_freq) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1032 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1033 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1034 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1035 UWORD8 physical_band_id = 0; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1036 physical_band_id = l1_multiband_radio_freq_convert_into_physical_band_id(radio_freq); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1037 #define txpwr_to_compare(pwr) ((pwr<= multiband_rf[physical_band_id].tx_turning_point)? pwr+32:pwr) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1038 switch(multiband_rf[physical_band_id].gsm_band_identifier) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1039 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1040 case RF_GSM900: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1041 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1042 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1043 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1044 if ( supplied_txpwr < MIN_TXPWR_GSM[l1a_l1s_com.powerclass[physical_band_id]]) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1045 return(MIN_TXPWR_GSM[l1a_l1s_com.powerclass[physical_band_id]]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1046 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1047 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1048 if ( supplied_txpwr > multiband_rf[physical_band_id].max_txpwr) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1049 return(multiband_rf[physical_band_id].max_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1050 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1051 }/*case GSM900*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1052 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1053 case RF_PCS1900: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1054 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1055 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1056 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1057 txpwr_to_compare(MIN_TXPWR_PCS[l1a_l1s_com.powerclass[physical_band_id]]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1058 return(MIN_TXPWR_PCS[l1a_l1s_com.powerclass[physical_band_id]]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1059 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1060 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1061 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1062 txpwr_to_compare(multiband_rf[physical_band_id].max_txpwr) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1063 return(multiband_rf[physical_band_id].max_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1064 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1065 }/*case PCS1900*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1066 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1067 case RF_DCS1800: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1068 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1069 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1070 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1071 txpwr_to_compare(MIN_TXPWR_DCS[l1a_l1s_com.powerclass[physical_band_id]]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1072 return(MIN_TXPWR_DCS[l1a_l1s_com.powerclass[physical_band_id]]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1073 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1074 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1075 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1076 txpwr_to_compare(multiband_rf[physical_band_id].max_txpwr) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1077 return(multiband_rf[physical_band_id].max_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1078 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1079 }/*case DCS1800*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1080 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1081 case RF_GSM850: |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1082 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1083 // Clip LOW according to powerclass_band1. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1084 if ( txpwr_to_compare(supplied_txpwr) < |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1085 txpwr_to_compare(MIN_TXPWR_GSM850[l1a_l1s_com.powerclass[physical_band_id]]) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1086 return(MIN_TXPWR_GSM850[l1a_l1s_com.powerclass[physical_band_id]]); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1087 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1088 // Clip HIGH according to GSM spec. 05.05. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1089 if ( txpwr_to_compare(supplied_txpwr) > |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1090 txpwr_to_compare(multiband_rf[physical_band_id].max_txpwr) ) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1091 return(multiband_rf[physical_band_id].max_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1092 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1093 }/*case GSM850*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1094 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1095 default: // should never occur |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1096 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1097 l1_multiband_error_handler(); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1098 return(supplied_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1099 break; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1100 } /*default*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1101 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1102 }/*switch(multiband_rfphysical_band_id].gsm_band_identifier)*/ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1103 return(supplied_txpwr); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1104 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1105 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1106 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1107 #endif /*L1_FF_MULTIBAND */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1108 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1109 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1110 //MADC |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1111 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1112 #if (L1_MADC_ON == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1113 #if (OP_L1_STANDALONE == 1) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1114 #if (ANLG_FAM == 11) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1115 void l1a_madc_callback(void) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1116 { |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1117 char str[40]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1118 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1119 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1120 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1121 xSignalHeaderRec *adc_msg; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1122 UWORD16 *adc_result; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1123 UWORD16 *madc_results; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1124 volatile UWORD16 *drp_temp_results; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1125 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1126 #if (RF_FAM == 61) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1127 drp_temp_results =(volatile UWORD16 *) (&drp_srm_api->inout.temperature.output); //omaps00090550 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1128 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1129 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1130 #if 0 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1131 sprintf(str, "Temp Measure %x ", drp_temp_results); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1132 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1133 //L1_trace_string ("Temp Meas\n"); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1134 L1_trace_string(str); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1135 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1136 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1137 #if 0 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1138 int i; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1139 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1140 adc_msg = os_alloc_sig(sizeof(BspTwl3029_MadcResults) + sizeof(UWORD16)); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1141 adc_result = &((BspTwl3029_MadcResults*)(adc_msg->SigP))->adc1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1142 madc_results =& l1_madc_results.adc1; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1143 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1144 //TEMP_MEAS: DRP |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1145 #if (RF_FAM == 61) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1146 drp_temp_results =& (drp_srm_api->inout.temperature.output); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1147 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1148 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1149 //copy the measured values into the the message structure. |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1150 memcpy(adc_result,madc_results,11*sizeof(UWORD16));//11 madc |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1151 adc_result[11] = *drp_temp_results; // 1 temp meas |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1152 /* |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1153 for (i=0;i<11;i++) |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1154 adc_result[i] = madc_results[i]; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1155 */ |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1156 //Send the message |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1157 adc_msg->SignalCode = CST_ADC_RESULT; |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1158 os_send_sig(adc_msg, RRM1_QUEUE); |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1159 #endif |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1160 } |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1161 #endif // ANLG_FAM == 11 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1162 #endif //OP_L1_STANDALONE |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1163 #endif // L1_MADC_ON |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1164 |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1165 //============================================================================================== |
1bec6419cd32
l1_afunc.c pulled from LoCosto, compiles
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
15
diff
changeset
|
1166 |