comparison scripts/config-headers.sh @ 7:d6f8d6efdf5b

scripts/config-headers.sh: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:52:37 +0000
parents
children 99ae5bf8cab5
comparison
equal deleted inserted replaced
6:b55b47f49638 7:d6f8d6efdf5b
1 #!/bin/sh
2
3 if [ -z "$TARGET" ]
4 then
5 echo "Error: TARGET= must be passed via environment" 1>&2
6 exit 1
7 fi
8
9 if [ -z "$BUILD_DIR" ]
10 then
11 echo "Error: BUILD_DIR= must be passed via environment" 1>&2
12 exit 1
13 fi
14
15 # The following vars will already be set when this script is invoked
16 # from configure.sh in a production build, but the following defaulting logic
17 # helps with manual invokation during development.
18
19 if [ -z "$CHIPSET" ]
20 then
21 CHIPSET=10
22 fi
23 export CHIPSET
24
25 if [ -z "$DSP" ]
26 then
27 DSP=36
28 fi
29 export DSP
30
31 if [ -z "$RF" ]
32 then
33 RF=12
34 fi
35 export RF
36
37 if [ -z "$AMR" ]
38 then
39 AMR=1
40 fi
41 export AMR
42
43 if [ -z "$L1_DYN_DSP_DWNLD" ]
44 then
45 L1_DYN_DSP_DWNLD=1
46 fi
47 export L1_DYN_DSP_DWNLD
48
49 if [ -z "$L1_VOICE_MEMO_AMR" ]
50 then
51 L1_VOICE_MEMO_AMR=1
52 fi
53 export L1_VOICE_MEMO_AMR
54
55 if [ -z "$MELODY_E2" ]
56 then
57 MELODY_E2=1
58 fi
59 export MELODY_E2
60
61 if [ -z "$SPEECH_RECO" ]
62 then
63 SPEECH_RECO=1
64 fi
65 export SPEECH_RECO
66
67 if [ -z "$GPRS" ]
68 then
69 GPRS=1
70 fi
71 export GPRS
72
73 if [ -z "$SRVC" ]
74 then
75 SRVC=1
76 fi
77 export SRVC
78
79 if [ -z "$ATP_STATE" ]
80 then
81 ATP_STATE=0
82 fi
83 export ATP_STATE
84
85 if [ -z "$FCHG_STATE" ]
86 then
87 FCHG_STATE=1
88 fi
89 export FCHG_STATE
90
91 if [ -z "$LCC_STATE" ]
92 then
93 LCC_STATE=0
94 fi
95 export LCC_STATE
96
97 if [ -z "$MKS_STATE" ]
98 then
99 MKS_STATE=0
100 fi
101 export MKS_STATE
102
103 if [ -z "$PWR_STATE" ]
104 then
105 PWR_STATE=0
106 fi
107 export PWR_STATE
108
109 if [ -z "$R2D_STATE" ]
110 then
111 R2D_STATE=1
112 fi
113 export R2D_STATE
114
115 if [ -z "$DSAMPLE_FULL_COLOR" ]
116 then
117 DSAMPLE_FULL_COLOR=1
118 fi
119 export DSAMPLE_FULL_COLOR
120
121 if [ -z "$TI_PROFILER" ]
122 then
123 TI_PROFILER=0
124 fi
125 export TI_PROFILER
126
127 if [ -z "$TR_BAUD_CONFIG" ]
128 then
129 TR_BAUD_CONFIG=TR_BAUD_115200
130 fi
131 export TR_BAUD_CONFIG
132
133 # Derived settings only for the generation of *.cfg headers
134
135 case "$RF" in
136 10)
137 RF_FAM=10
138 RF_PA=0
139 RF_PG=0
140 ;;
141 12)
142 RF_FAM=12
143 RF_PA=2
144 RF_PG=2
145 ;;
146 *)
147 echo "Error: RF=$RF setting not understood" 1>&2
148 exit 1
149 esac
150 export RF_FAM RF_PA RF_PG
151
152 case "$GPRS" in
153 0)
154 L1_GPRS=0
155 PMODE=1
156 ;;
157 1)
158 L1_GPRS=1
159 PMODE=2
160 ;;
161 *)
162 echo "Error: GPRS=$GPRS setting not understood" 1>&2
163 exit 1
164 esac
165 export L1_GPRS PMODE
166
167 if [ "$SRVC" != 0 ]
168 then
169 IDS=1
170 else
171 IDS=0
172 fi
173 export IDS
174
175 # do it!
176
177 set -e
178
179 rm -rf $BUILD_DIR/config
180 mkdir $BUILD_DIR/config
181 helpers/cfg-hdr-gen scripts/cfg-template $BUILD_DIR/config
182 scripts/make-rv-swe-hdr.sh > $BUILD_DIR/config/rv_swe.h
183 cp targets/$TARGET.h $BUILD_DIR/config/fc-target.h