annotate src/cs/layer1/tm_cfile/l1tm_async.c @ 234:b870b6a44d31

l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 20 Mar 2017 00:51:20 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
234
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /************* Revision Controle System Header *************
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * GSM Layer 1 software
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * L1TM_ASYNC.C
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 *
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Filename l1tm_async.c
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * Copyright 2003 (C) Texas Instruments
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ************* Revision Controle System Header *************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include "l1_macro.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include "l1_confg.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #if TESTMODE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #define L1TM_ASYNC_C
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #include <string.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #include <stdlib.h>
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 #include "l1_types.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 #include "sys_types.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #include "l1_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 #include "l1_time.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #include "l1_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #include "cust_os.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 #include "l1tm_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #if (AUDIO_TASK == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #include "l1audio_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "l1audio_cust.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include "l1audio_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include "l1audio_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "l1audio_proto.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #if (L1_GTT == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "l1gtt_const.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #include "l1gtt_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #if (L1_MP3 == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "l1mp3_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #if (L1_MIDI == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #include "l1midi_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #include "l1_defty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #include "l1_msgty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #include "l1_varex.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #include "l1_proto.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #include "l1tm_msgty.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #include "l1tm_signa.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #include "l1tm_varex.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #if (L1_STEREOPATH == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #include "sys_dma.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #include "l1audio_stereo.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #include "l1p_cons.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #include "l1p_msgt.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 #include "l1p_deft.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #include "l1p_vare.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 #include "l1p_sign.h"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 /* FreeCalypso TCS211 reconstruction */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 #define ETM_PROTOCOL 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #define ETM_MODE 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 //------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 // Prototypes from external functions
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 //------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 #if (OP_L1_STANDALONE == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 void etm_core(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 void Cust_tm_init(void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 void l1tm_stats_fb_confirm (T_TMODE_FB_CON *prim, WORD32 test);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 void l1tm_stats_sb_confirm (T_TMODE_NCELL_SYNC_IND *prim, WORD32 test);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 void l1tm_stats_bcch_confirm (T_TMODE_BCCHS_CON *prim);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 void l1tm_stats_tch_confirm (T_TMODE_TCH_INFO *prim);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 void l1tm_stats_mon_confirm (T_TMODE_FB_CON *prim);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 void l1tm_stats_full_list_meas_confirm(T_TMODE_RXLEV_REQ *prim);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 BOOL l1tm_is_rx_counter_done (void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 void l1tm_reset_rx_state (void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 void l1tm_rf_param_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 void l1tm_rf_param_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 void l1tm_rf_table_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 void l1tm_rf_table_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 void l1tm_rx_param_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 void l1tm_rx_param_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 void l1tm_tx_param_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 void l1tm_tx_param_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 void l1tm_tx_template_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 void l1tm_tx_template_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 void l1tm_special_param_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 void l1tm_special_param_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 void l1tm_special_table_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 void l1tm_special_table_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 void l1tm_special_enable (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 void l1tm_rf_enable (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 void l1tm_stats_config_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 void l1tm_stats_config_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 void l1tm_statistics (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 void l1tm_stats_read (T_TM_RETURN *tm_return, WORD16 type, UWORD16 bitmask);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 #if (L1_DRP == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 void l1tm_drp_sw_write(T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 void l1a_tmode_send_ul_msg (T_TM_RETURN *tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 UWORD16 l1tm_convert_arfcn2l1ch(UWORD16 arfcn, UWORD8 *error_flag);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 void l1tm_fill_burst (UWORD16 pattern, UWORD16 *TM_ul_data);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 void l1tm_initialize_var (void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 UWORD16 Convert_l1_radio_freq (SYS_UWORD16 radio_freq);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 void tm_transmit(T_TM_RETURN *tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #if (CODE_VERSION != SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 void l1tm_tpu_table_write (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 void l1tm_tpu_table_read (T_TESTMODE_PRIM *prim, T_TM_RETURN *tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 T_TRANSFER_SET *l1pa_get_free_transfer_set (UWORD8 new_tbf);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 T_CRES_LIST_PARAM *l1pa_get_free_cres_list_set(void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 void l1tm_stats_pdtch_confirm (T_TMODE_PDTCH_INFO *prim);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 #if (L1_TPU_DEV == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 void l1tm_flexi_tpu_table_read(T_TESTMODE_PRIM * prim, T_TM_RETURN * tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 void l1tm_flexi_tpu_table_write(T_TESTMODE_PRIM * prim, T_TM_RETURN * tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 //Flexi ABB Delay
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 void l1tm_flexi_abb_read(T_TESTMODE_PRIM * prim, T_TM_RETURN * tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 void l1tm_flexi_abb_write(T_TESTMODE_PRIM * prim, T_TM_RETURN * tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 // DRP Calibration
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 void l1tm_drp_calib_read(T_TESTMODE_PRIM * prim, T_TM_RETURN * tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 void l1tm_drp_calib_write(T_TESTMODE_PRIM * prim, T_TM_RETURN * tm_return);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 // Prototypes from internal functions
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 //------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 void l1a_tmode_fb0_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 void l1a_tmode_fb1_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 void l1a_tmode_sb_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 void l1a_tmode_bcch_reading_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 void l1a_tmode_dedicated_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 void l1a_tmode_access_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 void l1a_tmode_full_list_meas_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 void l1a_tmode_transfer_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 #if ((L1_STEREOPATH == 1) && (OP_L1_STANDALONE == 1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 void l1a_tmode_audio_stereopath_process(xSignalHeaderRec *msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 extern void l1tm_stereopath_DMA_handler(SYS_UWORD16 dma_status);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 extern void l1tm_stereopath_fill_buffer(void* buffer_address);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 extern UWORD16 l1tm_stereopath_get_pattern(UWORD16 sampling_freq, UWORD16 sin_freq_left,UWORD16 sin_freq_right, UWORD8 data_type);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 extern void l1a_audio_send_confirmation(UWORD32 SignalCode);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 extern void l1_trigger_api_interrupt(void);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 #if ( ANLG_FAM == 11)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 //Add the two new sampling frequencies in the test mode for Locosto - 12khz and 24 khz
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 const UWORD16 l1tm_stereopath_sampling_freqs[9] = {8000,11025,12000,16000,22050,24000,32000,44100,48000};
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 const UWORD16 l1tm_stereopath_sampling_freqs[8] = {48000,0,44100,32000,22050,16000,11025,8000};
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 const UWORD16 l1tm_stereopath_sin_freqs[4][2] = {{0,0},
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 {100,1000},
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 {1000,10000},
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 {1000,1000}}; // 4 different pattern of two freqs
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 const UWORD16 l1tm_stereopath_buffer[(480+1)*2];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 T_STP_DRV_MCU_DSP *stp_drv_ndb = (T_STP_DRV_MCU_DSP *)API_address_dsp2mcu(C_STP_DRV_API_BASE_ADDRESS);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 #if (CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 #pragma DATA_SECTION(TM_stereo_buf,".TM_stereo_buf");
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 #if (CHIPSET == 15)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 #pragma DATA_SECTION(TM_stereo_buf_ext_mem, ".TM_stereo_buf_ext_mem");
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 volatile WORD16 TM_stereo_buf[STEREOPATH_MAX_NB_OF_FRAMES*2];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 #if (CHIPSET == 15)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 volatile WORD16 TM_stereo_buf_ext_mem[STEREOPATH_MAX_NB_OF_FRAMES*2];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 #endif // ((L1_STEREOPATH == 1) && (OP_L1_STANDALONE == 1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 /***********************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 /* TESTMODE 3.X */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 /***********************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 // omaps00090550 static UWORD8 tx_param_band=0; // used in tx_param_write/read; default is GSM900
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 /*-----------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 /* l1a_tmode() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 /*-----------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 /* Description : State machine controls TestMode processes */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 /* Starting messages: TMODE_BCCH_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 /* TMODE_PM_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 /* TMODE_FB0_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 /* TMODE_FB1_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 /* TMODE_SB_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 /* Result messages (input): L1_TMODE_MEAS_REPORT */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 /* L1_SB_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 /* L1_BCCHS_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 /* Result messages (output): TMODE_PM_CON */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 /* MPH5_NCELL_SB_IND */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 /* Reset messages (input): MPH5_STOP_BCCH_READING */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 /*-----------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 void l1a_tmode(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 T_TESTMODE_PRIM *prim;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 T_TM_RETURN tm_ret;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 int SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 #if (OP_WCP==1) && (OP_L1_STANDALONE!=1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 // Security check for Operating System platforms (open platforms)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 // We forbid TESTMODE if the phone is running with an OS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 // so users can not invoke TESTMODE for malicious goals
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 extern unsigned long GC_RunningWithOs();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 if(GC_RunningWithOs())
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 if (SignalCode == TESTMODE_PRIM)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 // use CID to decide what to do
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 prim = (T_TESTMODE_PRIM *)(msg->SigP);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 // fill in the cid also named fid in the ETM protocol
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 tm_ret.cid = prim->cid;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 switch (prim->cid)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 case TM_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 l1tm_initialize(&tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 case TM_MODE_SET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 l1tm_mode_set(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 case VERSION_GET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 l1tm_version_get(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 case RF_ENABLE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 l1tm_rf_enable(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 case STATS_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 l1tm_statistics(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 case STATS_CONFIG_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 l1tm_stats_config_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 case STATS_CONFIG_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 l1tm_stats_config_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 case RF_PARAM_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 l1tm_rf_param_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 case RF_PARAM_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 l1tm_rf_param_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 case RF_TABLE_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 l1tm_rf_table_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 case RF_TABLE_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 l1tm_rf_table_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 case RX_PARAM_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 l1tm_rx_param_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 case RX_PARAM_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 l1tm_rx_param_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 case TX_PARAM_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 l1tm_tx_param_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 case TX_PARAM_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 l1tm_tx_param_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 case TX_TEMPLATE_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 l1tm_tx_template_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 case TX_TEMPLATE_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 l1tm_tx_template_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 case MEM_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 l1tm_mem_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 case MEM_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 l1tm_mem_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 case CODEC_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 l1tm_codec_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 case CODEC_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 l1tm_codec_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 case MISC_PARAM_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 l1tm_misc_param_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 case MISC_PARAM_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 l1tm_misc_param_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 case MISC_ENABLE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 l1tm_misc_enable(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 case SPECIAL_PARAM_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 l1tm_special_param_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 case SPECIAL_PARAM_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 l1tm_special_param_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 case SPECIAL_TABLE_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 l1tm_special_table_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 case SPECIAL_TABLE_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 l1tm_special_table_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 case SPECIAL_ENABLE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 l1tm_special_enable(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 #if (L1_DRP == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 case DRP_SW_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 l1tm_drp_sw_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 #if (CODE_VERSION != SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 case TPU_TABLE_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 l1tm_tpu_table_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 case TPU_TABLE_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 l1tm_tpu_table_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 case TM_FFS:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 l1tm_ffs(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 #if(L1_TPU_DEV == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 case FLEXI_TPU_TABLE_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 l1tm_flexi_tpu_table_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 case FLEXI_TPU_TABLE_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 l1tm_flexi_tpu_table_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 case FLEXI_ABB_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 l1tm_flexi_abb_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 case FLEXI_ABB_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 l1tm_flexi_abb_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 #if 0 //(CODE_VERSION != SIMULATION) // FreeCalypso TCS211 reconstruction
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 case DRP_CALIB_WRITE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 l1tm_drp_calib_write(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 case DRP_CALIB_READ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 l1tm_drp_calib_read(prim, &tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 break; // TBD for Future Use
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 #endif // CODE_VERSION
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 #if (OP_L1_STANDALONE == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 etm_core(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 tm_ret.size = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 #if (ETM_PROTOCOL == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 tm_ret.status = -ETM_BADOP;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 tm_ret.status = E_BADCID;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 #endif // OP_L1_STANDALONE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 } // end of switch
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 tm_transmit(&tm_ret);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 } //end of TESTMODE_PRIM
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 else if ( ((SignalCode <= TMODE_PDTCH_INFO) && (SignalCode >= TMODE_RXLEV_REQ)) || (l1tm.tm_msg_received == TRUE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 else if ( ((SignalCode <= TMODE_TCH_INFO) && (SignalCode >= TMODE_RXLEV_REQ)) || (l1tm.tm_msg_received == TRUE) )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 static BOOL tm_init = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 if (! tm_init)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 Cust_tm_init();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 l1tm_initialize_var();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 l1_config.TestMode = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 tm_init=TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 l1a_tmode_fb0_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 l1a_tmode_fb1_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 l1a_tmode_sb_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 l1a_tmode_bcch_reading_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 l1a_tmode_dedicated_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 l1a_tmode_access_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 l1a_tmode_full_list_meas_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 l1a_tmode_transfer_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 #if ((L1_STEREOPATH == 1) && (OP_L1_STANDALONE == 1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 l1a_tmode_audio_stereopath_process(msg);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 } //end of not TESTMODE_PRIM
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 } // end of procedure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 /* l1a_tmode_fb0_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 /* Description : This state machine handles the 1st */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 /* synchronization with the network in Test Mode. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 /* Starting messages: TMODE_FB0_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 /* Result messages (input): L1C_FB_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 void l1a_tmode_fb0_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 RESET = 0, // Reset state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 WAIT_INIT = 1, // Initial state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 SET_FS_FB_MODE0 = 2, // First Synchro, Setting of 1st FB mode 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 WAIT_FS_FB_MODE0 = 3 // First Synchro, 1st FB mode 0 state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 UWORD8 *state = &l1a.state[TMODE_FB0];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 BOOL done = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 #if (VCXO_ALGO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 #define FS_FB_MODE0_CENTER 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 #define FS_FB_MODE0_MAX 2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 #define FS_FB_MODE0_MIN 3
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 static WORD16 state_vcxo;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 static WORD16 static_attempt_counter;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 #if (VCXO_ALGO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 if(l1_config.params.eeprom_afc == 0) {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 // Go to the initial VCXO AFC_INIT algorithm state
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 state_vcxo = FS_FB_MODE0_CENTER;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 static_attempt_counter = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 // Reset tasks used in the process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 l1a_l1s_com.l1s_en_task[FBNEW] = TASK_DISABLED; // in tmode, not ALR
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 if (SignalCode == TMODE_FB0_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 l1tm_reset_rx_state();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 // Set task semaphores.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 l1a_l1s_com.task_param[FBNEW] = SEMAPHORE_SET; // Set "parameter synchro semaphore for FB task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 l1a_l1s_com.task_param[NSYNC] = SEMAPHORE_SET; // Set "parameter synchro semaphore for FB task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 l1a_l1s_com.nsync.current_list_size = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 // Downlink stuff timeslot is 0 (default in CS)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 l1a_l1s_com.dl_tn = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 // Set arfcn
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 l1a_l1s_com.nsync.list[0].radio_freq =l1_config.tmode.rf_params.bcch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 //Set timing validity for FB no a priori info
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 l1a_l1s_com.nsync.list[0].timing_validity = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 // Reset offset and time alignment
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 l1a_l1s_com.nsync.list[0].fn_offset = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 l1a_l1s_com.nsync.list[0].time_alignmt = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 // Set functional mode.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 l1a_l1s_com.mode = CS_MODE; //Needs to be set for l1ddsp_load_monit_task()
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 // Wideband search for FB detection.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 l1a_l1s_com.fb_mode = FB_MODE_0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 // Enable SYNCHRO task to cleanup the MFTAB.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 l1a_l1s_com.l1s_en_task[SYNCHRO] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 // Initialize AFC control function.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 #if AFC_ALGO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 if (l1_config.afc_enable) { // l1_config.TestMode MUST == 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 #if (VCXO_ALGO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 // The TM rfpw 10 parameter has a different meaning when using
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 // a VCXO. Instead of containing the AFC used for the FB0, which
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 // is stored in the rftw 9 table now, it tells the TM which "state" must
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 // be used for the VCXO algorithm
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 //
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 switch(l1_config.params.eeprom_afc) {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 case 0: // Full VCXO algo
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 // The AFC_INIT state is controlled by the state machine
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 // Reset attempt counter
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 static_attempt_counter = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 state_vcxo = FS_FB_MODE0_CENTER;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 case FS_FB_MODE0_CENTER * 8:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 state_vcxo = FS_FB_MODE0_CENTER;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 case FS_FB_MODE0_MIN * 8:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 state_vcxo = FS_FB_MODE0_MIN;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 case FS_FB_MODE0_MAX * 8:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 state_vcxo = FS_FB_MODE0_MAX;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 state_vcxo = FS_FB_MODE0_CENTER;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 // Step in state machine
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 *state = SET_FS_FB_MODE0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 case SET_FS_FB_MODE0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 *state = WAIT_FS_FB_MODE0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 // Enable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 l1a_l1s_com.nsync.list[0].status = NSYNC_PENDING; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 // Enable NSYNC task for FB detection mode 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 if (l1_config.afc_enable) {// l1_config.TestMode MUST == 1
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 #if (VCXO_ALGO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 switch(state_vcxo) {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 case FS_FB_MODE0_CENTER:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 l1s.afc = l1ctl_afc(AFC_INIT_CENTER, &l1s.afc_frame_count, NULL, 0, l1a_l1s_com.nsync.list[0].radio_freq,l1a_l1s_com.mode);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 case FS_FB_MODE0_MIN:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 l1s.afc = l1ctl_afc(AFC_INIT_MIN, &l1s.afc_frame_count, NULL, 0, l1a_l1s_com.nsync.list[0].radio_freq,l1a_l1s_com.mode);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 case FS_FB_MODE0_MAX:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 l1s.afc = l1ctl_afc(AFC_INIT_MAX, &l1s.afc_frame_count, NULL, 0, l1a_l1s_com.nsync.list[0].radio_freq,l1a_l1s_com.mode);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 l1s.afc = l1ctl_afc(AFC_INIT_CENTER, &l1s.afc_frame_count, NULL, 0, l1a_l1s_com.nsync.list[0].radio_freq,l1a_l1s_com.mode);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 l1s.afc = l1ctl_afc(AFC_INIT, &l1s.afc_frame_count, l1_config.params.eeprom_afc, 0, l1a_l1s_com.nsync.list[0].radio_freq);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 } // (l1_config.afc_enable) is TRUE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 case WAIT_FS_FB_MODE0:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609 if(SignalCode == L1C_FB_INFO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 // Frequency Burst acquisition result.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 //------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 BOOL fb_found = ((T_L1C_FB_INFO *) (msg->SigP))->fb_flag;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 if (fb_found)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617 // We consider the result of this successfull FB search attempt
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 // as a good a-priori information for next attempt.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 // "fn_offset" is reversed to satisfy its definition,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 // fn_offset = Fn_neigh - Fn_serving.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 l1a_l1s_com.nsync.list[0].timing_validity = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 l1a_l1s_com.nsync.list[0].fn_offset = 51 - l1a_l1s_com.nsync.list[0].fn_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 #if (VCXO_ALGO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 if(l1_config.params.eeprom_afc == 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 //- Full VCXO algo
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 // Increment "static_attempt_counter".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 static_attempt_counter++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 if(static_attempt_counter < 4)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 // Max number of attemps not reached yet...
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 // try again with the same VCXO state
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 *state = SET_FS_FB_MODE0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 // Do not accumulate the statistics yet, just try again
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 // Max number of attempt is reached... go back to 1st FB mode 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 static_attempt_counter = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 // Go to the next FS_FB_MODE0_CENTER state (CENTER -> MAX -> MIN)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 // After MIN go to CENTER again, which means that the attempt failed
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 switch(state_vcxo)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651 case FS_FB_MODE0_CENTER:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 state_vcxo = FS_FB_MODE0_MAX;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654 case FS_FB_MODE0_MAX:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 state_vcxo = FS_FB_MODE0_MIN;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 default: // i.e. case FS_FB_MODE0_MAX:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658 // The algorithm tried all the AFC_INIT values (CENTER, MAX & MIN)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 // but did not detect an FB in any of the attemps for these values:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 // The current attempt FAILED => Continue and accumulate the statistics
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661 state_vcxo = FS_FB_MODE0_CENTER;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665 if (state_vcxo != FS_FB_MODE0_CENTER)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 *state = SET_FS_FB_MODE0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 // Do not accumulate the statistics yet, just try again with the new
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 // selected state_vcxo
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670 break; // This breaks from the switch(*state), and thus re-loops thanks to the while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 } // (state_vcxo != FS_FB_MODE0_CENTER)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672 } // (static_attempt_counter >= 4)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 } // (l1_config.params.eeprom_afc != 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 } // (fb_found) is FALSE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 #if (VCXO_ALGO == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 if(l1_config.params.eeprom_afc == 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680 // If we got this far, the attempt ended (with a fail or a success)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 // So we can go back to the initial state
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 state_vcxo = FS_FB_MODE0_CENTER;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 //accumulate FB stats
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 l1tm_stats_fb_confirm( (T_TMODE_FB_CON*) ((T_L1C_FB_INFO *) (msg->SigP)), 0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 // Loop counter expired, stop the test
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698 break; // break out of switch
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 *state = SET_FS_FB_MODE0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 else if (SignalCode == TMODE_STOP_RX_TX)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 // Stop SYNC mode message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 //--------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 /* l1a_tmode_fb1_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 /* Description : This state machine handles the 1st */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 /* synchronization with the network in Test Mode. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 /* Starting messages: TMODE_FB1_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 /* Result messages (input): L1C_FB_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 void l1a_tmode_fb1_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742 RESET = 0, // Reset state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 WAIT_INIT = 1, // Initial state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 SET_FS_FB_MODE1 = 2, // First Synchro, Setting of 1st FB mode 1.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 WAIT_FS_FB_MODE1 = 3 // First Synchro, FB mode 1 state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 UWORD8 *state = &l1a.state[TMODE_FB1];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750 BOOL done = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 // Reset of tasks used in this process is carried out in WAIT_FS_FBMODE1 state
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764 // Otherwise we would possibly reset the task set by l1a_tmode_fb0_process()
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770 if (SignalCode == TMODE_FB1_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773 l1tm_reset_rx_state();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779 // Set task semaphores.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 l1a_l1s_com.task_param[FBNEW] = SEMAPHORE_SET; // Set "parameter synchro semaphore for FB task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781 l1a_l1s_com.task_param[NSYNC] = SEMAPHORE_SET; // Set "parameter synchro semaphore for FB task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 // Downlink stuff timeslot is 0 (default in CS)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784 l1a_l1s_com.dl_tn = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786 // Set arfcn
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 l1a_l1s_com.nsync.list[0].radio_freq =l1_config.tmode.rf_params.bcch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789 // Set functional mode.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790 l1a_l1s_com.mode = CS_MODE; //Needs to be set for l1ddsp_load_monit_task()
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 // Set FB detection mode.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 l1a_l1s_com.fb_mode = FB_MODE_1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 // Step in state machine
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796 *state = SET_FS_FB_MODE1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806 case SET_FS_FB_MODE1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 *state = WAIT_FS_FB_MODE1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 // Enable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 l1a_l1s_com.nsync.list[0].status = NSYNC_PENDING;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814 // Enable NSYNC task for FB detection mode 1.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822 case WAIT_FS_FB_MODE1:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824 // Use incoming message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825 //----------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826 if(SignalCode == L1C_FB_INFO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828 //accumulate FB stats
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829 l1tm_stats_fb_confirm( (T_TMODE_FB_CON*) ((T_L1C_FB_INFO *) (msg->SigP)), 0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
831 // increment counter
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
832 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
833
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
834 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
835 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
836 // Loop counter expired, stop the test
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
837 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
838
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
839 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
840 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
841 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
842
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
843 // Reset tasks used in the process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
844 l1a_l1s_com.l1s_en_task[FBNEW] = TASK_DISABLED; // in tmode, not ALR
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
845 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
846
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
847 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
848 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
849
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
850 break; // break out of switch
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
851 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
852
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
853 *state = SET_FS_FB_MODE1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
854 } // end if L1C_FB_INFO
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
855 else if (SignalCode == TMODE_STOP_RX_TX)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
856 // Stop SYNC mode message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
857 //--------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
858 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
859 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
860 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
861 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
862
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
863 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
864 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
865
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
866 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
867 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
868 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
869 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
870 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
871 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
872 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
873 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
874 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
875 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
876 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
877 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
878 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
879 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
880
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
881
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
882 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
883 /* l1a_tmode_sb_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
884 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
885 /* Description : This state machine handles the 1st */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
886 /* synchronization with the network in Test Mode. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
887 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
888 /* Starting messages: TMODE_SB_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
889 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
890 /* Result messages (input): L1C_SB_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
891 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
892 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
893 void l1a_tmode_sb_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
894 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
895 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
896 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
897 RESET = 0, // Reset state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
898 WAIT_INIT = 1, // Initial state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
899 SET_FS_SB = 2, // Set SB
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
900 WAIT_FS_SB = 3, // Wait for SB result
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
901 NEW_SYNCHRO = 4 // Camp on cell
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
902 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
903
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
904 UWORD8 *state = &l1a.state[TMODE_SB];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
905 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
906 BOOL done = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
907
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
908 static UWORD8 static_bsic;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
909 static UWORD32 static_fn_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
910 static UWORD32 static_time_alignmt;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
911
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
912 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
913 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
914 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
915 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
916 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
917 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
918 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
919 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
920 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
921
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
922 // Reset of tasks used in this process is carried out in WAIT_FS_SB state
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
923 // Otherwise we would possibly reset the NSYNC task set by l1a_tmode_fb0_process()
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
924 // or l1a_tmode_fb1_process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
925 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
926 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
927
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
928 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
929 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
930 if (SignalCode == TMODE_SB_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
931 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
932 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
933 l1tm_reset_rx_state();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
934 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
935
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
936 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
937 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
938
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
939 // Set arfcn
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
940 l1a_l1s_com.nsync.list[0].radio_freq =l1_config.tmode.rf_params.bcch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
941
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
942 // Enable NSYNC task for SB detection (SB2).
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
943 #if ((REL99 == 1) && ((FF_BHO == 1) || (FF_RTD == 1)))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
944 l1a_l1s_com.nsync.list[0].timing_validity = SB_ACQUISITION_PHASE ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
945 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
946 l1a_l1s_com.nsync.list[0].timing_validity = 3;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
947 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
948
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
949 // Step in state machine
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
950 *state = SET_FS_SB;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
951 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
952 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
953 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
954 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
955 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
956 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
957 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
958 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
959
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
960 case SET_FS_SB:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
961 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
962 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
963 *state = WAIT_FS_SB;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
964
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
965 // Enable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
966 l1a_l1s_com.nsync.list[0].status = NSYNC_PENDING;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
967
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
968 // Enable NSYNC task for SB detection.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
969 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
970
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
971 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
972 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
973 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
974 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
975
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
976 case WAIT_FS_SB:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
977 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
978 // Use incoming message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
979 //----------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
980 if(SignalCode == L1C_SB_INFO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
981 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
982 UWORD8 sb_found = ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->sb_flag;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
983 UWORD8 bsic = ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->bsic;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
984
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
985 if(sb_found == TRUE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
986 // SB detection is a success...
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
987 //-----------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
988 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
989 // Save Results.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
990 static_bsic = ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->bsic;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
991 static_fn_offset = ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->fn_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
992 static_time_alignmt = ((T_MPHC_NCELL_SYNC_IND *)(msg->SigP))->time_alignmt;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
993 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
994
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
995 l1tm_stats_sb_confirm( (T_TMODE_NCELL_SYNC_IND*) ((T_MPHC_NCELL_SYNC_IND*)(msg->SigP)), 0);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
996
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
997 // if just an SB test, increment counter
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
998 // if not done, just stay in this state, schedule a new attempt
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
999 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1000
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1001 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1002 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1003 // step in state machine
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1004 *state = NEW_SYNCHRO;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1005
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1006 // Reset NSYNC task and SB2 task enable flags.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1007 l1a_l1s_com.l1s_en_task[SB2] = TASK_DISABLED; // in tmode, not ALR
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1008 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1009
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1010 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1011 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1012
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1013 // Save results.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1014 l1a_l1s_com.nsync.list[0].fn_offset = static_fn_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1015 l1a_l1s_com.nsync.list[0].time_alignmt = static_time_alignmt;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1016
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1017 // Correct "ntdma" and "time_alignment" to shift 20 bit to the
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1018 // future for Normal Burst reading tasks.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1019 l1a_add_time_for_nb(&l1a_l1s_com.nsync.list[0].time_alignmt,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1020 &l1a_l1s_com.nsync.list[0].fn_offset);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1021
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1022 break; // break out of switch
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1023 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1024 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1025 // Make a new SB attempt
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1026 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1027 l1a_l1s_com.nsync.list[0].status = NSYNC_PENDING;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1028
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1029 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1030 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1031 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1032 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1033 else if (SignalCode == TMODE_STOP_RX_TX)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1034 // Stop SYNC mode message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1035 //--------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1036 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1037 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1038 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1039 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1040
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1041 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1042 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1043
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1044 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1045 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1046 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1047 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1048 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1049 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1050 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1051 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1052 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1053 }//End Case WAIT_FS_SB
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1054 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1055
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1056 case NEW_SYNCHRO:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1057 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1058 // Reset the Neighbor Cell information structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1059 l1a_reset_cell_info(&(l1a_l1s_com.Scell_info));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1060
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1061 // STILL SAVING TSC WITHIN BSIC !!!!!!!!!!!!!!!!
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1062
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1063 // Download ARFCN, timing information and bitmap from the command message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1064 l1a_l1s_com.Scell_info.radio_freq = l1_config.tmode.rf_params.bcch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1065 l1a_l1s_com.Scell_info.bsic = static_bsic;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1066 l1a_l1s_com.Scell_info.time_alignmt = l1a_l1s_com.nsync.list[0].time_alignmt;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1067 l1a_l1s_com.Scell_info.fn_offset = l1a_l1s_com.nsync.list[0].fn_offset;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1068
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1069 // tn_difference -> loaded with the number of timeslot to shift.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1070 // dl_tn -> loaded with the new timeslot.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1071 l1a_l1s_com.tn_difference = 0 - l1a_l1s_com.dl_tn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1072 l1a_l1s_com.dl_tn = 0; // Camping on timeslot 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1073
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1074 // Layer 1 internal mode is set to IDLE MODE.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1075 l1a_l1s_com.mode = I_MODE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1076
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1077 // Set flag for toa init.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1078 #if (TOA_ALGO != 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1079 l1a_l1s_com.toa_reset = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1080 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1081
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1082 // Enable SYNCHRO tasks.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1083 l1a_l1s_com.l1s_en_task[SYNCHRO] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1084
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1085 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1086 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1087
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1088 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1089 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1090 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1091 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1092 break; // break out of switch
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1093 // omaps00090550 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1094 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1095 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1096 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1097
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1098 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1099 /* l1a_tmode_bcch_reading_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1100 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1101 /* Description : This state machine handles serving cell */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1102 /* BCCH reading in Test Mode. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1103 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1104 /* This process happens for a TestMode BCCH test, after */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1105 /* completing FB's and SB's in */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1106 /* l1a_tmode_initial_network_sync_process, */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1107 /* and then passing through l1a_tmode_cres_process, */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1108 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1109 /* OR */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1110 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1111 /* it can also happen for a TestMode TCH with synch */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1112 /* test where, FB's and SB's have already been detected, */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1113 /* and 4 BCCH's will be received before moving to the */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1114 /* TCH and dedicated mode. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1115 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1116 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1117 /* Starting messages: TMODE_SCELL_NBCCH_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1118 /* ------------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1119 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1120 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1121 /* Result messages (input): L1C_BCCHS_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1122 /* ------------------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1123 /* System information data block from L1S. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1124 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1125 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1126 /* Reset messages (input): TMODE_STOP_SCELL_BCCH_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1127 /* ----------------------- */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1128 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1129 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1130 void l1a_tmode_bcch_reading_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1131 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1132 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1133 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1134 RESET = 0,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1135 WAIT_INIT = 1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1136 NBCCHS_CONFIG = 2,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1137 WAIT_BCCHS_RESULT = 3
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1138 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1139
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1140 UWORD8 *state = &l1a.state[TMODE_BCCH];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1141 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1142 BOOL done = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1143
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1144 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1145 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1146 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1147 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1148 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1149 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1150 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1151 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1152 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1153
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1154 // Reset CS_MEAS process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1155 l1a_l1s_com.l1s_en_task[NBCCHS] = TASK_DISABLED; // Clear NBCCHS task enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1156 //l1a_l1s_com.l1s_en_task[EBCCHS] = TASK_DISABLED; // Clear EBCCHS task enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1157 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1158 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1159
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1160 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1161 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1162 if(SignalCode == TMODE_SCELL_NBCCH_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1163 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1164
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1165 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1166 l1tm_reset_rx_state();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1167 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1168
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1169 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1170 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1171
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1172 // Request to read Normal BCCH from serving cell.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1173 l1a_l1s_com.Scell_info.radio_freq = l1_config.tmode.rf_params.bcch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1174
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1175 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1176 *state = NBCCHS_CONFIG;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1177 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1178
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1179 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1180 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1181 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1182 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1183 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1184 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1185 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1186 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1187 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1188
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1189 case NBCCHS_CONFIG:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1190 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1191 UWORD8 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1192
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1193 // Set semaphores for Normal Serving BCCH reading task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1194 l1a_l1s_com.task_param[NBCCHS] = SEMAPHORE_SET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1195
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1196 // Download message content.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1197 //--------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1198 l1a_l1s_com.nbcchs.schedule_array_size = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1199
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1200 for(i=0;i<l1a_l1s_com.nbcchs.schedule_array_size;i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1201 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1202 l1a_l1s_com.nbcchs.schedule_array[i].modulus = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1203 l1a_l1s_com.nbcchs.schedule_array[i].relative_position = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1204 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1205
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1206 // Enable NBCCHS task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1207 l1a_l1s_com.l1s_en_task[NBCCHS] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1208
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1209 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1210 *state = WAIT_BCCHS_RESULT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1211
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1212 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1213 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1214 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1215 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1216
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1217 case WAIT_BCCHS_RESULT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1218 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1219 if(SignalCode == L1C_BCCHS_INFO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1220 // Serving cell BCCH reading result.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1221 //----------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1222 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1223 // this function takes care of loops management
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1224 l1tm_stats_bcch_confirm( (T_TMODE_BCCHS_CON*) ((T_MPHC_DATA_IND *)(msg->SigP)) );
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1225
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1226 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1227
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1228 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1229 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1230 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1231 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1232 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1233
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1234 // This process must be reset.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1235 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1236
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1237 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1238 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1239 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1240 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1241 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1242 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1243 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1244 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1245 else if (SignalCode == TMODE_STOP_RX_TX)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1246 // Stop BCCH mode message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1247 //--------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1248 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1249 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1250 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1251 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1252
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1253 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1254 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1255
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1256 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1257 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1258 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1259 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1260 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1261 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1262 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1263 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1264 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1265 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1266 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1267 } // end of "switch".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1268 } // end of "while"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1269 } // end of procedure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1270
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1271 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1272 /* l1a_tmode_dedicated_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1273 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1274 /* Description : This state machine handles the dedicated*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1275 /* mode setup in Test Mode (L1A side). */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1276 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1277 /* Starting messages: TMODE_IMMED_ASSIGN_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1278 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1279 /* Subsequent messages: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1280 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1281 /* Result messages (input): L1C_DEDIC_DONE */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1282 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1283 /* Result messages (output): */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1284 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1285 /* Reset messages (input): TMODE_STOP_RX_TX */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1286 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1287 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1288 void l1a_tmode_dedicated_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1289 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1290 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1291 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1292 RESET = 0,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1293 WAIT_INIT = 1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1294 WAIT_MSG = 2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1295 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1296
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1297 T_DEDIC_SET *free_set;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1298 UWORD8 *state = &l1a.state[TMODE_DEDICATED];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1299 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1300
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1301 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1302 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1303 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1304 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1305 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1306 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1307 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1308 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1309 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1310
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1311 l1a_l1s_com.l1s_en_task[FB26] = TASK_DISABLED; // Reset FB26 task enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1312
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1313 // Reset D_NMEAS process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1314 l1a_l1s_com.l1s_en_meas &= D_BAMS_MEAS_MASK; // Reset D_BAMS Measurement enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1315 l1a.l1a_en_meas[D_NMEAS] &= D_BAMS_MEAS_MASK;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1316
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1317 // Reset L1S dedicated mode manager trigger.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1318 l1a_l1s_com.dedic_set.SignalCode = NULL;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1319 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1320 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1321
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1322 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1323 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1324 switch(SignalCode)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1325 // switch on input message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1326 //-------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1327 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1328 case TMODE_IMMED_ASSIGN_REQ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1329 // Immediate assignement message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1330 //-------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1331 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1332 UWORD8 maio_bef_sti;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1333 #if(L1_FF_MULTIBAND == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1334 UWORD8 operative_radio_freq;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1335 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1336
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1337 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1338 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1339
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1340 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1341 l1_config.tmode.rf_params.down_up = ((T_TMODE_IMMED_ASSIGN_REQ*)(msg->SigP))->ul_dl;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1342 l1tm_reset_rx_state();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1343 l1_config.tmode.stats_config.num_loops = 26; // 0 actually means infinite
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1344 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1345
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1346 // save this info for later
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1347 if (l1_config.tmode.rf_params.down_up == (TMODE_DOWNLINK|TMODE_UPLINK) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1348 l1_config.tmode.rf_params.mon_tasks == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1349 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1350 l1a_l1s_com.nsync.list[0].radio_freq = l1_config.tmode.rf_params.mon_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1351 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1352
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1353 // Get Ptr to the free dedicated parameter set.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1354 // All important fields are initialised.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1355 free_set = l1a_get_free_dedic_set();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1356
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1357 // Save given dedicated channel parameters from MPHC_IMMED_ASSIGN_REQ msg.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1358
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1359 //========================================================================
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1360
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1361 free_set->chan1.desc.chan_sel.h = 0; // no hopping
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1362
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1363 free_set->chan1.desc.chan_sel.rf_channel.single_rf.radio_freq = l1_config.tmode.rf_params.tch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1364 //DON'T: union with radio_freq
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1365 //free_set->chan1.desc.chan_sel.rf_channel.hopping_rf.maio=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1366 //free_set->chan1.desc.chan_sel.rf_channel.hopping_rf.hsn=0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1367
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1368 free_set->chan1.desc.channel_type = l1_config.tmode.rf_params.channel_type;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1369 free_set->chan1.desc.subchannel = l1_config.tmode.rf_params.subchannel;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1370 free_set->chan1.desc.timeslot_no = l1_config.tmode.rx_params.slot_num;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1371 free_set->chan1.desc.tsc = l1_config.tmode.tx_params.tsc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1372
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1373 //Set the loopback mode
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1374 // 0: No loopback, 1: Loop A ... 6: Loop F
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1375 if(l1_config.tmode.tx_params.burst_data >= 5 && l1_config.tmode.tx_params.burst_data <= 10 &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1376 l1_config.tmode.rf_params.down_up == (TMODE_DOWNLINK | TMODE_UPLINK))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1377 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1378 free_set->chan1.tch_loop = l1_config.tmode.tx_params.burst_data - 4;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1379
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1380 // For loop back the channel mode needs to be set to TCH/FS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1381 free_set->chan1.mode = TCH_FS_MODE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1382 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1383 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1384 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1385 free_set->chan1.tch_loop = 0; // no loopback
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1386
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1387 // Rem1: Mode is forced to Signalling Only.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1388 if (l1_config.tmode.rf_params.channel_type == TCH_F)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1389 free_set->chan1.mode = TCH_FS_MODE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1390 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1391 free_set->chan1.mode = SIG_ONLY_MODE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1392
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1393 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1394 /*
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1395 ;--------------------------------------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1396 ; channel_desc_1 :
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1397 ; chan_sel : ( h=FALSE, arfcn=5a )
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1398 ; channel_type = 1 (TCHFS)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1399 ; subchannel = 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1400 ; timeslot_no = 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1401 ; tsc = 5
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1402 ; timing_advance = 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1403 ; frequency_list :
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1404 ; rf_chan_cnt = 0000
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1405 ; rf_chan_no : (0000, 0000, ...(total of 64)... 0000)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1406 ; starting_time =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1407 ; start_time_present = FALSE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1408 ; start_time :
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1409 ; n32 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1410 ; n51 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1411 ; n26 =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1412 ; frequency_list_bef_sti
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1413 ; rf_chan_cnt = 0000
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1414 ; rf_chan_no : (0000, 0000, ...(total of 64)... 0000)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1415 ; maio_bef_sti = 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1416 ; dtx_allowed = FALSE
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1417 ; bcch_allocation = 0 carriers (...) UNUSED
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1418 ; ba_id = 0 UNUSED
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1419 ; pwrc = 5
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1420 ;--------------------------------------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1421 */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1422 free_set->ma.freq_list.rf_chan_cnt = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1423 free_set->ma.freq_list.rf_chan_no.A[0] = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1424 free_set->ma.freq_list_bef_sti.rf_chan_cnt = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1425 free_set->ma.freq_list_bef_sti.rf_chan_no.A[0] = 0; //DedicNew
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1426
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1427 maio_bef_sti = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1428
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1429 free_set->new_timing_advance = l1_config.tmode.tx_params.timing_advance;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1430 free_set->dtx_allowed = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1431 // New Timing Advance value must be applied on 1st frame of dedic. channel.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1432 free_set->timing_advance = free_set->new_timing_advance;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1433
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1434 l1a_l1s_com.dedic_set.pwrc = l1_config.tmode.tx_params.txpwr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1435 // l1a_l1s_com.dedic_set.pwrc = 5; // change from TM2!
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1436
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1437 // TXPWR command was given in Idle, save it in dedicated mode structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1438 free_set->new_target_txpwr = l1s.applied_txpwr = l1_config.tmode.tx_params.txpwr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1439
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1440 // Serving Cell stays the same.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1441 free_set->cell_desc = l1a_l1s_com.Scell_info;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1442
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1443 #if(L1_FF_MULTIBAND == 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1444
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1445 free_set->cell_desc.traffic_meas_beacon
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1446 = l1a_l1s_com.last_input_level[l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1447 free_set->cell_desc.traffic_meas = l1a_l1s_com.last_input_level[l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1448
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1449 #else // L1_FF_MULTIBAND = 1 below
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1450
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1451 operative_radio_freq =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1452 l1_multiband_radio_freq_convert_into_operative_radio_freq(l1a_l1s_com.Scell_info.radio_freq);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1453
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1454 free_set->cell_desc.traffic_meas_beacon
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1455 = l1a_l1s_com.last_input_level[operative_radio_freq];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1456 free_set->cell_desc.traffic_meas = l1a_l1s_com.last_input_level[operative_radio_freq];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1457
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1458 #endif // #if(L1_FF_MULTIBAND == 0) else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1459
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1460
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1461 // Decode the "starting time field", since staying on the same serving
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1462 // the same STI fn is saved in both "neig_sti_fn" and "serv_sti_fn".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1463 free_set->neig_sti_fn = -1; //l1a_decode_starting_time(((T_MPHC_IMMED_ASSIGN_REQ *)(msg->SigP))->starting_time);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1464 free_set->serv_sti_fn = free_set->neig_sti_fn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1465
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1466 // Check/Fill "before starting time" fields.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1467 //l1a_fill_bef_sti_param(free_set, ((T_MPHC_IMMED_ASSIGN_REQ *)(msg->SigP))->starting_time.start_time_present);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1468
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1469 //No hopping channel
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1470
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1471 // Save the "timeslot difference" between new and old configuration
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1472 // in "tn_difference".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1473 // tn_difference -> loaded with the number of timeslot to shift.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1474 // dl_tn -> loaded with the new timeslot.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1475 l1a_l1s_com.tn_difference = free_set->chan1.desc.timeslot_no - l1a_l1s_com.dl_tn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1476 l1a_l1s_com.dl_tn = free_set->chan1.desc.timeslot_no; // Save new TN id.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1477
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1478 // Set "fset" pointer to the new parameter set.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1479 l1a_l1s_com.dedic_set.fset = free_set;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1480
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1481 // Give new msg code to L1S. //TestMode: use existing L1S primitive name
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1482 l1a_l1s_com.dedic_set.SignalCode = MPHC_IMMED_ASSIGN_REQ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1483
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1484 // step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1485 *state = WAIT_MSG;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1486 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1487 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1488
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1489 } // end of "switch(SignalCode)".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1490 // end of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1491 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1492 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1493 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1494
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1495 case WAIT_MSG:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1496 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1497 switch(SignalCode)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1498 // switch on input message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1499 //-------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1500 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1501 case L1C_DEDIC_DONE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1502 // Dedicated channel activated.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1503 //-----------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1504 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1505 // if MON tasks are enabled, set up FB26 and D_BAMS_MEAS tasks now as well
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1506 if (l1_config.tmode.rf_params.down_up == (TMODE_DOWNLINK|TMODE_UPLINK) &&
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1507 l1_config.tmode.rf_params.mon_tasks == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1508 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1509 l1a_l1s_com.task_param[FB26] = SEMAPHORE_SET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1510 l1a_l1s_com.l1s_en_task[FB26] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1511 #if (L1_12NEIGH ==1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1512 //Set timing validity for FB no a priori info
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1513 l1a_l1s_com.nsync.list[0].timing_validity = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1514
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1515 // Enable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1516 l1a_l1s_com.nsync.list[0].status = NSYNC_PENDING; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1517 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1518 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1519 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1520
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1521 if (l1_config.tmode.rx_params.pm_enable)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1522 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1523 // Reset the BA list structure
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1524 l1a_reset_ba_list();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1525
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1526 // Next measurement report must indicate INVALID.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1527 //meas_valid = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1528
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1529 l1a_l1s_com.ba_list.nbr_carrier = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1530
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1531 // l1a_l1s_com.nsync.list[0].radio_freq was set to mon_arfcn above
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1532 l1a_l1s_com.ba_list.A[0].radio_freq = l1a_l1s_com.nsync.list[0].radio_freq;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1533
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1534 // Set parameter synchro semaphore for D_BAMS task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1535 // Enable Dedicated mode BA list measurement task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1536 l1a_l1s_com.meas_param |= D_BAMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1537 l1a.l1a_en_meas[D_NMEAS] |= D_BAMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1538 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1539
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1540 // keep track of dedicated mode state.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1541 l1tm.tmode_state.dedicated_active = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1542
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1543 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1544 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1545 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1546 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1547
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1548 case TMODE_TCH_INFO:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1549 // TCH result messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1550 //-----------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1551 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1552 // Check if RX stats done in TCH
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1553 if (l1_config.tmode.rf_params.mon_report == 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1554 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1555 BOOL done;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1556
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1557 // loop and stats management done within this function
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1558 l1tm_stats_tch_confirm((T_TMODE_TCH_INFO *) (msg->SigP));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1559
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1560 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1561
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1562 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1563 // if done, send stop message
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1564 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1565 l1tm.tmode_state.dedicated_active = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1566
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1567 // Give new msg code to L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1568 l1a_l1s_com.dedic_set.SignalCode = MPHC_STOP_DEDICATED_REQ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1569
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1570 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1571 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1572 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1573
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1574 #if (L1_12NEIGH ==1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1575 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1576 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1577 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1578 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1579
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1580 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1581 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1582 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1583 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1584
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1585 // end of process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1586 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1587 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1588 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1589
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1590 case L1C_FB_INFO:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1591 // MON result messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1592 //-----------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1593 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1594 // Check if RX stats done in Monitor channel
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1595 if (l1_config.tmode.rf_params.mon_report == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1596 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1597 BOOL done;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1598
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1599 // loop and stats management done within this function
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1600 l1tm_stats_mon_confirm( (T_TMODE_FB_CON*) ((T_L1C_FB_INFO *) (msg->SigP)));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1601
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1602 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1603
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1604 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1605 // if done, send stop message
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1606 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1607 l1tm.tmode_state.dedicated_active = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1608
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1609 // Give new msg code to L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1610 l1a_l1s_com.dedic_set.SignalCode = MPHC_STOP_DEDICATED_REQ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1611
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1612 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1613 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1614 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1615
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1616 #if (L1_12NEIGH ==1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1617 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1618 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1619 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1620 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1621
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1622 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1623 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1624 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1625 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1626
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1627 // end of process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1628 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1629 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1630 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1631
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1632 case TMODE_STOP_RX_TX:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1633 // Release dedicated mode message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1634 //--------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1635 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1636 l1tm.tmode_state.dedicated_active = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1637
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1638 // Give new msg code to L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1639 l1a_l1s_com.dedic_set.SignalCode = MPHC_STOP_DEDICATED_REQ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1640
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1641 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1642 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1643 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1644
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1645 #if (L1_12NEIGH ==1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1646 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1647 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1648 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1649 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1650 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1651 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1652
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1653 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1654 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1655 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1656
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1657 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1658 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1659 //----------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1660 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1661 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1662 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1663 } // end of "switch(SignalCode)".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1664 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1665 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1666
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1667 } // end of "switch".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1668 } // end of "while"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1669 } // end of procedure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1670
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1671 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1672 /* l1a_tmode_ra_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1673 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1674 /* Description : This state machine handles the TestMode */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1675 /* access to the network (IDLE mode). */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1676 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1677 /* Starting messages: TMODE_RA_START */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1678 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1679 /* Result messages (input): L1C_RA_DONE */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1680 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1681 /* Result messages (output): TMODE_RA_DONE */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1682 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1683 /* Stop messages (input): TMODE_STOP_RX_TX */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1684 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1685 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1686 void l1a_tmode_access_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1687 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1688 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1689 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1690 RESET = 0,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1691 WAIT_INIT = 1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1692 WAIT_RESULT = 2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1693 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1694
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1695 UWORD8 *state = &l1a.state[TMODE_RA];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1696 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1697 BOOL done = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1698
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1699 while(1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1700 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1701 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1702 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1703 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1704 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1705 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1706 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1707
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1708 // Reset RAACC process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1709 l1a_l1s_com.l1s_en_task[RAACC] = TASK_DISABLED; // Clear RAACC task enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1710 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1711 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1712
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1713 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1714 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1715 if(SignalCode == TMODE_RA_START)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1716 // Configuration message for Access Link.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1717 //---------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1718 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1719 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1720 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1721
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1722 l1s.applied_txpwr = l1_config.tmode.tx_params.txpwr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1723 l1a_l1s_com.ra_info.channel_request = 2; //l1_config.tm_params.channel_request;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1724
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1725 // Initialize rand counter for RAACC process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1726 l1a_l1s_com.ra_info.rand = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1727
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1728 // rand is random number of frames to wait between each AB transmission.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1729 // In actual L1 code this changes with each burst.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1730 // It is set to 1 here so the test runs fast.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1731
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1732 // also, channel_request is constant in TestMode for all bursts.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1733 // Actual L1 changes channel_request message each time with a different
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1734 // random reference. [channel_request = 3 bits for establishment cause
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1735 // and 5 bits of random reference]
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1736
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1737 // Use 2 multiframes (0.5 seconds) in reading all serving normal bursts
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1738 // (like paging reorganization) to refine TOA since we must have the quarter
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1739 // bit accuracy for RACH transmission.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1740
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1741 // Delay the start of RACH transmission (by incrementing rand
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1742 // counter), only at the start of the test.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1743
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1744 if(l1a_l1s_com.bcch_combined)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1745 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1746 l1a_l1s_com.ra_info.rand += 54; // Combined: 2 multiframes = 54 slots.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1747 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1748 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1749 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1750 l1a_l1s_com.ra_info.rand += 102; // Not combined: 2 multiframes = 102 slots.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1751 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1752
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1753 // step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1754 *state = WAIT_RESULT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1755
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1756 // TestMode does not set up full BCCH reading
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1757
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1758 // Activate RAACC task (no semaphore for UL tasks).
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1759 // TestMode does not enable Paging Reorg and Normal paging tasks.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1760 l1a_l1s_com.l1s_en_task[RAACC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1761
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1762 // Change mode to connection establishment part 1.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1763 l1a_l1s_com.mode = CON_EST_MODE1; // used for toa calc.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1764 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1765
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1766 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1767 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1768 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1769 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1770 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1771 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1772 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1773 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1774 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1775
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1776 case WAIT_RESULT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1777 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1778 if(SignalCode == L1C_RA_DONE)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1779 // Random access acknowledge message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1780 //-----------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1781 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1782 // Change mode to connection establishment part 2.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1783 l1a_l1s_com.mode = CON_EST_MODE2; // used for toa calc.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1784
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1785 //change power level and arfcn on the fly
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1786 l1s.applied_txpwr = l1_config.tmode.tx_params.txpwr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1787 // l1a_l1s_com.Scell_info.radio_freq = l1_config.tmode.rf_params.tch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1788
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1789 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1790
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1791 if (done)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1792 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1793 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1794 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1795 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1796
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1797 // No stats, just report end
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1798 //tmstats_ra_confirm( (T_TMODE_RA_DONE*) ((T_MPHC_RA_CON *)(msg->SigP)) );
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1799
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1800 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1801 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1802 else // there are more loops to do...
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1803 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1804 l1a_l1s_com.ra_info.rand += 10; // 1 chosen/set for quicker test
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1805 // Activate RAACC task (no semaphore for UL tasks).
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1806 l1a_l1s_com.l1s_en_task[RAACC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1807 // end of process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1808 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1809 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1810 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1811
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1812 else if(SignalCode == TMODE_STOP_RX_TX)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1813 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1814 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1815 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1816 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1817
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1818 // No stats, just report end
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1819 //tmstats_ra_confirm( (T_TMODE_RA_DONE*) ((T_MPHC_RA_CON *)(msg->SigP)) );
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1820 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1821 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1822 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1823
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1824 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1825 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1826 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1827 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1828 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1829 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1830 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1831 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1832 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1833 } // end of "switch".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1834 } // end of "while"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1835 } // end of procedure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1836
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1837 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1838 /* l1a_tmode_full_list_meas_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1839 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1840 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1841 /* Description: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1842 /* ------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1843 /* This function is a state machine which handles the */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1844 /* Cell Selection Full List Power Measurement L1/L3 */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1845 /* interface and it handles the neigbour cell */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1846 /* measurement process in IDLE mode with FULL list. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1847 /* When a message MPHC_RXLEV_REQ is received */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1848 /* the L1S task FSMS_MEAS is enabled. When this task */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1849 /* is completed a reporting message L1C_VALID_MEAS_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1850 /* is received and forwarded to L3. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1851 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1852 /* Starting messages: MPHC_RXLEV_REQ. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1853 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1854 /* Result messages (input): L1C_VALID_MEAS_INFO */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1855 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1856 /* Result messages (output): MPHC_RXLEV_IND */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1857 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1858 /* Reset messages (input): none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1859 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1860 /* Stop message (input): MPHC_STOP_RXLEV_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1861 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1862 /* Stop message (output): MPHC_STOP_RXLEV_CON */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1863 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1864 /* Rem: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1865 /* ---- */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1866 /* L3 is in charge of the number of pass to follow the */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1867 /* GSM recommendation. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1868 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1869 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1870 void l1a_tmode_full_list_meas_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1871 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1872 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1873 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1874 RESET = 0,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1875 WAIT_INIT = 1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1876 WAIT_RESULT = 2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1877 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1878
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1879 UWORD8 *state = &l1a.state[TMODE_FULL_MEAS];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1880 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1881
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1882 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1883
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1884 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1885 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1886 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1887 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1888 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1889 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1890 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1891 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1892
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1893 // Reset FULL_MEAS process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1894 l1a_l1s_com.l1s_en_meas &= FSMS_MEAS_MASK; // Clear Cell Selection Measurement enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1895 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1896 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1897
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1898 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1899 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1900 if(SignalCode == TMODE_RXLEV_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1901 // Request to enter the Cell Selection measurements.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1902 //--------------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1903 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1904 UWORD16 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1905
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1906 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1907 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1908
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1909 // Do NOT download info from message
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1910 // In TestMode always a full scanning is done, therefore primitive does not send the list
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1911 l1a_l1s_com.full_list_ptr=(T_FULL_LIST_MEAS *)((T_TMODE_RXLEV_REQ *)(msg->SigP));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1912
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1913 // Single power measurement carried out on monitor channel
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1914 l1a_l1s_com.full_list_ptr->power_array_size = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1915 l1a_l1s_com.full_list_ptr->power_array[0].radio_freq = l1_config.tmode.rf_params.mon_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1916
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1917 // Set "parameter synchro semaphores"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1918 l1a_l1s_com.meas_param |= FSMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1919
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1920 // Reset the full list structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1921 l1a_reset_full_list();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1922
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1923 // Reset the Input Level (IL) memory table.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1924 #if (L1_FF_MULTIBAND == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1925 for(i=0; i<= NBMAX_CARRIER; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1926 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1927 for(i=0; i<=l1_config.std.nbmax_carrier; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1928 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1929 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1930 l1a_l1s_com.last_input_level[i].input_level = l1_config.params.il_min;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1931 l1a_l1s_com.last_input_level[i].lna_off = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1932 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1933
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1934 // Enable Cell Selection Full list measurement task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1935 l1a.l1a_en_meas[TMODE_FULL_MEAS] |= FSMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1936
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1937 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1938 *state = WAIT_RESULT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1939 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1940
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1941 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1942 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1943 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1944 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1945
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1946 case WAIT_RESULT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1947 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1948 if(SignalCode == L1C_VALID_MEAS_INFO)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1949 // One valid measurement pass has been completed over the full list of carriers.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1950 //------------------------------------------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1951 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1952 BOOL done = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1953
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1954 //--------------------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1955 // WE COULD PUT HERE THE CODE TO TRANSLATE IL -> RXLEV !!!
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1956 //--------------------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1957
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1958 l1tm_stats_full_list_meas_confirm((T_TMODE_RXLEV_REQ *)(msg->SigP));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1959
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1960 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1961
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1962 if (done)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1963 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1964 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1965 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1966 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1967
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1968 // Reset the machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1969 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1970 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1971 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1972 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1973 // Reset the full list structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1974 l1a_reset_full_list();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1975
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1976 // Enable Cell Selection Full list measurement task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1977 l1a.l1a_en_meas[TMODE_FULL_MEAS] |= FSMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1978
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1979 // End of process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1980 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1981 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1982 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1983
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1984 else if (SignalCode == TMODE_STOP_RX_TX)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1985 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1986 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1987 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1988 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1989
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1990 // Forward result message to L3.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1991 l1a_send_confirmation(TMODE_STOP_RXLEV_CON,RRM1_QUEUE);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1992 // Reset the machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1993 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1994 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1995 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1996 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1997 // No action in this machine for other messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1998 //----------------------------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1999 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2000 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2001 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2002 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2003 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2004 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2005 } // end of "switch".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2006 } // end of "while"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2007 } // end of procedure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2008
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2009
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2010 #if L1_GPRS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2011 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2012 /* l1pa_tmode_transfer_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2013 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2014 /* Description: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2015 /* ------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2016 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2017 /* Starting messages: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2018 /* ------------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2019 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2020 /* Subsequent messages: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2021 /* -------------------- */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2022 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2023 /* Result messages (input): */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2024 /* ------------------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2025 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2026 /* Result messages (output): */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2027 /* ------------------------- */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2028 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2029 /* Reset messages (input): */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2030 /* ----------------------- */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2031 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2032 /*-------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2033 void l1a_tmode_transfer_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2034 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2035 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2036 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2037 RESET = 0,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2038 WAIT_INIT = 1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2039 WAIT_MSG = 2
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2040 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2041
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2042 UWORD8 *state = &l1a.state[TMODE_TRANSFER];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2043 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2044
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2045 static UWORD8 stat_gprs_slots;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2046
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2047 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2048
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2049 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2050 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2051 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2052 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2053 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2054 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2055 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2056 *state = WAIT_INIT;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2057
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2058 // Reset FB26 task enable flag.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2059 l1a_l1s_com.l1s_en_task[FB26] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2060
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2061 // Reset TCR_MEAS process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2062 l1pa_l1ps_com.l1ps_en_meas &= P_TCRMS_MEAS_MASK; // Disable Neighbour Measurement task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2063 l1pa.l1pa_en_meas[TCR_MEAS] &= P_TCRMS_MEAS_MASK; // Reset Neighbour Measurement task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2064
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2065 // Rise transfert parameter semaphore.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2066 l1pa_l1ps_com.transfer.semaphore = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2067 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2068 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2069
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2070 case WAIT_INIT:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2071 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2072 switch(SignalCode)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2073 // switch on input message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2074 //-------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2075 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2076 case TMODE_PDTCH_ASSIGN_REQ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2077 // Assignement message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2078 //---------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2079 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2080 static UWORD32 count =0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2081
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2082 T_TRANSFER_SET *free_set;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2083 UWORD8 assignment_command;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2084 UWORD8 timeslot_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2085 UWORD8 timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2086 UWORD32 i;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2087
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2088 count++ ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2089
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2090 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2091 l1tm_reset_rx_state();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2092 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2093
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2094 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2095 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2096
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2097 // Rise transfert parameter semaphore to prevent L1S to use partial configuration.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2098 l1pa_l1ps_com.transfer.semaphore = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2099
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2100 assignment_command = BOTH_TBF;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2101
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2102 // Get Ptr to the free dedicated parameter set.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2103 // All important fields are initialised.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2104 free_set = l1pa_get_free_transfer_set(assignment_command);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2105
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2106 // Download message containt.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2107 free_set->assignment_id = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2108 free_set->assignment_command = assignment_command;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2109 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2110 free_set->multislot_class = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->multislot_class;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2111 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2112 free_set->multislot_class = l1_config.tmode.rf_params.multislot_class;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2113 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2114 free_set->dl_pwr_ctl.p0 = 255; // no power control
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2115 free_set->packet_ta.ta = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2116 free_set->packet_ta.ta_index = 255;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2117 free_set->packet_ta.ta_tn = 255;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2118 free_set->tsc = l1_config.tmode.tx_params.tsc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2119 free_set->freq_param.chan_sel.h = FALSE; // no hopping
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2120 free_set->freq_param.chan_sel.rf_channel.single_rf.radio_freq = l1_config.tmode.rf_params.pdtch_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2121 free_set->mac_mode = FIX_ALLOC_NO_HALF; // fixed allocation
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2122 free_set->tbf_sti.present = TRUE; // STI present
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2123 // FreeCalypso TCS211 reconstruction: LoCosto change backed out
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2124 #if 0 //(CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2125 // In order to reduce the latency for the ETM command "rfe 4", make absolute_fn as
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2126 // next_time.fn+1. This was originally +100 because of which we had to wait for some
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2127 // time before L1 actually starts the TBF.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2128 free_set->tbf_sti.absolute_fn= l1s.next_time.fn + 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2129 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2130 // In PC simulation, keep the old +100 to keep output logs same as reference
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2131 free_set->tbf_sti.absolute_fn= l1s.next_time.fn + 100; // force to current FN+100
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2132 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2133
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2134 free_set->interf_meas_enable = FALSE; // Interference measurements disabled
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2135 free_set->pc_meas_chan = TRUE; // No measurement on the beacon (6 per MF52)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2136
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2137 // Allocation of both UL and DL time slots
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2138 free_set->dl_tbf_alloc.tfi = 1; // DL TFI ID
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2139 free_set->ul_tbf_alloc->tfi = 2; // UL TFI ID
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2140 #if (CODE_VERSION == SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2141 free_set->dl_tbf_alloc.timeslot_alloc = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->dl_ts_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2142 free_set->ul_tbf_alloc->timeslot_alloc = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->ul_ts_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2143 l1_config.tmode.stats_config.num_loops = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->ul_alloc_length;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2144 l1_config.tmode.rf_params.mon_tasks = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->mon_enable;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2145 l1_config.tmode.rf_params.mon_report = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->mon_enable;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2146 l1_config.tmode.rx_params.pm_enable = ((T_TMODE_PDTCH_ASSIGN_REQ *)(msg->SigP))->pm_enable;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2147 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2148 free_set->dl_tbf_alloc.timeslot_alloc = l1_config.tmode.rx_params.timeslot_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2149 free_set->ul_tbf_alloc->timeslot_alloc = l1_config.tmode.tx_params.timeslot_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2150 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2151 // free_set->ul_tbf_alloc->fixed_alloc.bitmap_length = l1_config.tmode.stats_config.num_loops;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2152 // force to 127
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2153 free_set->ul_tbf_alloc->fixed_alloc.bitmap_length = 127;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2154
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2155 // Init fixed allocation bitmap
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2156 for (i=0;i<free_set->ul_tbf_alloc->fixed_alloc.bitmap_length;i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2157 free_set->ul_tbf_alloc->fixed_alloc.bitmap[i] = free_set->ul_tbf_alloc->timeslot_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2158
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2159 free_set->allocated_tbf = BOTH_TBF;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2160
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2161 // Process the downlink TBF first allocated timeslot
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2162 timeslot_alloc = free_set->dl_tbf_alloc.timeslot_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2163 timeslot = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2164
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2165 while((timeslot<7) && !(timeslot_alloc & (0x80>>timeslot)))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2166 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2167 timeslot++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2168 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2169
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2170 free_set->dl_tbf_synchro_timeslot = timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2171
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2172 // Fill "synchro_timeslot" which will be the frame synchro slot.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2173 free_set->transfer_synchro_timeslot = timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2174
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2175 // save stats bitmap
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2176 stat_gprs_slots = l1_config.tmode.stats_config.stat_gprs_slots;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2177 // Adjust stats bit map
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2178 l1_config.tmode.stats_config.stat_gprs_slots <<= timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2179
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2180 // Process the uplink TBF first allocated timeslot
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2181 // Fixed mode: the 1st allocated timeslot is the downlink control
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2182 // timeslot allocated by the network, which is a timeslot allocated
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2183 // in uplink
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2184 timeslot_alloc = free_set->ul_tbf_alloc->timeslot_alloc;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2185
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2186 timeslot = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2187 while((timeslot<7) && !(timeslot_alloc & (0x80>>timeslot)))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2188 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2189 timeslot++;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2190 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2191 // if UL synchro TS > DL synchro TS, then fixed alloc ctrl TS is the UL sync TS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2192 // else fixed alloc ctrl TS is the DL sync TS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2193 if (timeslot > free_set->dl_tbf_synchro_timeslot)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2194 free_set->ul_tbf_alloc->fixed_alloc.ctrl_timeslot = timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2195 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2196 free_set->ul_tbf_alloc->fixed_alloc.ctrl_timeslot = free_set->dl_tbf_synchro_timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2197
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2198 free_set->ul_tbf_synchro_timeslot = free_set->ul_tbf_alloc->fixed_alloc.ctrl_timeslot;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2199
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2200 // Init txpwr levels for multi slot TX
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2201 // txpwr[index] is calculated according to TX allocation given by MACS
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2202 // timeslot contains the first allocated TS in UL
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2203 for(i = timeslot; i < 8; i++)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2204 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2205 l1pa_l1ps_com.transfer.dl_pwr_ctrl.txpwr[i]
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2206 = l1_config.tmode.tx_params.txpwr_gprs[i];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2207 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2208
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2209 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2210 *state = WAIT_MSG;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2211
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2212 // Store signalcode.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2213 free_set->SignalCode = MPHP_ASSIGNMENT_REQ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2214
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2215 // Clear transfer parameter semaphore to let L1S use the new parameters.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2216 l1pa_l1ps_com.transfer.semaphore = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2217
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2218 // end of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2219 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2220 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2221 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2222
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2223 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2224 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2225 //----------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2226 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2227 return;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2228 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2229 } // end switch(SignalCode)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2230 } // end case WAIT_INIT
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2231 case WAIT_MSG:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2232 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2233 switch(SignalCode)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2234 // switch on input message.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2235 //-------------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2236 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2237 case L1P_TRANSFER_DONE:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2238 // Switch to TRANSFER mode has been done.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2239 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2240 T_CRES_LIST_PARAM *free_list;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2241
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2242 // Set up TCR_MEAS task, if MON tasks are enabled set up FB26
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2243 if (l1_config.tmode.rf_params.mon_tasks == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2244 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2245 // Set FB26 task semaphore
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2246 l1a_l1s_com.task_param[FB26] = SEMAPHORE_SET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2247
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2248 // This process always use the first element of "nsync" structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2249 l1a_l1s_com.nsync.current_list_size = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2250 // l1a_l1s_com.nsync.list[0].radio_freq was set to mon_arfcn above
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2251 l1a_l1s_com.nsync.list[0].radio_freq = l1_config.tmode.rf_params.mon_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2252
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2253 // Enable FB detection during packet transfer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2254 l1a_l1s_com.l1s_en_task[FB26] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2255 #if (L1_12NEIGH ==1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2256 //Set timing validity for FB no a priori info
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2257 l1a_l1s_com.nsync.list[0].timing_validity = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2258 // Enable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2259 l1a_l1s_com.nsync.list[0].status = NSYNC_PENDING; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2260 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_ENABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2261 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2262 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2263
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2264 if (l1_config.tmode.rx_params.pm_enable)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2265 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2266 // Set parameter synchro semaphore for P_TCRMS_MEAS task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2267 l1pa_l1ps_com.meas_param |= P_TCRMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2268
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2269 // Reset Neighbour Cell measurement parameters.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2270 l1pa_l1ps_com.tcr_freq_list.tcr_next_to_ctrl = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2271 l1pa_l1ps_com.tcr_freq_list.tcr_next_to_read = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2272
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2273 // Get Ptr to the free Neighbour meas list.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2274 // The number of carriers in the list and the list
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2275 // identification are initialized.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2276 free_list = l1pa_get_free_cres_list_set();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2277
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2278 // Download new list within T_CRES_LIST_PARAM structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2279 free_list->nb_carrier = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2280 free_list->freq_list[0] = l1_config.tmode.rf_params.mon_arfcn;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2281
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2282 free_list->list_id = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2283
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2284 // Set "flist" with Circuit Swithed BA frequency list parameters
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2285 l1pa_l1ps_com.cres_freq_list.alist = free_list;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2286
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2287 // Reset flags.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2288 l1pa_l1ps_com.tcr_freq_list.ms_ctrl = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2289 l1pa_l1ps_com.tcr_freq_list.ms_ctrl_d = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2290 l1pa_l1ps_com.tcr_freq_list.ms_ctrl_dd = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2291
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2292 // Reset measures made on beacon frequency.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2293 l1pa_l1ps_com.tcr_freq_list.beacon_meas = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2294
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2295 // Enable Packet Transfer Neighbour Measurement task.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2296 l1pa.l1pa_en_meas[TCR_MEAS] |= P_TCRMS_MEAS;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2297 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2298
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2299 // Flag packet transfer mode active
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2300 l1tm.tmode_state.packet_transfer_active = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2301
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2302 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2303 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2304 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2305 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2306
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2307 case TMODE_PDTCH_INFO:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2308 // TCH result messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2309 //-----------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2310 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2311 // Check if RX stats done in PDTCH
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2312 if (l1_config.tmode.rf_params.mon_report == 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2313 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2314 BOOL done;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2315
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2316 // loop and stats management done within this function
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2317 l1tm_stats_pdtch_confirm((T_TMODE_PDTCH_INFO *) (msg->SigP));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2318
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2319 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2320
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2321 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2322 // if done, send stop TBFs
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2323 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2324 // Rise transfer parameter semaphore to prevent L1S to use partial configuration.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2325 l1pa_l1ps_com.transfer.semaphore = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2326
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2327 // Enables the TBF release processing in L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2328 l1pa_l1ps_com.transfer.tbf_release_param.tbf_release_cmd = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2329
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2330 // Download msg info into L1PA_L1PS_COM.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2331 l1pa_l1ps_com.transfer.tbf_release_param.released_tbf = BOTH_TBF;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2332
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2333 // Clear transfer parameter semaphore to let L1S use the new parameters.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2334 l1pa_l1ps_com.transfer.semaphore = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2335 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2336 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2337
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2338 // end of process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2339 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2340 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2341 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2342
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2343 case L1C_FB_INFO:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2344 // MON result messages.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2345 //-----------------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2346 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2347 // Check if RX stats done in Monitor channel
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2348 if (l1_config.tmode.rf_params.mon_report == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2349 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2350 BOOL done;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2351
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2352 // loop and stats management done within this function
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2353 l1tm_stats_mon_confirm( (T_TMODE_FB_CON*) ((T_L1C_FB_INFO *) (msg->SigP)));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2354
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2355 done = l1tm_is_rx_counter_done();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2356
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2357 if (done == 1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2358 // if done, send stop TBFs
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2359 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2360 // Rise transfer parameter semaphore to prevent L1S to use partial configuration.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2361 l1pa_l1ps_com.transfer.semaphore = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2362
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2363 // Enables the TBF release processing in L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2364 l1pa_l1ps_com.transfer.tbf_release_param.tbf_release_cmd = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2365
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2366 // Download msg info into L1PA_L1PS_COM.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2367 l1pa_l1ps_com.transfer.tbf_release_param.released_tbf = BOTH_TBF;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2368
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2369 // Clear transfer parameter semaphore to let L1S use the new parameters.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2370 l1pa_l1ps_com.transfer.semaphore = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2371 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2372 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2373
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2374 // end of process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2375 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2376 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2377 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2378
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2379 case TMODE_STOP_RX_TX:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2380 // TBF Release.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2381 //-------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2382 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2383 // Rise transfer parameter semaphore to prevent L1S to use partial configuration.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2384 l1pa_l1ps_com.transfer.semaphore = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2385
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2386 // Enables the TBF release processing in L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2387 l1pa_l1ps_com.transfer.tbf_release_param.tbf_release_cmd = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2388
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2389 // Download msg info into L1PA_L1PS_COM.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2390 l1pa_l1ps_com.transfer.tbf_release_param.released_tbf = BOTH_TBF;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2391
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2392 // Clear transfer parameter semaphore to let L1S use the new parameters.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2393 l1pa_l1ps_com.transfer.semaphore = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2394
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2395 // end of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2396 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2397 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2398 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2399
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2400 case L1P_TBF_RELEASED:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2401 // TBF has been release by L1S.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2402 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2403 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2404 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2405 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2406
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2407 // Reset transfer active state
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2408 l1tm.tmode_state.packet_transfer_active = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2409
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2410 // Restore stats bitmap
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2411 l1_config.tmode.stats_config.stat_gprs_slots = stat_gprs_slots;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2412
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2413 #if (L1_12NEIGH ==1)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2414 l1a_l1s_com.l1s_en_task[NSYNC] = TASK_DISABLED;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2415 // Disable neighbour sync 0.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2416 l1a_l1s_com.nsync.list[0].status = NSYNC_FREE; //Used by l1s_schedule_tasks in l1_sync
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2417 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2418
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2419 // Step in state machine.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2420 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2421
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2422 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2423 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2424 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2425 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2426
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2427 default:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2428 // End of process.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2429 //----------------
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2430 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2431 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2432 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2433 } // end of switch(SignalCode)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2434 } // end of case WAIT_MSG.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2435 } // end of "switch".
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2436 } // end of "while"
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2437 } // end of procedure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2438 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2439
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2440 #if ((L1_STEREOPATH == 1) && (OP_L1_STANDALONE == 1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2441 /*----------------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2442 /* l1a_tmode_audio_stereopath_process() */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2443 /*----------------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2444 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2445 /* Description: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2446 /* ------------ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2447 /* This function is a state machine which handles the */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2448 /* stereopath feature. */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2449 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2450 /* Starting messages: TMODE_AUDIO_STEREOPATH_DRV_START_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2451 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2452 /* Result messages (input): L1_STEREOPATH_DRV_START_CON */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2453 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2454 /* Result messages (output): TMODE_AUDIO_STEREOPATH_DRV_START_CON */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2455 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2456 /* Reset messages (input): none */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2457 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2458 /* Stop message (input): TMODE_AUDIO_STEREOPATH_DRV_STOP_REQ */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2459 /* L1_STEREOPATH_DRV_STOP_CON */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2460 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2461 /* Stop message (output): TMODE_AUDIO_STEREOPATH_DRV_STOP_CON */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2462 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2463 /* Rem: */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2464 /* ---- */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2465 /* */
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2466 /*----------------------------------------------------------------*/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2467 void l1a_tmode_audio_stereopath_process(xSignalHeaderRec *msg)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2468 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2469 #if (CODE_VERSION == NOT_SIMULATION)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2470 enum states
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2471 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2472 RESET = 0,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2473 WAIT_START_REQ = 1,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2474 WAIT_START_CON = 2,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2475 WAIT_STOP = 3,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2476 WAIT_DSP_STOP = 4
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2477
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2478 };
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2479
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2480 UWORD8 *state = &l1a.state[TMODE_AUDIO_STEREOPATH_DRV_STATE];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2481 UWORD32 SignalCode = msg->SignalCode;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2482
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2483 static UWORD8 previous_config = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2484
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2485 BOOL end_process = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2486
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2487 while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2488 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2489 switch(*state)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2490 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2491 case RESET:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2492 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2493 // initialize global variable
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2494 l1tm.stereopath.stereopath_source_timeout = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2495 l1tm.stereopath.stereopath_dest_timeout = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2496 l1tm.stereopath.stereopath_drop = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2497 l1tm.stereopath.stereopath_frame = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2498 l1tm.stereopath.stereopath_block = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2499 l1tm.stereopath.stereopath_half_block = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2500 l1tm.stereopath.stereopath_current_sample = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2501 l1tm.stereopath.stereopath_buffer_number = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2502
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2503 // initialize ndb
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2504 stp_drv_ndb->d_cport_api_dma_install = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2505 stp_drv_ndb->d_cport_api_dma_channel = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2506 stp_drv_ndb->d_cport_api_dma_rootcause = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2507
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2508 // Init DSP background
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2509 l1s_dsp_com.dsp_ndb_ptr->a_background_tasks[C_BGD_STP_DRV] = (API)((C_BGD_STP_DRV<<11) | 1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2510 if (l1s_dsp_com.dsp_ndb_ptr->d_max_background<(C_BGD_STP_DRV+1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2511 l1s_dsp_com.dsp_ndb_ptr->d_max_background=(API)(C_BGD_STP_DRV+1);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2512
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2513
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2514 *state = WAIT_START_REQ;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2515 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2516 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2517
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2518 case WAIT_START_REQ:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2519 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2520 if (SignalCode == TMODE_AUDIO_STEREOPATH_START_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2521 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2522 // receive a request to start stereopath
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2523 T_TMODE_AUDIO_STEREOPATH_START_REQ* tmode_audio_sp_conf_ptr;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2524
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2525 // Flag msg received
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2526 l1tm.tm_msg_received = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2527
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2528 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2529 /**************** GET STEREOPATH PARAMETERS ***********************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2530 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2531
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2532 if (((T_TMODE_AUDIO_STEREOPATH_START_REQ *)(msg->SigP))->configuration == AUDIO_SP_SELF_CONF)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2533 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2534 // no use of a predefined configuration, we have to get parameters from the message
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2535 tmode_audio_sp_conf_ptr = ((T_TMODE_AUDIO_STEREOPATH_START_REQ *)(msg->SigP));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2536 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2537 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2538 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2539 UWORD8 conf_index = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2540
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2541 // use of a predefined configuration, we have to get parameters from the constant config
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2542 tmode_audio_sp_conf_ptr = (T_TMODE_AUDIO_STEREOPATH_START_REQ *) tmode_audio_sp_conf[conf_index];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2543
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2544 while ((tmode_audio_sp_conf_ptr != NULL) && (conf_index < NB_MAX_STEREOPATH_CONFIG))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2545 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2546 if (tmode_audio_sp_conf_ptr->configuration == ((T_TMODE_AUDIO_STEREOPATH_START_REQ *)(msg->SigP))->configuration)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2547 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2548
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2549 tmode_audio_sp_conf_ptr = (T_TMODE_AUDIO_STEREOPATH_START_REQ *) tmode_audio_sp_conf[++conf_index];
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2550 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2551 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2552
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2553 if (tmode_audio_sp_conf_ptr == NULL)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2554 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2555 // unknow configuration identifier --> use message parameters
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2556 tmode_audio_sp_conf_ptr = ((T_TMODE_AUDIO_STEREOPATH_START_REQ *)(msg->SigP));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2557 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2558
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2559 // Download the stereopath description in the l1a_l1s structure.
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2560 l1a_l1s_com.stereopath_drv_task.parameters.sampling_frequency = tmode_audio_sp_conf_ptr->sampling_frequency;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2561 l1a_l1s_com.stereopath_drv_task.parameters.DMA_allocation = tmode_audio_sp_conf_ptr->DMA_allocation;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2562 l1a_l1s_com.stereopath_drv_task.parameters.DMA_channel_number = tmode_audio_sp_conf_ptr->DMA_channel_number;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2563 l1a_l1s_com.stereopath_drv_task.parameters.data_type = tmode_audio_sp_conf_ptr->data_type;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2564 l1a_l1s_com.stereopath_drv_task.parameters.source_port = tmode_audio_sp_conf_ptr->source_port;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2565 l1a_l1s_com.stereopath_drv_task.parameters.element_number = tmode_audio_sp_conf_ptr->element_number;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2566 l1a_l1s_com.stereopath_drv_task.parameters.frame_number = tmode_audio_sp_conf_ptr->frame_number;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2567 l1a_l1s_com.stereopath_drv_task.parameters.mono_stereo = tmode_audio_sp_conf_ptr->mono_stereo;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2568 l1a_l1s_com.stereopath_drv_task.parameters.feature_identifier = AUDIO_SP_TESTS_ID;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2569
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2570 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2571 /**************** CHECK ALLOCATION DSP/MCU ************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2572 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2573
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2574 if (tmode_audio_sp_conf_ptr->DMA_allocation == AUDIO_SP_DMA_ALLOC_MCU)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2575 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2576 l1a_l1s_com.stereopath_drv_task.parameters.DMA_int_callback_fct = l1tm_stereopath_DMA_handler;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2577 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2578 else // DMA_allocation == AUDIO_SP_DMA_ALLOC_DSP
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2579 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2580 // Update ndb
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2581 stp_drv_ndb->d_cport_api_dma_install = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2582 stp_drv_ndb->d_cport_api_dma_channel = l1a_l1s_com.stereopath_drv_task.parameters.DMA_channel_number;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2583 stp_drv_ndb->d_cport_api_dma_rootcause = 0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2584
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2585 // start background task
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2586 l1s_dsp_com.dsp_ndb_ptr->d_background_enable|=(API)(1<<C_BGD_STP_DRV);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2587 l1_trigger_api_interrupt();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2588
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2589 l1a_l1s_com.stereopath_drv_task.parameters.DMA_int_callback_fct = f_dma_default_call_back_it;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2590 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2591
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2592 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2593 /**************** GENERATION OF THE PATTERN ***********************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2594 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2595
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2596 // Reservation and generation of the pattern used to fill the buffer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2597 if (tmode_audio_sp_conf_ptr->pattern_identifier != AUDIO_SP_SILENCE_PATTERN)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2598 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2599 l1tm.stereopath.stereopath_pattern = (WORD8 *)l1tm_stereopath_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2600
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2601 // if pattern has already been build with the same config (mp3,midi or ext audio) in the current scenario,
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2602 // we don't do it again. This is to avoid to have a CPU overload during critical operation such as access or packet transfer
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2603 if ((tmode_audio_sp_conf_ptr->configuration == 0) || (tmode_audio_sp_conf_ptr->configuration != previous_config))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2604 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2605 previous_config = tmode_audio_sp_conf_ptr->configuration;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2606 l1tm.stereopath.stereopath_nb_samples = l1tm_stereopath_get_pattern(l1tm_stereopath_sampling_freqs[tmode_audio_sp_conf_ptr->sampling_frequency],
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2607 l1tm_stereopath_sin_freqs[tmode_audio_sp_conf_ptr->pattern_identifier][0],
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2608 l1tm_stereopath_sin_freqs[tmode_audio_sp_conf_ptr->pattern_identifier][1],
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2609 tmode_audio_sp_conf_ptr->data_type);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2610 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2611 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2612 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2613 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2614 // Silence pattern, consider just 2 samples at the value 0
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2615 l1tm.stereopath.stereopath_nb_samples = 2;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2616
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2617 l1tm.stereopath.stereopath_pattern = (WORD8 *)l1tm_stereopath_buffer;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2618 l1tm.stereopath.stereopath_pattern[0] = l1tm.stereopath.stereopath_pattern[1] =
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2619 l1tm.stereopath.stereopath_pattern[2] = l1tm.stereopath.stereopath_pattern[3] = 0x0000;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2620 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2621
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2622 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2623 /**************** GET ADDRESS OF THE BUFFER ***********************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2624 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2625 #if (CHIPSET == 15)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2626 if (tmode_audio_sp_conf_ptr->source_port == AUDIO_SP_SOURCE_EMIF)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2627 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2628 // get an address in internal RAM
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2629 l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address = (WORD8*) TM_stereo_buf_ext_mem;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2630 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2631
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2632
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2633 if (tmode_audio_sp_conf_ptr->source_port == AUDIO_SP_SOURCE_IMIF)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2634 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2635 // get an address in internal RAM
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2636 l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address = (WORD8*) TM_stereo_buf;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2637 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2638
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2639 if (tmode_audio_sp_conf_ptr->source_port == AUDIO_SP_SOURCE_API)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2640 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2641 // Disable DSP trace
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2642 l1s_dsp_com.dsp_ndb_ptr->d_debug_trace_type &= 0xfff0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2643 l1s_dsp_com.dsp_ndb_ptr->d_debug_trace_type |= 0x8000;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2644
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2645 l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address = (WORD8*)API_address_dsp2mcu(C_STP_DRV_BUF_API_BASE_ADDRESS);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2646 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2647 #else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2648 if (tmode_audio_sp_conf_ptr->source_port == AUDIO_SP_SOURCE_IMIF)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2649 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2650 // get an address in internal RAM
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2651 l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address = (WORD8*) TM_stereo_buf;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2652 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2653 else // source_port == AUDIO_SP_SOURCE_API
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2654 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2655 // Disable DSP trace
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2656 l1s_dsp_com.dsp_ndb_ptr->d_debug_trace_type &= 0xfff0;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2657 l1s_dsp_com.dsp_ndb_ptr->d_debug_trace_type |= 0x8000;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2658
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2659 l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address = (WORD8*)API_address_dsp2mcu(C_STP_DRV_BUF_API_BASE_ADDRESS);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2660 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2661 #endif
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2662
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2663 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2664 /**************** FILL THE 2 FIRST BUFFERS ************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2665 /******************************************************************/
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2666
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2667 l1tm_stereopath_fill_buffer((void*) l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2668 l1tm_stereopath_fill_buffer((void*) l1a_l1s_com.stereopath_drv_task.parameters.source_buffer_address);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2669
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2670 // Start the L1S stereopath task
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2671 l1a_l1s_com.stereopath_drv_task.command.start = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2672
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2673 *state = WAIT_START_CON;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2674 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2675
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2676 // End process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2677 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2678 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2679 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2680
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2681 case WAIT_START_CON:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2682 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2683 if (SignalCode == L1_STEREOPATH_DRV_START_CON)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2684 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2685 // Send the start confirmation message
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2686 l1a_audio_send_confirmation(TMODE_AUDIO_STEREOPATH_START_CON);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2687
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2688 *state = WAIT_STOP;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2689 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2690
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2691 // End process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2692 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2693 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2694 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2695
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2696 case WAIT_STOP:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2697 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2698 if (SignalCode == TMODE_AUDIO_STEREOPATH_STOP_REQ)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2699 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2700 if (l1a_l1s_com.stereopath_drv_task.parameters.DMA_allocation == AUDIO_SP_DMA_ALLOC_DSP)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2701 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2702 // we first need to stop the DSP background task
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2703 stp_drv_ndb->d_cport_api_dma_install = 0xFFFF;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2704 l1_trigger_api_interrupt();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2705
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2706 *state = WAIT_DSP_STOP;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2707 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2708 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2709 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2710 // Stop the L1S stereopath task
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2711 l1a_l1s_com.stereopath_drv_task.command.stop = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2712
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2713 // End process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2714 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2715 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2716 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2717 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2718 if (SignalCode == L1_STEREOPATH_DRV_STOP_CON)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2719 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2720 // Reset TM msg flag
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2721 // No new L1S result messages may be received before a new TM command
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2722 l1tm.tm_msg_received = FALSE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2723
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2724 free(l1tm.stereopath.stereopath_pattern);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2725
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2726 // Send the stop confirmation message
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2727 l1a_audio_send_confirmation(TMODE_AUDIO_STEREOPATH_STOP_CON);
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2728
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2729 *state = RESET;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2730 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2731 else
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2732 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2733 // End process
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2734 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2735 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2736 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2737 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2738
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2739 case WAIT_DSP_STOP:
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2740 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2741 if (stp_drv_ndb->d_cport_api_dma_install == 0)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2742 {
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2743 // stop the DSP background task
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2744 l1s_dsp_com.dsp_ndb_ptr->d_background_enable&=(API)(~(1<<C_BGD_STP_DRV));
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2745 l1_trigger_api_interrupt();
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2746
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2747 // Stop the L1S stereopath task
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2748 l1a_l1s_com.stereopath_drv_task.command.stop = TRUE;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2749
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2750 *state = WAIT_STOP;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2751
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2752 end_process = 1;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2753 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2754 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2755 break;
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2756 } // switch
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2757 } // while(!end_process)
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2758 #endif // CODE_VERSION == NOT_SIMULATION
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2759 }
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2760 #endif // #if ((L1_STEREOPATH == 1) && (OP_L1_STANDALONE == 1))
b870b6a44d31 l1audio and l1tm reconstructed source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2761 #endif