Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1755 | - | 1 | 1 .file "Spektrum.c" |
2 | 2 .arch atmega644p |
||
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 SpektrumTimer |
||
11 | 11 .global SpektrumTimer |
||
12 | 12 .section .bss |
||
13 | 15 SpektrumTimer: |
||
14 | 16 0000 00 .skip 1,0 |
||
15 | 17 .text |
||
16 | 18 .global SpektrumUartInit |
||
17 | 20 SpektrumUartInit: |
||
18 | 21 /* prologue: frame size=0 */ |
||
19 | 22 /* prologue end (size=0) */ |
||
20 | 23 0000 4FB7 in r20,95-0x20 |
||
21 | 24 0002 24E1 ldi r18,lo8(20) |
||
22 | 25 0004 30E0 ldi r19,hi8(20) |
||
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 8F7D andi r24,lo8(-33) |
||
56 | 59 0064 8093 CA00 sts 202,r24 |
||
57 | 60 0068 8091 CA00 lds r24,202 |
||
58 | 61 006c 8F7E andi r24,lo8(-17) |
||
59 | 62 006e 8093 CA00 sts 202,r24 |
||
60 | 63 0072 8091 CA00 lds r24,202 |
||
61 | 64 0076 877F andi r24,lo8(-9) |
||
62 | 65 0078 8093 CA00 sts 202,r24 |
||
63 | 66 007c 8091 C900 lds r24,201 |
||
64 | 67 0080 8B7F andi r24,lo8(-5) |
||
65 | 68 0082 8093 C900 sts 201,r24 |
||
66 | 69 0086 8091 CA00 lds r24,202 |
||
67 | 70 008a 8460 ori r24,lo8(4) |
||
68 | 71 008c 8093 CA00 sts 202,r24 |
||
69 | 72 0090 8091 CA00 lds r24,202 |
||
70 | 73 0094 8260 ori r24,lo8(2) |
||
71 | 74 0096 8093 CA00 sts 202,r24 |
||
72 | 75 .L7: |
||
73 | 76 009a 8091 C800 lds r24,200 |
||
74 | 77 009e 87FF sbrs r24,7 |
||
75 | 78 00a0 03C0 rjmp .L6 |
||
76 | 79 00a2 8091 CE00 lds r24,206 |
||
77 | 80 00a6 F9CF rjmp .L7 |
||
78 | 81 .L6: |
||
79 | 82 00a8 8091 C900 lds r24,201 |
||
80 | 83 00ac 8068 ori r24,lo8(-128) |
||
81 | 84 00ae 8093 C900 sts 201,r24 |
||
82 | 85 00b2 4FBF out 95-0x20,r20 |
||
83 | 86 /* epilogue: frame size=0 */ |
||
84 | 87 00b4 0895 ret |
||
85 | 88 /* epilogue end (size=1) */ |
||
86 | 89 /* function SpektrumUartInit size 92 (91) */ |
||
87 | 91 .section .progmem.data,"a",@progbits |
||
88 | 94 __c.5: |
||
89 | 95 0000 0A0D 506C .string "\n\rPlease connect Spektrum receiver for binding NOW..." |
||
90 | 95 6561 7365 |
||
91 | 95 2063 6F6E |
||
92 | 95 6E65 6374 |
||
93 | 95 2053 7065 |
||
94 | 98 __c.6: |
||
95 | 99 0036 6F6B 2E0A .string "ok.\n\r" |
||
96 | 99 0D00 |
||
97 | 102 __c.7: |
||
98 | 103 003c 5469 6D65 .string "Timeout.\n\r" |
||
99 | 103 6F75 742E |
||
100 | 103 0A0D 00 |
||
101 | 104 .text |
||
102 | 105 .global SpektrumBinding |
||
103 | 107 SpektrumBinding: |
||
104 | 108 /* prologue: frame size=0 */ |
||
105 | 109 00b6 FF92 push r15 |
||
106 | 110 00b8 0F93 push r16 |
||
107 | 111 00ba 1F93 push r17 |
||
108 | 112 00bc CF93 push r28 |
||
109 | 113 00be DF93 push r29 |
||
110 | 114 /* prologue end (size=5) */ |
||
111 | 115 00c0 80E1 ldi r24,lo8(10000) |
||
112 | 116 00c2 97E2 ldi r25,hi8(10000) |
||
113 | 117 00c4 0E94 0000 call SetDelay |
||
114 | 118 00c8 EC01 movw r28,r24 |
||
115 | 119 00ca FF24 clr r15 |
||
116 | 120 00cc 8091 C900 lds r24,201 |
||
117 | 121 00d0 8F77 andi r24,lo8(127) |
||
118 | 122 00d2 8093 C900 sts 201,r24 |
||
119 | 123 00d6 8091 C900 lds r24,201 |
||
120 | 124 00da 8F7E andi r24,lo8(-17) |
||
121 | 125 00dc 8093 C900 sts 201,r24 |
||
122 | 126 00e0 5A98 cbi 43-0x20,2 |
||
123 | 127 00e2 80E0 ldi r24,lo8(__c.5) |
||
124 | 128 00e4 90E0 ldi r25,hi8(__c.5) |
||
125 | 129 00e6 9F93 push r25 |
||
126 | 130 00e8 8F93 push r24 |
||
127 | 131 00ea 00E0 ldi r16,lo8(pm(uart_putchar)) |
||
128 | 132 00ec 10E0 ldi r17,hi8(pm(uart_putchar)) |
||
129 | 133 00ee 1F93 push r17 |
||
130 | 134 00f0 0F93 push r16 |
||
131 | 135 00f2 E091 0000 lds r30,_printf_P |
||
132 | 136 00f6 F091 0000 lds r31,(_printf_P)+1 |
||
133 | 137 00fa 0995 icall |
||
134 | 138 00fc 0F90 pop __tmp_reg__ |
||
135 | 139 00fe 0F90 pop __tmp_reg__ |
||
136 | 140 0100 0F90 pop __tmp_reg__ |
||
137 | 141 0102 0F90 pop __tmp_reg__ |
||
138 | 142 0104 02C0 rjmp .L9 |
||
139 | 143 .L12: |
||
140 | 144 0106 4A99 sbic 41-0x20,2 |
||
141 | 145 0108 6CC0 rjmp .L96 |
||
142 | 146 .L9: |
||
143 | 147 010a CE01 movw r24,r28 |
||
144 | 148 010c 0E94 0000 call CheckDelay |
||
145 | 149 0110 8823 tst r24 |
||
146 | 150 0112 C9F3 breq .L12 |
||
147 | 151 .L10: |
||
148 | 152 0114 E091 0000 lds r30,_printf_P |
||
149 | 153 0118 F091 0000 lds r31,(_printf_P)+1 |
||
150 | 154 011c FF20 tst r15 |
||
151 | 155 011e 09F4 brne .+2 |
||
152 | 156 0120 68C0 rjmp .L13 |
||
153 | 157 0122 80E0 ldi r24,lo8(__c.6) |
||
154 | 158 0124 90E0 ldi r25,hi8(__c.6) |
||
155 | 159 0126 9F93 push r25 |
||
156 | 160 0128 8F93 push r24 |
||
157 | 161 012a 1F93 push r17 |
||
158 | 162 012c 0F93 push r16 |
||
159 | 163 012e 0995 icall |
||
160 | 164 0130 529A sbi 42-0x20,2 |
||
161 | 165 0132 0F90 pop __tmp_reg__ |
||
162 | 166 0134 0F90 pop __tmp_reg__ |
||
163 | 167 0136 0F90 pop __tmp_reg__ |
||
164 | 168 0138 0F90 pop __tmp_reg__ |
||
165 | 169 .L14: |
||
166 | 170 013a CE01 movw r24,r28 |
||
167 | 171 013c 0E94 0000 call CheckDelay |
||
168 | 172 0140 8823 tst r24 |
||
169 | 173 0142 D9F3 breq .L14 |
||
170 | 174 0144 83E6 ldi r24,lo8(99) |
||
171 | 175 0146 90E0 ldi r25,hi8(99) |
||
172 | 176 .L20: |
||
173 | 177 0148 5A9A sbi 43-0x20,2 |
||
174 | 178 014a 0197 sbiw r24,1 |
||
175 | 179 014c 97FF sbrs r25,7 |
||
176 | 180 014e FCCF rjmp .L20 |
||
177 | 181 0150 8FE8 ldi r24,lo8(399) |
||
178 | 182 0152 91E0 ldi r25,hi8(399) |
||
179 | 183 .L24: |
||
180 | 184 0154 5A98 cbi 43-0x20,2 |
||
181 | 185 0156 0197 sbiw r24,1 |
||
182 | 186 0158 97FF sbrs r25,7 |
||
183 | 187 015a FCCF rjmp .L24 |
||
184 | 188 015c 89E0 ldi r24,lo8(9) |
||
185 | 189 015e 90E0 ldi r25,hi8(9) |
||
186 | 190 .L28: |
||
187 | 191 0160 5A9A sbi 43-0x20,2 |
||
188 | 192 0162 0197 sbiw r24,1 |
||
189 | 193 0164 97FF sbrs r25,7 |
||
190 | 194 0166 FCCF rjmp .L28 |
||
191 | 195 0168 89E0 ldi r24,lo8(9) |
||
192 | 196 016a 90E0 ldi r25,hi8(9) |
||
193 | 197 .L32: |
||
194 | 198 016c 5A98 cbi 43-0x20,2 |
||
195 | 199 016e 0197 sbiw r24,1 |
||
196 | 200 0170 97FF sbrs r25,7 |
||
197 | 201 0172 FCCF rjmp .L32 |
||
198 | 202 0174 8FE8 ldi r24,lo8(399) |
||
199 | 203 0176 91E0 ldi r25,hi8(399) |
||
200 | 204 .L36: |
||
201 | 205 0178 5A9A sbi 43-0x20,2 |
||
202 | 206 017a 0197 sbiw r24,1 |
||
203 | 207 017c 97FF sbrs r25,7 |
||
204 | 208 017e FCCF rjmp .L36 |
||
205 | 209 0180 8FE8 ldi r24,lo8(399) |
||
206 | 210 0182 91E0 ldi r25,hi8(399) |
||
207 | 211 .L40: |
||
208 | 212 0184 5A98 cbi 43-0x20,2 |
||
209 | 213 0186 0197 sbiw r24,1 |
||
210 | 214 0188 97FF sbrs r25,7 |
||
211 | 215 018a FCCF rjmp .L40 |
||
212 | 216 018c 89E0 ldi r24,lo8(9) |
||
213 | 217 018e 90E0 ldi r25,hi8(9) |
||
214 | 218 .L44: |
||
215 | 219 0190 5A9A sbi 43-0x20,2 |
||
216 | 220 0192 0197 sbiw r24,1 |
||
217 | 221 0194 97FF sbrs r25,7 |
||
218 | 222 0196 FCCF rjmp .L44 |
||
219 | 223 0198 89E0 ldi r24,lo8(9) |
||
220 | 224 019a 90E0 ldi r25,hi8(9) |
||
221 | 225 .L48: |
||
222 | 226 019c 5A98 cbi 43-0x20,2 |
||
223 | 227 019e 0197 sbiw r24,1 |
||
224 | 228 01a0 97FF sbrs r25,7 |
||
225 | 229 01a2 FCCF rjmp .L48 |
||
226 | 230 01a4 8FE8 ldi r24,lo8(399) |
||
227 | 231 01a6 91E0 ldi r25,hi8(399) |
||
228 | 232 .L52: |
||
229 | 233 01a8 5A9A sbi 43-0x20,2 |
||
230 | 234 01aa 0197 sbiw r24,1 |
||
231 | 235 01ac 97FF sbrs r25,7 |
||
232 | 236 01ae FCCF rjmp .L52 |
||
233 | 237 01b0 8FE8 ldi r24,lo8(399) |
||
234 | 238 01b2 91E0 ldi r25,hi8(399) |
||
235 | 239 .L56: |
||
236 | 240 01b4 5A98 cbi 43-0x20,2 |
||
237 | 241 01b6 0197 sbiw r24,1 |
||
238 | 242 01b8 97FF sbrs r25,7 |
||
239 | 243 01ba FCCF rjmp .L56 |
||
240 | 244 01bc 89E0 ldi r24,lo8(9) |
||
241 | 245 01be 90E0 ldi r25,hi8(9) |
||
242 | 246 .L60: |
||
243 | 247 01c0 5A9A sbi 43-0x20,2 |
||
244 | 248 01c2 0197 sbiw r24,1 |
||
245 | 249 01c4 97FF sbrs r25,7 |
||
246 | 250 01c6 FCCF rjmp .L60 |
||
247 | 251 01c8 89E0 ldi r24,lo8(9) |
||
248 | 252 01ca 90E0 ldi r25,hi8(9) |
||
249 | 253 .L64: |
||
250 | 254 01cc 5A98 cbi 43-0x20,2 |
||
251 | 255 01ce 0197 sbiw r24,1 |
||
252 | 256 01d0 97FF sbrs r25,7 |
||
253 | 257 01d2 FCCF rjmp .L64 |
||
254 | 258 01d4 8FE8 ldi r24,lo8(399) |
||
255 | 259 01d6 91E0 ldi r25,hi8(399) |
||
256 | 260 .L68: |
||
257 | 261 01d8 5A9A sbi 43-0x20,2 |
||
258 | 262 01da 0197 sbiw r24,1 |
||
259 | 263 01dc 97FF sbrs r25,7 |
||
260 | 264 01de FCCF rjmp .L68 |
||
261 | 265 01e0 13C0 rjmp .L69 |
||
262 | 266 .L96: |
||
263 | 267 01e2 8AE5 ldi r24,lo8(90) |
||
264 | 268 01e4 90E0 ldi r25,hi8(90) |
||
265 | 269 01e6 0E94 0000 call SetDelay |
||
266 | 270 01ea EC01 movw r28,r24 |
||
267 | 271 01ec 91E0 ldi r25,lo8(1) |
||
268 | 272 01ee F92E mov r15,r25 |
||
269 | 273 01f0 91CF rjmp .L10 |
||
270 | 274 .L13: |
||
271 | 275 01f2 80E0 ldi r24,lo8(__c.7) |
||
272 | 276 01f4 90E0 ldi r25,hi8(__c.7) |
||
273 | 277 01f6 9F93 push r25 |
||
274 | 278 01f8 8F93 push r24 |
||
275 | 279 01fa 1F93 push r17 |
||
276 | 280 01fc 0F93 push r16 |
||
277 | 281 01fe 0995 icall |
||
278 | 282 0200 0F90 pop __tmp_reg__ |
||
279 | 283 0202 0F90 pop __tmp_reg__ |
||
280 | 284 0204 0F90 pop __tmp_reg__ |
||
281 | 285 0206 0F90 pop __tmp_reg__ |
||
282 | 286 .L69: |
||
283 | 287 0208 5298 cbi 42-0x20,2 |
||
284 | 288 020a 5A98 cbi 43-0x20,2 |
||
285 | 289 020c 0E94 0000 call SpektrumUartInit |
||
286 | 290 /* epilogue: frame size=0 */ |
||
287 | 291 0210 E5E0 ldi r30,5 |
||
288 | 292 0212 CDB7 in r28,__SP_L__ |
||
289 | 293 0214 DEB7 in r29,__SP_H__ |
||
290 | 294 0216 0C94 0000 jmp __epilogue_restores__+26 |
||
291 | 295 /* epilogue end (size=5) */ |
||
292 | 296 /* function SpektrumBinding size 178 (168) */ |
||
293 | 298 .lcomm Sync.0,1 |
||
294 | 299 .lcomm FrameCnt.1,1 |
||
295 | 300 .lcomm ByteHigh.2,1 |
||
296 | 301 .data |
||
297 | 304 ReSync.3: |
||
298 | 305 0000 01 .byte 1 |
||
299 | 306 .lcomm Frame2.4,1 |
||
300 | 307 .text |
||
301 | 308 .global SpektrumParser |
||
302 | 310 SpektrumParser: |
||
303 | 311 /* prologue: frame size=0 */ |
||
304 | 312 021a EF92 push r14 |
||
305 | 313 021c FF92 push r15 |
||
306 | 314 021e 0F93 push r16 |
||
307 | 315 0220 1F93 push r17 |
||
308 | 316 0222 CF93 push r28 |
||
309 | 317 0224 DF93 push r29 |
||
310 | 318 /* prologue end (size=6) */ |
||
311 | 319 0226 482F mov r20,r24 |
||
312 | 320 0228 00E0 ldi r16,lo8(0) |
||
313 | 321 022a 10E0 ldi r17,hi8(0) |
||
314 | 322 022c 8091 0000 lds r24,ReSync.3 |
||
315 | 323 0230 8130 cpi r24,lo8(1) |
||
316 | 324 0232 61F4 brne .L98 |
||
317 | 325 0234 1092 0000 sts ReSync.3,__zero_reg__ |
||
318 | 326 0238 84E4 ldi r24,lo8(68) |
||
319 | 327 023a 8093 0000 sts SpektrumTimer,r24 |
||
320 | 328 023e 1092 0000 sts FrameCnt.1,__zero_reg__ |
||
321 | 329 0242 1092 0000 sts Sync.0,__zero_reg__ |
||
322 | 330 0246 1092 0000 sts ByteHigh.2,__zero_reg__ |
||
323 | 331 024a 2BC1 rjmp .L97 |
||
324 | 332 .L98: |
||
325 | 333 024c 8091 0000 lds r24,SpektrumTimer |
||
326 | 334 0250 8823 tst r24 |
||
327 | 335 0252 19F4 brne .L100 |
||
328 | 336 0254 21E0 ldi r18,lo8(1) |
||
329 | 337 0256 30E0 ldi r19,hi8(1) |
||
330 | 338 0258 01C0 rjmp .L101 |
||
331 | 339 .L100: |
||
332 | 340 025a 9801 movw r18,r16 |
||
333 | 341 .L101: |
||
334 | 342 025c 9091 0000 lds r25,Sync.0 |
||
335 | 343 0260 9923 tst r25 |
||
336 | 344 0262 71F4 brne .L102 |
||
337 | 345 0264 232B or r18,r19 |
||
338 | 346 0266 11F0 breq .L103 |
||
339 | 347 0268 81E0 ldi r24,lo8(1) |
||
340 | 348 026a 10C0 rjmp .L138 |
||
341 | 349 .L103: |
||
342 | 350 026c 84E4 ldi r24,lo8(68) |
||
343 | 351 026e 8093 0000 sts SpektrumTimer,r24 |
||
344 | 352 0272 9093 0000 sts FrameCnt.1,r25 |
||
345 | 353 0276 9093 0000 sts Sync.0,r25 |
||
346 | 354 027a 9093 0000 sts ByteHigh.2,r25 |
||
347 | 355 027e FAC0 rjmp .L105 |
||
348 | 356 .L102: |
||
349 | 357 0280 9130 cpi r25,lo8(1) |
||
350 | 358 0282 69F4 brne .L106 |
||
351 | 359 0284 232B or r18,r19 |
||
352 | 360 0286 09F0 breq .+2 |
||
353 | 361 0288 EBC0 rjmp .L112 |
||
354 | 362 028a 82E0 ldi r24,lo8(2) |
||
355 | 363 .L138: |
||
356 | 364 028c 8093 0000 sts Sync.0,r24 |
||
357 | 365 0290 8091 0000 lds r24,FrameCnt.1 |
||
358 | 366 0294 8F5F subi r24,lo8(-(1)) |
||
359 | 367 0296 8093 0000 sts FrameCnt.1,r24 |
||
360 | 368 029a 83E0 ldi r24,lo8(3) |
||
361 | 369 029c E9C0 rjmp .L136 |
||
362 | 370 .L106: |
||
363 | 371 029e 9230 cpi r25,lo8(2) |
||
364 | 372 02a0 D1F4 brne .L108 |
||
365 | 373 02a2 232B or r18,r19 |
||
366 | 374 02a4 09F0 breq .+2 |
||
367 | 375 02a6 DCC0 rjmp .L112 |
||
368 | 376 02a8 83E0 ldi r24,lo8(3) |
||
369 | 377 02aa 8093 0000 sts SpektrumTimer,r24 |
||
370 | 378 02ae 4093 0000 sts ByteHigh.2,r20 |
||
371 | 379 02b2 9091 0000 lds r25,FrameCnt.1 |
||
372 | 380 02b6 9230 cpi r25,lo8(2) |
||
373 | 381 02b8 39F4 brne .L109 |
||
374 | 382 02ba 1092 0000 sts Frame2.4,__zero_reg__ |
||
375 | 383 02be 47FF sbrs r20,7 |
||
376 | 384 02c0 03C0 rjmp .L109 |
||
377 | 385 02c2 81E0 ldi r24,lo8(1) |
||
378 | 386 02c4 8093 0000 sts Frame2.4,r24 |
||
379 | 387 .L109: |
||
380 | 388 02c8 83E0 ldi r24,lo8(3) |
||
381 | 389 02ca 8093 0000 sts Sync.0,r24 |
||
382 | 390 02ce 9F5F subi r25,lo8(-(1)) |
||
383 | 391 02d0 9093 0000 sts FrameCnt.1,r25 |
||
384 | 392 02d4 CFC0 rjmp .L105 |
||
385 | 393 .L108: |
||
386 | 394 02d6 9330 cpi r25,lo8(3) |
||
387 | 395 02d8 09F0 breq .+2 |
||
388 | 396 02da C2C0 rjmp .L112 |
||
389 | 397 02dc 232B or r18,r19 |
||
390 | 398 02de 09F0 breq .+2 |
||
391 | 399 02e0 BFC0 rjmp .L112 |
||
392 | 400 02e2 9093 0000 sts SpektrumTimer,r25 |
||
393 | 401 02e6 82E0 ldi r24,lo8(2) |
||
394 | 402 02e8 8093 0000 sts Sync.0,r24 |
||
395 | 403 02ec 8091 0000 lds r24,FrameCnt.1 |
||
396 | 404 02f0 8F5F subi r24,lo8(-(1)) |
||
397 | 405 02f2 8093 0000 sts FrameCnt.1,r24 |
||
398 | 406 02f6 2091 0000 lds r18,ByteHigh.2 |
||
399 | 407 02fa 822F mov r24,r18 |
||
400 | 408 02fc 9927 clr r25 |
||
401 | 409 02fe 782F mov r23,r24 |
||
402 | 410 0300 6627 clr r22 |
||
403 | 411 0302 842F mov r24,r20 |
||
404 | 412 0304 9927 clr r25 |
||
405 | 413 0306 682B or r22,r24 |
||
406 | 414 0308 792B or r23,r25 |
||
407 | 415 030a 8091 0000 lds r24,EE_Parameter+39 |
||
408 | 416 030e 8130 cpi r24,lo8(1) |
||
409 | 417 0310 49F4 brne .L113 |
||
410 | 418 0312 7370 andi r23,hi8(1023) |
||
411 | 419 0314 CB01 movw r24,r22 |
||
412 | 420 0316 8050 subi r24,lo8(-(-512)) |
||
413 | 421 0318 9240 sbci r25,hi8(-(-512)) |
||
414 | 422 031a 63E0 ldi r22,lo8(3) |
||
415 | 423 031c 70E0 ldi r23,hi8(3) |
||
416 | 424 031e 0E94 0000 call __divmodhi4 |
||
417 | 425 0322 17C0 rjmp .L137 |
||
418 | 426 .L113: |
||
419 | 427 0324 8230 cpi r24,lo8(2) |
||
420 | 428 0326 61F4 brne .L115 |
||
421 | 429 0328 7770 andi r23,hi8(2047) |
||
422 | 430 032a CB01 movw r24,r22 |
||
423 | 431 032c 8050 subi r24,lo8(-(-1024)) |
||
424 | 432 032e 9440 sbci r25,hi8(-(-1024)) |
||
425 | 433 0330 66E0 ldi r22,lo8(6) |
||
426 | 434 0332 70E0 ldi r23,hi8(6) |
||
427 | 435 0334 0E94 0000 call __divmodhi4 |
||
428 | 436 0338 2695 lsr r18 |
||
429 | 437 033a 2695 lsr r18 |
||
430 | 438 033c 2695 lsr r18 |
||
431 | 439 033e 0BC0 rjmp .L135 |
||
432 | 440 .L115: |
||
433 | 441 0340 7370 andi r23,hi8(1023) |
||
434 | 442 0342 6856 subi r22,lo8(-(-360)) |
||
435 | 443 0344 7140 sbci r23,hi8(-(-360)) |
||
436 | 444 0346 CB01 movw r24,r22 |
||
437 | 445 0348 77FD sbrc r23,7 |
||
438 | 446 034a 0196 adiw r24,1 |
||
439 | 447 .L117: |
||
440 | 448 034c BC01 movw r22,r24 |
||
441 | 449 034e 7595 asr r23 |
||
442 | 450 0350 6795 ror r22 |
||
443 | 451 .L137: |
||
444 | 452 0352 2695 lsr r18 |
||
445 | 453 0354 2695 lsr r18 |
||
446 | 454 .L135: |
||
447 | 455 0356 022F mov r16,r18 |
||
448 | 456 0358 1127 clr r17 |
||
449 | 457 035a 0F70 andi r16,lo8(15) |
||
450 | 458 035c 1070 andi r17,hi8(15) |
||
451 | 459 035e 0F5F subi r16,lo8(-(1)) |
||
452 | 460 0360 1F4F sbci r17,hi8(-(1)) |
||
453 | 461 0362 0D30 cpi r16,13 |
||
454 | 462 0364 1105 cpc r17,__zero_reg__ |
||
455 | 463 0366 08F0 brlo .+2 |
||
456 | 464 0368 74C0 rjmp .L118 |
||
457 | 465 036a 7801 movw r14,r16 |
||
458 | 466 036c E00E add r14,r16 |
||
459 | 467 036e F11E adc r15,r17 |
||
460 | 468 0370 F701 movw r30,r14 |
||
461 | 469 0372 E050 subi r30,lo8(-(PPM_in)) |
||
462 | 470 0374 F040 sbci r31,hi8(-(PPM_in)) |
||
463 | 471 0376 8081 ld r24,Z |
||
464 | 472 0378 9181 ldd r25,Z+1 |
||
465 | 473 037a 9B01 movw r18,r22 |
||
466 | 474 037c 281B sub r18,r24 |
||
467 | 475 037e 390B sbc r19,r25 |
||
468 | 476 0380 C901 movw r24,r18 |
||
469 | 477 0382 37FF sbrs r19,7 |
||
470 | 478 0384 03C0 rjmp .L120 |
||
471 | 479 0386 9095 com r25 |
||
472 | 480 0388 8195 neg r24 |
||
473 | 481 038a 9F4F sbci r25,lo8(-1) |
||
474 | 482 .L120: |
||
475 | 483 038c 0697 sbiw r24,6 |
||
476 | 484 038e 94F4 brge .L119 |
||
477 | 485 0390 8091 0000 lds r24,SenderOkay |
||
478 | 486 0394 883C cpi r24,lo8(-56) |
||
479 | 487 0396 30F4 brsh .L121 |
||
480 | 488 0398 8091 0000 lds r24,SenderOkay |
||
481 | 489 039c 865F subi r24,lo8(-(10)) |
||
482 | 490 039e 8093 0000 sts SenderOkay,r24 |
||
483 | 491 03a2 08C0 rjmp .L119 |
||
484 | 492 .L121: |
||
485 | 493 03a4 88EC ldi r24,lo8(-56) |
||
486 | 494 03a6 8093 0000 sts SenderOkay,r24 |
||
487 | 495 03aa 8091 6F00 lds r24,111 |
||
488 | 496 03ae 8F7D andi r24,lo8(-33) |
||
489 | 497 03b0 8093 6F00 sts 111,r24 |
||
490 | 498 .L119: |
||
491 | 499 03b4 F701 movw r30,r14 |
||
492 | 500 03b6 E050 subi r30,lo8(-(PPM_in)) |
||
493 | 501 03b8 F040 sbci r31,hi8(-(PPM_in)) |
||
494 | 502 03ba 8081 ld r24,Z |
||
495 | 503 03bc 9181 ldd r25,Z+1 |
||
496 | 504 03be 9C01 movw r18,r24 |
||
497 | 505 03c0 220F lsl r18 |
||
498 | 506 03c2 331F rol r19 |
||
499 | 507 03c4 280F add r18,r24 |
||
500 | 508 03c6 391F adc r19,r25 |
||
501 | 509 03c8 260F add r18,r22 |
||
502 | 510 03ca 371F adc r19,r23 |
||
503 | 511 03cc 37FF sbrs r19,7 |
||
504 | 512 03ce 02C0 rjmp .L123 |
||
505 | 513 03d0 2D5F subi r18,lo8(-(3)) |
||
506 | 514 03d2 3F4F sbci r19,hi8(-(3)) |
||
507 | 515 .L123: |
||
508 | 516 03d4 E901 movw r28,r18 |
||
509 | 517 03d6 D595 asr r29 |
||
510 | 518 03d8 C795 ror r28 |
||
511 | 519 03da D595 asr r29 |
||
512 | 520 03dc C795 ror r28 |
||
513 | 521 03de CB01 movw r24,r22 |
||
514 | 522 03e0 0196 adiw r24,1 |
||
515 | 523 03e2 8C17 cp r24,r28 |
||
516 | 524 03e4 9D07 cpc r25,r29 |
||
517 | 525 03e6 14F4 brge .L124 |
||
518 | 526 03e8 2197 sbiw r28,1 |
||
519 | 527 03ea 06C0 rjmp .L125 |
||
520 | 528 .L124: |
||
521 | 529 03ec 6150 subi r22,lo8(-(-1)) |
||
522 | 530 03ee 7040 sbci r23,hi8(-(-1)) |
||
523 | 531 03f0 C617 cp r28,r22 |
||
524 | 532 03f2 D707 cpc r29,r23 |
||
525 | 533 03f4 0CF4 brge .L125 |
||
526 | 534 03f6 2196 adiw r28,1 |
||
527 | 535 .L125: |
||
528 | 536 03f8 8091 0000 lds r24,SenderOkay |
||
529 | 537 03fc 843B cpi r24,lo8(-76) |
||
530 | 538 03fe D0F0 brlo .L127 |
||
531 | 539 0400 F701 movw r30,r14 |
||
532 | 540 0402 E050 subi r30,lo8(-(PPM_in)) |
||
533 | 541 0404 F040 sbci r31,hi8(-(PPM_in)) |
||
534 | 542 0406 8081 ld r24,Z |
||
535 | 543 0408 9181 ldd r25,Z+1 |
||
536 | 544 040a FE01 movw r30,r28 |
||
537 | 545 040c E81B sub r30,r24 |
||
538 | 546 040e F90B sbc r31,r25 |
||
539 | 547 0410 CF01 movw r24,r30 |
||
540 | 548 0412 63E0 ldi r22,lo8(3) |
||
541 | 549 0414 70E0 ldi r23,hi8(3) |
||
542 | 550 0416 0E94 0000 call __divmodhi4 |
||
543 | 551 041a CB01 movw r24,r22 |
||
544 | 552 041c 880F lsl r24 |
||
545 | 553 041e 991F rol r25 |
||
546 | 554 0420 860F add r24,r22 |
||
547 | 555 0422 971F adc r25,r23 |
||
548 | 556 0424 20E0 ldi r18,lo8(PPM_diff) |
||
549 | 557 0426 30E0 ldi r19,hi8(PPM_diff) |
||
550 | 558 0428 E20E add r14,r18 |
||
551 | 559 042a F31E adc r15,r19 |
||
552 | 560 042c F701 movw r30,r14 |
||
553 | 561 042e 9183 std Z+1,r25 |
||
554 | 562 0430 8083 st Z,r24 |
||
555 | 563 0432 07C0 rjmp .L128 |
||
556 | 564 .L127: |
||
557 | 565 0434 20E0 ldi r18,lo8(PPM_diff) |
||
558 | 566 0436 30E0 ldi r19,hi8(PPM_diff) |
||
559 | 567 0438 E20E add r14,r18 |
||
560 | 568 043a F31E adc r15,r19 |
||
561 | 569 043c F701 movw r30,r14 |
||
562 | 570 043e 1182 std Z+1,__zero_reg__ |
||
563 | 571 0440 1082 st Z,__zero_reg__ |
||
564 | 572 .L128: |
||
565 | 573 0442 000F add r16,r16 |
||
566 | 574 0444 111F adc r17,r17 |
||
567 | 575 0446 0050 subi r16,lo8(-(PPM_in)) |
||
568 | 576 0448 1040 sbci r17,hi8(-(PPM_in)) |
||
569 | 577 044a F801 movw r30,r16 |
||
570 | 578 044c D183 std Z+1,r29 |
||
571 | 579 044e C083 st Z,r28 |
||
572 | 580 0450 11C0 rjmp .L105 |
||
573 | 581 .L118: |
||
574 | 582 0452 0231 cpi r16,18 |
||
575 | 583 0454 1105 cpc r17,__zero_reg__ |
||
576 | 584 0456 70F0 brlo .L105 |
||
577 | 585 0458 81E0 ldi r24,lo8(1) |
||
578 | 586 045a 8093 0000 sts ReSync.3,r24 |
||
579 | 587 045e 0AC0 rjmp .L105 |
||
580 | 588 .L112: |
||
581 | 589 0460 81E0 ldi r24,lo8(1) |
||
582 | 590 0462 8093 0000 sts ReSync.3,r24 |
||
583 | 591 0466 1092 0000 sts FrameCnt.1,__zero_reg__ |
||
584 | 592 046a 1092 0000 sts Frame2.4,__zero_reg__ |
||
585 | 593 046e 84E4 ldi r24,lo8(68) |
||
586 | 594 .L136: |
||
587 | 595 0470 8093 0000 sts SpektrumTimer,r24 |
||
588 | 596 .L105: |
||
589 | 597 0474 8091 0000 lds r24,FrameCnt.1 |
||
590 | 598 0478 8031 cpi r24,lo8(16) |
||
591 | 599 047a 98F0 brlo .L97 |
||
592 | 600 047c 8091 0000 lds r24,Frame2.4 |
||
593 | 601 0480 8823 tst r24 |
||
594 | 602 0482 31F4 brne .L133 |
||
595 | 603 0484 8091 0000 lds r24,ReSync.3 |
||
596 | 604 0488 8823 tst r24 |
||
597 | 605 048a 11F4 brne .L133 |
||
598 | 606 048c 8093 0000 sts NewPpmData,r24 |
||
599 | 607 .L133: |
||
600 | 608 0490 1092 0000 sts FrameCnt.1,__zero_reg__ |
||
601 | 609 0494 1092 0000 sts Frame2.4,__zero_reg__ |
||
602 | 610 0498 1092 0000 sts Sync.0,__zero_reg__ |
||
603 | 611 049c 84E4 ldi r24,lo8(68) |
||
604 | 612 049e 8093 0000 sts SpektrumTimer,r24 |
||
605 | 613 .L97: |
||
606 | 614 /* epilogue: frame size=0 */ |
||
607 | 615 04a2 E6E0 ldi r30,6 |
||
608 | 616 04a4 CDB7 in r28,__SP_L__ |
||
609 | 617 04a6 DEB7 in r29,__SP_H__ |
||
610 | 618 04a8 0C94 0000 jmp __epilogue_restores__+24 |
||
611 | 619 /* epilogue end (size=5) */ |
||
612 | 620 /* function SpektrumParser size 334 (323) */ |
||
613 | 622 /* File "Spektrum.c": code 604 = 0x025c ( 582), prologues 11, epilogues 11 */ |
||
614 | DEFINED SYMBOLS |
||
615 | *ABS*:00000000 Spektrum.c |
||
616 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:3 *ABS*:0000003f __SREG__ |
||
617 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:4 *ABS*:0000003e __SP_H__ |
||
618 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:5 *ABS*:0000003d __SP_L__ |
||
619 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:6 *ABS*:00000000 __tmp_reg__ |
||
620 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:7 *ABS*:00000001 __zero_reg__ |
||
621 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:15 .bss:00000000 SpektrumTimer |
||
622 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:20 .text:00000000 SpektrumUartInit |
||
623 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:94 .progmem.data:00000000 __c.5 |
||
624 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:98 .progmem.data:00000036 __c.6 |
||
625 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:102 .progmem.data:0000003c __c.7 |
||
626 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:107 .text:000000b6 SpektrumBinding |
||
627 | .bss:00000001 Sync.0 |
||
628 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:298 .bss:00000002 FrameCnt.1 |
||
629 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:299 .bss:00000003 ByteHigh.2 |
||
630 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:304 .data:00000000 ReSync.3 |
||
631 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:300 .bss:00000004 Frame2.4 |
||
632 | C:\Users\Arthur-P\AppData\Local\Temp/ccIfbaaa.s:310 .text:0000021a SpektrumParser |
||
633 | |||
634 | UNDEFINED SYMBOLS |
||
635 | __do_copy_data |
||
636 | __do_clear_bss |
||
637 | SetDelay |
||
638 | uart_putchar |
||
639 | _printf_P |
||
640 | CheckDelay |
||
641 | __epilogue_restores__ |
||
642 | EE_Parameter |
||
643 | __divmodhi4 |
||
644 | PPM_in |
||
645 | SenderOkay |
||
646 | PPM_diff |
||
647 | NewPpmData |