Subversion Repositories FlightCtrl

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1189 kmpec 1
   1               		.file	"spi.c"
2
   2               	__SREG__ = 0x3f
3
   3               	__SP_H__ = 0x3e
4
   4               	__SP_L__ = 0x3d
5
   5               	__tmp_reg__ = 0
6
   6               	__zero_reg__ = 1
7
   7               		.global __do_copy_data
8
   8               		.global __do_clear_bss
9
   9               		.text
10
  10               	.global	SPI_MasterInit
11
  12               	SPI_MasterInit:
12
  13               	/* prologue: frame size=0 */
13
  14               	/* prologue end (size=0) */
14
  15 0000 84B1      		in r24,36-0x20
15
  16 0002 806A      		ori r24,lo8(-96)
16
  17 0004 84B9      		out 36-0x20,r24
17
  18 0006 3D9A      		sbi 39-0x20,5
18
  19 0008 82E5      		ldi r24,lo8(82)
19
  20 000a 8CBD      		out 76-0x20,r24
20
  21 000c 1DBC      		out 77-0x20,__zero_reg__
21
  22 000e 459A      		sbi 40-0x20,5
22
  23 0010 81E0      		ldi r24,lo8(1)
23
  24 0012 8093 0000 		sts SPITransferCompleted,r24
24
  25 0016 8AEA      		ldi r24,lo8(-86)
25
  26 0018 8093 0000 		sts ToNaviCtrl,r24
26
  27 001c 83E8      		ldi r24,lo8(-125)
27
  28 001e 8093 0000 		sts ToNaviCtrl+1,r24
28
  29 0022 8AE0      		ldi r24,lo8(10)
29
  30 0024 8093 0000 		sts ToNaviCtrl+2,r24
30
  31 0028 1092 0000 		sts (ToNaviCtrl+3)+1,__zero_reg__
31
  32 002c 1092 0000 		sts ToNaviCtrl+3,__zero_reg__
32
  33 0030 1092 0000 		sts (ToNaviCtrl+5)+1,__zero_reg__
33
  34 0034 1092 0000 		sts ToNaviCtrl+5,__zero_reg__
34
  35 0038 1092 0000 		sts SPI_RxDataValid,__zero_reg__
35
  36 003c 1092 0000 		sts SPI_VersionInfo,__zero_reg__
36
  37 0040 88E4      		ldi r24,lo8(72)
37
  38 0042 8093 0000 		sts SPI_VersionInfo+1,r24
38
  39 0046 8FE0      		ldi r24,lo8(15)
39
  40 0048 8093 0000 		sts SPI_VersionInfo+2,r24
40
  41 004c 85E0      		ldi r24,lo8(5)
41
  42 004e 8093 0000 		sts SPI_VersionInfo+3,r24
42
  43               	/* epilogue: frame size=0 */
43
  44 0052 0895      		ret
44
  45               	/* epilogue end (size=1) */
45
  46               	/* function SPI_MasterInit size 42 (41) */
46
  48               	.global	UpdateSPI_Buffer
47
  50               	UpdateSPI_Buffer:
48
  51               	/* prologue: frame size=0 */
49
  52 0054 EF92      		push r14
50
  53 0056 FF92      		push r15
51
  54 0058 0F93      		push r16
52
  55 005a 1F93      		push r17
53
  56               	/* prologue end (size=4) */
54
  57               	/* #APP */
55
  58 005c F894      		cli
56
  59               	/* #NOAPP */
57
  60 005e E090 0000 		lds r14,EE_Parameter+20
58
  61 0062 FF24      		clr r15
59
  62 0064 EE0C      		lsl r14
60
  63 0066 FF1C      		rol r15
61
  64 0068 EE0C      		lsl r14
62
  65 006a FF1C      		rol r15
63
  66 006c 0027      		clr r16
64
  67 006e F7FC      		sbrc r15,7
65
  68 0070 0095      		com r16
66
  69 0072 102F      		mov r17,r16
67
  70 0074 6091 0000 		lds r22,IntegralNick
68
  71 0078 7091 0000 		lds r23,(IntegralNick)+1
69
  72 007c 8091 0000 		lds r24,(IntegralNick)+2
70
  73 0080 9091 0000 		lds r25,(IntegralNick)+3
71
  74 0084 A801      		movw r20,r16
72
  75 0086 9701      		movw r18,r14
73
  76 0088 0E94 0000 		call __divmodsi4
74
  77 008c 3093 0000 		sts (ToNaviCtrl+3)+1,r19
75
  78 0090 2093 0000 		sts ToNaviCtrl+3,r18
76
  79 0094 6091 0000 		lds r22,IntegralRoll
77
  80 0098 7091 0000 		lds r23,(IntegralRoll)+1
78
  81 009c 8091 0000 		lds r24,(IntegralRoll)+2
79
  82 00a0 9091 0000 		lds r25,(IntegralRoll)+3
80
  83 00a4 A801      		movw r20,r16
81
  84 00a6 9701      		movw r18,r14
82
  85 00a8 0E94 0000 		call __divmodsi4
83
  86 00ac 3093 0000 		sts (ToNaviCtrl+5)+1,r19
84
  87 00b0 2093 0000 		sts ToNaviCtrl+5,r18
85
  88 00b4 6091 0000 		lds r22,ErsatzKompass
86
  89 00b8 7091 0000 		lds r23,(ErsatzKompass)+1
87
  90 00bc 8091 0000 		lds r24,(ErsatzKompass)+2
88
  91 00c0 9091 0000 		lds r25,(ErsatzKompass)+3
89
  92 00c4 2AE0      		ldi r18,lo8(10)
90
  93 00c6 30E0      		ldi r19,hi8(10)
91
  94 00c8 40E0      		ldi r20,hlo8(10)
92
  95 00ca 50E0      		ldi r21,hhi8(10)
93
  96 00cc 0E94 0000 		call __mulsi3
94
  97 00d0 2091 0000 		lds r18,GIER_GRAD_FAKTOR
95
  98 00d4 3091 0000 		lds r19,(GIER_GRAD_FAKTOR)+1
96
  99 00d8 4091 0000 		lds r20,(GIER_GRAD_FAKTOR)+2
97
 100 00dc 5091 0000 		lds r21,(GIER_GRAD_FAKTOR)+3
98
 101 00e0 0E94 0000 		call __divmodsi4
99
 102 00e4 3093 0000 		sts (ToNaviCtrl+11)+1,r19
100
 103 00e8 2093 0000 		sts ToNaviCtrl+11,r18
101
 104 00ec E091 0000 		lds r30,NaviCntAcc
102
 105 00f0 F091 0000 		lds r31,(NaviCntAcc)+1
103
 106 00f4 8091 0000 		lds r24,NaviAccNick
104
 107 00f8 9091 0000 		lds r25,(NaviAccNick)+1
105
 108 00fc BF01      		movw r22,r30
106
 109 00fe 0E94 0000 		call __divmodhi4
107
 110 0102 CB01      		movw r24,r22
108
 111 0104 880F      		lsl r24
109
 112 0106 991F      		rol r25
110
 113 0108 860F      		add r24,r22
111
 114 010a 971F      		adc r25,r23
112
 115 010c 9C01      		movw r18,r24
113
 116 010e 220F      		lsl r18
114
 117 0110 331F      		rol r19
115
 118 0112 96FD      		sbrc r25,6
116
 119 0114 00C0      		rjmp .L39
117
 120               	.L4:
118
 121 0116 3595      		asr r19
119
 122 0118 2795      		ror r18
120
 123 011a 3595      		asr r19
121
 124 011c 2795      		ror r18
122
 125 011e 3093 0000 		sts (ToNaviCtrl+7)+1,r19
123
 126 0122 2093 0000 		sts ToNaviCtrl+7,r18
124
 127 0126 8091 0000 		lds r24,NaviAccRoll
125
 128 012a 9091 0000 		lds r25,(NaviAccRoll)+1
126
 129 012e BF01      		movw r22,r30
127
 130 0130 0E94 0000 		call __divmodhi4
128
 131 0134 CB01      		movw r24,r22
129
 132 0136 880F      		lsl r24
130
 133 0138 991F      		rol r25
131
 134 013a 860F      		add r24,r22
132
 135 013c 971F      		adc r25,r23
133
 136 013e 9C01      		movw r18,r24
134
 137 0140 220F      		lsl r18
135
 138 0142 331F      		rol r19
136
 139 0144 96FD      		sbrc r25,6
137
 140 0146 00C0      		rjmp .L40
138
 141               	.L5:
139
 142 0148 3595      		asr r19
140
 143 014a 2795      		ror r18
141
 144 014c 3595      		asr r19
142
 145 014e 2795      		ror r18
143
 146 0150 3093 0000 		sts (ToNaviCtrl+9)+1,r19
144
 147 0154 2093 0000 		sts ToNaviCtrl+9,r18
145
 148 0158 1092 0000 		sts (NaviCntAcc)+1,__zero_reg__
146
 149 015c 1092 0000 		sts NaviCntAcc,__zero_reg__
147
 150 0160 1092 0000 		sts (NaviAccNick)+1,__zero_reg__
148
 151 0164 1092 0000 		sts NaviAccNick,__zero_reg__
149
 152 0168 1092 0000 		sts (NaviAccRoll)+1,__zero_reg__
150
 153 016c 1092 0000 		sts NaviAccRoll,__zero_reg__
151
 154 0170 8091 0000 		lds r24,ToNaviCtrl+2
152
 155 0174 8C30      		cpi r24,lo8(12)
153
 156 0176 01F4      		brne .+2
154
 157 0178 00C0      		rjmp .L9
155
 158 017a 8D30      		cpi r24,lo8(13)
156
 159 017c 00F4      		brsh .+2
157
 160 017e 00C0      		rjmp .L41
158
 161 0180 8D30      		cpi r24,lo8(13)
159
 162 0182 01F4      		brne .+2
160
 163 0184 00C0      		rjmp .L10
161
 164 0186 8E30      		cpi r24,lo8(14)
162
 165 0188 01F4      		brne .+2
163
 166 018a 00C0      		rjmp .L42
164
 167               	.L6:
165
 168               	/* #APP */
166
 169 018c 7894      		sei
167
 170               	/* #NOAPP */
168
 171 018e 8091 0000 		lds r24,SPI_RxDataValid
169
 172 0192 8823      		tst r24
170
 173 0194 01F4      		brne .+2
171
 174 0196 00C0      		rjmp .L24
172
 175               	.L45:
173
 176 0198 2091 0000 		lds r18,FromNaviCtrl+1
174
 177 019c 3091 0000 		lds r19,(FromNaviCtrl+1)+1
175
 178 01a0 C901      		movw r24,r18
176
 179 01a2 8150      		subi r24,lo8(-(511))
177
 180 01a4 9E4F      		sbci r25,hi8(-(511))
178
 181 01a6 8F5F      		subi r24,lo8(1023)
179
 182 01a8 9340      		sbci r25,hi8(1023)
180
 183 01aa 00F4      		brsh .L26
181
 184 01ac 4091 0000 		lds r20,FromNaviCtrl+3
182
 185 01b0 5091 0000 		lds r21,(FromNaviCtrl+3)+1
183
 186 01b4 CA01      		movw r24,r20
184
 187 01b6 8150      		subi r24,lo8(-(511))
185
 188 01b8 9E4F      		sbci r25,hi8(-(511))
186
 189 01ba 8F5F      		subi r24,lo8(1023)
187
 190 01bc 9340      		sbci r25,hi8(1023)
188
 191 01be 00F4      		brsh .+2
189
 192 01c0 00C0      		rjmp .L43
190
 193               	.L26:
191
 194 01c2 8091 0000 		lds r24,FromNaviCtrl+7
192
 195 01c6 9091 0000 		lds r25,(FromNaviCtrl+7)+1
193
 196 01ca 21E0      		ldi r18,hi8(361)
194
 197 01cc 8936      		cpi r24,lo8(361)
195
 198 01ce 9207      		cpc r25,r18
196
 199 01d0 04F4      		brge .L30
197
 200 01d2 9093 0000 		sts (KompassValue)+1,r25
198
 201 01d6 8093 0000 		sts KompassValue,r24
199
 202               	.L30:
200
 203 01da 8091 0000 		lds r24,KompassValue
201
 204 01de 9091 0000 		lds r25,(KompassValue)+1
202
 205 01e2 845E      		subi r24,lo8(-(540))
203
 206 01e4 9D4F      		sbci r25,hi8(-(540))
204
 207 01e6 2091 0000 		lds r18,KompassStartwert
205
 208 01ea 3091 0000 		lds r19,(KompassStartwert)+1
206
 209 01ee 821B      		sub r24,r18
207
 210 01f0 930B      		sbc r25,r19
208
 211 01f2 68E6      		ldi r22,lo8(360)
209
 212 01f4 71E0      		ldi r23,hi8(360)
210
 213 01f6 0E94 0000 		call __divmodhi4
211
 214 01fa 845B      		subi r24,lo8(-(-180))
212
 215 01fc 9040      		sbci r25,hi8(-(-180))
213
 216 01fe 9093 0000 		sts (KompassRichtung)+1,r25
214
 217 0202 8093 0000 		sts KompassRichtung,r24
215
 218 0206 2091 0000 		lds r18,FromNaviCtrl+11
216
 219 020a 3091 0000 		lds r19,(FromNaviCtrl+11)+1
217
 220 020e 8091 0000 		lds r24,beeptime
218
 221 0212 9091 0000 		lds r25,(beeptime)+1
219
 222 0216 8217      		cp r24,r18
220
 223 0218 9307      		cpc r25,r19
221
 224 021a 00F4      		brsh .L32
222
 225 021c 8091 0000 		lds r24,WinkelOut+6
223
 226 0220 8823      		tst r24
224
 227 0222 01F4      		brne .+2
225
 228 0224 00C0      		rjmp .L44
226
 229               	.L32:
227
 230 0226 8091 0000 		lds r24,FromNaviCtrl
228
 231 022a 8736      		cpi r24,lo8(103)
229
 232 022c 01F0      		breq .+2
230
 233 022e 00C0      		rjmp .L37
231
 234 0230 8091 0000 		lds r24,FromNaviCtrl+13
232
 235 0234 8093 0000 		sts FromNaviCtrl_Value,r24
233
 236 0238 8091 0000 		lds r24,FromNaviCtrl+14
234
 237 023c 8093 0000 		sts FromNaviCtrl_Value+2,r24
235
 238 0240 8091 0000 		lds r24,FromNaviCtrl+15
236
 239 0244 8093 0000 		sts FromNaviCtrl_Value+1,r24
237
 240 0248 00C0      		rjmp .L37
238
 241               	.L41:
239
 242 024a 8A30      		cpi r24,lo8(10)
240
 243 024c 01F4      		brne .+2
241
 244 024e 00C0      		rjmp .L7
242
 245 0250 8B30      		cpi r24,lo8(11)
243
 246 0252 01F0      		breq .+2
244
 247 0254 00C0      		rjmp .L6
245
 248 0256 E091 0000 		lds r30,EE_Parameter+2
246
 249 025a F0E0      		ldi r31,lo8(0)
247
 250 025c EE0F      		lsl r30
248
 251 025e FF1F      		rol r31
249
 252 0260 E050      		subi r30,lo8(-(PPM_in))
250
 253 0262 F040      		sbci r31,hi8(-(PPM_in))
251
 254 0264 0190      		ld __tmp_reg__,Z+
252
 255 0266 F081      		ld r31,Z
253
 256 0268 E02D      		mov r30,__tmp_reg__
254
 257 026a 2FEF      		ldi r18,hi8(-127)
255
 258 026c E138      		cpi r30,lo8(-127)
256
 259 026e F207      		cpc r31,r18
257
 260 0270 04F4      		brge .L13
258
 261 0272 E1E8      		ldi r30,lo8(-127)
259
 262 0274 FFEF      		ldi r31,hi8(-127)
260
 263               	.L13:
261
 264 0276 E038      		cpi r30,128
262
 265 0278 F105      		cpc r31,__zero_reg__
263
 266 027a 04F0      		brlt .L14
264
 267 027c EFE7      		ldi r30,lo8(127)
265
 268 027e F0E0      		ldi r31,hi8(127)
266
 269               	.L14:
267
 270 0280 E093 0000 		sts ToNaviCtrl+19,r30
268
 271 0284 E091 0000 		lds r30,EE_Parameter+3
269
 272 0288 F0E0      		ldi r31,lo8(0)
270
 273 028a EE0F      		lsl r30
271
 274 028c FF1F      		rol r31
272
 275 028e E050      		subi r30,lo8(-(PPM_in))
273
 276 0290 F040      		sbci r31,hi8(-(PPM_in))
274
 277 0292 0190      		ld __tmp_reg__,Z+
275
 278 0294 F081      		ld r31,Z
276
 279 0296 E02D      		mov r30,__tmp_reg__
277
 280 0298 4FEF      		ldi r20,hi8(-127)
278
 281 029a E138      		cpi r30,lo8(-127)
279
 282 029c F407      		cpc r31,r20
280
 283 029e 04F4      		brge .L15
281
 284 02a0 E1E8      		ldi r30,lo8(-127)
282
 285 02a2 FFEF      		ldi r31,hi8(-127)
283
 286               	.L15:
284
 287 02a4 E038      		cpi r30,128
285
 288 02a6 F105      		cpc r31,__zero_reg__
286
 289 02a8 04F0      		brlt .L16
287
 290 02aa EFE7      		ldi r30,lo8(127)
288
 291 02ac F0E0      		ldi r31,hi8(127)
289
 292               	.L16:
290
 293 02ae E093 0000 		sts ToNaviCtrl+20,r30
291
 294 02b2 E091 0000 		lds r30,EE_Parameter+1
292
 295 02b6 F0E0      		ldi r31,lo8(0)
293
 296 02b8 EE0F      		lsl r30
294
 297 02ba FF1F      		rol r31
295
 298 02bc E050      		subi r30,lo8(-(PPM_in))
296
 299 02be F040      		sbci r31,hi8(-(PPM_in))
297
 300 02c0 0190      		ld __tmp_reg__,Z+
298
 301 02c2 F081      		ld r31,Z
299
 302 02c4 E02D      		mov r30,__tmp_reg__
300
 303 02c6 6FEF      		ldi r22,hi8(-127)
301
 304 02c8 E138      		cpi r30,lo8(-127)
302
 305 02ca F607      		cpc r31,r22
303
 306 02cc 04F4      		brge .L17
304
 307 02ce E1E8      		ldi r30,lo8(-127)
305
 308 02d0 FFEF      		ldi r31,hi8(-127)
306
 309               	.L17:
307
 310 02d2 E038      		cpi r30,128
308
 311 02d4 F105      		cpc r31,__zero_reg__
309
 312 02d6 04F0      		brlt .L18
310
 313 02d8 EFE7      		ldi r30,lo8(127)
311
 314 02da F0E0      		ldi r31,hi8(127)
312
 315               	.L18:
313
 316 02dc E093 0000 		sts ToNaviCtrl+21,r30
314
 317 02e0 E091 0000 		lds r30,EE_Parameter
315
 318 02e4 F0E0      		ldi r31,lo8(0)
316
 319 02e6 EE0F      		lsl r30
317
 320 02e8 FF1F      		rol r31
318
 321 02ea E050      		subi r30,lo8(-(PPM_in))
319
 322 02ec F040      		sbci r31,hi8(-(PPM_in))
320
 323 02ee 0190      		ld __tmp_reg__,Z+
321
 324 02f0 F081      		ld r31,Z
322
 325 02f2 E02D      		mov r30,__tmp_reg__
323
 326 02f4 8FEF      		ldi r24,hi8(-127)
324
 327 02f6 E138      		cpi r30,lo8(-127)
325
 328 02f8 F807      		cpc r31,r24
326
 329 02fa 04F4      		brge .L19
327
 330 02fc E1E8      		ldi r30,lo8(-127)
328
 331 02fe FFEF      		ldi r31,hi8(-127)
329
 332               	.L19:
330
 333 0300 E038      		cpi r30,128
331
 334 0302 F105      		cpc r31,__zero_reg__
332
 335 0304 04F0      		brlt .L20
333
 336 0306 EFE7      		ldi r30,lo8(127)
334
 337 0308 F0E0      		ldi r31,hi8(127)
335
 338               	.L20:
336
 339 030a E093 0000 		sts ToNaviCtrl+22,r30
337
 340 030e 8091 0000 		lds r24,Poti1
338
 341 0312 8093 0000 		sts ToNaviCtrl+23,r24
339
 342 0316 8091 0000 		lds r24,Poti2
340
 343 031a 8093 0000 		sts ToNaviCtrl+24,r24
341
 344 031e 8091 0000 		lds r24,Poti3
342
 345 0322 8093 0000 		sts ToNaviCtrl+25,r24
343
 346 0326 8091 0000 		lds r24,Poti4
344
 347 032a 8093 0000 		sts ToNaviCtrl+26,r24
345
 348 032e 8091 0000 		lds r24,SenderOkay
346
 349 0332 8093 0000 		sts ToNaviCtrl+27,r24
347
 350               	/* #APP */
348
 351 0336 7894      		sei
349
 352               	/* #NOAPP */
350
 353 0338 8091 0000 		lds r24,SPI_RxDataValid
351
 354 033c 8823      		tst r24
352
 355 033e 01F0      		breq .+2
353
 356 0340 00C0      		rjmp .L45
354
 357               	.L24:
355
 358 0342 1092 0000 		sts (GPS_Nick)+1,__zero_reg__
356
 359 0346 1092 0000 		sts GPS_Nick,__zero_reg__
357
 360 034a 1092 0000 		sts (GPS_Roll)+1,__zero_reg__
358
 361 034e 1092 0000 		sts GPS_Roll,__zero_reg__
359
 362 0352 00C0      		rjmp .L37
360
 363               	.L40:
361
 364 0354 2D5F      		subi r18,lo8(-(3))
362
 365 0356 3F4F      		sbci r19,hi8(-(3))
363
 366 0358 00C0      		rjmp .L5
364
 367               	.L39:
365
 368 035a 2D5F      		subi r18,lo8(-(3))
366
 369 035c 3F4F      		sbci r19,hi8(-(3))
367
 370 035e 00C0      		rjmp .L4
368
 371               	.L44:
369
 372 0360 3093 0000 		sts (beeptime)+1,r19
370
 373 0364 2093 0000 		sts beeptime,r18
371
 374 0368 00C0      		rjmp .L32
372
 375               	.L43:
373
 376 036a 8091 0000 		lds r24,EE_Parameter+8
374
 377 036e 85FF      		sbrs r24,5
375
 378 0370 00C0      		rjmp .L26
376
 379 0372 3093 0000 		sts (GPS_Nick)+1,r19
377
 380 0376 2093 0000 		sts GPS_Nick,r18
378
 381 037a 5093 0000 		sts (GPS_Roll)+1,r21
379
 382 037e 4093 0000 		sts GPS_Roll,r20
380
 383 0382 00C0      		rjmp .L26
381
 384               	.L42:
382
 385 0384 8091 0000 		lds r24,SPI_VersionInfo
383
 386 0388 8093 0000 		sts ToNaviCtrl+19,r24
384
 387 038c 8091 0000 		lds r24,SPI_VersionInfo+1
385
 388 0390 8093 0000 		sts ToNaviCtrl+20,r24
386
 389 0394 8091 0000 		lds r24,SPI_VersionInfo+2
387
 390 0398 8093 0000 		sts ToNaviCtrl+21,r24
388
 391 039c 8091 0000 		lds r24,SPI_VersionInfo+3
389
 392 03a0 8093 0000 		sts ToNaviCtrl+22,r24
390
 393 03a4 8091 0000 		lds r24,PlatinenVersion
391
 394 03a8 8093 0000 		sts ToNaviCtrl+23,r24
392
 395 03ac 00C0      		rjmp .L6
393
 396               	.L10:
394
 397 03ae 8091 0000 		lds r24,EE_Parameter+58
395
 398 03b2 8093 0000 		sts ToNaviCtrl+19,r24
396
 399 03b6 8091 0000 		lds r24,EE_Parameter+59
397
 400 03ba 8093 0000 		sts ToNaviCtrl+20,r24
398
 401 03be 8091 0000 		lds r24,EE_Parameter+60
399
 402 03c2 8093 0000 		sts ToNaviCtrl+21,r24
400
 403 03c6 8091 0000 		lds r24,EE_Parameter+61
401
 404 03ca 8093 0000 		sts ToNaviCtrl+22,r24
402
 405 03ce 8091 0000 		lds r24,EE_Parameter+62
403
 406 03d2 8093 0000 		sts ToNaviCtrl+23,r24
404
 407 03d6 8091 0000 		lds r24,EE_Parameter+66
405
 408 03da 8093 0000 		sts ToNaviCtrl+24,r24
406
 409 03de 8091 0000 		lds r24,EE_Parameter+67
407
 410 03e2 8093 0000 		sts ToNaviCtrl+25,r24
408
 411 03e6 8091 0000 		lds r24,EE_Parameter+68
409
 412 03ea 8093 0000 		sts ToNaviCtrl+26,r24
410
 413 03ee 8091 0000 		lds r24,EE_Parameter+71
411
 414 03f2 8093 0000 		sts ToNaviCtrl+27,r24
412
 415 03f6 8091 0000 		lds r24,EE_Parameter+69
413
 416 03fa 8093 0000 		sts ToNaviCtrl+28,r24
414
 417 03fe 8091 0000 		lds r24,EE_Parameter+70
415
 418 0402 8093 0000 		sts ToNaviCtrl+29,r24
416
 419 0406 8091 0000 		lds r24,EE_Parameter+72
417
 420 040a 8093 0000 		sts ToNaviCtrl+30,r24
418
 421 040e 00C0      		rjmp .L6
419
 422               	.L7:
420
 423 0410 8091 0000 		lds r24,Parameter_UserParam1
421
 424 0414 8093 0000 		sts ToNaviCtrl+19,r24
422
 425 0418 8091 0000 		lds r24,Parameter_UserParam2
423
 426 041c 8093 0000 		sts ToNaviCtrl+20,r24
424
 427 0420 8091 0000 		lds r24,Parameter_UserParam3
425
 428 0424 8093 0000 		sts ToNaviCtrl+21,r24
426
 429 0428 8091 0000 		lds r24,Parameter_UserParam4
427
 430 042c 8093 0000 		sts ToNaviCtrl+22,r24
428
 431 0430 8091 0000 		lds r24,Parameter_UserParam5
429
 432 0434 8093 0000 		sts ToNaviCtrl+23,r24
430
 433 0438 8091 0000 		lds r24,Parameter_UserParam6
431
 434 043c 8093 0000 		sts ToNaviCtrl+24,r24
432
 435 0440 8091 0000 		lds r24,Parameter_UserParam7
433
 436 0444 8093 0000 		sts ToNaviCtrl+25,r24
434
 437 0448 8091 0000 		lds r24,Parameter_UserParam8
435
 438 044c 8093 0000 		sts ToNaviCtrl+26,r24
436
 439 0450 8091 0000 		lds r24,MikroKopterFlags
437
 440 0454 8093 0000 		sts ToNaviCtrl+27,r24
438
 441 0458 837F      		andi r24,lo8(-13)
439
 442 045a 8093 0000 		sts MikroKopterFlags,r24
440
 443 045e 8091 0000 		lds r24,UBat
441
 444 0462 9091 0000 		lds r25,(UBat)+1
442
 445 0466 8093 0000 		sts ToNaviCtrl+28,r24
443
 446 046a 8091 0000 		lds r24,EE_Parameter+25
444
 447 046e 8093 0000 		sts ToNaviCtrl+29,r24
445
 448 0472 A0E0      		ldi r26,lo8(EEPromArray+2)
446
 449 0474 B0E0      		ldi r27,hi8(EEPromArray+2)
447
 450               	/* #APP */
448
 451 0476 0E94 0000 		call __eeprom_read_byte_1F2021
449
 452 047a 802D      		mov r24,__tmp_reg__
450
 453               	/* #NOAPP */
451
 454 047c 8093 0000 		sts ToNaviCtrl+30,r24
452
 455 0480 00C0      		rjmp .L6
453
 456               	.L9:
454
 457 0482 8091 0000 		lds r24,WinkelOut+6
455
 458 0486 8630      		cpi r24,lo8(6)
456
 459 0488 00F0      		brlo .L21
457
 460 048a 1092 0000 		sts WinkelOut+6,__zero_reg__
458
 461 048e 85E0      		ldi r24,lo8(5)
459
 462 0490 8093 0000 		sts ToNaviCtrl+19,r24
460
 463               	.L23:
461
 464 0494 8091 0000 		lds r24,HoehenWert
462
 465 0498 9091 0000 		lds r25,(HoehenWert)+1
463
 466 049c 9093 0000 		sts (ToNaviCtrl+21)+1,r25
464
 467 04a0 8093 0000 		sts ToNaviCtrl+21,r24
465
 468 04a4 8091 0000 		lds r24,EE_Parameter+73
466
 469 04a8 8093 0000 		sts ToNaviCtrl+20,r24
467
 470 04ac 8091 0000 		lds r24,EE_Parameter+63
468
 471 04b0 8093 0000 		sts ToNaviCtrl+23,r24
469
 472 04b4 8091 0000 		lds r24,EE_Parameter+64
470
 473 04b8 8093 0000 		sts ToNaviCtrl+24,r24
471
 474 04bc 8091 0000 		lds r24,EE_Parameter+65
472
 475 04c0 8093 0000 		sts ToNaviCtrl+25,r24
473
 476 04c4 00C0      		rjmp .L6
474
 477               	.L21:
475
 478 04c6 8093 0000 		sts ToNaviCtrl+19,r24
476
 479 04ca 00C0      		rjmp .L23
477
 480               	.L37:
478
 481               	/* epilogue: frame size=0 */
479
 482 04cc 1F91      		pop r17
480
 483 04ce 0F91      		pop r16
481
 484 04d0 FF90      		pop r15
482
 485 04d2 EF90      		pop r14
483
 486 04d4 0895      		ret
484
 487               	/* epilogue end (size=5) */
485
 488               	/* function UpdateSPI_Buffer size 583 (574) */
486
 490               	.global	SPI_StartTransmitPacket
487
 492               	SPI_StartTransmitPacket:
488
 493               	/* prologue: frame size=0 */
489
 494               	/* prologue end (size=0) */
490
 495 04d6 8091 0000 		lds r24,SPITransferCompleted
491
 496 04da 8823      		tst r24
492
 497 04dc 01F4      		brne .+2
493
 498 04de 00C0      		rjmp .L51
494
 499 04e0 4598      		cbi 40-0x20,5
495
 500 04e2 80E0      		ldi r24,lo8(ToNaviCtrl)
496
 501 04e4 90E0      		ldi r25,hi8(ToNaviCtrl)
497
 502 04e6 9093 0000 		sts (SPI_TX_Buffer)+1,r25
498
 503 04ea 8093 0000 		sts SPI_TX_Buffer,r24
499
 504 04ee 9091 0000 		lds r25,SPI_CommandCounter
500
 505 04f2 E92F      		mov r30,r25
501
 506 04f4 F0E0      		ldi r31,lo8(0)
502
 507 04f6 E050      		subi r30,lo8(-(SPI_CommandSequence))
503
 508 04f8 F040      		sbci r31,hi8(-(SPI_CommandSequence))
504
 509 04fa 8081      		ld r24,Z
505
 510 04fc 8093 0000 		sts ToNaviCtrl+2,r24
506
 511 0500 9F5F      		subi r25,lo8(-(1))
507
 512 0502 9093 0000 		sts SPI_CommandCounter,r25
508
 513 0506 9630      		cpi r25,lo8(6)
509
 514 0508 00F0      		brlo .L49
510
 515 050a 1092 0000 		sts SPI_CommandCounter,__zero_reg__
511
 516               	.L49:
512
 517 050e 1092 0000 		sts SPITransferCompleted,__zero_reg__
513
 518 0512 0E94 0000 		call UpdateSPI_Buffer
514
 519 0516 81E0      		ldi r24,lo8(1)
515
 520 0518 8093 0000 		sts SPI_BufferIndex,r24
516
 521               	/* #APP */
517
 522 051c 0000      		nop
518
 523 051e 0000      		nop
519
 524 0520 0000      		nop
520
 525 0522 0000      		nop
521
 526 0524 0000      		nop
522
 527 0526 0000      		nop
523
 528 0528 0000      		nop
524
 529 052a 0000      		nop
525
 530 052c 0000      		nop
526
 531 052e 0000      		nop
527
 532 0530 0000      		nop
528
 533 0532 0000      		nop
529
 534 0534 0000      		nop
530
 535 0536 0000      		nop
531
 536 0538 0000      		nop
532
 537 053a 0000      		nop
533
 538 053c 0000      		nop
534
 539 053e 0000      		nop
535
 540 0540 0000      		nop
536
 541 0542 0000      		nop
537
 542 0544 0000      		nop
538
 543 0546 0000      		nop
539
 544 0548 0000      		nop
540
 545 054a 0000      		nop
541
 546               	/* #NOAPP */
542
 547 054c 8091 0000 		lds r24,ToNaviCtrl
543
 548 0550 8093 0000 		sts ToNaviCtrl+31,r24
544
 549 0554 8EBD      		out 78-0x20,r24
545
 550               	.L51:
546
 551 0556 0895      		ret
547
 552               	/* epilogue: frame size=0 */
548
 553               	/* epilogue: noreturn */
549
 554               	/* epilogue end (size=0) */
550
 555               	/* function SPI_StartTransmitPacket size 89 (89) */
551
 557               	.global	SPI_TransmitByte
552
 559               	SPI_TransmitByte:
553
 560               	/* prologue: frame size=0 */
554
 561               	/* prologue end (size=0) */
555
 562 0558 8091 0000 		lds r24,SPITransferCompleted
556
 563 055c 8823      		tst r24
557
 564 055e 01F4      		brne .L72
558
 565 0560 0DB4      		in __tmp_reg__,77-0x20
559
 566 0562 07FE      		sbrs __tmp_reg__,7
560
 567               	.L72:
561
 568 0564 0895      		ret
562
 569               	.L75:
563
 570 0566 84E0      		ldi r24,lo8(4)
564
 571 0568 8093 0000 		sts SendSPI,r24
565
 572 056c 459A      		sbi 40-0x20,5
566
 573 056e 9EB5      		in r25,78-0x20
567
 574 0570 8091 0000 		lds r24,SPI_RXState.2396
568
 575 0574 8130      		cpi r24,lo8(1)
569
 576 0576 01F4      		brne .+2
570
 577 0578 00C0      		rjmp .L58
571
 578 057a 8130      		cpi r24,lo8(1)
572
 579 057c 00F0      		brlo .+2
573
 580 057e 00C0      		rjmp .L76
574
 581 0580 1092 0000 		sts SPI_RxBufferIndex,__zero_reg__
575
 582 0584 9093 0000 		sts rxchksum.2398,r25
576
 583 0588 9138      		cpi r25,lo8(-127)
577
 584 058a 01F4      		brne .+2
578
 585 058c 00C0      		rjmp .L77
579
 586               	.L56:
580
 587 058e 2091 0000 		lds r18,SPI_BufferIndex
581
 588 0592 2032      		cpi r18,lo8(32)
582
 589 0594 00F0      		brlo .+2
583
 590 0596 00C0      		rjmp .L69
584
 591 0598 4598      		cbi 40-0x20,5
585
 592               	/* #APP */
586
 593 059a 0000      		nop
587
 594 059c 0000      		nop
588
 595 059e 0000      		nop
589
 596 05a0 0000      		nop
590
 597 05a2 0000      		nop
591
 598 05a4 0000      		nop
592
 599 05a6 0000      		nop
593
 600 05a8 0000      		nop
594
 601 05aa 0000      		nop
595
 602 05ac 0000      		nop
596
 603 05ae 0000      		nop
597
 604 05b0 0000      		nop
598
 605 05b2 0000      		nop
599
 606 05b4 0000      		nop
600
 607 05b6 0000      		nop
601
 608 05b8 0000      		nop
602
 609 05ba 0000      		nop
603
 610 05bc 0000      		nop
604
 611 05be 0000      		nop
605
 612 05c0 0000      		nop
606
 613 05c2 0000      		nop
607
 614 05c4 0000      		nop
608
 615 05c6 0000      		nop
609
 616 05c8 0000      		nop
610
 617               	/* #NOAPP */
611
 618 05ca E091 0000 		lds r30,SPI_TX_Buffer
612
 619 05ce F091 0000 		lds r31,(SPI_TX_Buffer)+1
613
 620 05d2 E20F      		add r30,r18
614
 621 05d4 F11D      		adc r31,__zero_reg__
615
 622 05d6 8081      		ld r24,Z
616
 623 05d8 8EBD      		out 78-0x20,r24
617
 624 05da 8081      		ld r24,Z
618
 625 05dc 9091 0000 		lds r25,ToNaviCtrl+31
619
 626 05e0 890F      		add r24,r25
620
 627 05e2 8093 0000 		sts ToNaviCtrl+31,r24
621
 628               	.L71:
622
 629 05e6 2F5F      		subi r18,lo8(-(1))
623
 630 05e8 2093 0000 		sts SPI_BufferIndex,r18
624
 631 05ec 0895      		ret
625
 632               	.L58:
626
 633 05ee 9535      		cpi r25,lo8(85)
627
 634 05f0 01F0      		breq .L78
628
 635               	.L68:
629
 636 05f2 1092 0000 		sts SPI_RXState.2396,__zero_reg__
630
 637 05f6 00C0      		rjmp .L56
631
 638               	.L69:
632
 639 05f8 81E0      		ldi r24,lo8(1)
633
 640 05fa 8093 0000 		sts SPITransferCompleted,r24
634
 641 05fe 00C0      		rjmp .L71
635
 642               	.L76:
636
 643 0600 8230      		cpi r24,lo8(2)
637
 644 0602 01F0      		breq .+2
638
 645 0604 00C0      		rjmp .L56
639
 646 0606 8091 0000 		lds r24,SPI_RxBufferIndex
640
 647 060a E82F      		mov r30,r24
641
 648 060c F0E0      		ldi r31,lo8(0)
642
 649 060e E050      		subi r30,lo8(-(SPI_Buffer))
643
 650 0610 F040      		sbci r31,hi8(-(SPI_Buffer))
644
 651 0612 9083      		st Z,r25
645
 652 0614 8F5F      		subi r24,lo8(-(1))
646
 653 0616 8093 0000 		sts SPI_RxBufferIndex,r24
647
 654 061a 8A31      		cpi r24,lo8(26)
648
 655 061c 00F0      		brlo .L63
649
 656 061e 8091 0000 		lds r24,rxchksum.2398
650
 657 0622 9817      		cp r25,r24
651
 658 0624 01F0      		breq .L79
652
 659 0626 1092 0000 		sts SPI_RxDataValid,__zero_reg__
653
 660 062a 00C0      		rjmp .L68
654
 661               	.L63:
655
 662 062c 8091 0000 		lds r24,rxchksum.2398
656
 663 0630 890F      		add r24,r25
657
 664 0632 8093 0000 		sts rxchksum.2398,r24
658
 665 0636 00C0      		rjmp .L56
659
 666               	.L78:
660
 667 0638 8091 0000 		lds r24,rxchksum.2398
661
 668 063c 8B5A      		subi r24,lo8(-(85))
662
 669 063e 8093 0000 		sts rxchksum.2398,r24
663
 670 0642 82E0      		ldi r24,lo8(2)
664
 671 0644 8093 0000 		sts SPI_RXState.2396,r24
665
 672 0648 00C0      		rjmp .L56
666
 673               	.L77:
667
 674 064a 81E0      		ldi r24,lo8(1)
668
 675 064c 8093 0000 		sts SPI_RXState.2396,r24
669
 676 0650 00C0      		rjmp .L56
670
 677               	.L79:
671
 678 0652 A0E0      		ldi r26,lo8(FromNaviCtrl)
672
 679 0654 B0E0      		ldi r27,hi8(FromNaviCtrl)
673
 680 0656 E0E0      		ldi r30,lo8(SPI_Buffer)
674
 681 0658 F0E0      		ldi r31,hi8(SPI_Buffer)
675
 682 065a 8AE1      		ldi r24,lo8(26)
676
 683               	.L67:
677
 684 065c 0190      		ld r0,Z+
678
 685 065e 0D92      		st X+,r0
679
 686 0660 8150      		subi r24,lo8(-(-1))
680
 687 0662 01F4      		brne .L67
681
 688 0664 81E0      		ldi r24,lo8(1)
682
 689 0666 8093 0000 		sts SPI_RxDataValid,r24
683
 690 066a 00C0      		rjmp .L68
684
 691               	/* epilogue: frame size=0 */
685
 692               	/* epilogue: noreturn */
686
 693               	/* epilogue end (size=0) */
687
 694               	/* function SPI_TransmitByte size 164 (164) */
688
 696               	.global	SPI_CommandSequence
689
 697               		.data
690
 700               	SPI_CommandSequence:
691
 701 0000 0A        		.byte	10
692
 702 0001 0B        		.byte	11
693
 703 0002 0D        		.byte	13
694
 704 0003 0B        		.byte	11
695
 705 0004 0C        		.byte	12
696
 706 0005 0E        		.byte	14
697
 707               	.global	SPI_CommandCounter
698
 708               	.global	SPI_CommandCounter
699
 709               		.section .bss
700
 712               	SPI_CommandCounter:
701
 713 0000 00        		.skip 1,0
702
 714               		.lcomm rxchksum.2398,1
703
 715               		.lcomm SPI_RXState.2396,1
704
 716               		.comm FromNaviCtrl_Value,3,1
705
 717               		.comm ToNaviCtrl,32,1
706
 718               		.comm FromNaviCtrl,26,1
707
 719               		.comm SPI_VersionInfo,4,1
708
 720               		.comm SPI_BufferIndex,1,1
709
 721               		.comm SPI_RxBufferIndex,1,1
710
 722               		.comm SPI_Buffer,26,1
711
 723               		.comm SPI_TX_Buffer,2,1
712
 724               		.comm SPITransferCompleted,1,1
713
 725               		.comm SPI_ChkSum,1,1
714
 726               		.comm SPI_RxDataValid,1,1
715
 727               	/* File "spi.c": code  878 = 0x036e ( 868), prologues   4, epilogues   6 */
716
DEFINED SYMBOLS
717
                            *ABS*:00000000 spi.c
718
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:2      *ABS*:0000003f __SREG__
719
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:3      *ABS*:0000003e __SP_H__
720
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:4      *ABS*:0000003d __SP_L__
721
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:5      *ABS*:00000000 __tmp_reg__
722
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:6      *ABS*:00000001 __zero_reg__
723
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:12     .text:00000000 SPI_MasterInit
724
                            *COM*:00000001 SPITransferCompleted
725
                            *COM*:00000020 ToNaviCtrl
726
                            *COM*:00000001 SPI_RxDataValid
727
                            *COM*:00000004 SPI_VersionInfo
728
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:50     .text:00000054 UpdateSPI_Buffer
729
                            *COM*:0000001a FromNaviCtrl
730
                            *COM*:00000003 FromNaviCtrl_Value
731
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:492    .text:000004d6 SPI_StartTransmitPacket
732
                            *COM*:00000002 SPI_TX_Buffer
733
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:712    .bss:00000000 SPI_CommandCounter
734
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:700    .data:00000000 SPI_CommandSequence
735
                            *COM*:00000001 SPI_BufferIndex
736
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:559    .text:00000558 SPI_TransmitByte
737
C:\DOKUME~1\DPeters\LOKALE~1\Temp/ccuv0Mvj.s:714    .bss:00000002 SPI_RXState.2396
738
                            *COM*:00000001 SPI_RxBufferIndex
739
                             .bss:00000001 rxchksum.2398
740
                            *COM*:0000001a SPI_Buffer
741
                            *COM*:00000001 SPI_ChkSum
742
 
743
UNDEFINED SYMBOLS
744
__do_copy_data
745
__do_clear_bss
746
EE_Parameter
747
IntegralNick
748
__divmodsi4
749
IntegralRoll
750
ErsatzKompass
751
__mulsi3
752
GIER_GRAD_FAKTOR
753
NaviCntAcc
754
NaviAccNick
755
__divmodhi4
756
NaviAccRoll
757
KompassValue
758
KompassStartwert
759
KompassRichtung
760
beeptime
761
WinkelOut
762
PPM_in
763
Poti1
764
Poti2
765
Poti3
766
Poti4
767
SenderOkay
768
GPS_Nick
769
GPS_Roll
770
PlatinenVersion
771
Parameter_UserParam1
772
Parameter_UserParam2
773
Parameter_UserParam3
774
Parameter_UserParam4
775
Parameter_UserParam5
776
Parameter_UserParam6
777
Parameter_UserParam7
778
Parameter_UserParam8
779
MikroKopterFlags
780
UBat
781
EEPromArray
782
__eeprom_read_byte_1F2021
783
HoehenWert
784
SendSPI