Subversion Repositories FlightCtrl

Rev

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

Rev Author Line No. Line
2286 - 1
   1               		.file	"sbus.c"
2
   2               		.arch atmega1284p
3
   3               	__SREG__ = 0x3f
4
   4               	__SP_H__ = 0x3e
5
   5               	__SP_L__ = 0x3d
6
   6               	__tmp_reg__ = 0
7
   7               	__zero_reg__ = 1
8
   8               		.global __do_copy_data
9
   9               		.global __do_clear_bss
10
  10               	.global	NewSBusData
11
  11               	.global	NewSBusData
12
  12               		.section .bss
13
  15               	NewSBusData:
14
  16 0000 00        		.skip 1,0
15
  17               		.text
16
  18               	.global	SbusUartInit
17
  20               	SbusUartInit:
18
  21               	/* prologue: frame size=0 */
19
  22               	/* prologue end (size=0) */
20
  23 0000 4FB7      		in r20,95-0x20
21
  24 0002 28E1      		ldi r18,lo8(24)
22
  25 0004 30E0      		ldi r19,hi8(24)
23
  26               	/* #APP */
24
  27 0006 F894      		cli
25
  28               	/* #NOAPP */
26
  29 0008 8091 C900 		lds r24,201
27
  30 000c 8F77      		andi r24,lo8(127)
28
  31 000e 8093 C900 		sts 201,r24
29
  32 0012 8091 C900 		lds r24,201
30
  33 0016 8F7B      		andi r24,lo8(-65)
31
  34 0018 8093 C900 		sts 201,r24
32
  35 001c 8091 C900 		lds r24,201
33
  36 0020 8F7D      		andi r24,lo8(-33)
34
  37 0022 8093 C900 		sts 201,r24
35
  38 0026 5A9A      		sbi 43-0x20,2
36
  39 0028 5298      		cbi 42-0x20,2
37
  40 002a 5B9A      		sbi 43-0x20,3
38
  41 002c 539A      		sbi 42-0x20,3
39
  42 002e 832F      		mov r24,r19
40
  43 0030 9927      		clr r25
41
  44 0032 8093 CD00 		sts 205,r24
42
  45 0036 2093 CC00 		sts 204,r18
43
  46 003a 8091 C800 		lds r24,200
44
  47 003e 8260      		ori r24,lo8(2)
45
  48 0040 8093 C800 		sts 200,r24
46
  49 0044 80E1      		ldi r24,lo8(16)
47
  50 0046 8093 C900 		sts 201,r24
48
  51 004a 8091 CA00 		lds r24,202
49
  52 004e 8F77      		andi r24,lo8(127)
50
  53 0050 8093 CA00 		sts 202,r24
51
  54 0054 8091 CA00 		lds r24,202
52
  55 0058 8F7B      		andi r24,lo8(-65)
53
  56 005a 8093 CA00 		sts 202,r24
54
  57 005e 8091 CA00 		lds r24,202
55
  58 0062 8091 CA00 		lds r24,202
56
  59 0066 8F7E      		andi r24,lo8(-17)
57
  60 0068 8093 CA00 		sts 202,r24
58
  61 006c 8091 CA00 		lds r24,202
59
  62 0070 8860      		ori r24,lo8(8)
60
  63 0072 8093 CA00 		sts 202,r24
61
  64 0076 8091 C900 		lds r24,201
62
  65 007a 8B7F      		andi r24,lo8(-5)
63
  66 007c 8093 C900 		sts 201,r24
64
  67 0080 8091 CA00 		lds r24,202
65
  68 0084 8460      		ori r24,lo8(4)
66
  69 0086 8093 CA00 		sts 202,r24
67
  70 008a 8091 CA00 		lds r24,202
68
  71 008e 8260      		ori r24,lo8(2)
69
  72 0090 8093 CA00 		sts 202,r24
70
  73               	.L7:
71
  74 0094 8091 C800 		lds r24,200
72
  75 0098 87FF      		sbrs r24,7
73
  76 009a 00C0      		rjmp .L6
74
  77 009c 8091 CE00 		lds r24,206
75
  78 00a0 00C0      		rjmp .L7
76
  79               	.L6:
77
  80 00a2 8091 C900 		lds r24,201
78
  81 00a6 8068      		ori r24,lo8(-128)
79
  82 00a8 8093 C900 		sts 201,r24
80
  83 00ac 8091 0000 		lds r24,sBusBuffer+23
81
  84 00b0 8460      		ori r24,lo8(4)
82
  85 00b2 8093 0000 		sts sBusBuffer+23,r24
83
  86 00b6 4FBF      		out 95-0x20,r20
84
  87               	/* epilogue: frame size=0 */
85
  88 00b8 0895      		ret
86
  89               	/* epilogue end (size=1) */
87
  90               	/* function SbusUartInit size 94 (93) */
88
  92               		.lcomm ptr.1,1
89
  93               	.global	SbusParser
90
  95               	SbusParser:
91
  96               	/* prologue: frame size=0 */
92
  97               	/* prologue end (size=0) */
93
  98 00ba 9091 0000 		lds r25,SpektrumTimer
94
  99 00be 9923      		tst r25
95
 100 00c0 01F4      		brne .L9
96
 101 00c2 8F30      		cpi r24,lo8(15)
97
 102 00c4 01F4      		brne .L9
98
 103 00c6 9093 0000 		sts ptr.1,r25
99
 104 00ca 80E5      		ldi r24,lo8(80)
100
 105 00cc 8093 0000 		sts SpektrumTimer,r24
101
 106 00d0 0895      		ret
102
 107               	.L9:
103
 108 00d2 E091 0000 		lds r30,ptr.1
104
 109 00d6 EF5F      		subi r30,lo8(-(1))
105
 110 00d8 E093 0000 		sts ptr.1,r30
106
 111 00dc E831      		cpi r30,lo8(24)
107
 112 00de 01F4      		brne .L11
108
 113 00e0 81E0      		ldi r24,lo8(1)
109
 114 00e2 8093 0000 		sts NewSBusData,r24
110
 115 00e6 0895      		ret
111
 116               	.L11:
112
 117 00e8 E931      		cpi r30,lo8(25)
113
 118 00ea 00F0      		brlo .L13
114
 119 00ec 89E1      		ldi r24,lo8(25)
115
 120 00ee 8093 0000 		sts ptr.1,r24
116
 121 00f2 0895      		ret
117
 122               	.L13:
118
 123 00f4 FF27      		clr r31
119
 124 00f6 E050      		subi r30,lo8(-(sBusBuffer))
120
 125 00f8 F040      		sbci r31,hi8(-(sBusBuffer))
121
 126 00fa 8083      		st Z,r24
122
 127 00fc 0895      		ret
123
 128               	/* epilogue: frame size=0 */
124
 129               	/* epilogue: noreturn */
125
 130               	/* epilogue end (size=0) */
126
 131               	/* function SbusParser size 34 (34) */
127
 133               		.lcomm load.0,1
128
 134               	.global	ProcessSBus
129
 136               	ProcessSBus:
130
 137               	/* prologue: frame size=0 */
131
 138 00fe A0E0      		ldi r26,lo8(0)
132
 139 0100 B0E0      		ldi r27,hi8(0)
133
 140 0102 E0E0      		ldi r30,pm_lo8(1f)
134
 141 0104 F0E0      		ldi r31,pm_hi8(1f)
135
 142 0106 0C94 0000 		jmp __prologue_saves__+16
136
 143               	1:
137
 144               	/* prologue end (size=6) */
138
 145 010a 91E0      		ldi r25,lo8(1)
139
 146 010c D92E      		mov r13,r25
140
 147 010e 82E0      		ldi r24,lo8(2)
141
 148 0110 A82E      		mov r10,r24
142
 149 0112 BD2C      		mov r11,r13
143
 150 0114 E12C      		mov r14,__zero_reg__
144
 151 0116 01E0      		ldi r16,hi8(256)
145
 152 0118 F02E      		mov r15,r16
146
 153 011a 8091 0000 		lds r24,sBusBuffer+23
147
 154 011e 82FD      		sbrc r24,2
148
 155 0120 00C0      		rjmp .L16
149
 156 0122 8091 6F00 		lds r24,111
150
 157 0126 8F7D      		andi r24,lo8(-33)
151
 158 0128 8093 6F00 		sts 111,r24
152
 159 012c E091 0000 		lds r30,EE_Parameter+105
153
 160 0130 EE23      		tst r30
154
 161 0132 01F0      		breq .L18
155
 162 0134 FF27      		clr r31
156
 163 0136 EE0F      		add r30,r30
157
 164 0138 FF1F      		adc r31,r31
158
 165 013a E050      		subi r30,lo8(-(PPM_in))
159
 166 013c F040      		sbci r31,hi8(-(PPM_in))
160
 167 013e 8081      		ld r24,Z
161
 168 0140 9181      		ldd r25,Z+1
162
 169 0142 8436      		cpi r24,100
163
 170 0144 9105      		cpc r25,__zero_reg__
164
 171 0146 04F4      		brge .L17
165
 172               	.L18:
166
 173 0148 8091 0000 		lds r24,SenderOkay
167
 174 014c 883C      		cpi r24,lo8(-56)
168
 175 014e 00F4      		brsh .L19
169
 176 0150 8091 0000 		lds r24,SenderOkay
170
 177 0154 8C5E      		subi r24,lo8(-(20))
171
 178 0156 00C0      		rjmp .L38
172
 179               	.L19:
173
 180 0158 88EC      		ldi r24,lo8(-56)
174
 181               	.L38:
175
 182 015a 8093 0000 		sts SenderOkay,r24
176
 183               	.L17:
177
 184 015e 8091 0000 		lds r24,sBusBuffer+1
178
 185 0162 682F      		mov r22,r24
179
 186 0164 7727      		clr r23
180
 187 0166 8091 0000 		lds r24,load.0
181
 188 016a 8150      		subi r24,lo8(-(-1))
182
 189 016c 8093 0000 		sts load.0,r24
183
 190 0170 8F3F      		cpi r24,lo8(-1)
184
 191 0172 01F4      		brne .L21
185
 192 0174 1CE7      		ldi r17,lo8(124)
186
 193 0176 C12E      		mov r12,r17
187
 194 0178 82E0      		ldi r24,lo8(2)
188
 195 017a 8093 0000 		sts load.0,r24
189
 196 017e 00C0      		rjmp .L22
190
 197               	.L21:
191
 198 0180 C4E2      		ldi r28,lo8(36)
192
 199 0182 CC2E      		mov r12,r28
193
 200               	.L22:
194
 201 0184 40E0      		ldi r20,lo8(0)
195
 202               	.L39:
196
 203 0186 4C15      		cp r20,r12
197
 204 0188 00F0      		brlo .+2
198
 205 018a 00C0      		rjmp .L37
199
 206 018c EA2D      		mov r30,r10
200
 207 018e FF27      		clr r31
201
 208 0190 E050      		subi r30,lo8(-(sBusBuffer))
202
 209 0192 F040      		sbci r31,hi8(-(sBusBuffer))
203
 210 0194 8081      		ld r24,Z
204
 211 0196 8D21      		and r24,r13
205
 212 0198 01F0      		breq .L26
206
 213 019a 6E29      		or r22,r14
207
 214 019c 7F29      		or r23,r15
208
 215               	.L26:
209
 216 019e 8D2D      		mov r24,r13
210
 217 01a0 9927      		clr r25
211
 218 01a2 880F      		add r24,r24
212
 219 01a4 991F      		adc r25,r25
213
 220 01a6 D82E      		mov r13,r24
214
 221 01a8 8823      		tst r24
215
 222 01aa 01F4      		brne .L27
216
 223 01ac B1E0      		ldi r27,lo8(1)
217
 224 01ae DB2E      		mov r13,r27
218
 225 01b0 AD0C      		add r10,r13
219
 226               	.L27:
220
 227 01b2 EE0C      		add r14,r14
221
 228 01b4 FF1C      		adc r15,r15
222
 229 01b6 20E0      		ldi r18,lo8(2048)
223
 230 01b8 E216      		cp r14,r18
224
 231 01ba 28E0      		ldi r18,hi8(2048)
225
 232 01bc F206      		cpc r15,r18
226
 233 01be 01F0      		breq .+2
227
 234 01c0 00C0      		rjmp .L25
228
 235 01c2 A1E0      		ldi r26,lo8(1)
229
 236 01c4 EA2E      		mov r14,r26
230
 237 01c6 F12C      		mov r15,__zero_reg__
231
 238 01c8 CB01      		movw r24,r22
232
 239 01ca 8050      		subi r24,lo8(-(-1024))
233
 240 01cc 9440      		sbci r25,hi8(-(-1024))
234
 241 01ce 65E0      		ldi r22,lo8(5)
235
 242 01d0 70E0      		ldi r23,hi8(5)
236
 243 01d2 0E94 0000 		call __divmodhi4
237
 244 01d6 AB2D      		mov r26,r11
238
 245 01d8 BB27      		clr r27
239
 246 01da FD01      		movw r30,r26
240
 247 01dc EA0F      		add r30,r26
241
 248 01de FB1F      		adc r31,r27
242
 249 01e0 E050      		subi r30,lo8(-(PPM_in))
243
 250 01e2 F040      		sbci r31,hi8(-(PPM_in))
244
 251 01e4 8081      		ld r24,Z
245
 252 01e6 9181      		ldd r25,Z+1
246
 253 01e8 9C01      		movw r18,r24
247
 254 01ea 220F      		lsl r18
248
 255 01ec 331F      		rol r19
249
 256 01ee 280F      		add r18,r24
250
 257 01f0 391F      		adc r19,r25
251
 258 01f2 260F      		add r18,r22
252
 259 01f4 371F      		adc r19,r23
253
 260 01f6 37FF      		sbrs r19,7
254
 261 01f8 00C0      		rjmp .L29
255
 262 01fa 2D5F      		subi r18,lo8(-(3))
256
 263 01fc 3F4F      		sbci r19,hi8(-(3))
257
 264               	.L29:
258
 265 01fe E901      		movw r28,r18
259
 266 0200 D595      		asr r29
260
 267 0202 C795      		ror r28
261
 268 0204 D595      		asr r29
262
 269 0206 C795      		ror r28
263
 270 0208 CB01      		movw r24,r22
264
 271 020a 0196      		adiw r24,1
265
 272 020c 8C17      		cp r24,r28
266
 273 020e 9D07      		cpc r25,r29
267
 274 0210 04F4      		brge .L30
268
 275 0212 2197      		sbiw r28,1
269
 276 0214 00C0      		rjmp .L31
270
 277               	.L30:
271
 278 0216 6150      		subi r22,lo8(-(-1))
272
 279 0218 7040      		sbci r23,hi8(-(-1))
273
 280 021a C617      		cp r28,r22
274
 281 021c D707      		cpc r29,r23
275
 282 021e 04F4      		brge .L31
276
 283 0220 2196      		adiw r28,1
277
 284               	.L31:
278
 285 0222 8091 0000 		lds r24,SenderOkay
279
 286 0226 833C      		cpi r24,lo8(-61)
280
 287 0228 00F0      		brlo .L33
281
 288 022a 8D01      		movw r16,r26
282
 289 022c 0A0F      		add r16,r26
283
 290 022e 1B1F      		adc r17,r27
284
 291 0230 F801      		movw r30,r16
285
 292 0232 E050      		subi r30,lo8(-(PPM_in))
286
 293 0234 F040      		sbci r31,hi8(-(PPM_in))
287
 294 0236 8081      		ld r24,Z
288
 295 0238 9181      		ldd r25,Z+1
289
 296 023a FE01      		movw r30,r28
290
 297 023c E81B      		sub r30,r24
291
 298 023e F90B      		sbc r31,r25
292
 299 0240 CF01      		movw r24,r30
293
 300 0242 63E0      		ldi r22,lo8(3)
294
 301 0244 70E0      		ldi r23,hi8(3)
295
 302 0246 0E94 0000 		call __divmodhi4
296
 303 024a CB01      		movw r24,r22
297
 304 024c 880F      		lsl r24
298
 305 024e 991F      		rol r25
299
 306 0250 860F      		add r24,r22
300
 307 0252 971F      		adc r25,r23
301
 308 0254 0050      		subi r16,lo8(-(PPM_diff))
302
 309 0256 1040      		sbci r17,hi8(-(PPM_diff))
303
 310 0258 F801      		movw r30,r16
304
 311 025a 9183      		std Z+1,r25
305
 312 025c 8083      		st Z,r24
306
 313 025e 00C0      		rjmp .L34
307
 314               	.L33:
308
 315 0260 AA0F      		add r26,r26
309
 316 0262 BB1F      		adc r27,r27
310
 317 0264 A050      		subi r26,lo8(-(PPM_diff))
311
 318 0266 B040      		sbci r27,hi8(-(PPM_diff))
312
 319 0268 1196      		adiw r26,1
313
 320 026a 1C92      		st X,__zero_reg__
314
 321 026c 1E92      		st -X,__zero_reg__
315
 322               	.L34:
316
 323 026e EB2D      		mov r30,r11
317
 324 0270 FF27      		clr r31
318
 325 0272 EE0F      		add r30,r30
319
 326 0274 FF1F      		adc r31,r31
320
 327 0276 E050      		subi r30,lo8(-(PPM_in))
321
 328 0278 F040      		sbci r31,hi8(-(PPM_in))
322
 329 027a D183      		std Z+1,r29
323
 330 027c C083      		st Z,r28
324
 331 027e 60E0      		ldi r22,lo8(0)
325
 332 0280 70E0      		ldi r23,hi8(0)
326
 333 0282 B394      		inc r11
327
 334               	.L25:
328
 335 0284 4F5F      		subi r20,lo8(-(1))
329
 336 0286 00C0      		rjmp .L39
330
 337               	.L37:
331
 338 0288 1092 0000 		sts NewPpmData,__zero_reg__
332
 339               	.L16:
333
 340 028c 1092 0000 		sts NewSBusData,__zero_reg__
334
 341               	/* epilogue: frame size=0 */
335
 342 0290 EAE0      		ldi r30,10
336
 343 0292 CDB7      		in r28,__SP_L__
337
 344 0294 DEB7      		in r29,__SP_H__
338
 345 0296 0C94 0000 		jmp __epilogue_restores__+16
339
 346               	/* epilogue end (size=5) */
340
 347               	/* function ProcessSBus size 207 (196) */
341
 349               		.comm sBusBuffer,25,1
342
 350               	/* File "sbus.c": code  335 = 0x014f ( 323), prologues   6, epilogues   6 */
343
DEFINED SYMBOLS
344
                            *ABS*:00000000 sbus.c
345
  C:\Temp/ccZAe6Uj.s:3      *ABS*:0000003f __SREG__
346
  C:\Temp/ccZAe6Uj.s:4      *ABS*:0000003e __SP_H__
347
  C:\Temp/ccZAe6Uj.s:5      *ABS*:0000003d __SP_L__
348
  C:\Temp/ccZAe6Uj.s:6      *ABS*:00000000 __tmp_reg__
349
  C:\Temp/ccZAe6Uj.s:7      *ABS*:00000001 __zero_reg__
350
  C:\Temp/ccZAe6Uj.s:15     .bss:00000000 NewSBusData
351
  C:\Temp/ccZAe6Uj.s:20     .text:00000000 SbusUartInit
352
                            *COM*:00000019 sBusBuffer
353
                             .bss:00000001 ptr.1
354
  C:\Temp/ccZAe6Uj.s:95     .text:000000ba SbusParser
355
  C:\Temp/ccZAe6Uj.s:92     .bss:00000002 load.0
356
  C:\Temp/ccZAe6Uj.s:136    .text:000000fe ProcessSBus
357
 
358
UNDEFINED SYMBOLS
359
__do_copy_data
360
__do_clear_bss
361
SpektrumTimer
362
__prologue_saves__
363
EE_Parameter
364
PPM_in
365
SenderOkay
366
__divmodhi4
367
PPM_diff
368
NewPpmData
369
__epilogue_restores__