annotate chipsetsw/layer1/cfile/l1_func.c @ 290:95f308ba55c7

README for the almost fully reconstructed state
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 20 Mar 2017 00:37:25 +0000
parents bfee762b21f3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1 /************* Revision Controle System Header *************
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2 * GSM Layer 1 software
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
3 * L1_FUNC.C
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
4 *
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
5 * Filename l1_func.c
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
6 * Copyright 2003 (C) Texas Instruments
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
7 *
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
8 ************* Revision Controle System Header *************/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
9
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
10 #define L1_FUNC_C
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
11
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
12 #include "l1_macro.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
13 #include "l1_confg.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
14
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
15 #if (CODE_VERSION == SIMULATION)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
16 #include <string.h>
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
17 #include "l1_types.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
18 #include "sys_types.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
19 #include "l1_const.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
20 #include "l1_time.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
21 #include "l1_signa.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
22 #if TESTMODE
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
23 #include "l1tm_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
24 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
25 #if (AUDIO_TASK == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
26 #include "l1audio_const.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
27 #include "l1audio_cust.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
28 #include "l1audio_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
29 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
30 #if (L1_GTT == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
31 #include "l1gtt_const.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
32 #include "l1gtt_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
33 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
34 #if (L1_MP3 == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
35 #include "l1mp3_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
36 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
37 #if (L1_MIDI == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
38 #include "l1midi_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
39 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
40 //ADDED FOR AAC
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
41 #if (L1_AAC == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
42 #include "l1aac_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
43 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
44 #include "l1_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
45 #include "cust_os.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
46 #include "l1_msgty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
47 #include "l1_varex.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
48 #include "l1_proto.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
49 #include "l1_mftab.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
50 #include "l1_tabs.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
51 #include "l1_ver.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
52
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
53 #if L1_GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
54 #include "l1p_cons.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
55 #include "l1p_msgt.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
56 #include "l1p_deft.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
57 #include "l1p_vare.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
58 #include "l1p_tabs.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
59 #include "l1p_macr.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
60 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
61
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
62 #include "l1_rf2.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
63 #include <stdio.h>
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
64 #include "sim_cfg.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
65 #include "sim_cons.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
66 #include "sim_def.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
67 #include "sim_var.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
68
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
69 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
70
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
71 #include <string.h>
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
72 #include "l1_types.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
73 #include "sys_types.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
74 #include "l1_const.h"
101
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
75 #if (RF_FAM == 12)
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
76 #include "l1_rf12.h"
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
77 #elif (RF_FAM == 61)
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
78 #include "l1_rf61.h"
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
79 #endif
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
80 #include "l1_time.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
81 #include "l1_signa.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
82
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
83 #if TESTMODE
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
84 #include "l1tm_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
85 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
86 #if (AUDIO_TASK == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
87 #include "l1audio_const.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
88 #include "l1audio_cust.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
89 #include "l1audio_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
90 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
91 #if (L1_GTT == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
92 #include "l1gtt_const.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
93 #include "l1gtt_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
94 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
95 #if (L1_MP3 == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
96 #include "l1mp3_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
97 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
98 #if (L1_MIDI == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
99 #include "l1midi_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
100 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
101 //ADDED FOR AAC
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
102 #if (L1_AAC == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
103 #include "l1aac_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
104 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
105 #include "l1_defty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
106 #include "cust_os.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
107 #include "l1_msgty.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
108 #include "l1_varex.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
109 #include "l1_proto.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
110 #include "l1_mftab.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
111 #include "l1_tabs.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
112 #include "l1_ver.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
113 #include "tpudrv.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
114
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
115 #include "mem.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
116 #include "inth.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
117 #include "clkm.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
118 #include "rhea_arm.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
119 #include "dma.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
120 #include "ulpd.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
121 #include "leadapi.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
122
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
123 #if (OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
124 #if (CHIPSET == 4) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
125 (CHIPSET == 11) || (CHIPSET == 12) || (CHIPSET == 15)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
126 #include "dynamic_clock.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
127 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
128 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
129
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
130
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
131 #if L1_GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
132 #include "l1p_cons.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
133 #include "l1p_msgt.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
134 #include "l1p_deft.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
135 #include "l1p_vare.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
136 #include "l1p_tabs.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
137 #include "l1p_macr.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
138 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
139
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
140 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
141 #include "l1_trace.h"
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
142
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
143 #if ((TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==4) || (TRACE_TYPE==7))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
144 extern void L1_trace_string(char *s);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
145 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
146
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
147
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
148 #if (CODE_VERSION != SIMULATION)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
149
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
150 /* DSP patch */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
151 #if (DWNLD == NO_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
152 const UWORD8 patch_array[1];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
153 const UWORD8 DspCode_array[1] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
154 const UWORD8 DspData_array[1];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
155 #elif (DWNLD == PATCH_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
156 extern const UWORD8 patch_array[] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
157 const UWORD8 DspCode_array[1] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
158 const UWORD8 DspData_array[1];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
159 #elif (DWNLD == DSP_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
160 const UWORD8 patch_array[1] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
161 extern const UWORD8 DspCode_array[] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
162 extern const UWORD8 DspData_array[];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
163 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
164 extern const UWORD8 patch_array[] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
165 extern const UWORD8 DspCode_array[] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
166 extern const UWORD8 DspData_array[];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
167 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
168
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
169 extern const UWORD8 bootCode[] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
170 /* DSP patch */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
171
107
bfee762b21f3 l1_func.c fully reconstructed: matches TCS211 object
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 106
diff changeset
172 #if ( FF_REPEATED_DL_FACCH == 1 )
bfee762b21f3 l1_func.c fully reconstructed: matches TCS211 object
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 106
diff changeset
173 UWORD32 fn_prev; // Added as a debug stage..
bfee762b21f3 l1_func.c fully reconstructed: matches TCS211 object
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 106
diff changeset
174 #endif
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
175
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
176 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
177 /* Prototypes of internal functions used in this file. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
178 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
179 void l1s_init_voice_blocks (void);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
180
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
181 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
182 /* Prototypes of external functions used in this file. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
183 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
184 void l1dmacro_synchro (UWORD32 when, UWORD32 value);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
185 void LA_ReleaseLead(void);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
186 #if (CODE_VERSION != SIMULATION)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
187 void l1s_audio_path_control (UWORD16 FIR_selection, UWORD16 audio_loop);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
188 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
189
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
190 #if (L1_GPRS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
191 // external functions from GPRS implementation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
192 void initialize_l1pvar(void);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
193 void l1pa_reset_cr_freq_list(void);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
194 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
195 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
196 /* dsp_power_on() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
197 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
198 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
199 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
200 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
201 /* Remarq : USART Buffer is 256 characters. While USART*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
202 /* is not run during Application_Initialize */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
203 /* (hisrs not served because Nucleus scheduler*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
204 /* is not running yet) : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
205 /* ==> check string size < 256 !!!!!! */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
206 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
207 void dsp_power_on(void)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
208 {
104
078763b12477 l1_func.c: dsp_power_on() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 103
diff changeset
209 UWORD16 dsp_start_address;
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
210 UWORD16 param_size;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
211 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
212 UWORD16 param_size2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
213 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
214
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
215 API i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
216 API *pt;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
217 volatile WORD16 j;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
218
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
219 T_NDB_MCU_DSP * dsp_ndb_ptr;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
220
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
221 #if (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
222 static API_SIGNED param_tab[] = {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
223
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
224 D_TRANSFER_RATE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
225
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
226 // ..................Latencies
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
227 D_LAT_MCU_BRIDGE, D_LAT_MCU_HOM2SAM,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
228
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
229 D_LAT_MCU_BEF_FAST_ACCESS, D_LAT_DSP_AFTER_SAM,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
230
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
231 //...................p_gprs_install_adress
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
232 D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
233
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
234 //...................d_misc_config
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
235 D_MISC_CONFIG,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
236
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
237
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
238 //...................d_cn_sw_workaround
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
239 C_DSP_SW_WORK_AROUND,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
240
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
241 //...................Reserved
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
242 D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
243 D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
244
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
245 //...................Frequency burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
246 D_FB_MARGIN_BEG, D_FB_MARGIN_END,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
247 D_NSUBB_IDLE, D_NSUBB_DEDIC, D_FB_THR_DET_IACQ,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
248 D_FB_THR_DET_TRACK,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
249 //...................Demodulation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
250 D_DC_OFF_THRES, D_DUMMY_THRES, D_DEM_POND_GEWL,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
251 D_DEM_POND_RED,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
252 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
253 D_MACCTHRESH1, D_MLDT, D_MACCTHRESH,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
254 D_GU, D_GO, D_ATTMAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
255 D_SM, D_B,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
256
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
257 //...................V42 bis
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
258 D_V42B_SWITCH_HYST, D_V42B_SWITCH_MIN, D_V42B_SWITCH_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
259 D_V42B_RESET_DELAY,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
260
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
261 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
262 D_LDT_HR, D_MACCTRESH_HR, D_MACCTRESH1_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
263 D_GU_HR, D_GO_HR, D_B_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
264 D_SM_HR, D_ATTMAX_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
265
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
266 //...................Added variables for EFR
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
267 C_MLDT_EFR, C_MACCTHRESH_EFR, C_MACCTHRESH1_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
268 C_GU_EFR, C_GO_EFR, C_B_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
269 C_SM_EFR, C_ATTMAX_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
270
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
271 //...................Full rate variables
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
272 D_SD_MIN_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
273 D_MA_MIN_THR_TCHFS, D_MD_MAX_THR_TCHFS, D_MD1_MAX_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
274
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
275 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
276 D_SD_MIN_THR_TCHHS, D_MA_MIN_THR_TCHHS, D_SD_AV_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
277 D_MD_MAX_THR_TCHHS, D_MD1_MAX_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
278
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
279 //...................TCH Enhanced Full Rate Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
280 D_SD_MIN_THR_TCHEFS, D_MA_MIN_THR_TCHEFS, D_MD_MAX_THR_TCHEFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
281 D_MD1_MAX_THR_TCHEFS, D_WED_FIL_INI,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
282
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
283 D_WED_FIL_TC, D_X_MIN, D_X_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
284 D_SLOPE, D_Y_MIN, D_Y_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
285 D_WED_DIFF_THRESHOLD,D_MABFI_MIN_THR_TCHHS,D_FACCH_THR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
286
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
287 D_MAX_OVSPD_UL, D_SYNC_THRES, D_IDLE_THRES,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
288 D_M1_THRES, D_MAX_OVSP_DL, D_GSM_BGD_MGT
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
289 };
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
290 param_size = 79;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
291
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
292 #if (OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
293 #if (CHIPSET == 4) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
294 (CHIPSET == 11) || (CHIPSET == 12) || (CHIPSET == 15)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
295 /* Dynamic clock configuration */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
296 param_tab[0] = p_dynamic_clock_cfg->d_transfer_rate;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
297 param_tab[1] = p_dynamic_clock_cfg->d_lat_mcu_bridge;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
298 param_tab[2] = p_dynamic_clock_cfg->d_lat_mcu_hom2sam;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
299 param_tab[3] = p_dynamic_clock_cfg->d_lat_mcu_bef_fast_access;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
300 param_tab[4] = p_dynamic_clock_cfg->d_lat_dsp_after_sam;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
301 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
302 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
303
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
304 #elif (DSP == 33)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
305 static API_SIGNED param_tab[] = {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
306
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
307 D_TRANSFER_RATE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
308
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
309 // ..................Latencies
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
310 D_LAT_MCU_BRIDGE, D_LAT_MCU_HOM2SAM,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
311
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
312 D_LAT_MCU_BEF_FAST_ACCESS, D_LAT_DSP_AFTER_SAM,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
313
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
314 //...................p_gprs_install_adress
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
315 D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
316
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
317 //...................d_misc_config
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
318 D_MISC_CONFIG,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
319
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
320 //...................d_cn_sw_workaround
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
321 C_DSP_SW_WORK_AROUND,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
322
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
323 #if DCO_ALGO
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
324 //...................d_cn_dco_param
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
325 C_CN_DCO_PARAM,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
326 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
327 //.................. Reserved
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
328 D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
329 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
330
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
331 //...................Reserved
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
332 D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
333 D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
334
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
335 //...................Frequency burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
336 D_FB_MARGIN_BEG, D_FB_MARGIN_END,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
337 D_NSUBB_IDLE, D_NSUBB_DEDIC, D_FB_THR_DET_IACQ,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
338 D_FB_THR_DET_TRACK,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
339 //...................Demodulation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
340 D_DC_OFF_THRES, D_DUMMY_THRES, D_DEM_POND_GEWL,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
341 D_DEM_POND_RED,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
342 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
343 D_MACCTHRESH1, D_MLDT, D_MACCTHRESH,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
344 D_GU, D_GO, D_ATTMAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
345 D_SM, D_B,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
346
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
347 //...................V42 bis
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
348 D_V42B_SWITCH_HYST, D_V42B_SWITCH_MIN, D_V42B_SWITCH_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
349 D_V42B_RESET_DELAY,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
350
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
351 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
352 D_LDT_HR, D_MACCTRESH_HR, D_MACCTRESH1_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
353 D_GU_HR, D_GO_HR, D_B_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
354 D_SM_HR, D_ATTMAX_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
355
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
356 //...................Added variables for EFR
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
357 C_MLDT_EFR, C_MACCTHRESH_EFR, C_MACCTHRESH1_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
358 C_GU_EFR, C_GO_EFR, C_B_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
359 C_SM_EFR, C_ATTMAX_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
360
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
361 //...................Full rate variables
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
362 D_SD_MIN_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
363 D_MA_MIN_THR_TCHFS, D_MD_MAX_THR_TCHFS, D_MD1_MAX_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
364
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
365 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
366 D_SD_MIN_THR_TCHHS, D_MA_MIN_THR_TCHHS, D_SD_AV_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
367 D_MD_MAX_THR_TCHHS, D_MD1_MAX_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
368
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
369 //...................TCH Enhanced Full Rate Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
370 D_SD_MIN_THR_TCHEFS, D_MA_MIN_THR_TCHEFS, D_MD_MAX_THR_TCHEFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
371 D_MD1_MAX_THR_TCHEFS, D_WED_FIL_INI,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
372
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
373 D_WED_FIL_TC, D_X_MIN, D_X_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
374 D_SLOPE, D_Y_MIN, D_Y_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
375 D_WED_DIFF_THRESHOLD,D_MABFI_MIN_THR_TCHHS,D_FACCH_THR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
376
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
377 D_MAX_OVSPD_UL, D_SYNC_THRES, D_IDLE_THRES,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
378 D_M1_THRES, D_MAX_OVSP_DL, D_GSM_BGD_MGT
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
379 };
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
380 param_size = 79;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
381
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
382 #if (OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
383 #if (CHIPSET == 4) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
384 (CHIPSET == 11) || (CHIPSET == 12)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
385 /* Dynamic clock configuration */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
386 param_tab[0] = p_dynamic_clock_cfg->d_transfer_rate;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
387 param_tab[1] = p_dynamic_clock_cfg->d_lat_mcu_bridge;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
388 param_tab[2] = p_dynamic_clock_cfg->d_lat_mcu_hom2sam;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
389 param_tab[3] = p_dynamic_clock_cfg->d_lat_mcu_bef_fast_access;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
390 param_tab[4] = p_dynamic_clock_cfg->d_lat_dsp_after_sam;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
391 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
392 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
393
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
394 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
395
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
396 #if (VOC == FR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
397 static API_SIGNED param_tab[] = {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
398 //...................Frequency burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
399 D_NSUBB_IDLE, D_NSUBB_DEDIC, D_FB_THR_DET_IACQ,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
400 D_FB_THR_DET_TRACK,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
401 //...................Demodulation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
402 D_DC_OFF_THRES, D_DUMMY_THRES, D_DEM_POND_GEWL,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
403 D_DEM_POND_RED, D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
404 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
405 D_MACCTHRESH1, D_MLDT, D_MACCTHRESH,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
406 D_GU, D_GO, D_ATTMAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
407 D_SM, D_B, D_SD_MIN_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
408 D_MA_MIN_THR_TCHFS, D_MD_MAX_THR_TCHFS, D_MD1_MAX_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
409 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
410 D_SD_MIN_THR_TCHHS, D_MA_MIN_THR_TCHHS, D_SD_AV_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
411 D_MD_MAX_THR_TCHHS, D_MD1_MAX_THR_TCHHS, D_WED_FIL_INI,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
412 D_WED_FIL_TC, D_X_MIN, D_X_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
413 D_SLOPE, D_Y_MIN, D_Y_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
414 D_WED_DIFF_THRESHOLD,D_MABFI_MIN_THR_TCHHS,D_FACCH_THR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
415 D_DSP_TEST
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
416 };
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
417 param_size = 38;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
418 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
419
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
420 #if (VOC == FR_HR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
421 static API_SIGNED param_tab[] = {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
422 //...................Frequency burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
423 D_NSUBB_IDLE, D_NSUBB_DEDIC, D_FB_THR_DET_IACQ,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
424 D_FB_THR_DET_TRACK,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
425 //...................Demodulation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
426 D_DC_OFF_THRES, D_DUMMY_THRES, D_DEM_POND_GEWL,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
427 D_DEM_POND_RED, D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
428 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
429 D_MACCTHRESH1, D_MLDT, D_MACCTHRESH,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
430 D_GU, D_GO, D_ATTMAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
431 D_SM, D_B,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
432 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
433 D_LDT_HR, D_MACCTRESH_HR, D_MACCTRESH1_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
434 D_GU_HR, D_GO_HR, D_B_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
435 D_SM_HR, D_ATTMAX_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
436 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
437 D_SD_MIN_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
438 D_MA_MIN_THR_TCHFS, D_MD_MAX_THR_TCHFS, D_MD1_MAX_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
439 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
440 D_SD_MIN_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
441 D_MA_MIN_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
442 D_SD_AV_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
443 D_MD_MAX_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
444 D_MD1_MAX_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
445 D_WED_FIL_INI,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
446 D_WED_FIL_TC,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
447 D_X_MIN,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
448 D_X_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
449 D_SLOPE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
450 D_Y_MIN,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
451 D_Y_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
452 D_WED_DIFF_THRESHOLD,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
453 D_MABFI_MIN_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
454 D_FACCH_THR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
455 D_DSP_TEST
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
456 };
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
457 param_size = 46;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
458 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
459
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
460 #if (VOC == FR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
461 static API_SIGNED param_tab[] = {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
462 //...................Frequency burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
463 D_NSUBB_IDLE, D_NSUBB_DEDIC, D_FB_THR_DET_IACQ,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
464 D_FB_THR_DET_TRACK,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
465 //...................Demodulation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
466 D_DC_OFF_THRES, D_DUMMY_THRES, D_DEM_POND_GEWL,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
467 D_DEM_POND_RED, D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
468
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
469 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
470 D_MACCTHRESH1, D_MLDT, D_MACCTHRESH,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
471 D_GU, D_GO, D_ATTMAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
472 D_SM, D_B,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
473
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
474 //...................Added variables for EFR
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
475 C_MLDT_EFR, C_MACCTHRESH_EFR, C_MACCTHRESH1_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
476 C_GU_EFR, C_GO_EFR, C_B_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
477 C_SM_EFR, C_ATTMAX_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
478
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
479 //...................Full rate variables
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
480 D_SD_MIN_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
481 D_MA_MIN_THR_TCHFS, D_MD_MAX_THR_TCHFS, D_MD1_MAX_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
482
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
483 //...................TCH Enhanced Full Rate Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
484 D_SD_MIN_THR_TCHEFS, D_MA_MIN_THR_TCHEFS, D_MD_MAX_THR_TCHEFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
485 D_MD1_MAX_THR_TCHEFS, D_HOLE, D_WED_FIL_INI,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
486
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
487 D_WED_FIL_TC, D_X_MIN, D_X_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
488 D_SLOPE, D_Y_MIN, D_Y_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
489 D_WED_DIFF_THRESHOLD,D_MABFI_MIN_THR_TCHHS,D_FACCH_THR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
490 D_DSP_TEST
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
491 };
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
492 param_size = 46;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
493 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
494
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
495 #if (VOC == FR_HR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
496 static API_SIGNED param_tab[] = {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
497 //...................Frequency burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
498 D_NSUBB_IDLE, D_NSUBB_DEDIC, D_FB_THR_DET_IACQ,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
499 D_FB_THR_DET_TRACK,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
500 //...................Demodulation
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
501 D_DC_OFF_THRES, D_DUMMY_THRES, D_DEM_POND_GEWL,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
502 D_DEM_POND_RED, D_HOLE, D_TRANSFER_RATE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
503 //...................TCH Full Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
504 D_MACCTHRESH1, D_MLDT, D_MACCTHRESH,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
505 D_GU, D_GO, D_ATTMAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
506 D_SM, D_B,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
507
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
508 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
509 D_LDT_HR, D_MACCTRESH_HR, D_MACCTRESH1_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
510 D_GU_HR, D_GO_HR, D_B_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
511 D_SM_HR, D_ATTMAX_HR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
512
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
513 //...................Added variables for EFR
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
514 C_MLDT_EFR, C_MACCTHRESH_EFR, C_MACCTHRESH1_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
515 C_GU_EFR, C_GO_EFR, C_B_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
516 C_SM_EFR, C_ATTMAX_EFR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
517
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
518 //...................Full rate variables
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
519 D_SD_MIN_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
520 D_MA_MIN_THR_TCHFS, D_MD_MAX_THR_TCHFS, D_MD1_MAX_THR_TCHFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
521
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
522 //...................TCH Half Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
523 D_SD_MIN_THR_TCHHS, D_MA_MIN_THR_TCHHS, D_SD_AV_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
524 D_MD_MAX_THR_TCHHS, D_MD1_MAX_THR_TCHHS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
525
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
526 //...................TCH Enhanced Full Rate Speech
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
527 D_SD_MIN_THR_TCHEFS, D_MA_MIN_THR_TCHEFS, D_MD_MAX_THR_TCHEFS,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
528 D_MD1_MAX_THR_TCHEFS, D_HOLE, D_WED_FIL_INI,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
529
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
530 D_WED_FIL_TC, D_X_MIN, D_X_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
531 D_SLOPE, D_Y_MIN, D_Y_MAX,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
532 D_WED_DIFF_THRESHOLD,D_MABFI_MIN_THR_TCHHS,D_FACCH_THR,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
533 D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
534
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
535 //...................Data patch provisions
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
536 D_HOLE, D_HOLE, D_HOLE, D_HOLE, D_HOLE, D_HOLE, D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
537
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
538 //...................Version Number, TI Number
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
539 D_HOLE, D_HOLE,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
540
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
541 // ..................DSP page
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
542 D_DSP_TEST
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
543
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
544 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
545 ,D_MAX_OVSPD_UL, D_SYNC_THRES, D_IDLE_THRES,
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
546 D_M1_THRES, D_MAX_OVSP_DL
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
547 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
548
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
549 };
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
550 param_size = 67;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
551 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
552 // Take care to not erased "d_version_number, d_ti_version and d_dsp_page" wrote by DSP before ARM
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
553 // set PARAM memory
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
554 param_size2 = 5;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
555 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
556 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
557 #endif // (end of DSP != 33 || DSP != 34 || DSP != 35 || DSP != 36) || (DSP != 37) || (DSP != 38) || (DSP != 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
558
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
559 // NDB pointer.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
560 dsp_ndb_ptr = (T_NDB_MCU_DSP *) NDB_ADR;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
561
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
562
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
563 //-------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
564 // DSP STARTUP
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
565 //-------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
566 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
567 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
568 #if (CHIPSET == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
569 L1_trace_string ("\n\r\n\rGEMINI/POLESTAR test code\n\r-------------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
570 #elif (CHIPSET == 2)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
571 L1_trace_string ("\n\r\n\rHERCULES test code\n\r------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
572 #elif (CHIPSET == 3)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
573 L1_trace_string ("\n\r\n\rULYSSE/ULYSSE G0 test code\n\r--------------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
574 #elif (CHIPSET == 4)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
575 L1_trace_string ("\n\r\n\rSAMSON test code\n\r----------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
576 #elif (CHIPSET == 5)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
577 L1_trace_string ("\n\r\n\rULYSSE G1 test code 13 MHz\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
578 #elif (CHIPSET == 6)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
579 L1_trace_string ("\n\r\n\rULYSSE G1 test code 26 MHz\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
580 #elif (CHIPSET == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
581 L1_trace_string ("\n\r\n\rCALYPSO Rev A test code\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
582 #elif (CHIPSET == 8)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
583 L1_trace_string ("\n\r\n\rCALYPSO Rev B test code\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
584 #elif (CHIPSET == 9)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
585 L1_trace_string ("\n\r\n\rULYSSE C035 test code\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
586 #elif (CHIPSET == 10) || (CHIPSET == 11)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
587 L1_trace_string ("\n\r\n\rCALYPSO C035 test code\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
588 #elif (CHIPSET == 12)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
589 L1_trace_string ("\n\r\n\rCALYPSO PLUS test code\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
590 #elif (CHIPSET == 15)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
591 L1_trace_string ("\n\r\n\rLOCOSTO test code\n\r-------------------");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
592 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
593 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
594
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
595 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
596 /* Display Audio Configuration */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
597 L1_trace_string ("\n\rAUDIO: ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
598 #if (KEYBEEP)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
599 L1_trace_string ("KB ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
600 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
601 #if (TONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
602 L1_trace_string ("TN ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
603 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
604 #if (MELODY_E1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
605 L1_trace_string ("E1 ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
606 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
607 #if (MELODY_E2)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
608 L1_trace_string ("E2 ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
609 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
610 #if (VOICE_MEMO)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
611 L1_trace_string ("VM ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
612 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
613 #if (L1_VOICE_MEMO_AMR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
614 L1_trace_string ("VMA ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
615 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
616 #if (SPEECH_RECO)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
617 L1_trace_string ("SR ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
618 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
619 #if (L1_NEW_AEC)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
620 L1_trace_string ("NEWAEC ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
621 #elif (AEC)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
622 L1_trace_string ("AEC ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
623 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
624 #if (L1_GTT)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
625 L1_trace_string ("GTT ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
626 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
627 #if (FIR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
628 L1_trace_string ("FIR ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
629 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
630 #if (AUDIO_MODE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
631 L1_trace_string ("AUM ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
632 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
633 #if (L1_CPORT == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
634 L1_trace_string ("CPO ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
635 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
636 #if (L1_STEREOPATH == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
637 L1_trace_string ("STP ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
638 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
639 #if (L1_EXT_AUDIO_MGT == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
640 L1_trace_string ("EAM ");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
641 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
642 L1_trace_string ("\n\r");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
643 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
644 // Release Lead reset before DSP code/patch download to insure proper reset of DSP
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
645 LA_ReleaseLead();
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
646
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
647 // Init PLL : PLONOFF =1, PLMU = 0010 (k=3), PLLNDIV=1, PLLDIV=0
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
648 LA_InitialLeadBoot(bootCode); // Load the bootCode in API
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
649 LA_StartLead(CLKSTART); // LEAD_PLL_CNTL register (on MCU side)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
650 // On SAMSON, only the LEAD reset is released
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
651
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
652 // GSM 1.5
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
653 //-----------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
654 // After RESET release, DSP is in SAM Mode ! while API_CNTR (0xF900)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
655 // register is in reset state: HOM mode, PLL off, Bridge off. No ws
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
656 // are applied for MCU<-->API access !!!!! So, MCU must wait for
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
657 // end of Leadboot execution before accessing API.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
658 wait_ARM_cycles(convert_nanosec_to_cycles(10000)); // wait 10us
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
659
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
660
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
661 if(l1_config.dwnld == NO_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
662 // NO DOWNLOAD...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
663 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
664 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
665 L1_trace_string ("\n\r-> No download !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
666 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
667
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
668 // Wait for READY status from DSP.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
669 while(*((volatile UWORD16 *)DOWNLOAD_STATUS) != LEAD_READY);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
670
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
671 // Set DSP start address.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
672 dsp_start_address = DSP_START;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
673 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
674 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
675 if(l1_config.dwnld == DSP_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
676 // DSP CODE DOWNLOAD...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
677 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
678 WORD32 load_result;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
679
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
680 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
681 #if (VOC == FR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
682 L1_trace_string ("\n\r-> Downloading FR DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
683 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
684
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
685 #if (VOC == FR_HR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
686 L1_trace_string ("\n\r-> Downloading FR&HR DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
687 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
688
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
689 #if (VOC == FR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
690 L1_trace_string ("\n\r-> Downloading FR&EFR DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
691 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
692
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
693 #if (VOC == FR_HR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
694 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
695 L1_trace_string ("\n\r-> Download FR&IDS DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
696 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
697 L1_trace_string ("\n\r-> Downloading 3VOC DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
698 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
699 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
700 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
701
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
702 // Download DSP code into DSP via API / bootcode.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
703 load_result = LA_LoadPage(DspCode_array,0,0);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
704
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
705 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
706 if(load_result)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
707 L1_trace_string ("\n\r-> Download FAILED !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
708 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
709 L1_trace_string ("\n\r-> ... finished !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
710 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
711
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
712 #if (VOC == FR_HR) || (VOC == FR_EFR) || (VOC == FR_HR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
713 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
714 #if (VOC == FR_HR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
715 L1_trace_string ("\n\r-> Downloading FR&HR DSP data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
716 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
717
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
718 #if (VOC == FR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
719 L1_trace_string ("\n\r-> Downloading FR&EFR DSP data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
720 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
721
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
722 #if (VOC == FR_HR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
723 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
724 L1_trace_string ("\n\r-> Download FR&IDS DSP Data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
725 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
726 L1_trace_string ("\n\r-> Downloading 3VOC DSP DATA ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
727 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
728 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
729 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
730
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
731 load_result = LA_LoadPage(DspData_array,1,0);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
732
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
733 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
734 if(load_result)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
735 L1_trace_string ("\n\r-> Download FAILED !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
736 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
737 L1_trace_string ("\n\r-> ... finished !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
738 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
739 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
740
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
741 // Set DSP start address;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
742 dsp_start_address = DSP_START;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
743 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
744 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
745 if(l1_config.dwnld == PATCH_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
746 // DSP PATCH DOWNLOAD...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
747 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
748 WORD32 load_result;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
749
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
750 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
751 L1_trace_string ("\n\r-> Downloading patch...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
752 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
753
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
754 // Download DSP patch into DSP via API / bootcode.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
755 load_result = LA_LoadPage(patch_array,0,0);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
756
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
757 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
758 if(load_result)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
759 L1_trace_string ("\n\r-> Download FAILED !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
760 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
761 L1_trace_string ("\n\r-> ... finished !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
762 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
763
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
764 // Catch start address always from patch_file#.c.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
765 dsp_start_address = (WORD16)patch_array[3];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
766 dsp_start_address <<= 8;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
767 dsp_start_address += (WORD16)patch_array[2];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
768
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
769 // if COFF2CP output, the file begins by a null tag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
770 if(dsp_start_address == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
771 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
772 dsp_start_address = (WORD16)patch_array[13];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
773 dsp_start_address <<= 8;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
774 dsp_start_address += (WORD16)patch_array[12];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
775 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
776 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
777 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
778 if(l1_config.dwnld == PATCH_DSP_DWNLD)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
779 // DSP CODE DOWNLOAD + PATCH DOWNLOAD...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
780 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
781 WORD32 load_result;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
782
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
783 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
784 #if (VOC == FR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
785 L1_trace_string ("\n\r-> Downloading FR DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
786 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
787
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
788 #if (VOC == FR_HR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
789 L1_trace_string ("\n\r-> Downloading FR&HR DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
790 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
791
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
792 #if (VOC == FR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
793 L1_trace_string ("\n\r-> Downloading FR&EFR DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
794 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
795
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
796 #if (VOC == FR_HR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
797 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
798 L1_trace_string ("\n\r-> Download FR&IDS DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
799 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
800 L1_trace_string ("\n\r-> Downloading 3VOC DSP code...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
801 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
802 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
803 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
804
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
805 // Download DSP code into DSP via API / bootcode.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
806 load_result = LA_LoadPage(DspCode_array,0,0);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
807
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
808 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
809 if(load_result)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
810 L1_trace_string ("\n\r-> Download FAILED !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
811 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
812 L1_trace_string ("\n\r-> ... finished !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
813 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
814
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
815 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
816 L1_trace_string ("\n\r-> Downloading patch...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
817 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
818
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
819 // Download DSP patch into DSP via API / bootcode.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
820 load_result = LA_LoadPage(patch_array,0,0);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
821
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
822 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
823 if(load_result)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
824 L1_trace_string ("\n\r-> Download FAILED !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
825 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
826 L1_trace_string ("\n\r-> ... finished !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
827 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
828
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
829 #if ((VOC == FR_HR) || (VOC == FR_EFR) || (VOC == FR_HR_EFR))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
830 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
831 #if (VOC == FR_HR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
832 L1_trace_string ("\n\r-> Downloading FR&HR DSP data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
833 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
834
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
835 #if (VOC == FR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
836 L1_trace_string ("\n\r-> Downloading FR&EFR DSP data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
837 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
838
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
839 #if (VOC == FR_HR_EFR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
840 #if IDS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
841 L1_trace_string ("\n\r-> Download FR&IDS DSP data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
842 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
843 L1_trace_string ("\n\r-> Downloading 3VOC DSP data ROM...");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
844 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
845 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
846 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
847
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
848 load_result = LA_LoadPage(DspData_array,1,0);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
849
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
850 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE == 7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
851 if(load_result)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
852 L1_trace_string ("\n\r-> Download FAILED !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
853 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
854 L1_trace_string ("\n\r-> ... finished !!");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
855 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
856 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
857
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
858
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
859 // Catch start address always from patch_file#.c.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
860 dsp_start_address = (WORD16)patch_array[3];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
861 dsp_start_address <<= 8;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
862 dsp_start_address += (WORD16)patch_array[2];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
863
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
864 // if COFF2CP output, the file begins by a null tag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
865 if(dsp_start_address == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
866 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
867 dsp_start_address = (WORD16)patch_array[13];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
868 dsp_start_address <<= 8;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
869 dsp_start_address += (WORD16)patch_array[12];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
870 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
871 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
872
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
873 #if (DSP == 16 || DSP == 17 || DSP == 30 || DSP == 31 || DSP == 32)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
874 dsp_ndb_ptr->d_pll_clkmod1 = CLKMOD1; // PLL variable (multiply by 3 factor)+ Power consumpt.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
875 dsp_ndb_ptr->d_pll_clkmod2 = CLKMOD2; // PLL variable (40 us lock time)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
876 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
877 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
878
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
879 #if (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==7)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
880 L1_trace_string ("\n\r\n\r");
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
881 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
882
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
883 //--------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
884 // Loading of NDB parameters.......
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
885 //--------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
886
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
887 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
888 // Initialize background control variable to No background. Background tasks can be launch in GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
889 // as in GSM.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
890 dsp_ndb_ptr->d_background_enable = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
891 dsp_ndb_ptr->d_background_abort = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
892 dsp_ndb_ptr->d_background_state = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
893 dsp_ndb_ptr->d_debug_ptr = 0x0074;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
894 dsp_ndb_ptr->d_debug_bk = 0x0001;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
895 dsp_ndb_ptr->d_pll_config = C_PLL_CONFIG;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
896 dsp_ndb_ptr->p_debug_buffer = C_DEBUG_BUFFER_ADD;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
897 dsp_ndb_ptr->d_debug_buffer_size = C_DEBUG_BUFFER_SIZE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
898 dsp_ndb_ptr->d_debug_trace_type = C_DEBUG_TRACE_TYPE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
899
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
900
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
901 #if (CHIPSET == 12) || (CHIPSET == 15)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
902 dsp_ndb_ptr->d_swh_flag_ndb = 0; /* interpolation off for non SAIC build*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
903 dsp_ndb_ptr->d_swh_Clipping_Threshold_ndb = 0x0000;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
904 #if (DSP == 36) || (DSP == 37) || (DSP == 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
905 #if (L1_SAIC != 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
906 dsp_ndb_ptr->d_swh_flag_ndb = SAIC_INITIAL_VALUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
907 dsp_ndb_ptr->d_swh_Clipping_Threshold_ndb = 0x4000;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
908 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
909 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
910 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
911
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
912 #if (W_A_DSP_IDLE3 == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
913 // Deep Sleep work around used on Calypso
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
914 // This init is used to backward compatibility with old patch.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
915 dsp_ndb_ptr->d_dsp_state = C_DSP_IDLE3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
916 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
917
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
918 dsp_ndb_ptr->d_audio_gain_ul = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
919 dsp_ndb_ptr->d_audio_gain_dl = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
920
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
921 // for patch >= 2100, use new AEC
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
922 #if (!L1_NEW_AEC)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
923 dsp_ndb_ptr->d_es_level_api = 0x5213;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
924 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
925 dsp_ndb_ptr->d_mu_api = 0x5000;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
926 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
927 #if L1_GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
928 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
929 T_NDB_MCU_DSP_GPRS *p_ndb_gprs = (T_NDB_MCU_DSP_GPRS *) NDB_ADR_GPRS;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
930
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
931 // Initialize background control variable to No background.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
932 p_ndb_gprs->d_background_enable = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
933 p_ndb_gprs->d_background_abort = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
934 p_ndb_gprs->d_background_state = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
935 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
936 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
937
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
938 #if (AMR == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
939 // Reset NDB pointer for AMR trace
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
940 dsp_ndb_ptr->p_debug_amr = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
941 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
942
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
943 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
944
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
945 //--------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
946 // Loading of PARAM area.......
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
947 //--------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
948 // Load PARAM memory...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
949 pt = (API *) PARAM_ADR;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
950
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
951 for (i=0; i<param_size; i++) *pt++ = param_tab[i];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
952 #if (DSP < 33) && (IDS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
953 pt += 3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
954 for (i= param_size + 3; i<param_size + 3 + param_size2; i++) *pt++ = param_tab[i];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
955 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
956
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
957 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
958 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
959 T_PARAM_MCU_DSP *pt_param = (T_PARAM_MCU_DSP *) PARAM_ADR;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
960
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
961 // "d_gprs_install_address" has to be set only if no PATCH is download, i.e.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
962 // "d_gprs_install_address" is automatically set by DSP if a PATCH is download
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
963 if ((l1_config.dwnld == DSP_DWNLD) || (l1_config.dwnld == NO_DWNLD))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
964 pt_param->d_gprs_install_address = INSTALL_ADD;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
965 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
966 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
967
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
968 #if L1_GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
969 //--------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
970 // Loading of GPRS PARAM area.......
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
971 //--------------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
972 // Load GPRS PARAM memory...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
973 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
974 T_PARAM_MCU_DSP_GPRS *pt_gprs = (T_PARAM_MCU_DSP_GPRS *) PARAM_ADR_GPRS;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
975
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
976 // WARNING: must be configured according to the ARM & DSP clock speed.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
977 // The following values are required with a 13MHz ARM clock and with a 65 MIPS DSP.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
978 pt_gprs->d_overlay_rlcmac_cfg_gprs = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
979 pt_gprs->d_mac_threshold = 0x4e20;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
980 pt_gprs->d_sd_threshold = 0x0016;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
981 pt_gprs->d_nb_max_iteration = 0x0004;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
982
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
983 #if (DSP != 33) && (DSP != 34) && (DSP != 35) && (DSP != 36) && (DSP != 37) && (DSP != 38) && (DSP != 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
984
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
985 #if (OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
986 #if (CHIPSET == 4) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || \
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
987 (CHIPSET == 11) || (CHIPSET == 12)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
988 pt_gprs->d_lat_mcu_bridge = p_dynamic_clock_cfg->d_lat_mcu_bridge;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
989 pt_gprs->d_lat_mcu_hom2sam = p_dynamic_clock_cfg->d_lat_mcu_hom2sam;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
990 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
991 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
992
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
993 #if (CHIPSET == 4)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
994 #if (!OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
995 // Latency for DSP at 78 MIPS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
996 pt_gprs->d_lat_mcu_bridge = 0x0009;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
997 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
998 pt_gprs->d_lat_pll2div = 0x000C;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
999 #if (!OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1000 pt_gprs->d_lat_mcu_hom2sam = 0x000C;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1001 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1002 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1003 #if (!OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1004 pt_gprs->d_lat_mcu_bridge = 0x0008;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1005 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1006 pt_gprs->d_lat_pll2div = 0x000A;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1007 #if (!OP_L1_STANDALONE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1008 pt_gprs->d_lat_mcu_hom2sam = 0x000A;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1009 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1010 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1011
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1012 // To be removed once G0 patch process will be aligned with G1 & G2
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1013 // i.e. "d_gprs_install_address" automatically set by DSP if a Patch is present.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1014 #if (DSP == 31)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1015 if ((l1_config.dwnld == PATCH_DSP_DWNLD) ||
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1016 (l1_config.dwnld == PATCH_DWNLD))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1017 pt_gprs->d_gprs_install_address = INSTALL_ADD_WITH_PATCH;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1018 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1019 pt_gprs->d_gprs_install_address = INSTALL_ADD;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1020 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1021 if ((l1_config.dwnld == DSP_DWNLD) || (l1_config.dwnld == NO_DWNLD))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1022 pt_gprs->d_gprs_install_address = INSTALL_ADD;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1023 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1024 #endif // DSP != 33 && DSP != 34 && (DSP != 35) && DSP != 36 && DSP != 37 && DSP != 38
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1025 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1026 #endif // L1_GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1027
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1028 *(volatile UWORD16 *) DOWNLOAD_SIZE = 0; // Size=0 to force DSP to start from address...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1029 *(volatile UWORD16 *) DOWNLOAD_ADDR = dsp_start_address; // Start address.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1030 *(volatile UWORD16 *) DOWNLOAD_STATUS = BLOCK_READY; // Start DSP...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1031
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1032 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1033 #endif //#if CODE_VERSION!=SIMULATION
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1034
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1035 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1036 /* l1s_reset_db_mcu_to_dsp() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1037 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1038 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1039 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1040 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1041 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1042 void l1s_reset_db_mcu_to_dsp(T_DB_MCU_TO_DSP *page_ptr)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1043 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1044 API i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1045 API size = sizeof(T_DB_MCU_TO_DSP) / sizeof(API);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1046 API *ptr = (API *)page_ptr;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1047
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1048 // Clear all locations.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1049 for(i=0; i<size; i++) *ptr++ = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1050 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1051
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1052 #if (DSP == 38) || (DSP == 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1053 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1054 /* l1s_reset_db_common_mcu_to_dsp() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1055 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1056 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1057 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1058 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1059 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1060 void l1s_reset_db_common_mcu_to_dsp(T_DB_COMMON_MCU_TO_DSP *page_ptr)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1061 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1062 API i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1063 API size = sizeof(T_DB_COMMON_MCU_TO_DSP) / sizeof(API);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1064 API *ptr = (API *)page_ptr;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1065
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1066 // Clear all locations.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1067 for(i=0; i<size; i++) *ptr++ = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1068 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1069 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1070 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1071 /* l1s_reset_db_dsp_to_mcu() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1072 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1073 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1074 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1075 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1076 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1077 void l1s_reset_db_dsp_to_mcu(T_DB_DSP_TO_MCU *page_ptr)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1078 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1079 API i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1080 API size = sizeof(T_DB_DSP_TO_MCU) / sizeof(API);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1081 API *ptr = (API *)page_ptr;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1082
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1083 // Clear all locations.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1084 for(i=0; i<size; i++) *ptr++ = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1085
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1086 // Set crc result as "SB not found".
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1087 page_ptr->a_sch[0] = (1<<B_SCH_CRC); // B_SCH_CRC =1, BLUD =0
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1088 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1089
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1090 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1091 /* l1s_increment_time() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1092 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1093 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1094 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1095 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1096 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1097 void l1s_increment_time(T_TIME_INFO *time, UWORD32 fn_offset)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1098 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1099 // Increment FN % MAX_FN.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1100 //------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1101 IncMod(time->fn, fn_offset, MAX_FN);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1102
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1103 if(fn_offset == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1104 // Frame by frame increment...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1105 //----------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1106 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1107 IncMod(time->t2, 1, 26); // increment T2 % 26.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1108 IncMod(time->t3, 1, 51); // increment T3 % 51.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1109 IncMod(time->fn_mod42432, 1, 42432); // increment FN % 42432.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1110 IncMod(time->fn_mod13, 1, 13); // increment FN % 13.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1111
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1112 if(time->t3 == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1113 // new FN is a multiple of 51.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1114 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1115 // Increment TC ((FN/51) % 8).
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1116 IncMod(time->tc, 1, 8);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1117
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1118 // New FN is a multiple of 26 and 51 -> increment T1 % 2048 (T1=FN div (26*51)).
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1119 if(time->t2 == 0) IncMod(time->t1, 1, 2048);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1120 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1121
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1122 #if (L1_GPRS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1123 IncMod(time->fn_mod52, 1, 52); // increment FN % 52.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1124 IncMod(time->fn_mod104, 1, 104); // increment FN % 104.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1125
105
46b4a7ae4d58 l1_func.c: l1s_increment_time() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 104
diff changeset
1126 IncMod(time->fn_mod13_mod4, 1, 4); // increment (FN % 13) % 4.
46b4a7ae4d58 l1_func.c: l1s_increment_time() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 104
diff changeset
1127 if(time->fn_mod13 == 0)
46b4a7ae4d58 l1_func.c: l1s_increment_time() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 104
diff changeset
1128 time->fn_mod13_mod4 = 0;
46b4a7ae4d58 l1_func.c: l1s_increment_time() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 104
diff changeset
1129
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1130 if((time->fn_mod13 == 0) || (time->fn_mod13 == 4) || (time->fn_mod13 == 8))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1131 IncMod(time->block_id, 1, MAX_BLOCK_ID);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1132 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1133
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1134 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1135
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1136 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1137 // Jumping on a new serving cell.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1138 //-------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1139 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1140 time->t2 = time->fn % 26; // T2 = FN % 26.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1141 time->t3 = time->fn % 51; // T3 = FN % 51.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1142 time->t1 = time->fn / (26L*51L); // T1 = FN div 26*51
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1143 time->tc = (time->fn / 51) % 8; // TC = (FN div 51) % 8
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1144 time->fn_mod42432 = time->fn % 42432; // FN%42432.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1145 time->fn_mod13 = time->fn % 13; // FN % 13.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1146
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1147 #if (L1_GPRS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1148 time->fn_mod104 = time->fn % 104; // FN % 104.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1149
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1150 if(time->fn_mod104 >= 52) // FN % 52.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1151 time->fn_mod52 = time->fn_mod104 - 52;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1152 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1153 time->fn_mod52 = time->fn_mod104;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1154
105
46b4a7ae4d58 l1_func.c: l1s_increment_time() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 104
diff changeset
1155 time->fn_mod13_mod4 = time->fn_mod13 % 4; // FN % 13 % 4.
46b4a7ae4d58 l1_func.c: l1s_increment_time() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 104
diff changeset
1156
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1157 time->block_id = ((3 * (time->fn / 13)) + (time->fn_mod13 / 4));
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1158 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1159
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1160 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1161
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1162 // Computes reporting period frame number according to the current FN
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1163 if(l1a_l1s_com.l1s_en_task[DEDIC] == TASK_ENABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1164 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1165 T_CHANNEL_DESCRIPTION *desc_ptr;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1166 UWORD8 timeslot_no;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1167 UWORD8 subchannel;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1168
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1169 // Get a meaningfull channel description.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1170 //---------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1171 // Rem1: this is to avoid a bad setting of "fn_in_report" when synchro is performed
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1172 // whereas L1 is waiting for starting time and no channel discribed BEFORE STI.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1173 // Rem2: "fn_in_report" is computed with "CHAN1" parameters since it is the channel
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1174 // which carries the SACCH.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1175 if(l1a_l1s_com.dedic_set.aset->chan1.desc_ptr->channel_type == INVALID_CHANNEL)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1176 desc_ptr = &l1a_l1s_com.dedic_set.aset->chan1.desc;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1177 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1178 desc_ptr = l1a_l1s_com.dedic_set.aset->chan1.desc_ptr;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1179
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1180 timeslot_no = desc_ptr->timeslot_no;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1181 subchannel = desc_ptr->subchannel;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1182 if(desc_ptr->channel_type == TCH_H) timeslot_no = (2*(timeslot_no/2) + subchannel);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1183
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1184
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1185 // Compute "fn_in_report" according to the channel_type.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1186 //------------------------------------------------------
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1187 if(desc_ptr->channel_type == SDCCH_4)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1188 // FN_REPORT for SDCCH/4 is: fn%102 in [37..36].
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1189 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1190 l1s.actual_time.fn_in_report = (UWORD8)((l1s.actual_time.fn - 37 + 102) % 102);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1191 l1s.next_time.fn_in_report = (UWORD8)((l1s.next_time.fn - 37 + 102) % 102);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1192 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1193 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1194 if(desc_ptr->channel_type == SDCCH_8)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1195 // FN_REPORT for SDCCH/4 is: fn%102 in [12..11].
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1196 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1197 l1s.actual_time.fn_in_report = (UWORD8)((l1s.actual_time.fn - 12 + 102) % 102);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1198 l1s.next_time.fn_in_report = (UWORD8)((l1s.next_time.fn - 12 + 102) % 102);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1199 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1200 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1201 // TCH_F or TCH_H...
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1202 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1203 // 1) (timeslot_no * 13) is computed in order to substract the considered beginning for this
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1204 // timeslot and then always be in the range 0..103
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1205 // 2) 104 is added in order to cope with negative numbers.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1206 l1s.actual_time.fn_in_report = (UWORD8)((l1s.actual_time.fn - (timeslot_no * 13) + 104) % 104);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1207 l1s.next_time.fn_in_report = (UWORD8)((l1s.next_time.fn - (timeslot_no * 13) + 104) % 104);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1208 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1209 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1210 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1211
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1212 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1213 /* l1s_encode_rxlev() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1214 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1215 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1216 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1217 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1218 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1219 WORD16 l1s_encode_rxlev(UWORD8 inlevel)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1220 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1221 WORD16 rxlev;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1222
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1223 rxlev = (221 - inlevel) / 2; // the result is divided by 2 due to
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1224 // the IL format is 7.1 and rxlev format is 8.0
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1225
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1226 return(rxlev);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1227 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1228
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1229 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1230 /* l1s_send_ho_finished() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1231 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1232 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1233 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1234 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1235 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1236 void l1s_send_ho_finished(UWORD8 cause)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1237 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1238 xSignalHeaderRec *msg;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1239
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1240 msg = os_alloc_sig(sizeof(T_MPHC_HANDOVER_FINISHED));
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1241 DEBUGMSG(status,NU_ALLOC_ERR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1242 msg->SignalCode = L1C_HANDOVER_FINISHED;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1243 ((T_MPHC_HANDOVER_FINISHED *)(msg->SigP))->cause = cause;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1244
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1245 os_send_sig(msg, L1C1_QUEUE);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1246 DEBUGMSG(status,NU_SEND_QUEUE_ERR)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1247 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1248
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1249
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1250 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1251 /* l1s_get_versions() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1252 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1253 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1254 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1255 /* Functionality : return address of version structur */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1256 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1257 T_VERSION *l1s_get_version (void)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1258 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1259 //update the fields not initialized by the sw init.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1260
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1261 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1262 l1s.version.dsp_code_version = l1s_dsp_com.dsp_ndb_ptr->d_version_number1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1263 l1s.version.dsp_patch_version = l1s_dsp_com.dsp_ndb_ptr->d_version_number2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1264 // Note: if l1s.version.dsp_checksum is not initialized (field set to 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1265 // use TST_TEST_HW_REQ message to initialize the whole structur.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1266 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1267 l1s.version.dsp_patch_version = l1s_dsp_com.dsp_param_ptr->d_version_number;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1268 // Note: if l1s.version.dsp_code_version and l1s.version.dsp_checksum
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1269 // are not initialized (fields set to 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1270 // use TST_TEST_HW_REQ message to initialize the whole structur.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1271 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1272
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1273 return (&l1s.version);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1274 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1275
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1276 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1277 /* l1s_reset_dedic_meas() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1278 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1279 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1280 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1281 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1282 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1283 void l1s_reset_dedic_serving_meas(void)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1284 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1285 // Reset rxlev related fields
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1286 l1a_l1s_com.Scell_info.meas.acc = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1287 l1a_l1s_com.Scell_info.meas.nbr_meas = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1288 l1a_l1s_com.Smeas_dedic.acc_sub = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1289 l1a_l1s_com.Smeas_dedic.nbr_meas_sub = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1290
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1291 // Reset rxqual related fields
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1292 l1a_l1s_com.Smeas_dedic.qual_acc_full = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1293 l1a_l1s_com.Smeas_dedic.qual_nbr_meas_full = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1294 l1a_l1s_com.Smeas_dedic.qual_acc_sub = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1295 l1a_l1s_com.Smeas_dedic.qual_nbr_meas_sub = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1296
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1297
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1298 #if REL99
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1299 #if FF_EMR
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1300 // Reset EMR variables
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1301 l1a_l1s_com.Smeas_dedic_emr.rxlev_val_acc = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1302 l1a_l1s_com.Smeas_dedic_emr.rxlev_val_nbr_meas = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1303 l1a_l1s_com.Smeas_dedic_emr.nbr_rcvd_blocks = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1304 l1a_l1s_com.Smeas_dedic_emr.mean_bep_block_acc = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1305 l1a_l1s_com.Smeas_dedic_emr.cv_bep_block_acc = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1306 l1a_l1s_com.Smeas_dedic_emr.mean_bep_block_num = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1307 l1a_l1s_com.Smeas_dedic_emr.cv_bep_block_num = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1308 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1309 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1310
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1311
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1312 // Reset dtx frame counter
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1313 l1a_l1s_com.Smeas_dedic.dtx_used = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1314 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1315
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1316 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1317 /* SwapIQ_dl() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1318 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1319 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1320 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1321 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1322 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1323 UWORD32 l1s_swap_iq_dl(UWORD16 radio_freq, UWORD8 task)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1324 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1325 UWORD8 swap_iq;
106
c768c181ece8 l1_func.c: l1s_swap_iq_dl() and l1s_swap_iq_ul() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 105
diff changeset
1326 UWORD32 task_tab;
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1327
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1328 #if (L1_FF_MULTIBAND == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1329 if(((l1_config.std.id == DUAL) || (l1_config.std.id == DUALEXT) || (l1_config.std.id == DUAL_US)) &&
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1330 (radio_freq >= l1_config.std.first_radio_freq_band2))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1331 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1332 swap_iq = l1_config.std.swap_iq_band2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1333 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1334 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1335 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1336 swap_iq = l1_config.std.swap_iq_band1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1337 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1338 #else // L1_FF_MULTIBAND = 1 below
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1339
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1340 UWORD16 physical_band_id;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1341 physical_band_id =
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1342 l1_multiband_radio_freq_convert_into_physical_band_id(radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1343 swap_iq = rf_band[physical_band_id].swap_iq;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1344
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1345 #endif // #if (L1_FF_MULTIBAND == 0) else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1346
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1347 switch(swap_iq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1348 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1349 case 0: /* No swap at all. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1350 case 2: /* DL, no swap. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1351 task_tab = (UWORD32)DSP_TASK_CODE[task];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1352 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1353 case 1: /* DL I/Q swap. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1354 case 3: /* DL I/Q swap. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1355 task_tab = (UWORD32)DSP_TASK_CODE[task];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1356 task_tab |= 0x8000L;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1357 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1358 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1359 return(task_tab);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1360 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1361
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1362 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1363 /* l1s_swap_iq_ul() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1364 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1365 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1366 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1367 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1368 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1369 UWORD32 l1s_swap_iq_ul(UWORD16 radio_freq, UWORD8 task)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1370 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1371 UWORD8 swap_iq;
106
c768c181ece8 l1_func.c: l1s_swap_iq_dl() and l1s_swap_iq_ul() reconstructed
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 105
diff changeset
1372 UWORD32 task_tab;
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1373
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1374 #if (L1_FF_MULTIBAND == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1375
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1376 if(((l1_config.std.id == DUAL) || (l1_config.std.id == DUALEXT) || (l1_config.std.id == DUAL_US)) &&
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1377 (radio_freq >= l1_config.std.first_radio_freq_band2))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1378 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1379 swap_iq = l1_config.std.swap_iq_band2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1380 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1381 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1382 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1383 swap_iq = l1_config.std.swap_iq_band1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1384 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1385 #else // L1_FF_MULTIBAND = 1 below
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1386
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1387 UWORD16 physical_band_id = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1388 physical_band_id =
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1389 l1_multiband_radio_freq_convert_into_physical_band_id(radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1390 swap_iq = rf_band[physical_band_id].swap_iq;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1391
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1392 #endif // #if (L1_FF_MULTIBAND == 0) else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1393
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1394 switch(swap_iq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1395 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1396 case 0: /* No swap at all. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1397 case 1: /* UL, no swap. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1398 task_tab = (UWORD32)DSP_TASK_CODE[task];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1399 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1400 case 2: /* UL I/Q swap. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1401 case 3: /* UL I/Q swap. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1402 task_tab = (UWORD32)DSP_TASK_CODE[task];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1403 task_tab |= 0x8000L;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1404 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1405 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1406 return(task_tab);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1407 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1408
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1409
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1410 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1411 /* l1s_ADC_decision_on_NP() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1412 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1413 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1414 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1415 /* Functionality : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1416 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1417 UWORD8 l1s_ADC_decision_on_NP(void)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1418 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1419 UWORD8 adc_active = INACTIVE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1420
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1421 if (l1a_l1s_com.l1s_en_task[ALLC] == TASK_DISABLED) // no reorg mode
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1422 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1423 if (l1a_l1s_com.adc_mode & ADC_NEXT_NORM_PAGING) // perform ADC only one time
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1424 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1425 adc_active = ACTIVE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1426 l1a_l1s_com.adc_mode &= ADC_MASK_RESET_IDLE; // reset in order to have only one ADC measurement in Idle
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1427 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1428 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1429 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1430 if (l1a_l1s_com.adc_mode & ADC_EACH_NORM_PAGING) // perform ADC on each "period" x bloc
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1431 if ((++l1a_l1s_com.adc_cpt)>=l1a_l1s_com.adc_idle_period) // wait for the period
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1432 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1433 adc_active = ACTIVE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1434 l1a_l1s_com.adc_cpt = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1435 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1436 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1437 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1438 else // ADC measurement in reorg mode
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1439 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1440 if (l1a_l1s_com.adc_mode & ADC_NEXT_NORM_PAGING_REORG) // perform ADC only one time
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1441 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1442 adc_active = ACTIVE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1443 l1a_l1s_com.adc_mode &= ADC_MASK_RESET_IDLE; // reset in order to have only one ADC measurement in Idle
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1444 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1445 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1446 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1447 if (l1a_l1s_com.adc_mode & ADC_EACH_NORM_PAGING_REORG) // perform ADC on each "period" x bloc
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1448 if ((++l1a_l1s_com.adc_cpt)>=l1a_l1s_com.adc_idle_period) // wait for the period
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1449 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1450 adc_active = ACTIVE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1451 l1a_l1s_com.adc_cpt = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1452 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1453 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1454 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1455 return(adc_active);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1456 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1457
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1458
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1459 #if (AMR == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1460 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1461 /* l1s_amr_get_ratscch_type() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1462 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1463 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1464 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1465 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1466 /* This function returns the type of a RATSCCH block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1467 /* Decoding is done according to ETSI spec 05.09 */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1468 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1469 /* Input parameter: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1470 /* --------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1471 /* "a_ratscch" */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1472 /* pointer to the RATSCCH block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1473 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1474 /* Output parameter: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1475 /* ---------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1476 /* Type of RATSCCH block. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1477 /* Can be: C_RATSCCH_UNKNOWN */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1478 /* C_RATSCCH_CMI_PHASE_REQ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1479 /* C_RATSCCH_AMR_CONFIG_REQ_MAIN */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1480 /* C_RATSCCH_AMR_CONFIG_REQ_ALT */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1481 /* C_RATSCCH_AMR_CONFIG_REQ_ALT_IGNORE */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1482 /* C_RATSCCH_THRES_REQ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1483 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1484 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1485 UWORD8 l1s_amr_get_ratscch_type(API *a_ratscch)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1486 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1487 // Check if the RATSCCH block is a CMI_PHASE_REQ block
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1488 // -> if and only if bits 1, 3 through 34 are cleared and bit 2 is set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1489 if(((UWORD16)(a_ratscch[3] & 0xFFFE) == 0x0004) && // bits 1, 3-15 are cleared, bit 2 is set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1490 ((UWORD16)(a_ratscch[4]) == 0x0000) && // bits 16-31 are cleared
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1491 ((UWORD16)(a_ratscch[5] & 0x0007) == 0x0000)) // bits 32-34 are cleared
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1492 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1493 return C_RATSCCH_CMI_PHASE_REQ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1494 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1495
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1496 // Check if the RATSCCH block is a THRES_REQ block
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1497 // -> if and only if bits 31 through 34 are cleared and bit 30 is set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1498 if(((UWORD16)(a_ratscch[4] & 0xC000) == 0x4000) && // bit 30 is set, bit 31 is cleared
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1499 ((UWORD16)(a_ratscch[5] & 0x0007) == 0x0000)) // bits 32-34 are cleared
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1500 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1501 return C_RATSCCH_THRES_REQ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1502 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1503
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1504 // Check if the RATSCCH block is a AMR_CONFIG_REQ block
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1505 // -> if and only if bits 33-34 are cleared and bits 30-32 are set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1506 if(((UWORD16)(a_ratscch[4] & 0xC000) == 0xC000) && // bits 30-31 are set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1507 ((UWORD16)(a_ratscch[5] & 0x0007) == 0x0001)) // bit 32 is set, bits 33-34 are cleared
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1508 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1509 // Check if it's a main AMR_CONFIG_REQ block or an alternative AMR_CONFIG_REQ block
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1510 UWORD16 ratscch_acs = (a_ratscch[4] & 0x0FF0) >> 4; // get bits 20-27
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1511 UWORD8 nb_coders,i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1512
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1513 // Count number of active coders
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1514 for(i=0, nb_coders=0; i<8; i++)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1515 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1516 if((ratscch_acs & 1)==1) nb_coders++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1517 ratscch_acs >>= 1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1518 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1519
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1520 // If the number of coders is 1, 2 or 3, it is a main AMR_CONFIG_REQ block
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1521 if(nb_coders<=3)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1522 return C_RATSCCH_AMR_CONFIG_REQ_MAIN;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1523
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1524 // If the number of coders is more than 4, it is an alternate AMR_CONFIG_REQ block
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1525 // Check if it must be ignored (block THRES_REQ pending) or not
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1526 // -> if and only if bits 0 through 19 are set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1527 if(((UWORD16)(a_ratscch[3]) == 0xFFFF) && // bits 0-15 are set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1528 ((UWORD16)(a_ratscch[4] & 0x000F) == 0x000F)) // bits 16-19 are set
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1529 return C_RATSCCH_AMR_CONFIG_REQ_ALT_IGNORE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1530 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1531 return C_RATSCCH_AMR_CONFIG_REQ_ALT;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1532 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1533
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1534 // Block is not recognized
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1535 return C_RATSCCH_UNKNOWN;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1536 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1537
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1538
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1539 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1540 /* l1s_amr_update_from_ratscch() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1541 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1542 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1543 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1544 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1545 /* This function updates the AMR parameters modified by */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1546 /* the RATSCCH block received. This updates is done both */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1547 /* in the NDB and in the L1A/L1S communication structure */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1548 /* (aset pointer). */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1549 /* Data manipulation is done according to ETSI spec 05.08 */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1550 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1551 /* Input parameter: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1552 /* --------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1553 /* "a_ratscch_dl" */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1554 /* pointer to the RATSCCH block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1555 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1556 /* Output parameter: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1557 /* ---------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1558 /* n/a */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1559 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1560 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1561 void l1s_amr_update_from_ratscch(API *a_ratscch_dl)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1562 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1563 UWORD16 acs,hysteresis1,hysteresis2,hysteresis3,threshold1,threshold2,threshold3,icm,cmip;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1564 UWORD16 amr_change_bitmap=0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1565 UWORD8 ratscch_type;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1566 BOOL ratscch_unknown=TRUE; // No AMR parameters update
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1567
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1568 // Get the RATSCCH block's type
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1569 ratscch_type = l1s_amr_get_ratscch_type(a_ratscch_dl);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1570
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1571 // Check the RATSCCH block's type
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1572 switch(ratscch_type)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1573 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1574 case C_RATSCCH_CMI_PHASE_REQ:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1575 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1576 // Copy CMIP to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1577 cmip = a_ratscch_dl[3] & 0x0001; // bit 0
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1578 l1a_l1s_com.dedic_set.aset->cmip=(UWORD8)cmip;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1579 amr_change_bitmap |= 1 << C_AMR_CHANGE_CMIP;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1580 // AMR parameters update flag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1581 ratscch_unknown=FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1582 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1583 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1584 case C_RATSCCH_AMR_CONFIG_REQ_MAIN:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1585 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1586 // Copy ACS to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1587 acs = (a_ratscch_dl[4] & 0x0FF0) >> 4; // bits 20-27
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1588 l1a_l1s_com.dedic_set.aset->amr_configuration.active_codec_set=(UWORD8)acs;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1589 amr_change_bitmap |= 1 << C_AMR_CHANGE_ACS;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1590
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1591 // Copy ICM to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1592 icm = (a_ratscch_dl[4] & 0x3000) >> 12; // bits 28-29
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1593 l1a_l1s_com.dedic_set.aset->amr_configuration.initial_codec_mode=(UWORD8)icm;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1594 amr_change_bitmap |= 1 << C_AMR_CHANGE_ICM;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1595
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1596 // Copy hysteresis 1 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1597 hysteresis1 = (a_ratscch_dl[3] & 0x03C0) >> 6; // bits 6-9
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1598 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[0]=(UWORD8)hysteresis1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1599 amr_change_bitmap |= 1 << C_AMR_CHANGE_HYST1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1600
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1601 // Copy threshold 1 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1602 threshold1 = a_ratscch_dl[3] & 0x003F; // bits 0-5
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1603 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[0]=(UWORD8)threshold1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1604 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1605
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1606 // Copy hysteresis 2 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1607 hysteresis2 = a_ratscch_dl[4] & 0x000F; // bits 16-19
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1608 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[1]=(UWORD8)hysteresis2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1609 amr_change_bitmap |= 1 << C_AMR_CHANGE_HYST2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1610
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1611 // Copy threshold 2 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1612 threshold2 = (a_ratscch_dl[3] & 0xFC00) >> 10; // bits 10-15
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1613 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[1]=(UWORD8)threshold2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1614 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1615 // AMR parameters update flag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1616 ratscch_unknown=FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1617 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1618 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1619 case C_RATSCCH_AMR_CONFIG_REQ_ALT:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1620 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1621 // Copy ACS to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1622 acs = (a_ratscch_dl[4] & 0x0FF0) >> 4; // bits 20-27
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1623 l1a_l1s_com.dedic_set.aset->amr_configuration.active_codec_set=(UWORD8)acs;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1624 amr_change_bitmap |= 1 << C_AMR_CHANGE_ACS;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1625
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1626 // Copy ICM to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1627 icm = (a_ratscch_dl[4] & 0x3000) >> 12; // bits 28-29
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1628 l1a_l1s_com.dedic_set.aset->amr_configuration.initial_codec_mode=(UWORD8)icm;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1629 amr_change_bitmap |= 1 << C_AMR_CHANGE_ICM;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1630
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1631 // Copy threshold 1 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1632 threshold1 = a_ratscch_dl[3] & 0x003F; // bits 0-5
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1633 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[0]=(UWORD8)threshold1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1634 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1635
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1636 // Copy threshold 2 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1637 threshold2 = (a_ratscch_dl[3] & 0x0FC0) >> 6; // bits 6-11
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1638 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[1]=(UWORD8)threshold2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1639 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1640
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1641 // Copy threshold 3 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1642 threshold3 = ((a_ratscch_dl[3] & 0xF000) >> 12) | // bits 12-15
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1643 ((a_ratscch_dl[4] & 0x0003) << 4); // bits 16-17
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1644 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[2]=(UWORD8)threshold3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1645 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1646
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1647 // Copy hysteresis 1, 2 and 3 (common hysteresis) to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1648 hysteresis1 = (a_ratscch_dl[4] & 0x000C) >> 2; // bits 18-19
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1649 hysteresis2 = hysteresis3 = hysteresis1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1650 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[0]=
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1651 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[1]=
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1652 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[2]=(UWORD8)hysteresis1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1653 amr_change_bitmap |= (1 << C_AMR_CHANGE_HYST1) | (1 << C_AMR_CHANGE_HYST2) | (1 << C_AMR_CHANGE_HYST3);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1654 // AMR parameters update flag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1655 ratscch_unknown=FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1656 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1657 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1658 case C_RATSCCH_AMR_CONFIG_REQ_ALT_IGNORE:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1659 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1660 // Copy ACS to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1661 acs = (a_ratscch_dl[4] & 0x0FF0) >> 4; // bits 20-27
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1662 l1a_l1s_com.dedic_set.aset->amr_configuration.active_codec_set=(UWORD8)acs;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1663 amr_change_bitmap |= 1 << C_AMR_CHANGE_ACS;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1664
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1665 // Copy ICM to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1666 icm = (a_ratscch_dl[4] & 0x3000) >> 12; // bits 28-29
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1667 l1a_l1s_com.dedic_set.aset->amr_configuration.initial_codec_mode=(UWORD8)icm;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1668 amr_change_bitmap |= 1 << C_AMR_CHANGE_ICM;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1669 // AMR parameters update flag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1670 ratscch_unknown=FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1671 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1672 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1673 case C_RATSCCH_THRES_REQ:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1674 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1675 // Copy hysteresis 1 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1676 hysteresis1 = (a_ratscch_dl[3] & 0x03C0) >> 6; // bits 6-9
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1677 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[0]=(UWORD8)hysteresis1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1678 amr_change_bitmap |= 1 << C_AMR_CHANGE_HYST1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1679
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1680 // Copy threshold 1 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1681 threshold1 = a_ratscch_dl[3] & 0x003F; // bits 0-5
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1682 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[0]=(UWORD8)threshold1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1683 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1684
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1685 // Copy hysteresis 2 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1686 hysteresis2 = a_ratscch_dl[4] & 0x000F; // bits 16-19
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1687 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[1]=(UWORD8)hysteresis2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1688 amr_change_bitmap |= 1 << C_AMR_CHANGE_HYST2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1689
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1690 // Copy threshold 2 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1691 threshold2 = (a_ratscch_dl[3] & 0xFC00) >> 10; // bits 10-15
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1692 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[1]=(UWORD8)threshold2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1693 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR2;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1694
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1695 // Copy hysteresis 3 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1696 hysteresis3 = (a_ratscch_dl[4] & 0x3C00) >> 10; // bits 26-29
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1697 l1a_l1s_com.dedic_set.aset->amr_configuration.hysteresis[2]=(UWORD8)hysteresis3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1698 amr_change_bitmap |= 1 << C_AMR_CHANGE_HYST3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1699
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1700 // Copy threshold 3 to L1 structure
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1701 threshold3 = (a_ratscch_dl[4] & 0x03F0) >> 4; // bits 20-25
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1702 l1a_l1s_com.dedic_set.aset->amr_configuration.threshold[2]=(UWORD8)threshold3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1703 amr_change_bitmap |= 1 << C_AMR_CHANGE_THR3;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1704 // AMR parameters update flag
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1705 ratscch_unknown=FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1706 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1707 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1708 case C_RATSCCH_UNKNOWN:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1709 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1710 // No AMR parameters update
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1711 ratscch_unknown=TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1712 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1713 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1714 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1715 // AMR parameters update only if valid RATSCCH
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1716 if(ratscch_unknown==FALSE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1717 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1718 // Update NDB with new AMR parameters
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1719 l1ddsp_load_amr_param(l1a_l1s_com.dedic_set.aset->amr_configuration,l1a_l1s_com.dedic_set.aset->cmip);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1720
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1721 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1722 l1_trace_ratscch(l1s.actual_time.fn_mod42432,amr_change_bitmap);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1723 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1724 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1725 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1726
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1727 #endif // AMR
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1728
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1729
101
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
1730 /*
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
1731 * FreeCalypso TCS211 reconstruction: the following l1_memcpy_16bit()
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
1732 * function has been moved to l1_dyn_dwl_func.c.
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
1733 */
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1734
101
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
1735 #if 0
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1736 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1737 /* l1_memcpy_16bit() */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1738 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1739 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1740 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1741 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1742 /* This function is equivalemt of memcopy. Thid function */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1743 /* does only 8/16 bit accessed to both source and */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1744 /* destination */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1745 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1746 /* Input parameter: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1747 /* --------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1748 /* "src" - input pointer */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1749 /* "len" - number of bytes to copy */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1750 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1751 /* Output parameter: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1752 /* ---------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1753 /* "dst" - output pointer */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1754 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1755 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1756 void l1_memcpy_16bit(void *dst,void* src,unsigned int len)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1757 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1758 unsigned int i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1759 unsigned int tempLen;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1760 unsigned char *cdst,*csrc;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1761 unsigned short *ssrc,*sdst;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1762
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1763 cdst=dst;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1764 csrc=src;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1765 sdst=dst;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1766 ssrc=src;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1767
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1768 if(((unsigned int)src&0x01) || ((unsigned int)dst&0x01)){
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1769 // if either source or destination is not 16-bit aligned do the entire memcopy
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1770 // in 8-bit
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1771 for(i=0;i<len;i++){
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1772 *cdst++=*csrc++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1773 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1774 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1775 else{
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1776 // if both the source and destination are 16-bit aligned do the memcopy
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1777 // in 16-bits
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1778 tempLen = len>>1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1779 for(i=0;i<tempLen;i++){
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1780 *sdst++ = *ssrc++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1781 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1782 if(len & 0x1){
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1783 // if the caller wanted to copy odd number of bytes do a last 8-bit copy
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1784 cdst=(unsigned char*)sdst;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1785 csrc=(unsigned char*)ssrc;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1786 *cdst++ = *csrc++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1787 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1788 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1789 return;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1790 }
101
a103d40accc2 l1_func.c: passes compilation, object diffing begins
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 100
diff changeset
1791 #endif
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1792
102
334789c5338c l1_func.c: l1s_restore_synchro() removed - not applicable to our config
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 101
diff changeset
1793 #if (FF_L1_FAST_DECODING == 1)
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1794 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1795 /* l1s_restore_synchro */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1796 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1797 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1798 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1799 /* This function restores TPU synchro after an actiity */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1800 /* using synchro/synchro back scheme. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1801 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1802 /* Input parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1803 /* ----------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1804 /* None */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1805 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1806 /* Input parameters from globals: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1807 /* ------------------------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1808 /* l1s.tpu_offset */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1809 /* l1s.next_time */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1810 /* l1s.next_plus_time */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1811 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1812 /* Output parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1813 /* ------------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1814 /* None */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1815 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1816 /* Modified parameters from globals: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1817 /* --------------------------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1818 /* l1s.actual_time */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1819 /* l1s.next_time */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1820 /* l1s.next_plus_time */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1821 /* l1s.tpu_ctrl_reg */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1822 /* l1s.dsp_ctrl_reg */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1823 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1824 void l1s_restore_synchro(void)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1825 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1826 // Slide synchro back to mach current serving timeslot.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1827 l1dmacro_synchro(SWITCH_TIME, l1s.tpu_offset);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1828
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1829 // Increment frame number.
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1830 #if L1_GPRS
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1831 l1s.actual_time = l1s.next_time;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1832 l1s.next_time = l1s.next_plus_time;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1833 l1s_increment_time(&(l1s.next_plus_time), 1); // Increment "next_plus time".
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1834 #else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1835 l1s.actual_time = l1s.next_time;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1836 l1s_increment_time(&(l1s.next_time), 1); // Increment "next time".
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1837 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1838
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1839 l1s.tpu_ctrl_reg |= CTRL_SYCB;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1840 l1s.dsp_ctrl_reg |= CTRL_SYNC;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1841
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1842 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1843 trace_fct(CST_L1S_ADJUST_TIME, (UWORD32)(-1));
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1844 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1845 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1846
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1847 BOOL l1s_check_deferred_control(UWORD8 task, UWORD8 burst_id)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1848 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1849 /* Control activities are performed only if:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1850 - Fast decoding is not authorized
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1851 - Fast decoding authorized, control running inside the fast HISR context and not first burst
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1852 - Fast decoding authorized, control running inside L1S context and first burst */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1853
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1854 /* Running from fast API HISR? */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1855 BOOL fast_decoding_hisr = (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_PROCESSING);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1856
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1857 if (fast_decoding_hisr && (burst_id == BURST_1))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1858 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1859 /* Error this case shouldn't happen */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1860 return TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1861 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1862 else if (!fast_decoding_hisr && (burst_id != BURST_1))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1863 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1864 /* Currently running from L1S, control must be performed on the upcoming fast HISR */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1865 l1a_apihisr_com.fast_decoding.task = task;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1866 l1a_apihisr_com.fast_decoding.burst_id = burst_id;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1867 /* If a tasks semaphore get SET do not do deferred control */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1868 if(!(l1a_l1s_com.task_param[task] == SEMAPHORE_SET))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1869 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1870 l1a_apihisr_com.fast_decoding.deferred_control_req = TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1871 return TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1872 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1873 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1874 else if (!fast_decoding_hisr && (burst_id == BURST_1))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1875 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1876 /* Control running from L1S for the first burst => Control must be performed now. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1877 /* As a result, a fast API IT will be triggered on the next frame */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1878
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1879 if (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_AWAITED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1880 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1881 /* A fast API IT was already awaited. It means that we are starting the fast decoding */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1882 /* of a new block before the previous one is finished. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1883 /* This case is signaled through the variable below so the status can stay as awaited */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1884 /* for the first fast API IT of the new block. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1885 l1a_apihisr_com.fast_decoding.contiguous_decoding = TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1886 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1887 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1888 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1889 l1a_apihisr_com.fast_decoding.status = C_FAST_DECODING_AWAITED;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1890 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1891 l1a_apihisr_com.fast_decoding.task = task;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1892 return FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1893 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1894 /* In other cases do control now. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1895 return FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1896 } /* end function l1s_check_deferred_control */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1897
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1898 BOOL l1s_check_fast_decoding_authorized(UWORD8 task)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1899 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1900 BOOL result = FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1901
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1902 /* Is a fast decoding already in progress (AWAITED or PROCESSING states)? */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1903 /* Is a fast decoding complete but waiting for the read activity (COMPLETE state)? */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1904 /* In that case, it will continue, even if a mode change has occured. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1905 BOOL already_in_progress = ( (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_AWAITED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1906 || (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_PROCESSING)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1907 || (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_COMPLETE) );
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1908
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1909 /* One variable used later that contains the status of several tasks */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1910 BOOL no_serving_audio_and_neighbour_tasks = (
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1911 (l1a_l1s_com.l1s_en_task[EP] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1912 && (l1a_l1s_com.l1s_en_task[ALLC] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1913 && (l1a_l1s_com.l1s_en_task[NSYNC] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1914 && (l1a_l1s_com.l1s_en_task[FBNEW] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1915 && (l1a_l1s_com.l1s_en_task[SBCONF] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1916 && (l1a_l1s_com.l1s_en_task[BCCHN] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1917 && (l1a_l1s_com.l1s_en_task[EBCCHS] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1918 //&& (l1a_l1s_com.l1s_en_task[NBCCHS] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1919 && (l1a_l1s_com.l1s_en_task[BCCHN_TOP] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1920 #if (L1_GPRS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1921 && (l1a_l1s_com.l1s_en_task[PBCCHS] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1922 && (l1a_l1s_com.l1s_en_task[PEP] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1923 && (l1a_l1s_com.l1s_en_task[PALLC] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1924 && (l1a_l1s_com.l1s_en_task[PBCCHN_IDLE] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1925 #endif /* L1_GPRS */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1926 //&& (l1a_l1s_com.l1s_en_task[SMSCB] == TASK_DISABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1927 #if (L1_MP3 == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1928 && (l1a_apihisr_com.mp3.running == FALSE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1929 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1930 #if (L1_AAC == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1931 && (l1a_apihisr_com.aac.running == FALSE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1932 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1933 );
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1934
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1935 /* If fast decoding is already forbidden, do not enable it until the end of the block. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1936 /* The forbidden status is reset at the first control of the block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1937 if (l1a_apihisr_com.fast_decoding.status == C_FAST_DECODING_FORBIDDEN)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1938 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1939 return FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1940 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1941
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1942 switch(task)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1943 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1944 case NP:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1945 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1946 /* Enable Fast Paging (NP) except if CCCH reorg*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1947 if ( ( already_in_progress == TRUE )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1948 ||
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1949 ( (l1a_l1s_com.mode == I_MODE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1950 && (l1a_l1s_com.l1s_en_task[NP] == TASK_ENABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1951 && (no_serving_audio_and_neighbour_tasks == TRUE) )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1952 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1953 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1954 result = TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1955 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1956 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1957 } /* case NP */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1958
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1959 case NBCCHS:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1960 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1961 /* Enable Fast Paging (NP) except if CCCH reorg*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1962 if ( ( already_in_progress == TRUE )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1963 ||
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1964 ( (l1a_l1s_com.mode == I_MODE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1965 && (l1a_l1s_com.l1s_en_task[NBCCHS] == TASK_ENABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1966 && (no_serving_audio_and_neighbour_tasks == TRUE) )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1967 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1968 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1969 result = TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1970 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1971 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1972 } /* case NBCCHS */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1973
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1974 #if (L1_GPRS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1975 case PNP:
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1976 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1977 /* Enable Fast Paging (PNP) except if PCCCH reorg*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1978 if ( ( already_in_progress == TRUE )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1979 ||
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1980 ( (l1a_l1s_com.mode == I_MODE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1981 && (l1a_l1s_com.l1s_en_task[PNP] == TASK_ENABLED)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1982 && (no_serving_audio_and_neighbour_tasks == TRUE)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1983 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1984 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1985 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1986 result = TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1987 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1988 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1989 } /* case PNP */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1990 #endif /* L1_GPRS*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1991
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1992 } /* switch(task) */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1993
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1994 #if (L1_GPRS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1995 if ((result == FALSE) && ((task == NP) || (task == PNP) || (task == NBCCHS)))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1996 #else /* NO_GPRS*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1997 if ((result == FALSE) && ((task == NP) || (task == NBCCHS)))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1998 #endif /* L1_GPRS */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
1999 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2000 l1a_apihisr_com.fast_decoding.status = C_FAST_DECODING_FORBIDDEN;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2001 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2002
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2003 return result;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2004 } /* end function l1s_check_fast_decoding_authorized */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2005
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2006 #endif /* FF_L1_FAST_DECODING */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2007 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2008 /* l1s_check_sacch_dl_block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2009 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2010 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2011 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2012 /* Downlink SACCH buffer comparison function for FER Traces */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2013 /* This is called only when there is a successfully decoded */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2014 /* block. The count of no of successfully decoded SACCH blocks */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2015 /* is updated. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2016 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2017 /* Input parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2018 /* ----------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2019 /* sacch_dl_block "Downlink SACCH BLOCK" */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2020 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2021 /* Output parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2022 /* ------------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2023 /* None */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2024 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2025 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2026 #if ((FF_REPEATED_SACCH) && (TRACE_TYPE ==1 || TRACE_TYPE == 4))
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2027
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2028 void l1s_check_sacch_dl_block(API *sacch_dl_block)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2029 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2030 int i,j,repeat=1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2031 if( trace_info.repeat_sacch.dl_buffer_empty == FALSE )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2032 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2033 for(i=3,j=0;i<15;i++,j++)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2034 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2035 if(trace_info.repeat_sacch.dl_buffer[j] != sacch_dl_block[i])
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2036 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2037 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2038 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2039 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2040 if( i != 15 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2041 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2042 repeat=0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2043 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2044 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2045 else /* if( trace_info.repeat_sacch.dl_buffer_empty == FALSE ) */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2046 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2047 repeat=0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2048 } /* end else empty DL SACCH buffer*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2049 if(repeat == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2050 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2051 trace_info.repeat_sacch.dl_good_norep++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2052 for ( i=3 ; i<15 ; i++ )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2053 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2054 trace_info.repeat_sacch.dl_buffer[i] = sacch_dl_block[i];// info_address[i];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2055 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2056 trace_info.repeat_sacch.dl_buffer_empty = FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2057 } /* end if repeat = 0*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2058 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2059 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2060 trace_info.repeat_sacch.dl_buffer_empty = TRUE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2061 } /* end else repeat = 1*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2062 } /* end function void l1s_check_sacch_dl_block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2063 #endif /* ((FF_REPEATED_SACCH) && (TRACE_TYPE ==1 || TRACE_TYPE == 4)) */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2064
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2065
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2066 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2067 /* l1s_store_sacch_buffer */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2068 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2069 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2070 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2071 /* Function to store data in case of a retransmission. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2072 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2073 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2074 /* Input parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2075 /* ----------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2076 /* sacch_ul_block "SACCH Uplink block to be stored" */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2077 /* repeat_sacch "The buffer tocontain the stored block" */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2078 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2079 /* Output parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2080 /* ------------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2081 /* None */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2082 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2083 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2084
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2085 #if (FF_REPEATED_SACCH == 1 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2086 void l1s_store_sacch_buffer(T_REPEAT_SACCH *repeat_sacch, UWORD8 *sacch_ul_block)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2087 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2088 int i=0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2089 /* Store the first 11 words after header in the first 22 bytes. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2090 for(i=0;i<23;i++)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2091 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2092 repeat_sacch->buffer[i] = sacch_ul_block[i] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2093 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2094 repeat_sacch->buffer_empty = FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2095 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2096 #endif /* (FF_REPEATED_SACCH == 1 ) */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2097
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2098
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2099 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2100 /* l1s_repeated_facch_check */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2101 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2102 /* Description: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2103 /* ------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2104 /* If two successfully decoded blocks (separated by 8 or 9 frames) are */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2105 /* identical then it returns a NULL buffer otherwise a pointer to the last block */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2106 /* data. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2107 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2108 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2109 /* Input parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2110 /* ----------------- */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2111 /* "FACCH block to be stored" */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2112 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2113 /* Output parameters: */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2114 /* ------------------ */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2115 /* None */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2116 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2117 /*-----------------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2118
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2119
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2120 #if ( FF_REPEATED_DL_FACCH == 1 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2121 API * l1s_repeated_facch_check(API *info_address)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2122 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2123 unsigned int repeat=1;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2124 unsigned int i,j;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2125 UWORD8 counter_candidate;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2126
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2127 counter_candidate=l1s.repeated_facch.counter_candidate;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2128 if( l1s.repeated_facch.pipeline[counter_candidate].buffer_empty == FALSE )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2129 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2130 for(i=3,j=0;i<15;j++,i++)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2131 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2132 if(l1s.repeated_facch.pipeline[counter_candidate].buffer[j] != info_address[i])
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2133 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2134 break;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2135 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2136 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2137 if( i != 15 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2138 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2139 repeat=0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2140 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2141 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2142 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2143 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2144 repeat=0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2145 } /* end else buffer empty*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2146 #if TESTMODE
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2147 if(l1_config.repeat_facch_dl_enable != REPEATED_FACCHDL_ENABLE) // repeated FACCH mode is disabled
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2148 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2149 repeat = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2150 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2151 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2152 if(repeat == 0)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2153 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2154 return &info_address[0];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2155 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2156 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2157 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2158 #if (TRACE_TYPE==1) || (TRACE_TYPE==4)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2159 trace_info.facch_dl_repetition_block_count++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2160 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2161 if (((l1s.actual_time.fn - fn_prev ) == 8) || ((l1s.actual_time.fn - fn_prev ) == 9 )) // added debug
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2162 return (API)NULL;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2163 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2164 return &info_address[0];
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2165 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2166 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2167 #endif /* FF_REPEATED_DL_FACCH == 1 */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2168
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2169
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2170
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2171 #if ( FF_REPEATED_DL_FACCH == 1 )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2172 void l1s_store_facch_buffer(T_REPEAT_FACCH *repeated_facch, API *facch_block)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2173 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2174 int i;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2175 UWORD8 counter_candidate;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2176 fn_prev = l1s.actual_time.fn ;// added
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2177 counter_candidate=repeated_facch->counter_candidate;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2178 /* Store the first 12 words after header in the first 23 bytes. */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2179 for(i=0;i<13;i++)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2180 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2181 repeated_facch->pipeline[counter_candidate].buffer[i] = facch_block[i] ;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2182 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2183 repeated_facch->pipeline[counter_candidate].buffer_empty = FALSE;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2184 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2185 #endif /* ( FF_REPEATED_DL_FACCH == 1 ) */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2186
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2187 #if(L1_FF_MULTIBAND == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2188
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2189 #if 0
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2190
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2191 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2192 /* l1_multiband_radio_freq_convert_into_effective_band_id*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2193 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2194 /* Parameters : radio_freq the frequency to convert */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2195 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2196 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2197 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2198 /* Return : the ID of the effectiev band in which */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2199 /* is located radio_freq */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2200 /* Functionality : compare radio_freq with the effective */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2201 /* bands ranges, return efective_band_id */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2202 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2203 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2204 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2205 UWORD8 l1_multiband_radio_freq_convert_into_effective_band_id(UWORD16 radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2206 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2207 UWORD8 effective_band_id = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2208 while( effective_band_id < NB_MAX_EFFECTIVE_SUPPORTED_BANDS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2209 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2210 if ((radio_freq >= multiband_conversion_data[effective_band_id].first_radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2211 && (radio_freq < (multiband_conversion_data[effective_band_id].first_radio_freq + multiband_conversion_data[effective_band_id].nbmax_carrier)) )
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2212
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2213 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2214 return(effective_band_id);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2215 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2216 else
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2217 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2218 effective_band_id ++;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2219 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2220 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2221 if(effective_band_id == NB_MAX_EFFECTIVE_SUPPORTED_BANDS)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2222 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2223 l1_multiband_error_handler(radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2224 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2225 return(effective_band_id);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2226
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2227 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2228 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2229 /* l1_multiband_radio_freq_convert_into_physical_band_id */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2230 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2231 /* Parameters : radio_freq the frequency to convert */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2232 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2233 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2234 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2235 /* Return : the ID of the physical_band band in which*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2236 /* radio_freq is located */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2237 /* Functionality : Identify effective_band_id, the ID of */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2238 /* the effective band in whicb radio_freq is located */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2239 /* then derive physical_band_id from effective_band_id */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2240 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2241
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2242 UWORD8 l1_multiband_radio_freq_convert_into_physical_band_id(UWORD16 radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2243 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2244 UWORD8 effective_band_id, physical_band_id;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2245 effective_band_id = l1_multiband_radio_freq_convert_into_effective_band_id(radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2246 physical_band_id = multiband_conversion_data[effective_band_id].physical_band_id;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2247 return(physical_band_id);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2248 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2249
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2250 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2251 /* l1_multiband_radio_freq_convert_into_operative_radio_freq*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2252 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2253 /* Parameters : radio_freq the frequency to convert */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2254 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2255 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2256 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2257 /* Return : the operative_radio_freq corresponding to radio_freq */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2258 /* Functionality : identify effective_band_id, then */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2259 /* based on the relationships linking the ranges of operative_radio_freq*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2260 /* and radio_freq , derive operative_radio_freq */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2261 /*-------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2262 UWORD16 l1_multiband_radio_freq_convert_into_operative_radio_freq(UWORD16 radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2263 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2264 UWORD8 effective_band_id;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2265 UWORD16 operative_radio_freq;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2266 effective_band_id = l1_multiband_radio_freq_convert_into_effective_band_id(radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2267 operative_radio_freq = radio_freq - multiband_conversion_data[effective_band_id].first_radio_freq + multiband_conversion_data[effective_band_id].first_operative_radio_freq;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2268 return(operative_radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2269 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2270 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2271 /* l1_multiband_map_radio_freq_into_tpu_table */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2272 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2273 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2274 /* radio_freq the parameter to be converted */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2275 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2276 /* Return : the index in table rf_band or rf_tpu_band */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2277 /* corresponding to radio_freq */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2278 /* Functionality :identify physical_band_id */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2279 /* then derive from physical_band_id, tpu_band_index to be*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2280 /* returned a physical band having the ID physical_band_id*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2281 /* is mapped to the table rf_band[physical_band_id ] */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2282 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2283 UWORD8 l1_multiband_map_radio_freq_into_tpu_table(UWORD16 radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2284 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2285 UWORD8 tpu_table_index = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2286 UWORD8 physical_band_id = 0;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2287 physical_band_id = l1_multiband_radio_freq_convert_into_physical_band_id(radio_freq);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2288 /*For Neptune a band having the ID physical_band_id is mapped to multiband_rf_data[physical_band_id], rf_band[physical_band_id]*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2289 /*Consequently the existence of this API for API is not necessary since it is redundant with l1_multiband_radio_freq_convert_into_physical_band_id*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2290 tpu_table_index = physical_band_id;
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2291 return(tpu_table_index);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2292 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2293 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2294 /* l1_multiband_error_handler */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2295 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2296 /* Parameters : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2297 /* radio_freq the channel number received from the L3 */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2298 /* */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2299 /* Return : */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2300 /* corresponding to radio_freq */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2301 /* Functionality :handling error code of MULTIBAND */
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2302 /*--------------------------------------------------------*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2303 void l1_multiband_error_handler(UWORD16 radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2304 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2305 L1_MULTIBAND_TRACE_PARAMS(MULTIBAND_ERROR_TRACE_ID, 1);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2306 #if (OP_L1_STANDALONE == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2307 #if(CODE_VERSION == NOT_SIMULATION)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2308 L1BSP_error_handler();
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2309 #endif /*if(CODE_VERSION == NOT_SIMULATION)*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2310 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2311 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2312 #endif // if 0
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2313 #endif /*if (L1_FF_MULTIBAND == 1)*/
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2314
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2315 #if (OP_L1_STANDALONE == 1)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2316
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2317 UWORD8 l1_get_pwr_mngt()
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2318 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2319 return(l1_config.pwr_mngt);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2320 }
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2321
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2322 #endif
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2323
103
e3faf217ac9e l1_func.c: l1_multiband_error_handler() removed - not applicable to our config
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 102
diff changeset
2324 #if (L1_FF_MULTIBAND == 1)
100
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2325 void l1_multiband_error_handler(UWORD16 radio_freq)
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2326 {
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2327 while(1);
ba58ce852caf l1_func.c: initial import of LoCosto source
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 15
diff changeset
2328 }
103
e3faf217ac9e l1_func.c: l1_multiband_error_handler() removed - not applicable to our config
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents: 102
diff changeset
2329 #endif