Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
1 .file "spi.c"
2 .arch atmega644p
3 __SREG__ = 0x3f
4 __SP_H__ = 0x3e
5 __SP_L__ = 0x3d
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .global __do_copy_data
9 .global __do_clear_bss
10 .global NC_ErrorCode
11 .global NC_ErrorCode
12 .section .bss
15 NC_ErrorCode:
16 0000 00 .skip 1,0
17 .global SPI_CommandCounter
18 .global SPI_CommandCounter
21 SPI_CommandCounter:
22 0001 00 .skip 1,0
23 .global SPI_CommandSequence
24 .data
27 SPI_CommandSequence:
28 0000 0B .byte 11
29 0001 0A .byte 10
30 0002 0D .byte 13
31 0003 0B .byte 11
32 0004 0C .byte 12
33 0005 0E .byte 14
34 0006 0B .byte 11
35 0007 0F .byte 15
36 0008 10 .byte 16
37 .global NaviDataOkay
40 NaviDataOkay:
41 0009 FA .byte -6
42 .global FromNC_Rotate_S
43 .global FromNC_Rotate_S
44 .section .bss
47 FromNC_Rotate_S:
48 0002 00 .skip 1,0
49 .global FromNC_Rotate_C
50 .data
53 FromNC_Rotate_C:
54 000a 20 .byte 32
55 .text
56 .global SPI_MasterInit
58 SPI_MasterInit:
59 /* prologue: frame size=0 */
60 /* prologue end (size=0) */
61 0000 84B1 in r24,36-0x20
62 0002 806A ori r24,lo8(-96)
63 0004 84B9 out 36-0x20,r24
64 0006 3D9A sbi 39-0x20,5
65 0008 82E5 ldi r24,lo8(82)
66 000a 8CBD out 76-0x20,r24
67 000c 1DBC out 77-0x20,__zero_reg__
68 000e 459A sbi 40-0x20,5
69 0010 81E0 ldi r24,lo8(1)
70 0012 8093 0000 sts SPITransferCompleted,r24
71 0016 8AEA ldi r24,lo8(-86)
72 0018 8093 0000 sts ToNaviCtrl,r24
73 001c 83E8 ldi r24,lo8(-125)
74 001e 8093 0000 sts ToNaviCtrl+1,r24
75 0022 8AE0 ldi r24,lo8(10)
76 0024 8093 0000 sts ToNaviCtrl+2,r24
77 0028 1092 0000 sts (ToNaviCtrl+3)+1,__zero_reg__
78 002c 1092 0000 sts ToNaviCtrl+3,__zero_reg__
79 0030 1092 0000 sts (ToNaviCtrl+5)+1,__zero_reg__
80 0034 1092 0000 sts ToNaviCtrl+5,__zero_reg__
81 0038 1092 0000 sts FromNaviCtrl_Value+3,__zero_reg__
82 003c 1092 0000 sts SPI_RxDataValid,__zero_reg__
83 /* epilogue: frame size=0 */
84 0040 0895 ret
85 /* epilogue end (size=1) */
86 /* function SPI_MasterInit size 33 (32) */
88 .lcomm SPI_RXState.0,1
89 .lcomm rxchksum.1,1
90 .global SPI_TransmitByte
92 SPI_TransmitByte:
93 /* prologue: frame size=0 */
94 /* prologue end (size=0) */
95 0042 3091 0000 lds r19,SPITransferCompleted
96 0046 3323 tst r19
97 0048 09F0 breq .+2
98 004a 85C0 rjmp .L2
99 004c 0DB4 in __tmp_reg__,77-0x20
100 004e 07FE sbrs __tmp_reg__,7
101 0050 82C0 rjmp .L2
102 0052 84E0 ldi r24,lo8(4)
103 0054 8093 0000 sts SendSPI,r24
104 0058 459A sbi 40-0x20,5
105 005a 2EB5 in r18,78-0x20
106 005c 8091 0000 lds r24,SPI_RXState.0
107 0060 9927 clr r25
108 0062 8130 cpi r24,1
109 0064 9105 cpc r25,__zero_reg__
110 0066 89F0 breq .L8
111 0068 8230 cpi r24,2
112 006a 9105 cpc r25,__zero_reg__
113 006c 1CF4 brge .L16
114 006e 892B or r24,r25
115 0070 21F0 breq .L6
116 0072 3EC0 rjmp .L5
117 .L16:
118 0074 0297 sbiw r24,2
119 0076 B9F0 breq .L11
120 0078 3BC0 rjmp .L5
121 .L6:
122 007a 3093 0000 sts SPI_RxBufferIndex,r19
123 007e 2093 0000 sts rxchksum.1,r18
124 0082 2138 cpi r18,lo8(-127)
125 0084 A9F5 brne .L5
126 0086 81E0 ldi r24,lo8(1)
127 0088 08C0 rjmp .L19
128 .L8:
129 008a 2535 cpi r18,lo8(85)
130 008c 49F4 brne .L9
131 008e 8091 0000 lds r24,rxchksum.1
132 0092 820F add r24,r18
133 0094 8093 0000 sts rxchksum.1,r24
134 0098 82E0 ldi r24,lo8(2)
135 .L19:
136 009a 8093 0000 sts SPI_RXState.0,r24
137 009e 28C0 rjmp .L5
138 .L9:
139 00a0 3093 0000 sts SPI_RXState.0,r19
140 00a4 25C0 rjmp .L5
141 .L11:
142 00a6 8091 0000 lds r24,SPI_RxBufferIndex
143 00aa E82F mov r30,r24
144 00ac FF27 clr r31
145 00ae E050 subi r30,lo8(-(SPI_Buffer))
146 00b0 F040 sbci r31,hi8(-(SPI_Buffer))
147 00b2 2083 st Z,r18
148 00b4 8F5F subi r24,lo8(-(1))
149 00b6 8093 0000 sts SPI_RxBufferIndex,r24
150 00ba 9091 0000 lds r25,rxchksum.1
151 00be 8A31 cpi r24,lo8(26)
152 00c0 A0F0 brlo .L12
153 00c2 2917 cp r18,r25
154 00c4 69F4 brne .L13
155 00c6 8AE1 ldi r24,lo8(26)
156 00c8 A0E0 ldi r26,lo8(SPI_Buffer)
157 00ca B0E0 ldi r27,hi8(SPI_Buffer)
158 00cc E0E0 ldi r30,lo8(FromNaviCtrl)
159 00ce F0E0 ldi r31,hi8(FromNaviCtrl)
160 00d0 0D90 ld __tmp_reg__,X+
161 00d2 0192 st Z+,__tmp_reg__
162 00d4 8A95 dec r24
163 00d6 E1F7 brne .-8
164 00d8 81E0 ldi r24,lo8(1)
165 00da 8093 0000 sts SPI_RxDataValid,r24
166 00de 02C0 rjmp .L14
167 .L13:
168 00e0 3093 0000 sts SPI_RxDataValid,r19
169 .L14:
170 00e4 1092 0000 sts SPI_RXState.0,__zero_reg__
171 00e8 03C0 rjmp .L5
172 .L12:
173 00ea 920F add r25,r18
174 00ec 9093 0000 sts rxchksum.1,r25
175 .L5:
176 00f0 2091 0000 lds r18,SPI_BufferIndex
177 00f4 2032 cpi r18,lo8(32)
178 00f6 08F0 brlo .+2
179 00f8 28C0 rjmp .L17
180 00fa 4598 cbi 40-0x20,5
181 /* #APP */
182 00fc 0000 nop
183 00fe 0000 nop
184 0100 0000 nop
185 0102 0000 nop
186 0104 0000 nop
187 0106 0000 nop
188 0108 0000 nop
189 010a 0000 nop
190 010c 0000 nop
191 010e 0000 nop
192 0110 0000 nop
193 0112 0000 nop
194 0114 0000 nop
195 0116 0000 nop
196 0118 0000 nop
197 011a 0000 nop
198 011c 0000 nop
199 011e 0000 nop
200 0120 0000 nop
201 0122 0000 nop
202 0124 0000 nop
203 0126 0000 nop
204 0128 0000 nop
205 012a 0000 nop
206 /* #NOAPP */
207 012c E091 0000 lds r30,SPI_TX_Buffer
208 0130 F091 0000 lds r31,(SPI_TX_Buffer)+1
209 0134 E20F add r30,r18
210 0136 F11D adc r31,__zero_reg__
211 0138 8081 ld r24,Z
212 013a 8EBD out 78-0x20,r24
213 013c 8091 0000 lds r24,ToNaviCtrl+31
214 0140 9081 ld r25,Z
215 0142 890F add r24,r25
216 0144 8093 0000 sts ToNaviCtrl+31,r24
217 0148 03C0 rjmp .L18
218 .L17:
219 014a 81E0 ldi r24,lo8(1)
220 014c 8093 0000 sts SPITransferCompleted,r24
221 .L18:
222 0150 2F5F subi r18,lo8(-(1))
223 0152 2093 0000 sts SPI_BufferIndex,r18
224 .L2:
225 0156 0895 ret
226 /* epilogue: frame size=0 */
227 /* epilogue: noreturn */
228 /* epilogue end (size=0) */
229 /* function SPI_TransmitByte size 164 (164) */
231 .global UpdateSPI_Buffer
233 UpdateSPI_Buffer:
234 /* prologue: frame size=0 */
235 0158 EF92 push r14
236 015a FF92 push r15
237 015c 0F93 push r16
238 015e 1F93 push r17
239 /* prologue end (size=4) */
240 0160 8091 0000 lds r24,EE_Parameter+28
241 0164 9927 clr r25
242 0166 880F lsl r24
243 0168 991F rol r25
244 016a 880F lsl r24
245 016c 991F rol r25
246 016e 7C01 movw r14,r24
247 0170 0027 clr r16
248 0172 F7FC sbrc r15,7
249 0174 0095 com r16
250 0176 102F mov r17,r16
251 0178 8091 0000 lds r24,IntegralNick
252 017c 9091 0000 lds r25,(IntegralNick)+1
253 0180 A091 0000 lds r26,(IntegralNick)+2
254 0184 B091 0000 lds r27,(IntegralNick)+3
255 0188 BC01 movw r22,r24
256 018a CD01 movw r24,r26
257 018c A801 movw r20,r16
258 018e 9701 movw r18,r14
259 0190 0E94 0000 call __divmodsi4
260 0194 3093 0000 sts (ToNaviCtrl+3)+1,r19
261 0198 2093 0000 sts ToNaviCtrl+3,r18
262 019c 8091 0000 lds r24,IntegralRoll
263 01a0 9091 0000 lds r25,(IntegralRoll)+1
264 01a4 A091 0000 lds r26,(IntegralRoll)+2
265 01a8 B091 0000 lds r27,(IntegralRoll)+3
266 01ac BC01 movw r22,r24
267 01ae CD01 movw r24,r26
268 01b0 A801 movw r20,r16
269 01b2 9701 movw r18,r14
270 01b4 0E94 0000 call __divmodsi4
271 01b8 3093 0000 sts (ToNaviCtrl+5)+1,r19
272 01bc 2093 0000 sts ToNaviCtrl+5,r18
273 01c0 2091 0000 lds r18,ErsatzKompass
274 01c4 3091 0000 lds r19,(ErsatzKompass)+1
275 01c8 4091 0000 lds r20,(ErsatzKompass)+2
276 01cc 5091 0000 lds r21,(ErsatzKompass)+3
277 01d0 DA01 movw r26,r20
278 01d2 C901 movw r24,r18
279 01d4 E3E0 ldi r30,3
280 01d6 880F 1: lsl r24
281 01d8 991F rol r25
282 01da AA1F rol r26
283 01dc BB1F rol r27
284 01de EA95 dec r30
285 01e0 D1F7 brne 1b
286 01e2 820F add r24,r18
287 01e4 931F adc r25,r19
288 01e6 A41F adc r26,r20
289 01e8 B51F adc r27,r21
290 01ea 820F add r24,r18
291 01ec 931F adc r25,r19
292 01ee A41F adc r26,r20
293 01f0 B51F adc r27,r21
294 01f2 2091 0000 lds r18,GIER_GRAD_FAKTOR
295 01f6 3091 0000 lds r19,(GIER_GRAD_FAKTOR)+1
296 01fa 4091 0000 lds r20,(GIER_GRAD_FAKTOR)+2
297 01fe 5091 0000 lds r21,(GIER_GRAD_FAKTOR)+3
298 0202 BC01 movw r22,r24
299 0204 CD01 movw r24,r26
300 0206 0E94 0000 call __divmodsi4
301 020a 3093 0000 sts (ToNaviCtrl+11)+1,r19
302 020e 2093 0000 sts ToNaviCtrl+11,r18
303 0212 8091 0000 lds r24,AdNeutralGier
304 0216 9091 0000 lds r25,(AdNeutralGier)+1
305 021a 2091 0000 lds r18,AdWertGier
306 021e 3091 0000 lds r19,(AdWertGier)+1
307 0222 821B sub r24,r18
308 0224 930B sbc r25,r19
309 0226 9093 0000 sts (ToNaviCtrl+17)+1,r25
310 022a 8093 0000 sts ToNaviCtrl+17,r24
311 022e E091 0000 lds r30,NaviCntAcc
312 0232 F091 0000 lds r31,(NaviCntAcc)+1
313 0236 8091 0000 lds r24,NaviAccNick
314 023a 9091 0000 lds r25,(NaviAccNick)+1
315 023e BF01 movw r22,r30
316 0240 0E94 0000 call __divmodhi4
317 0244 CB01 movw r24,r22
318 0246 9B01 movw r18,r22
319 0248 220F lsl r18
320 024a 331F rol r19
321 024c 220F lsl r18
322 024e 331F rol r19
323 0250 280F add r18,r24
324 0252 391F adc r19,r25
325 0254 280F add r18,r24
326 0256 391F adc r19,r25
327 0258 37FF sbrs r19,7
328 025a 02C0 rjmp .L21
329 025c 2D5F subi r18,lo8(-(3))
330 025e 3F4F sbci r19,hi8(-(3))
331 .L21:
332 0260 3595 asr r19
333 0262 2795 ror r18
334 0264 3595 asr r19
335 0266 2795 ror r18
336 0268 3093 0000 sts (ToNaviCtrl+7)+1,r19
337 026c 2093 0000 sts ToNaviCtrl+7,r18
338 0270 8091 0000 lds r24,NaviAccRoll
339 0274 9091 0000 lds r25,(NaviAccRoll)+1
340 0278 BF01 movw r22,r30
341 027a 0E94 0000 call __divmodhi4
342 027e 9B01 movw r18,r22
343 0280 220F lsl r18
344 0282 331F rol r19
345 0284 220F lsl r18
346 0286 331F rol r19
347 0288 260F add r18,r22
348 028a 371F adc r19,r23
349 028c 260F add r18,r22
350 028e 371F adc r19,r23
351 0290 37FF sbrs r19,7
352 0292 02C0 rjmp .L22
353 0294 2D5F subi r18,lo8(-(3))
354 0296 3F4F sbci r19,hi8(-(3))
355 .L22:
356 0298 3595 asr r19
357 029a 2795 ror r18
358 029c 3595 asr r19
359 029e 2795 ror r18
360 02a0 3093 0000 sts (ToNaviCtrl+9)+1,r19
361 02a4 2093 0000 sts ToNaviCtrl+9,r18
362 02a8 1092 0000 sts (NaviCntAcc)+1,__zero_reg__
363 02ac 1092 0000 sts NaviCntAcc,__zero_reg__
364 02b0 1092 0000 sts (NaviAccNick)+1,__zero_reg__
365 02b4 1092 0000 sts NaviAccNick,__zero_reg__
366 02b8 1092 0000 sts (NaviAccRoll)+1,__zero_reg__
367 02bc 1092 0000 sts NaviAccRoll,__zero_reg__
368 02c0 8091 0000 lds r24,ToNaviCtrl+2
369 02c4 9927 clr r25
370 02c6 8D30 cpi r24,13
371 02c8 9105 cpc r25,__zero_reg__
372 02ca 09F4 brne .+2
373 02cc 66C0 rjmp .L26
374 02ce 8E30 cpi r24,14
375 02d0 9105 cpc r25,__zero_reg__
376 02d2 5CF4 brge .L46
377 02d4 8B30 cpi r24,11
378 02d6 9105 cpc r25,__zero_reg__
379 02d8 09F4 brne .+2
380 02da 8EC0 rjmp .L27
381 02dc 8C30 cpi r24,12
382 02de 9105 cpc r25,__zero_reg__
383 02e0 0CF0 brlt .+2
384 02e2 0FC1 rjmp .L40
385 02e4 0A97 sbiw r24,10
386 02e6 61F0 breq .L24
387 02e8 A8C1 rjmp .L23
388 .L46:
389 02ea 8F30 cpi r24,15
390 02ec 9105 cpc r25,__zero_reg__
391 02ee 09F4 brne .+2
392 02f0 7CC1 rjmp .L45
393 02f2 8F30 cpi r24,15
394 02f4 9105 cpc r25,__zero_reg__
395 02f6 0CF4 brge .+2
396 02f8 5CC1 rjmp .L44
397 02fa 4097 sbiw r24,16
398 02fc 99F1 breq .L25
399 02fe 9DC1 rjmp .L23
400 .L24:
401 0300 8091 0000 lds r24,Parameter_UserParam1
402 0304 8093 0000 sts ToNaviCtrl+19,r24
403 0308 8091 0000 lds r24,Parameter_UserParam2
404 030c 8093 0000 sts ToNaviCtrl+20,r24
405 0310 8091 0000 lds r24,Parameter_UserParam3
406 0314 8093 0000 sts ToNaviCtrl+21,r24
407 0318 8091 0000 lds r24,Parameter_UserParam4
408 031c 8093 0000 sts ToNaviCtrl+22,r24
409 0320 8091 0000 lds r24,Parameter_UserParam5
410 0324 8093 0000 sts ToNaviCtrl+23,r24
411 0328 8091 0000 lds r24,Parameter_UserParam6
412 032c 8093 0000 sts ToNaviCtrl+24,r24
413 0330 8091 0000 lds r24,Parameter_UserParam7
414 0334 8093 0000 sts ToNaviCtrl+25,r24
415 0338 8091 0000 lds r24,Parameter_UserParam8
416 033c 8093 0000 sts ToNaviCtrl+26,r24
417 0340 8091 0000 lds r24,FCFlags
418 0344 8093 0000 sts ToNaviCtrl+27,r24
419 0348 8091 0000 lds r24,FCFlags
420 034c 837F andi r24,lo8(-13)
421 034e 8093 0000 sts FCFlags,r24
422 0352 0E94 0000 call GetActiveParamSet
423 0356 8093 0000 sts ToNaviCtrl+28,r24
424 035a 8091 0000 lds r24,ControlHeading
425 035e 8093 0000 sts ToNaviCtrl+29,r24
426 0362 6BC1 rjmp .L23
427 .L25:
428 0364 8091 0000 lds r24,Capacity
429 0368 9091 0000 lds r25,(Capacity)+1
430 036c 9093 0000 sts (ToNaviCtrl+19)+1,r25
431 0370 8093 0000 sts ToNaviCtrl+19,r24
432 0374 8091 0000 lds r24,Capacity+4
433 0378 9091 0000 lds r25,(Capacity+4)+1
434 037c 9093 0000 sts (ToNaviCtrl+21)+1,r25
435 0380 8093 0000 sts ToNaviCtrl+21,r24
436 0384 8091 0000 lds r24,UBat
437 0388 9091 0000 lds r25,(UBat)+1
438 038c 8093 0000 sts ToNaviCtrl+23,r24
439 0390 8091 0000 lds r24,BattLowVoltageWarning
440 0394 8093 0000 sts ToNaviCtrl+24,r24
441 0398 50C1 rjmp .L23
442 .L26:
443 039a 8091 0000 lds r24,EE_Parameter+78
444 039e 8093 0000 sts ToNaviCtrl+19,r24
445 03a2 8091 0000 lds r24,EE_Parameter+79
446 03a6 8093 0000 sts ToNaviCtrl+20,r24
447 03aa 8091 0000 lds r24,EE_Parameter+80
448 03ae 8093 0000 sts ToNaviCtrl+21,r24
449 03b2 8091 0000 lds r24,EE_Parameter+81
450 03b6 8093 0000 sts ToNaviCtrl+22,r24
451 03ba 8091 0000 lds r24,EE_Parameter+82
452 03be 8093 0000 sts ToNaviCtrl+23,r24
453 03c2 8091 0000 lds r24,EE_Parameter+86
454 03c6 8093 0000 sts ToNaviCtrl+24,r24
455 03ca 8091 0000 lds r24,EE_Parameter+87
456 03ce 8093 0000 sts ToNaviCtrl+25,r24
457 03d2 8091 0000 lds r24,EE_Parameter+88
458 03d6 8093 0000 sts ToNaviCtrl+26,r24
459 03da 8091 0000 lds r24,EE_Parameter+91
460 03de 8093 0000 sts ToNaviCtrl+27,r24
461 03e2 8091 0000 lds r24,EE_Parameter+89
462 03e6 8093 0000 sts ToNaviCtrl+28,r24
463 03ea 8091 0000 lds r24,EE_Parameter+90
464 03ee 8093 0000 sts ToNaviCtrl+29,r24
465 03f2 8091 0000 lds r24,EE_Parameter+92
466 03f6 DAC0 rjmp .L58
467 .L27:
468 /* #APP */
469 03f8 F894 cli
470 /* #NOAPP */
471 03fa 8091 0000 lds r24,EE_Parameter+3
472 03fe E82F mov r30,r24
473 0400 FF27 clr r31
474 0402 EE0F add r30,r30
475 0404 FF1F adc r31,r31
476 0406 E050 subi r30,lo8(-(PPM_in))
477 0408 F040 sbci r31,hi8(-(PPM_in))
478 040a 0190 ld __tmp_reg__,Z+
479 040c F081 ld r31,Z
480 040e E02D mov r30,__tmp_reg__
481 0410 E038 cpi r30,128
482 0412 F105 cpc r31,__zero_reg__
483 0414 1CF0 brlt .L28
484 0416 EFE7 ldi r30,lo8(127)
485 0418 F0E0 ldi r31,hi8(127)
486 041a 06C0 rjmp .L29
487 .L28:
488 041c 2FEF ldi r18,hi8(-127)
489 041e E138 cpi r30,lo8(-127)
490 0420 F207 cpc r31,r18
491 0422 14F4 brge .L29
492 0424 E1E8 ldi r30,lo8(-127)
493 0426 FFEF ldi r31,hi8(-127)
494 .L29:
495 0428 E093 0000 sts ToNaviCtrl+19,r30
496 042c 8091 0000 lds r24,EE_Parameter+4
497 0430 E82F mov r30,r24
498 0432 FF27 clr r31
499 0434 EE0F add r30,r30
500 0436 FF1F adc r31,r31
501 0438 E050 subi r30,lo8(-(PPM_in))
502 043a F040 sbci r31,hi8(-(PPM_in))
503 043c 0190 ld __tmp_reg__,Z+
504 043e F081 ld r31,Z
505 0440 E02D mov r30,__tmp_reg__
506 0442 E038 cpi r30,128
507 0444 F105 cpc r31,__zero_reg__
508 0446 1CF0 brlt .L31
509 0448 EFE7 ldi r30,lo8(127)
510 044a F0E0 ldi r31,hi8(127)
511 044c 06C0 rjmp .L32
512 .L31:
513 044e 6FEF ldi r22,hi8(-127)
514 0450 E138 cpi r30,lo8(-127)
515 0452 F607 cpc r31,r22
516 0454 14F4 brge .L32
517 0456 E1E8 ldi r30,lo8(-127)
518 0458 FFEF ldi r31,hi8(-127)
519 .L32:
520 045a E093 0000 sts ToNaviCtrl+20,r30
521 045e 8091 0000 lds r24,EE_Parameter+2
522 0462 E82F mov r30,r24
523 0464 FF27 clr r31
524 0466 EE0F add r30,r30
525 0468 FF1F adc r31,r31
526 046a E050 subi r30,lo8(-(PPM_in))
527 046c F040 sbci r31,hi8(-(PPM_in))
528 046e 0190 ld __tmp_reg__,Z+
529 0470 F081 ld r31,Z
530 0472 E02D mov r30,__tmp_reg__
531 0474 E038 cpi r30,128
532 0476 F105 cpc r31,__zero_reg__
533 0478 1CF0 brlt .L34
534 047a EFE7 ldi r30,lo8(127)
535 047c F0E0 ldi r31,hi8(127)
536 047e 06C0 rjmp .L35
537 .L34:
538 0480 8FEF ldi r24,hi8(-127)
539 0482 E138 cpi r30,lo8(-127)
540 0484 F807 cpc r31,r24
541 0486 14F4 brge .L35
542 0488 E1E8 ldi r30,lo8(-127)
543 048a FFEF ldi r31,hi8(-127)
544 .L35:
545 048c E093 0000 sts ToNaviCtrl+21,r30
546 0490 8091 0000 lds r24,EE_Parameter+1
547 0494 E82F mov r30,r24
548 0496 FF27 clr r31
549 0498 EE0F add r30,r30
550 049a FF1F adc r31,r31
551 049c E050 subi r30,lo8(-(PPM_in))
552 049e F040 sbci r31,hi8(-(PPM_in))
553 04a0 0190 ld __tmp_reg__,Z+
554 04a2 F081 ld r31,Z
555 04a4 E02D mov r30,__tmp_reg__
556 04a6 E038 cpi r30,128
557 04a8 F105 cpc r31,__zero_reg__
558 04aa 1CF0 brlt .L37
559 04ac EFE7 ldi r30,lo8(127)
560 04ae F0E0 ldi r31,hi8(127)
561 04b0 06C0 rjmp .L38
562 .L37:
563 04b2 2FEF ldi r18,hi8(-127)
564 04b4 E138 cpi r30,lo8(-127)
565 04b6 F207 cpc r31,r18
566 04b8 14F4 brge .L38
567 04ba E1E8 ldi r30,lo8(-127)
568 04bc FFEF ldi r31,hi8(-127)
569 .L38:
570 /* #APP */
571 04be 7894 sei
572 /* #NOAPP */
573 04c0 E093 0000 sts ToNaviCtrl+22,r30
574 04c4 8091 0000 lds r24,Poti
575 04c8 8093 0000 sts ToNaviCtrl+23,r24
576 04cc 8091 0000 lds r24,Poti+1
577 04d0 8093 0000 sts ToNaviCtrl+24,r24
578 04d4 8091 0000 lds r24,Poti+2
579 04d8 8093 0000 sts ToNaviCtrl+25,r24
580 04dc 8091 0000 lds r24,Poti+3
581 04e0 8093 0000 sts ToNaviCtrl+26,r24
582 04e4 8091 0000 lds r24,Poti+4
583 04e8 8093 0000 sts ToNaviCtrl+27,r24
584 04ec 8091 0000 lds r24,Poti+5
585 04f0 8093 0000 sts ToNaviCtrl+28,r24
586 04f4 8091 0000 lds r24,Poti+6
587 04f8 8093 0000 sts ToNaviCtrl+29,r24
588 04fc 8091 0000 lds r24,Poti+7
589 0500 55C0 rjmp .L58
590 .L40:
591 0502 8091 0000 lds r24,WinkelOut+6
592 0506 8630 cpi r24,lo8(6)
593 0508 18F0 brlo .L41
594 050a 1092 0000 sts WinkelOut+6,__zero_reg__
595 050e 85E0 ldi r24,lo8(5)
596 .L41:
597 0510 8093 0000 sts ToNaviCtrl+19,r24
598 0514 8091 0000 lds r24,EE_Parameter+93
599 0518 8093 0000 sts ToNaviCtrl+20,r24
600 051c 8091 0000 lds r24,HoehenWert
601 0520 9091 0000 lds r25,(HoehenWert)+1
602 0524 A091 0000 lds r26,(HoehenWert)+2
603 0528 B091 0000 lds r27,(HoehenWert)+3
604 052c BC01 movw r22,r24
605 052e CD01 movw r24,r26
606 0530 25E0 ldi r18,lo8(5)
607 0532 30E0 ldi r19,hi8(5)
608 0534 40E0 ldi r20,hlo8(5)
609 0536 50E0 ldi r21,hhi8(5)
610 0538 0E94 0000 call __divmodsi4
611 053c 3093 0000 sts (ToNaviCtrl+21)+1,r19
612 0540 2093 0000 sts ToNaviCtrl+21,r18
613 0544 8091 0000 lds r24,SollHoehe
614 0548 9091 0000 lds r25,(SollHoehe)+1
615 054c A091 0000 lds r26,(SollHoehe)+2
616 0550 B091 0000 lds r27,(SollHoehe)+3
617 0554 BC01 movw r22,r24
618 0556 CD01 movw r24,r26
619 0558 25E0 ldi r18,lo8(5)
620 055a 30E0 ldi r19,hi8(5)
621 055c 40E0 ldi r20,hlo8(5)
622 055e 50E0 ldi r21,hhi8(5)
623 0560 0E94 0000 call __divmodsi4
624 0564 3093 0000 sts (ToNaviCtrl+23)+1,r19
625 0568 2093 0000 sts ToNaviCtrl+23,r18
626 056c 8091 0000 lds r24,EE_Parameter+83
627 0570 8093 0000 sts ToNaviCtrl+25,r24
628 0574 8091 0000 lds r24,EE_Parameter+84
629 0578 8093 0000 sts ToNaviCtrl+26,r24
630 057c 8091 0000 lds r24,EE_Parameter+85
631 0580 8093 0000 sts ToNaviCtrl+27,r24
632 0584 8091 0000 lds r24,SenderOkay
633 0588 8093 0000 sts ToNaviCtrl+28,r24
634 058c 8091 0000 lds r24,PPM_in
635 0590 9091 0000 lds r25,(PPM_in)+1
636 0594 8093 0000 sts ToNaviCtrl+29,r24
637 0598 8091 0000 lds r24,DebugOut+16
638 059c 9091 0000 lds r25,(DebugOut+16)+1
639 05a0 97FD sbrc r25,7
640 05a2 0396 adiw r24,3
641 .L43:
642 05a4 9595 asr r25
643 05a6 8795 ror r24
644 05a8 9595 asr r25
645 05aa 8795 ror r24
646 .L58:
647 05ac 8093 0000 sts ToNaviCtrl+30,r24
648 05b0 44C0 rjmp .L23
649 .L44:
650 05b2 1092 0000 sts ToNaviCtrl+19,__zero_reg__
651 05b6 80E5 ldi r24,lo8(80)
652 05b8 8093 0000 sts ToNaviCtrl+20,r24
653 05bc 86E0 ldi r24,lo8(6)
654 05be 8093 0000 sts ToNaviCtrl+21,r24
655 05c2 8EE0 ldi r24,lo8(14)
656 05c4 8093 0000 sts ToNaviCtrl+22,r24
657 05c8 8091 0000 lds r24,PlatinenVersion
658 05cc 8093 0000 sts ToNaviCtrl+23,r24
659 05d0 8091 0000 lds r24,VersionInfo+5
660 05d4 8093 0000 sts ToNaviCtrl+24,r24
661 05d8 8091 0000 lds r24,VersionInfo+6
662 05dc 8093 0000 sts ToNaviCtrl+25,r24
663 05e0 8091 0000 lds r24,VersionInfo+7
664 05e4 8093 0000 sts ToNaviCtrl+26,r24
665 05e8 28C0 rjmp .L23
666 .L45:
667 05ea 8091 0000 lds r24,EE_Parameter+53
668 05ee 8093 0000 sts ToNaviCtrl+19,r24
669 05f2 8091 0000 lds r24,EE_Parameter+98
670 05f6 8093 0000 sts ToNaviCtrl+20,r24
671 05fa 8091 0000 lds r24,Parameter_ServoNickControl
672 05fe 8093 0000 sts ToNaviCtrl+21,r24
673 0602 8091 0000 lds r24,EE_Parameter+46
674 0606 8093 0000 sts ToNaviCtrl+22,r24
675 060a 8091 0000 lds r24,EE_Parameter+47
676 060e 8093 0000 sts ToNaviCtrl+23,r24
677 0612 8091 0000 lds r24,EE_Parameter+48
678 0616 8093 0000 sts ToNaviCtrl+24,r24
679 061a 8091 0000 lds r24,Parameter_ServoRollControl
680 061e 8093 0000 sts ToNaviCtrl+25,r24
681 0622 8091 0000 lds r24,EE_Parameter+50
682 0626 8093 0000 sts ToNaviCtrl+26,r24
683 062a 8091 0000 lds r24,EE_Parameter+51
684 062e 8093 0000 sts ToNaviCtrl+27,r24
685 0632 8091 0000 lds r24,EE_Parameter+52
686 0636 8093 0000 sts ToNaviCtrl+28,r24
687 .L23:
688 063a 8091 0000 lds r24,SPI_RxDataValid
689 063e 8823 tst r24
690 0640 09F4 brne .+2
691 0642 CFC0 rjmp .L47
692 0644 8AEF ldi r24,lo8(-6)
693 0646 8093 0000 sts NaviDataOkay,r24
694 064a 4091 0000 lds r20,FromNaviCtrl+1
695 064e 5091 0000 lds r21,(FromNaviCtrl+1)+1
696 0652 CA01 movw r24,r20
697 0654 8150 subi r24,lo8(-(511))
698 0656 9E4F sbci r25,hi8(-(511))
699 0658 8F5F subi r24,lo8(1023)
700 065a 9340 sbci r25,hi8(1023)
701 065c B0F4 brsh .L48
702 065e 2091 0000 lds r18,FromNaviCtrl+3
703 0662 3091 0000 lds r19,(FromNaviCtrl+3)+1
704 0666 C901 movw r24,r18
705 0668 8150 subi r24,lo8(-(511))
706 066a 9E4F sbci r25,hi8(-(511))
707 066c 8F5F subi r24,lo8(1023)
708 066e 9340 sbci r25,hi8(1023)
709 0670 60F4 brsh .L48
710 0672 8091 0000 lds r24,EE_Parameter+13
711 0676 85FF sbrs r24,5
712 0678 08C0 rjmp .L48
713 067a 5093 0000 sts (GPS_Nick)+1,r21
714 067e 4093 0000 sts GPS_Nick,r20
715 0682 3093 0000 sts (GPS_Roll)+1,r19
716 0686 2093 0000 sts GPS_Roll,r18
717 .L48:
718 068a 8091 0000 lds r24,FromNaviCtrl+7
719 068e 9091 0000 lds r25,(FromNaviCtrl+7)+1
720 0692 21E0 ldi r18,hi8(361)
721 0694 8936 cpi r24,lo8(361)
722 0696 9207 cpc r25,r18
723 0698 24F4 brge .L49
724 069a 9093 0000 sts (KompassValue)+1,r25
725 069e 8093 0000 sts KompassValue,r24
726 .L49:
727 06a2 8091 0000 lds r24,KompassValue
728 06a6 9091 0000 lds r25,(KompassValue)+1
729 06aa 2091 0000 lds r18,KompassStartwert
730 06ae 3091 0000 lds r19,(KompassStartwert)+1
731 06b2 821B sub r24,r18
732 06b4 930B sbc r25,r19
733 06b6 845E subi r24,lo8(-(540))
734 06b8 9D4F sbci r25,hi8(-(540))
735 06ba 68E6 ldi r22,lo8(360)
736 06bc 71E0 ldi r23,hi8(360)
737 06be 0E94 0000 call __divmodhi4
738 06c2 845B subi r24,lo8(-(-180))
739 06c4 9040 sbci r25,hi8(-(-180))
740 06c6 9093 0000 sts (KompassRichtung)+1,r25
741 06ca 8093 0000 sts KompassRichtung,r24
742 06ce 2091 0000 lds r18,FromNaviCtrl+11
743 06d2 3091 0000 lds r19,(FromNaviCtrl+11)+1
744 06d6 8091 0000 lds r24,beeptime
745 06da 9091 0000 lds r25,(beeptime)+1
746 06de 8217 cp r24,r18
747 06e0 9307 cpc r25,r19
748 06e2 40F4 brsh .L50
749 06e4 8091 0000 lds r24,WinkelOut+6
750 06e8 8823 tst r24
751 06ea 21F4 brne .L50
752 06ec 3093 0000 sts (beeptime)+1,r19
753 06f0 2093 0000 sts beeptime,r18
754 .L50:
755 06f4 8091 0000 lds r24,FromNaviCtrl
756 06f8 9927 clr r25
757 06fa 8836 cpi r24,104
758 06fc 9105 cpc r25,__zero_reg__
759 06fe 49F1 breq .L53
760 0700 8936 cpi r24,105
761 0702 9105 cpc r25,__zero_reg__
762 0704 24F4 brge .L56
763 0706 8736 cpi r24,103
764 0708 9105 cpc r25,__zero_reg__
765 070a 31F0 breq .L52
766 070c 72C0 rjmp .L20
767 .L56:
768 070e 8936 cpi r24,105
769 0710 9105 cpc r25,__zero_reg__
770 0712 09F4 brne .+2
771 0714 45C0 rjmp .L54
772 0716 6DC0 rjmp .L20
773 .L52:
774 0718 8091 0000 lds r24,FromNaviCtrl+13
775 071c 8093 0000 sts FromNaviCtrl_Value,r24
776 0720 8091 0000 lds r24,FromNaviCtrl+14
777 0724 8093 0000 sts FromNaviCtrl_Value+2,r24
778 0728 8091 0000 lds r24,FromNaviCtrl+15
779 072c 8093 0000 sts FromNaviCtrl_Value+1,r24
780 0730 8091 0000 lds r24,FromNaviCtrl+16
781 0734 8093 0000 sts FromNaviCtrl_Value+3,r24
782 0738 8091 0000 lds r24,FromNaviCtrl+17
783 073c 8093 0000 sts FromNaviCtrl_Value+4,r24
784 0740 8091 0000 lds r24,FromNaviCtrl+18
785 0744 8093 0000 sts FromNC_Rotate_C,r24
786 0748 8091 0000 lds r24,FromNaviCtrl+19
787 074c 8093 0000 sts FromNC_Rotate_S,r24
788 0750 50C0 rjmp .L20
789 .L53:
790 0752 8091 0000 lds r24,FromNaviCtrl+13
791 0756 8093 0000 sts NC_Version,r24
792 075a 8091 0000 lds r24,FromNaviCtrl+14
793 075e 8093 0000 sts NC_Version+1,r24
794 0762 8091 0000 lds r24,FromNaviCtrl+15
795 0766 8093 0000 sts NC_Version+2,r24
796 076a 8091 0000 lds r24,FromNaviCtrl+16
797 076e 8093 0000 sts NC_Version+3,r24
798 0772 8091 0000 lds r24,FromNaviCtrl+17
799 0776 8093 0000 sts NC_Version+4,r24
800 077a 8091 0000 lds r24,DebugOut
801 077e 9091 0000 lds r25,FromNaviCtrl+18
802 0782 892B or r24,r25
803 0784 8093 0000 sts DebugOut,r24
804 0788 9091 0000 lds r25,FromNaviCtrl+19
805 078c 9093 0000 sts NC_ErrorCode,r25
806 0790 8091 0000 lds r24,DebugOut+1
807 0794 8370 andi r24,lo8(3)
808 0796 9C70 andi r25,lo8(12)
809 0798 892B or r24,r25
810 079a 8093 0000 sts DebugOut+1,r24
811 079e 29C0 rjmp .L20
812 .L54:
813 07a0 8091 0000 lds r24,FromNaviCtrl+13
814 07a4 8093 0000 sts GPSInfo,r24
815 07a8 8091 0000 lds r24,FromNaviCtrl+14
816 07ac 8093 0000 sts GPSInfo+1,r24
817 07b0 8091 0000 lds r24,FromNaviCtrl+15
818 07b4 8093 0000 sts GPSInfo+2,r24
819 07b8 8091 0000 lds r24,FromNaviCtrl+16
820 07bc 8093 0000 sts GPSInfo+3,r24
821 07c0 8091 0000 lds r24,FromNaviCtrl+17
822 07c4 9091 0000 lds r25,(FromNaviCtrl+17)+1
823 07c8 9093 0000 sts (GPSInfo+4)+1,r25
824 07cc 8093 0000 sts GPSInfo+4,r24
825 07d0 8091 0000 lds r24,FromNaviCtrl+19
826 07d4 9091 0000 lds r25,(FromNaviCtrl+19)+1
827 07d8 9093 0000 sts (GPSInfo+6)+1,r25
828 07dc 8093 0000 sts GPSInfo+6,r24
829 07e0 08C0 rjmp .L20
830 .L47:
831 07e2 1092 0000 sts (GPS_Nick)+1,__zero_reg__
832 07e6 1092 0000 sts GPS_Nick,__zero_reg__
833 07ea 1092 0000 sts (GPS_Roll)+1,__zero_reg__
834 07ee 1092 0000 sts GPS_Roll,__zero_reg__
835 .L20:
836 /* epilogue: frame size=0 */
837 07f2 1F91 pop r17
838 07f4 0F91 pop r16
839 07f6 FF90 pop r15
840 07f8 EF90 pop r14
841 07fa 0895 ret
842 /* epilogue end (size=5) */
843 /* function UpdateSPI_Buffer size 857 (848) */
845 .global SPI_StartTransmitPacket
847 SPI_StartTransmitPacket:
848 /* prologue: frame size=0 */
849 /* prologue end (size=0) */
850 07fc 8091 0000 lds r24,SPITransferCompleted
851 0800 8823 tst r24
852 0802 09F4 brne .+2
853 0804 3BC0 rjmp .L59
854 0806 4598 cbi 40-0x20,5
855 0808 80E0 ldi r24,lo8(ToNaviCtrl)
856 080a 90E0 ldi r25,hi8(ToNaviCtrl)
857 080c 9093 0000 sts (SPI_TX_Buffer)+1,r25
858 0810 8093 0000 sts SPI_TX_Buffer,r24
859 0814 9091 0000 lds r25,SPI_CommandCounter
860 0818 E92F mov r30,r25
861 081a FF27 clr r31
862 081c E050 subi r30,lo8(-(SPI_CommandSequence))
863 081e F040 sbci r31,hi8(-(SPI_CommandSequence))
864 0820 9F5F subi r25,lo8(-(1))
865 0822 9093 0000 sts SPI_CommandCounter,r25
866 0826 8081 ld r24,Z
867 0828 8093 0000 sts ToNaviCtrl+2,r24
868 082c 9930 cpi r25,lo8(9)
869 082e 10F0 brlo .L61
870 0830 1092 0000 sts SPI_CommandCounter,__zero_reg__
871 .L61:
872 0834 1092 0000 sts SPITransferCompleted,__zero_reg__
873 0838 0E94 0000 call UpdateSPI_Buffer
874 083c 81E0 ldi r24,lo8(1)
875 083e 8093 0000 sts SPI_BufferIndex,r24
876 /* #APP */
877 0842 0000 nop
878 0844 0000 nop
879 0846 0000 nop
880 0848 0000 nop
881 084a 0000 nop
882 084c 0000 nop
883 084e 0000 nop
884 0850 0000 nop
885 0852 0000 nop
886 0854 0000 nop
887 0856 0000 nop
888 0858 0000 nop
889 085a 0000 nop
890 085c 0000 nop
891 085e 0000 nop
892 0860 0000 nop
893 0862 0000 nop
894 0864 0000 nop
895 0866 0000 nop
896 0868 0000 nop
897 086a 0000 nop
898 086c 0000 nop
899 086e 0000 nop
900 0870 0000 nop
901 /* #NOAPP */
902 0872 8091 0000 lds r24,ToNaviCtrl
903 0876 8093 0000 sts ToNaviCtrl+31,r24
904 087a 8EBD out 78-0x20,r24
905 .L59:
906 087c 0895 ret
907 /* epilogue: frame size=0 */
908 /* epilogue: noreturn */
909 /* epilogue end (size=0) */
910 /* function SPI_StartTransmitPacket size 89 (89) */
912 .comm GPSInfo,8,1
913 .comm NC_Version,5,1
914 .comm FromNaviCtrl_Value,5,1
915 .comm ToNaviCtrl,32,1
916 .comm FromNaviCtrl,26,1
917 .comm SPI_BufferIndex,1,1
918 .comm SPI_RxBufferIndex,1,1
919 .comm SPI_Buffer,26,1
920 .comm SPI_TX_Buffer,2,1
921 .comm SPITransferCompleted,1,1
922 .comm SPI_ChkSum,1,1
923 .comm SPI_RxDataValid,1,1
924 /* File "spi.c": code 1143 = 0x0477 (1133), prologues 4, epilogues 6 */
DEFINED SYMBOLS
*ABS*:00000000 spi.c
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:3 *ABS*:0000003f __SREG__
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:4 *ABS*:0000003e __SP_H__
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:5 *ABS*:0000003d __SP_L__
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:6 *ABS*:00000000 __tmp_reg__
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:7 *ABS*:00000001 __zero_reg__
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:15 .bss:00000000 NC_ErrorCode
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:21 .bss:00000001 SPI_CommandCounter
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:27 .data:00000000 SPI_CommandSequence
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:40 .data:00000009 NaviDataOkay
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:47 .bss:00000002 FromNC_Rotate_S
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:53 .data:0000000a FromNC_Rotate_C
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:58 .text:00000000 SPI_MasterInit
*COM*:00000001 SPITransferCompleted
*COM*:00000020 ToNaviCtrl
*COM*:00000005 FromNaviCtrl_Value
*COM*:00000001 SPI_RxDataValid
.bss:00000003 SPI_RXState.0
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:88 .bss:00000004 rxchksum.1
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:92 .text:00000042 SPI_TransmitByte
*COM*:00000001 SPI_RxBufferIndex
*COM*:0000001a SPI_Buffer
*COM*:0000001a FromNaviCtrl
*COM*:00000001 SPI_BufferIndex
*COM*:00000002 SPI_TX_Buffer
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:233 .text:00000158 UpdateSPI_Buffer
*COM*:00000005 NC_Version
*COM*:00000008 GPSInfo
C:\Users\Arthur-P\AppData\Local\Temp/ccM3baaa.s:847 .text:000007fc SPI_StartTransmitPacket
*COM*:00000001 SPI_ChkSum
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
SendSPI
EE_Parameter
IntegralNick
__divmodsi4
IntegralRoll
ErsatzKompass
GIER_GRAD_FAKTOR
AdNeutralGier
AdWertGier
NaviCntAcc
NaviAccNick
__divmodhi4
NaviAccRoll
Parameter_UserParam1
Parameter_UserParam2
Parameter_UserParam3
Parameter_UserParam4
Parameter_UserParam5
Parameter_UserParam6
Parameter_UserParam7
Parameter_UserParam8
FCFlags
GetActiveParamSet
ControlHeading
Capacity
UBat
BattLowVoltageWarning
PPM_in
Poti
WinkelOut
HoehenWert
SollHoehe
SenderOkay
DebugOut
PlatinenVersion
VersionInfo
Parameter_ServoNickControl
Parameter_ServoRollControl
GPS_Nick
GPS_Roll
KompassValue
KompassStartwert
KompassRichtung
beeptime