annotate gsm-fw/g23m-glue/cst/cst_pei.c @ 1005:908566db1538

gsm-fw feature tch-reroute: init and config fleshed out
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 20 Mar 2016 18:50:54 +0000
parents eebafd9f4275
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 +-------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 | PROJECT: GSM-F&D (8411) $Workfile:: cst_pei.c $|
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 | $Author:: Be $ CONDAT GmbH $Revision:: 14 $|
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 | CREATED: 01.02.99 $Modtime:: 14.02.00 12:14 $|
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 | STATE : code |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 MODULE : CST_PEI
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 PURPOSE : This Modul defines the process body interface for the
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 component CST of the mobile station.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 EXPORT : pei_create - Create the Protocol Stack Entity
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 pei_init - Initialize Protocol Stack Entity
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 pei_primitive - Process Primitive
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 pei_timeout - Process Timeout
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 pei_exit - Close resources and terminate
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 pei_run - Process Primitive
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 pei_config - Dynamic Configuration
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 pei_monitor - Monitoring of physical Parameters
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 #ifndef CST_PEI_C
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 #define CST_PEI_C
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
30 #include "config.h"
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
31 #include "fixedconf.h"
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
32 #include "condat-features.h"
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 #define ENTITY_CST
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 /*==== INCLUDES ===================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 #include <string.h>
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 #include <stdlib.h>
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 #include <ctype.h>
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "typedefs.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 #include "vsi.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 #include "custom.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 #include "gsm.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 #include "prim.h"
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
46 #include "cnf_cst.h"
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
47 #include "cus_cst.h"
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
48 #include "mon_cst.h"
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 #include "tok.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 #include "p_cst.h"
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
51 #include "cst.h"
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 #include "rx.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 #include "audio.h"
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 /*==== CONSTANTS ==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 // token processing
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 #define ERROR -1
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 #define EOS 1
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 #define COMMA 2
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 #define EQUAL 3
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 #define IDENT 4
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 #define STRING 5
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 #define LBRACK 6
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 #define RBRACK 7
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 /*==== EXPORT =====================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 extern void CST_stack_trace(void);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 int cst_gsm_parameters(TOK_DCB *dcb);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 extern void l1_cst_l1_parameters(char*);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 extern void csf_adc_start (UBYTE tx_flag, UBYTE traffic_period, UBYTE idle_period);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 extern void spi_adc_on (void);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 GLOBAL T_HANDLE t_adc_timer = VSI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 GLOBAL T_HANDLE hCommPL = VSI_ERROR; /* PL Communication */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 GLOBAL T_HANDLE hCommL1 = VSI_ERROR; /* L1 Communication */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 T_HANDLE cst_handle;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 GLOBAL UBYTE extDisplay = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 EXTERN UBYTE audio_is_free;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 /*==== PRIVATE ====================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
83 LOCAL void pei_not_supported (void *data);
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 #ifdef OPTION_RELATIVE
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 LOCAL ULONG offset;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 /*==== VARIABLES ==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 LOCAL USHORT t_flag = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 LOCAL BOOL exit_flag = FALSE;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 LOCAL BOOL first_access = TRUE;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 LOCAL T_MONITOR cst_mon;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 /*==== FUNCTIONS ==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 LOCAL const T_FUNC cst_table[] =
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 MAK_FUNC_0 ( csf_adc_process , CST_ADC_IND )
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 };
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 /*==== PROTOTYPES==================================================*/
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
104 #if 1 //defined (_TMS470)
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 static SHORT cst_tok_gettok (TOK_DCB *dcb, char ** token);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 static SHORT cst_tok_value (TOK_DCB *dcb, char * value []);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 static int cst_tokenizer_has_more_data(const TOK_DCB *dcb);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 static SHORT cst_tok_issep (char c);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110 static void cst_tok_init (char * s, TOK_DCB *dcb, char *buf, int buf_len);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 static SHORT cst_get_values(TOK_DCB *dcb, char *value[]);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112 static int cst_getbyte(TOK_DCB *dcb);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 | STATE : code ROUTINE : pei_primitive |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 PURPOSE : This function processes protocol specific primitives.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 LOCAL SHORT pei_primitive (void * ptr)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 T_PRIM *prim = ptr;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 if (prim NEQ NULL)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 USHORT opc = prim->custom.opc;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 USHORT n;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 const T_FUNC *table;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 VSI_PPM_REC ((T_PRIM_HEADER*)prim, __FILE__, __LINE__);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 switch (opc & OPC_MASK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 case CST_DL: table = cst_table; n = TAB_SIZE (cst_table); break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 default : table = NULL; n = 0; break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142 if (table != NULL )
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 if ((opc & PRM_MASK) < n)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146 table += opc & PRM_MASK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 #ifdef PALLOC_TRANSITION
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 P_SDU(prim) = table->soff ? (T_sdu*) (((char*)&prim->data) + table->soff) : 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 P_LEN(prim) = table->size + sizeof (T_PRIM_HEADER);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151 JUMP (table->func) (P2D(prim));
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 pei_not_supported (P2D(prim));
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 #ifdef GSM_ONLY
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 PFREE (P2D(prim))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
162 return PEI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
163 #else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
164 if (opc & SYS_MASK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
165 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
166 vsi_c_primitive (VSI_CALLER prim);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
167 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
168 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
169 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
170 PFREE (P2D(prim))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
171 return PEI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
172 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
173 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
174 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
175 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
176 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
177
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
178 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
179 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
180 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
181 | STATE : code ROUTINE : pei_not_supported |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
182 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
183
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
184 PURPOSE : This function handles an unsupported primitive.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
185 */
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
186 LOCAL void pei_not_supported (void *data)
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
187 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
188 TRACE_FUNCTION ("pei_not_supported()");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
189
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
190 PFREE (data);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
191 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
192
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
193
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
194 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
195 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
196 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
197 | STATE : code ROUTINE : pei_init |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
198 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
199
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
200 PURPOSE : This function initializes the protocol stack entity
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
201
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
202 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
203
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
204 LOCAL SHORT pei_init (T_HANDLE handle)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
205 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
206 cst_handle = handle;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
207
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
208 TRACE_FUNCTION ("pei_init()");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
209
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
210 exit_flag = FALSE;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
211
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
212 if (hCommPL < VSI_OK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
213 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
214 if ((hCommPL = vsi_c_open (VSI_CALLER PL_NAME)) < VSI_OK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
215 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
216 return PEI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
217 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
218 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
219
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
220 if (hCommL1 < VSI_OK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
221 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
222 if ((hCommL1 = vsi_c_open (VSI_CALLER L1_NAME)) < VSI_OK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
223 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
224 return PEI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
225 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
226 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
227
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
228 vsi_t_start (VSI_CALLER CST_ADC_TIMER, 230); // equal to 50 TDMA frames
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
229
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
230 #if 1 //defined (_TMS470)
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
231 // Set the sleep mode authorized for the layer1 synchronous.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
232 // Possible modes are :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
233 // for CHIPSET = 0 : NO_SLEEP, SMALL_SLEEP, BIG_SLEEP.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
234 // It is necessary to indicate in the prototype of power_down_config()
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
235 // function which clocks (amongst ARMIO_CLK, UWIRE_CLK, SIM_CLK and UART_CLK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
236 // to be stopped in case of BIG_SLEEP mode.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
237 // With this default init, ARMIO_CLK, UWIRE_CLK, SIM_CLK and UART_CLK will be stopped
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
238 // in case of BIG_SLEEP mode, but it can be changed here.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
239
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
240 // other CHIPSETs : NO_SLEEP, SMALL_SLEEP, BIG_SLEEP, DEEP_SLEEP, ALL_SLEEP.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
241 // It is necessary to indicate in the prototype of power_down_config()
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
242 // function which clocks to be stopped in case of BIG_SLEEP mode,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
243 // amongst ARMIO and UWIRE clocks.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
244 // With this default init, UWIRE_CLK will always be stopped
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
245 // in case of BIG_SLEEP mode, but it can be changed here.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
246
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
247 // The default configuration is ALL SLEEP. It can be changed in this init.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
248
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
249 // WARNING !! THE SLEEP MODE SHOULD NOT BE MODIFIED ONCE THE SYSTEM INIT IS FINISHED !!
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
250
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
251 #if !defined (TI_VERSION)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
252 #if (CHIPSET == 0)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
253 power_down_config(NO_SLEEP, ARMIO_CLK | UWIRE_CLK | SIM_CLK | UART_CLK);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
254 #elif ((CHIPSET == 2) || (CHIPSET == 3) || \
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
255 (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
256 power_down_config(ALL_SLEEP, UWIRE_CLK_CUT);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
257 #elif ((CHIPSET == 4) || (CHIPSET == 9))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
258 power_down_config(NO_SLEEP, UWIRE_CLK_CUT);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
259 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
260 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
261 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
262
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
263 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
264 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
265
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
266 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
267 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
268 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
269 | STATE : code ROUTINE : pei_timeout |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
270 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
271
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
272 PURPOSE : This function processes timeouts.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
273 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
274
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
275 LOCAL SHORT pei_timeout (USHORT index)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
276 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
277 rx_timeout (index);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
278 audio_timeout (index);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
279
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
280 if (index EQ CST_ADC_TIMER)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
281 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
282 // start the AD conversions in layer1 synchronous
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
283 // this function will send MMI_ADC_REQ primitive to L1A for test reason.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
284 // The user has to implement it by himself in the MMI.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
285 // The parameters are : tx_flag, traffic_period, idle_period.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
286 // Please refer to the ADC specification for details.
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
287
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
288 // WCS Patch : Schedule ADC on RX and TX
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
289 #if (OP_WCP == 1)
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
290 csf_adc_start(1, 10, 1);
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
291 #else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
292 csf_adc_start(0, 10, 1);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
293 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
294
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
295 spi_adc_on();
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
296 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
297
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
298 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
299 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
300
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
301
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
302 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
303 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
304 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
305 | STATE : code ROUTINE : pei_exit |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
306 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
307
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
308 PURPOSE : This function closes all resources and terminates.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
309 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
310
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
311 LOCAL SHORT pei_exit (void)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
312 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
313 TRACE_FUNCTION ("pei_exit()");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
314
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
315 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
316 * clean up communication
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
317 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
318
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
319 vsi_c_close (VSI_CALLER hCommPL);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
320 hCommPL = VSI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
321
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
322 vsi_c_close (VSI_CALLER hCommL1);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
323 hCommL1 = VSI_ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
324
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
325 exit_flag = TRUE;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
326
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
327 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
328 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
329
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
330 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
331 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
332 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
333 | STATE : code ROUTINE : pei_config |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
334 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
335
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
336 PURPOSE : Dynamic Configuration
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
337
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
338 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
339
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
340 #if !defined (NCONFIG)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
341 LOCAL KW_DATA kwtab[] = {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
342 CST_CONFIG, ID_CONFIG,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
343 CST_MUTE, ID_MUTE,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
344 CST_GSM_PARAMETERS, ID_GSM_PARAMETERS,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
345 CST_L1_PARAMETERS, ID_L1_PARAMETERS,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
346 "", 0
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
347 };
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
348
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
349 GLOBAL KW_DATA partab[] = {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
350 "", 0
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
351 };
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
352 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
353
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
354
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
355 GLOBAL SHORT pei_config (T_PEI_CONFIG inString)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
356 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
357 #if !defined (NCONFIG)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
358 char * s = inString;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
359 SHORT valno;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
360 USHORT keyno;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
361 char * keyw;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
362 char * val [10];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
363 TOK_DCB tokenizer;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
364 char token_buf[80];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
365 SHORT token_type;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
366 int error; /* terminate processing */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
367
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
368 TRACE_FUNCTION ("pei_config()");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
369
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
370 TRACE_FUNCTION (s);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
371
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
372 cst_tok_init(s, &tokenizer, &token_buf[0], sizeof(token_buf));
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
373
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
374 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
375 * Parse next keyword and number of variables
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
376 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
377 error = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
378 while (!error && cst_tokenizer_has_more_data(&tokenizer))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
379 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
380 token_type = cst_tok_gettok(&tokenizer, &keyw);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
381 if (token_type != IDENT)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
382 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
383 error = 1;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
384 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
385 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
386 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
387 switch ((keyno = tok_key((KW_DATA *)kwtab, keyw)))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
388 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
389 case ID_CONFIG:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
390 valno = cst_get_values(&tokenizer, val);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
391 if (valno EQ 3)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
392 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
393 extDisplay = 1;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
394 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
395 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
396 case ID_MUTE:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
397 valno = cst_get_values(&tokenizer, val); /* eat up rest of line */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
398 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
399 * FTA testcase 26.6.3.4 needs the the MS is in audio free
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
400 * environment. This config disables opening of the audio
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
401 * path.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
402 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
403 audio_is_free = FALSE;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
404 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
405 case ID_GSM_PARAMETERS:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
406 cst_gsm_parameters(&tokenizer);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
407 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
408 case ID_L1_PARAMETERS:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
409 /* pass parameters to L1 function for further process */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
410 l1_cst_l1_parameters(s);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
411 valno = cst_get_values(&tokenizer, val); /* eat up rest of line */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
412 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
413 default:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
414 TRACE_ERROR ("[PEI_CONFIG]: Illegal Keyword");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
415 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
416 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
417 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
418 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
419 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
420 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
421 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
422
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
423 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
424 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
425 | PROJECT : GSM-PS (6147) MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
426 | STATE : code ROUTINE : cst_pei_config |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
427 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
428
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
429 PURPOSE : Dynamic Configuration
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
430
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
431 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
432
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
433 GLOBAL SHORT cst_pei_config ( char * inString, char * dummy )
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
434 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
435 pei_config ( inString );
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
436 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
437
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
438
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
439 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
440 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
441 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
442 | STATE : code ROUTINE : pei_monitor |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
443 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
444
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
445 PURPOSE : This function monitors physical parameters.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
446 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
447 LOCAL SHORT pei_monitor (void ** monitor)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
448 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
449 TRACE_FUNCTION ("pei_monitor()");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
450
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
451 cst_mon.version = VERSION_CST;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
452
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
453 *monitor = &cst_mon;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
454
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
455 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
456 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
457
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
458 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
459 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
460 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
461 | STATE : code ROUTINE : pei_create |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
462 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
463
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
464 PURPOSE : This function creates the protocol stack entity.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
465 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
466
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
467 GLOBAL SHORT cst_pei_create (T_PEI_INFO **info)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
468 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
469 static const T_PEI_INFO pei_info =
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
470 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
471 "CST",
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
472 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
473 pei_init,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
474 pei_exit,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
475 pei_primitive,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
476 pei_timeout,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
477 NULL, /* no signal function */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
478 NULL, /* no run function */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
479 pei_config,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
480 pei_monitor,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
481 },
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
482 1536, /* Stack Size */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
483 10, /* Queue Entries */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
484 55, /* Priority */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
485 MAX_CST_TIMER, /* number of timer */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
486 0x03 /* flags */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
487 };
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
488
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
489 TRACE_FUNCTION ("pei_create()");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
490
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
491 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
492 * Close Resources if open
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
493 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
494
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
495 if (first_access)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
496 first_access = FALSE;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
497 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
498 pei_exit ();
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
499
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
500 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
501 * Export startup configuration data
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
502 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
503
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
504 *info = (T_PEI_INFO *)&pei_info;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
505
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
506 return PEI_OK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
507 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
508
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
509
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
510 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
511 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
512 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
513 | STATE : code ROUTINE : cst_tok_init |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
514 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
515
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
516 PURPOSE : Initialize token scanner.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
517
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
518 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
519 static void cst_tok_init (char * s, TOK_DCB *dcb, char *buf, int buf_len)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
520 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
521 int i;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
522 dcb->nexttok = dcb->tokbuf = buf;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
523 // can't use strcpy since it stops at 0s
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
524 for (i=0; i<buf_len-1; i++)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
525 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
526 dcb->tokbuf[i] = s[i];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
527 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
528 dcb->tokbuf[buf_len-1] = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
529 dcb->lastchar = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
530 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
531
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
532 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
533 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
534 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
535 | STATE : code ROUTINE : cst_get_values |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
536 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
537 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
538 static SHORT cst_get_values(TOK_DCB *dcb, char *value[])
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
539 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
540 char * val; /* not identifier, so thrown away */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
541 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
542 * Check next token
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
543 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
544 switch (cst_tok_gettok (dcb, &val))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
545 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
546 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
547 * No value present
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
548 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
549 case COMMA:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
550 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
551 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
552 * Value(s) follows
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
553 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
554 case EQUAL:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
555 return (cst_tok_value (dcb, value));
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
556 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
557 * No value present and EOS
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
558 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
559 case EOS:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
560 dcb->nexttok = NULL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
561 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
562 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
563 * Syntax error
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
564 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
565 default:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
566 dcb->nexttok = NULL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
567 return (TOK_EOCS);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
568 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
569 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
570
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
571 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
572 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
573 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
574 | STATE : code ROUTINE : cst_tok_value |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
575 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
576 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
577 static SHORT cst_tok_value (TOK_DCB *dcb, char * value [])
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
578 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
579 SHORT count;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
580 SHORT tok;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
581 SHORT inbrack;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
582 char * val;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
583 char * val2;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
584
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
585 inbrack = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
586 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
587 * Get next token
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
588 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
589 tok = cst_tok_gettok (dcb, &val);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
590
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
591 switch (tok)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
592 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
593 case LBRACK:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
594 inbrack++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
595 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
596
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
597 case IDENT :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
598 case STRING :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
599 tok = cst_tok_gettok (dcb, &val2); /* val2 ignored since next tok */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
600 if ((tok == COMMA) || (tok == EOS)) /* shouldn't be an IDENT */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
601 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
602 /* just single value, return */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
603 value[0] = val;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
604 return (1);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
605 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
606 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
607 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
608 /* error */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
609 dcb->nexttok = NULL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
610 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
611 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
612
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
613 case EOS :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
614 default :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
615 dcb->nexttok = NULL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
616 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
617 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
618
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
619 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
620 * Get first token of list
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
621 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
622
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
623 tok = cst_tok_gettok (dcb, &val);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
624 count = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
625 while (1)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
626 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
627 if ((tok == IDENT) || (tok == STRING))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
628 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
629 value[count++] = val;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
630 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
631 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
632 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
633 dcb->nexttok = NULL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
634 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
635 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
636
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
637 tok = cst_tok_gettok (dcb, &val);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
638 switch (tok)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
639 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
640 case COMMA:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
641 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
642
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
643 case RBRACK :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
644 if (inbrack)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
645 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
646 if (((tok = cst_tok_gettok (dcb, &val)) == COMMA) ||
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
647 (tok == EOS))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
648 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
649 return (count);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
650 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
651 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
652 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
653 * Fall through
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
654 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
655 default:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
656 dcb->nexttok = NULL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
657 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
658 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
659 tok = cst_tok_gettok (dcb, &val);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
660 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
661 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
662 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
663
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
664 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
665 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
666 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
667 | STATE : code ROUTINE : cst_tok_gettok |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
668 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
669
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
670 PURPOSE : Get list of values for token.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
671 Return number of values found.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
672
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
673 Formats: Value
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
674 (Value)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
675 (Value, Value,...)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
676 ()
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
677 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
678 static SHORT cst_tok_gettok (TOK_DCB *dcb, char ** token)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
679 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
680 SHORT tok;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
681 /* if previous token was IDENT, a '\0' was placed afterwards
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
682 * for string processing and the overwritten character was
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
683 * placed in lastchar. We now replace this character.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
684 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
685 if (dcb->lastchar)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
686 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
687 *(dcb->nexttok) = dcb->lastchar;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
688 dcb->lastchar = 0;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
689 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
690 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
691 * Skip leading white space
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
692 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
693 while (isspace (*(dcb->nexttok)))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
694 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
695 dcb->nexttok++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
696 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
697
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
698 * token = dcb->nexttok++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
699
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
700 switch (** token)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
701 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
702 case '\0': /* End of string */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
703 case '\n':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
704 tok = EOS;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
705 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
706
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
707 case ',':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
708 ** token = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
709 tok = COMMA;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
710 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
711
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
712 case '=':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
713 ** token = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
714 tok = EQUAL;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
715 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
716
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
717 case '(':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
718 case '<':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
719 case '[':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
720 ** token = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
721 tok = LBRACK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
722 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
723
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
724 case ')':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
725 case '>':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
726 case ']':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
727 ** token = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
728 tok = RBRACK;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
729 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
730
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
731 case '"':
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
732 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
733 * Get first char of string
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
734 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
735 * token = dcb->nexttok;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
736 while ((*(dcb->nexttok) != '\0') && (*(dcb->nexttok) != '"'))
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
737 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
738 dcb->nexttok++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
739 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
740
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
741 if (*(dcb->nexttok) != '\0')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
742 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
743 *(dcb->nexttok++) = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
744 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
745
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
746 tok = STRING;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
747 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
748
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
749 default:
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
750 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
751 * Read an identifier
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
752 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
753 while ( !cst_tok_issep (*(dcb->nexttok)) )
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
754 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
755 dcb->nexttok++;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
756 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
757
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
758 dcb->lastchar = *(dcb->nexttok);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
759 *(dcb->nexttok) = '\0';
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
760
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
761 if (*token == dcb->nexttok)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
762 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
763 /* no characters in identifier. Error in code! */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
764 tok = ERROR;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
765 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
766 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
767 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
768 tok = IDENT;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
769 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
770 break;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
771 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
772 return (tok);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
773 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
774
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
775 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
776 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
777 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
778 | STATE : code ROUTINE : cst_tok_issep |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
779 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
780
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
781 PURPOSE : Return 1 if special character.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
782 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
783 static SHORT cst_tok_issep (char c)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
784 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
785 switch (c)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
786 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
787 case '\0' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
788 case '\n' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
789 case ',' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
790 case '=' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
791 case '(' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
792 case '<' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
793 case '[' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
794 case ')' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
795 case '>' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
796 case ']' :
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
797 case '"' : return (1);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
798
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
799 default : return (isspace (c));
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
800 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
801 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
802
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
803 /* if string in tokenizer state has unprocessed tokens return 1 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
804 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
805 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
806 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
807 | STATE : code ROUTINE : cst_tokenizer_has_more_data |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
808 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
809
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
810 PURPOSE : Return 1 if string in tokenizer state has unprocessed tokens.
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
811 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
812 static int cst_tokenizer_has_more_data(const TOK_DCB *dcb)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
813 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
814 return (dcb->nexttok != NULL);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
815 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
816
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
817 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
818 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
819 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
820 | STATE : code ROUTINE : cst_getbyte |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
821 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
822 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
823
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
824 static int cst_getbyte(TOK_DCB *dcb)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
825 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
826 if (dcb->nexttok)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
827 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
828 return *(dcb->nexttok++);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
829 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
830 else
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
831 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
832 return -1;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
833 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
834 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
835
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
836 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
837 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
838 | PROJECT : XXX MODULE : CST_PEI |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
839 | STATE : code ROUTINE : cst_gsm_parameters |
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
840 +--------------------------------------------------------------------+
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
841 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
842
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
843 int cst_gsm_parameters(TOK_DCB *dcb)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
844 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
845 unsigned char id;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
846 char str[80];
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
847 int i;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
848
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
849 // STRIP FIRST TWO DELIMITERS
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
850 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
851 char *tok_string;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
852
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
853 if (cst_tok_gettok(dcb, &tok_string) != EQUAL)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
854 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
855 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
856 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
857 if (cst_tok_gettok(dcb, &tok_string) != LBRACK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
858 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
859 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
860 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
861 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
862
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
863 // GET CONTROL ID
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
864 if ((id = cst_getbyte(dcb)) == -1)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
865 {
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
866 vsi_o_trace("CST", 0x08, "gsm_parameters() parser error: out of bytes");
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
867 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
868 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
869
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
870 // STACK TRACE
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
871 else if (id == '1')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
872 {
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
873 CST_stack_trace();
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
874 } //end else if (id == '1')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
875
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
876 // Crash Me
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
877 else if (id == '2')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
878 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
879 // No instruction before setting the reset vector
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
880 void (*reset_vector)() = (void (*)()) 0;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
881 (*reset_vector)();
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
882 } //end else if (id == '2')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
883 #if defined (ALR)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
884 // Print Reg Copy
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
885 else if (id == '3')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
886 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
887 extern int xdump_buffer;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
888 int *xp = &xdump_buffer;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
889 int magic_word;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
890
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
891 // displays the 16 User mode 32bits registers saved on exception
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
892 // vsi_o_trace("CST", 0x08, "User mode registers [r0-r15] = ...");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
893 for (i=0; i<4; i++)
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
894 {
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
895 sprintf(str, "%08x %08x %08x %08x", *(xp++), *(xp++),
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
896 *(xp++), *(xp++));
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
897 vsi_o_trace("CST", 0x08, str);
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
898 }
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
899
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
900 // displays the User mode CPSR saved on exception
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
901 sprintf(str, "User mode CPSR = %08x", *(xp++));
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
902 vsi_o_trace("CST", 0x08, str);
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
903
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
904 // displays the magic word and the index of vector taken
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
905 magic_word = *(xp++);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
906 sprintf(str, "Magic Word + Index of Vector = %08x", magic_word);
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
907 vsi_o_trace("CST", 0x08, str);
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
908
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
909 // displays the cause of the exception
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
910 magic_word &= 0x000F;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
911
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
912 switch (magic_word) {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
913
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
914 case 1:
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
915 vsi_o_trace("CST", 0x08, "Exception: Undefined Instruction");
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
916 break;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
917
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
918 case 2:
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
919 vsi_o_trace("CST", 0x08, "Exception: Unexpected Software Interrupt");
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
920 break;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
921
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
922 case 3:
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
923 vsi_o_trace("CST", 0x08, "Exception: Abort Prefetch");
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
924 break;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
925
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
926 case 4:
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
927 vsi_o_trace("CST", 0x08, "Exception: Abort Data");
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
928 break;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
929
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
930 case 5:
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
931 vsi_o_trace("CST", 0x08, "Exception: Reserved");
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
932 break;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
933
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
934 default:
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
935 break;
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
936 }
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
937
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
938 // displays the bottom 20 words of user mode stack saved on exception
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
939 // vsi_o_trace("CST", 0x08, "Bottom 20 words of User mode stack = ...");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
940 for (i=0; i<5; i++)
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
941 {
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
942 sprintf(str, "%08x %08x %08x %08x", *(xp++), *(xp++),
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
943 *(xp++), *(xp++));
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
944 vsi_o_trace("CST", 0x08, str);
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
945 }
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
946 } //end else if (id == '3')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
947
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
948 // Clear Reg Copy
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
949 else if (id == '4')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
950 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
951 extern int xdump_buffer;
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
952 int *xp = &xdump_buffer;
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
953 // Clears the 38 32bits registers saved on exception
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
954 for (i=0; i<38; i++)
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
955 {
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
956 *(xp+i) = 0;
846
eebafd9f4275 cst_pei.c compiles
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 832
diff changeset
957 }
832
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
958 // vsi_o_trace("CST", 0x08, "Registers Copy cleared ...");
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
959 } //end else if (id == '4')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
960 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
961 #if (OP_WCP == 1)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
962 #if (WCP_PROF == 1)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
963 // Enable/disable MC profiler
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
964 else if (id == '5')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
965 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
966 PR_EnableProfiler(0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
967 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
968 else if (id == '6')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
969 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
970 PR_EnableProfiler(1);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
971 power_down_config(0, 0x5ff); // disable sleep, which interferes with profiler
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
972 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
973
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
974 // Enable/disable CPU Meter
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
975 else if (id == '7')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
976 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
977 PR_EnableCpuMeter(0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
978 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
979 else if (id == '8')
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
980 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
981 PR_EnableCpuMeter(1);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
982 power_down_config(0, 0x5ff); // disable sleep, which interferes with CPU meter
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
983 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
984 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
985 #endif
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
986
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
987 // STRIP LAST DELIMITER
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
988 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
989 char *tok_string;
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
990
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
991 if (cst_tok_gettok(dcb, &tok_string) != RBRACK)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
992 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
993 return (0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
994 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
995 }
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
996 } // end cst_gsm_parameters
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
997
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
998 /*
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
999 * Reach here if unexpected event occurs (e.g. Undefined instruction, Abort,
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1000 * out of memory); choose whether to restart or stay in datadump mode to find
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1001 * out cause of problem
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1002 */
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1003 void exception_handler(void)
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1004 {
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1005 void (*jump_address)() = (void (*)()) ((unsigned)0x0);
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1006
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1007 (*jump_address)();
c14bc60c6c30 gsm-fw/g23m-glue/cst: import from Leonardo source
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1008 }