Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
741 | agressiva | 1 | |
2 | C-OSD.elf: file format elf32-avr |
||
3 | |||
4 | Sections: |
||
5 | Idx Name Size VMA LMA File off Algn |
||
6 | |||
7 | CONTENTS, ALLOC, LOAD, DATA |
||
8 | 1 .text 00003a28 00000000 00000000 000000b4 2**1 |
||
9 | CONTENTS, ALLOC, LOAD, READONLY, CODE |
||
10 | 2 .bss 0000018f 00800112 00800112 00003aee 2**0 |
||
11 | ALLOC |
||
12 | 3 .eeprom 00000005 00810000 00810000 00003aee 2**0 |
||
13 | CONTENTS, ALLOC, LOAD, DATA |
||
14 | 4 .debug_aranges 00000180 00000000 00000000 00003af3 2**0 |
||
15 | CONTENTS, READONLY, DEBUGGING |
||
16 | 5 .debug_pubnames 0000245b 00000000 00000000 00003c73 2**0 |
||
17 | CONTENTS, READONLY, DEBUGGING |
||
18 | 6 .debug_info 000070a3 00000000 00000000 000060ce 2**0 |
||
19 | CONTENTS, READONLY, DEBUGGING |
||
20 | 7 .debug_abbrev 0000113c 00000000 00000000 0000d171 2**0 |
||
21 | CONTENTS, READONLY, DEBUGGING |
||
22 | 8 .debug_line 00002b13 00000000 00000000 0000e2ad 2**0 |
||
23 | CONTENTS, READONLY, DEBUGGING |
||
24 | 9 .debug_frame 00000430 00000000 00000000 00010dc0 2**2 |
||
25 | CONTENTS, READONLY, DEBUGGING |
||
26 | 10 .debug_str 00000c43 00000000 00000000 000111f0 2**0 |
||
27 | CONTENTS, READONLY, DEBUGGING |
||
28 | 11 .debug_loc 00001c20 00000000 00000000 00011e33 2**0 |
||
29 | CONTENTS, READONLY, DEBUGGING |
||
30 | 12 .debug_ranges 00000138 00000000 00000000 00013a53 2**0 |
||
31 | CONTENTS, READONLY, DEBUGGING |
||
32 | |||
33 | Disassembly of section .text: |
||
34 | |||
35 | 00000000 <__vectors>: |
||
36 | 0: 0c 94 c6 01 jmp 0x38c ; 0x38c <__ctors_end> |
||
37 | 4: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
38 | 8: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
39 | c: 0c 94 a3 0e jmp 0x1d46 ; 0x1d46 <__vector_3> |
||
40 | 10: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
41 | 14: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
42 | 18: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
43 | 1c: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
44 | 20: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
45 | 24: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
46 | 28: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
47 | 2c: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
48 | 30: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
49 | 34: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
50 | 38: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
51 | 3c: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
52 | 40: 0c 94 d9 02 jmp 0x5b2 ; 0x5b2 <__vector_16> |
||
53 | 44: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
54 | 48: 0c 94 07 0e jmp 0x1c0e ; 0x1c0e <__vector_18> |
||
55 | 4c: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
56 | 50: 0c 94 64 03 jmp 0x6c8 ; 0x6c8 <__vector_20> |
||
57 | 54: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
58 | 58: 0c 94 5a 03 jmp 0x6b4 ; 0x6b4 <__vector_22> |
||
59 | 5c: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
60 | 60: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
61 | 64: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
62 | 68: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
63 | 6c: 0c 94 e3 01 jmp 0x3c6 ; 0x3c6 <__bad_interrupt> |
||
64 | |||
65 | 00000070 <stats_item_0>: |
||
66 | 70: 6d 61 78 20 41 6c 74 69 74 75 64 65 3a 00 max Altitude:. |
||
67 | |||
68 | 0000007e <stats_item_1>: |
||
69 | 7e: 6d 61 78 20 53 70 65 65 64 20 20 20 3a 00 max Speed :. |
||
70 | |||
71 | 0000008c <stats_item_2>: |
||
72 | 8c: 6d 61 78 20 44 69 73 74 61 6e 63 65 3a 00 max Distance:. |
||
73 | |||
74 | 0000009a <stats_item_3>: |
||
75 | 9a: 6d 69 6e 20 56 6f 6c 74 61 67 65 20 3a 00 min Voltage :. |
||
76 | |||
77 | 000000a8 <stats_item_4>: |
||
78 | a8: 6d 61 78 20 54 69 6d 65 20 20 20 20 3a 00 max Time :. |
||
79 | |||
80 | 000000b6 <stats_item_5>: |
||
81 | b6: 6c 6f 6e 67 69 74 75 64 65 20 20 20 3a 00 longitude :. |
||
82 | |||
83 | 000000c4 <stats_item_6>: |
||
84 | c4: 6c 61 74 69 74 75 64 65 20 20 20 20 3a 00 latitude :. |
||
85 | |||
86 | 000000d2 <stats_item_7>: |
||
87 | d2: 6d 61 78 20 63 75 72 72 65 6e 74 20 3a 00 max current :. |
||
88 | |||
89 | 000000e0 <stats_item_pointers>: |
||
90 | e0: 70 00 7e 00 8c 00 9a 00 a8 00 b6 00 c4 00 d2 00 p.~............. |
||
91 | |||
92 | 000000f0 <str_NE>: |
||
93 | f0: 4e 45 00 NE. |
||
94 | |||
95 | 000000f3 <str_E>: |
||
96 | f3: 45 20 00 E . |
||
97 | |||
98 | 000000f6 <str_SE>: |
||
99 | f6: 53 45 00 SE. |
||
100 | |||
101 | 000000f9 <str_S>: |
||
102 | f9: 53 20 00 S . |
||
103 | |||
104 | 000000fc <str_SW>: |
||
105 | fc: 53 57 00 SW. |
||
106 | |||
107 | 000000ff <str_W>: |
||
108 | ff: 57 20 00 W . |
||
109 | |||
110 | 00000102 <str_NW>: |
||
111 | 102: 4e 57 00 NW. |
||
112 | |||
113 | 00000105 <str_N>: |
||
114 | 105: 4e 20 00 N . |
||
115 | |||
116 | 00000108 <directions>: |
||
117 | 108: f0 00 f3 00 f6 00 f9 00 fc 00 ff 00 02 01 05 01 ................ |
||
118 | |||
119 | 00000118 <str_1>: |
||
120 | 118: 64 65 66 61 75 6c 74 00 default. |
||
121 | |||
122 | 00000120 <str_2>: |
||
123 | 120: 6d 69 6e 69 6d 61 6c 00 minimal. |
||
124 | |||
125 | 00000128 <str_3>: |
||
126 | 128: 20 20 20 6a 6f 70 6c 00 jopl. |
||
127 | |||
128 | 00000130 <ncdisplaymodes>: |
||
129 | 130: 0c 0f 18 01 02 15 20 01 ...... . |
||
130 | |||
131 | 00000138 <fcdisplaymodes>: |
||
132 | 138: 8a 18 18 01 33 1a 28 01 ....3.(. |
||
133 | |||
134 | 00000140 <__c.1706>: |
||
135 | 140: 23 62 6f 3f 5d 3d 3d 45 47 0d 00 #bo?]==EG.. |
||
136 | |||
137 | 0000014b <vario_00>: |
||
138 | 14b: 00 00 c2 ff ff ..... |
||
139 | |||
140 | 00000150 <vario_01>: |
||
141 | 150: 00 00 c2 ff c0 ..... |
||
142 | |||
143 | 00000155 <vario_02>: |
||
144 | 155: 00 00 c2 ff c1 ..... |
||
145 | |||
146 | 0000015a <vario_03>: |
||
147 | 15a: 00 00 c2 ff 00 ..... |
||
148 | |||
149 | 0000015f <vario_04>: |
||
150 | 15f: 00 00 c2 c0 00 ..... |
||
151 | |||
152 | 00000164 <vario_05>: |
||
153 | 164: 00 00 c2 c1 00 ..... |
||
154 | |||
155 | 00000169 <vario_06>: |
||
156 | 169: 00 00 c2 00 00 ..... |
||
157 | |||
158 | 0000016e <vario_07>: |
||
159 | 16e: 00 00 bb 00 00 ..... |
||
160 | |||
161 | 00000173 <vario_08>: |
||
162 | 173: 00 00 c3 00 00 ..... |
||
163 | |||
164 | 00000178 <vario_09>: |
||
165 | 178: 00 c4 c3 00 00 ..... |
||
166 | |||
167 | 0000017d <vario_10>: |
||
168 | 17d: 00 c5 c3 00 00 ..... |
||
169 | |||
170 | 00000182 <vario_11>: |
||
171 | 182: 00 ff c3 00 00 ..... |
||
172 | |||
173 | 00000187 <vario_12>: |
||
174 | 187: c4 ff c3 00 00 ..... |
||
175 | |||
176 | 0000018c <vario_13>: |
||
177 | 18c: c5 ff c3 00 00 ..... |
||
178 | |||
179 | 00000191 <vario_14>: |
||
180 | 191: ff ff c3 00 00 ..... |
||
181 | |||
182 | 00000196 <vario_pnt>: |
||
183 | 196: 4b 01 50 01 55 01 5a 01 5f 01 64 01 69 01 6e 01 K.P.U.Z._.d.i.n. |
||
184 | 1a6: 73 01 78 01 7d 01 82 01 87 01 8c 01 91 01 s.x.}......... |
||
185 | |||
186 | 000001b4 <rose.1545>: |
||
187 | 1b4: d8 d7 d8 d3 d8 d7 d8 d5 d8 d7 d8 d4 d8 d7 d8 d6 ................ |
||
188 | 1c4: d8 d7 d8 d3 d8 d7 d8 d5 d8 d7 d8 d4 d8 d7 d8 d6 ................ |
||
189 | 1d4: d8 d7 d8 d3 d8 d7 d8 d5 d8 d7 d8 d4 d8 d7 d8 d6 ................ |
||
190 | |||
191 | 000001e4 <VM_PAL>: |
||
192 | 1e4: 50 41 4c 20 00 PAL . |
||
193 | |||
194 | 000001e9 <VM_NTSC>: |
||
195 | 1e9: 4e 54 53 43 00 NTSC. |
||
196 | |||
197 | 000001ee <ee_message0>: |
||
198 | 1ee: 4c 6f 61 64 69 6e 67 20 44 61 74 61 20 66 72 6f Loading Data fro |
||
199 | 1fe: 6d 20 45 45 50 52 4f 4d 00 m EEPROM. |
||
200 | |||
201 | 00000207 <ee_message1>: |
||
202 | 207: 4e 6f 20 73 61 76 65 64 20 44 61 74 61 20 69 6e No saved Data in |
||
203 | 217: 20 45 45 50 52 4f 4d 00 EEPROM. |
||
204 | |||
205 | 0000021f <ee_msg>: |
||
206 | 21f: ee 01 07 02 .... |
||
207 | |||
208 | 00000223 <__c.1787>: |
||
209 | 223: 43 2d 4f 53 44 20 43 6f 6e 66 69 67 20 4d 65 6e C-OSD Config Men |
||
210 | 233: 75 00 u. |
||
211 | |||
212 | 00000235 <__c.1779>: |
||
213 | 235: 44 4f 4e 45 20 20 20 20 20 20 20 20 20 20 20 20 DONE |
||
214 | 245: 20 20 00 . |
||
215 | |||
216 | 00000248 <__c.1753>: |
||
217 | 248: 45 58 49 54 00 EXIT. |
||
218 | |||
219 | 0000024d <__c.1751>: |
||
220 | 24d: 53 61 76 65 20 63 6f 6e 66 69 67 00 Save config. |
||
221 | |||
222 | 00000259 <__c.1749>: |
||
223 | 259: 42 41 52 4f 00 BARO. |
||
224 | |||
225 | 0000025e <__c.1747>: |
||
226 | 25e: 20 47 50 53 00 GPS. |
||
227 | |||
228 | 00000263 <__c.1745>: |
||
229 | 263: 48 65 69 67 68 74 20 62 79 00 Height by. |
||
230 | |||
231 | 0000026d <__c.1740>: |
||
232 | 26d: 44 69 73 70 6c 61 79 20 4d 6f 64 65 00 Display Mode. |
||
233 | |||
234 | 0000027a <__c.1738>: |
||
235 | 27a: 52 65 73 65 74 20 75 70 74 69 6d 65 00 Reset uptime. |
||
236 | |||
237 | 00000287 <__c.1736>: |
||
238 | 287: 56 6f 6c 74 61 67 65 20 62 79 20 43 2d 53 74 72 Voltage by C-Str |
||
239 | 297: 6f 6d 00 om. |
||
240 | |||
241 | 0000029a <__c.1734>: |
||
242 | 29a: 43 75 72 72 65 6e 74 20 62 79 20 46 43 00 Current by FC. |
||
243 | |||
244 | 000002a8 <__c.1732>: |
||
245 | 2a8: 53 74 61 74 69 73 74 69 63 73 00 Statistics. |
||
246 | |||
247 | 000002b3 <__c.1730>: |
||
248 | 2b3: 42 69 67 20 56 61 72 69 6f 20 62 61 72 00 Big Vario bar. |
||
249 | |||
250 | 000002c1 <__c.1728>: |
||
251 | 2c1: 41 72 74 20 48 6f 72 69 7a 6f 6e 20 69 6e 20 48 Art Horizon in H |
||
252 | 2d1: 55 44 00 UD. |
||
253 | |||
254 | 000002d4 <__c.1726>: |
||
255 | 2d4: 46 75 6c 6c 20 48 55 44 00 Full HUD. |
||
256 | |||
257 | 000002dd <__c.1724>: |
||
258 | 2dd: 56 69 64 65 6f 20 4d 6f 64 65 00 Video Mode. |
||
259 | |||
260 | 000002e8 <__c.1714>: |
||
261 | 2e8: 4f 46 46 00 OFF. |
||
262 | |||
263 | 000002ec <__c.1712>: |
||
264 | 2ec: 4f 4e 20 00 ON . |
||
265 | |||
266 | 000002f0 <__c.1663>: |
||
267 | 2f0: 4e 43 20 56 45 52 53 49 4f 4e 3a 20 2e 2e 2e 2e NC VERSION: .... |
||
268 | 300: 2e 2e 2e 2e 00 ..... |
||
269 | |||
270 | 00000305 <__c.1661>: |
||
271 | 305: 23 62 76 3d 3d 3d 3d 44 6c 0d 00 #bv====Dl.. |
||
272 | |||
273 | 00000310 <__c.1659>: |
||
274 | 310: 4d 61 78 20 56 6f 6c 74 61 67 65 20 20 20 20 3a Max Voltage : |
||
275 | ... |
||
276 | |||
277 | 00000321 <__c.1657>: |
||
278 | 321: 57 61 72 6e 20 56 6f 6c 74 61 67 65 20 20 20 3a Warn Voltage : |
||
279 | ... |
||
280 | |||
281 | 00000332 <__c.1655>: |
||
282 | 332: 4e 75 6d 62 65 72 20 6f 66 20 43 65 6c 6c 73 3a Number of Cells: |
||
283 | ... |
||
284 | |||
285 | 00000343 <__c.1651>: |
||
286 | 343: 47 75 65 73 73 69 6e 67 20 4e 75 6d 62 65 72 20 Guessing Number |
||
287 | 353: 6f 66 20 43 65 6c 6c 73 00 of Cells. |
||
288 | |||
289 | 0000035c <__c.1648>: |
||
290 | 35c: 44 45 56 45 4c 2d 42 55 49 4c 44 00 DEVEL-BUILD. |
||
291 | |||
292 | 00000368 <__c.1646>: |
||
293 | 368: 4e 61 76 69 43 74 72 6c 20 4d 6f 64 65 00 NaviCtrl Mode. |
||
294 | |||
295 | 00000376 <__c.1644>: |
||
296 | 376: 43 2d 4f 53 44 20 49 6e 69 74 69 61 6c 69 73 61 C-OSD Initialisa |
||
297 | 386: 74 69 6f 6e 00 00 tion.. |
||
298 | |||
299 | 0000038c <__ctors_end>: |
||
300 | 38c: 11 24 eor r1, r1 |
||
301 | 38e: 1f be out 0x3f, r1 ; 63 |
||
302 | 390: cf ef ldi r28, 0xFF ; 255 |
||
303 | 392: d4 e0 ldi r29, 0x04 ; 4 |
||
304 | 394: de bf out 0x3e, r29 ; 62 |
||
305 | 396: cd bf out 0x3d, r28 ; 61 |
||
306 | |||
307 | 00000398 <__do_copy_data>: |
||
308 | 398: 11 e0 ldi r17, 0x01 ; 1 |
||
309 | 39a: a0 e0 ldi r26, 0x00 ; 0 |
||
310 | 39c: b1 e0 ldi r27, 0x01 ; 1 |
||
311 | 39e: e8 e2 ldi r30, 0x28 ; 40 |
||
312 | 3a0: fa e3 ldi r31, 0x3A ; 58 |
||
313 | 3a2: 02 c0 rjmp .+4 ; 0x3a8 <.do_copy_data_start> |
||
314 | |||
315 | 000003a4 <.do_copy_data_loop>: |
||
316 | 3a4: 05 90 lpm r0, Z+ |
||
317 | 3a6: 0d 92 st X+, r0 |
||
318 | |||
319 | 000003a8 <.do_copy_data_start>: |
||
320 | 3a8: a2 31 cpi r26, 0x12 ; 18 |
||
321 | 3aa: b1 07 cpc r27, r17 |
||
322 | 3ac: d9 f7 brne .-10 ; 0x3a4 <.do_copy_data_loop> |
||
323 | |||
324 | 000003ae <__do_clear_bss>: |
||
325 | 3ae: 12 e0 ldi r17, 0x02 ; 2 |
||
326 | 3b0: a2 e1 ldi r26, 0x12 ; 18 |
||
327 | 3b2: b1 e0 ldi r27, 0x01 ; 1 |
||
328 | 3b4: 01 c0 rjmp .+2 ; 0x3b8 <.do_clear_bss_start> |
||
329 | |||
330 | 000003b6 <.do_clear_bss_loop>: |
||
331 | 3b6: 1d 92 st X+, r1 |
||
332 | |||
333 | 000003b8 <.do_clear_bss_start>: |
||
334 | 3b8: a1 3a cpi r26, 0xA1 ; 161 |
||
335 | 3ba: b1 07 cpc r27, r17 |
||
336 | 3bc: e1 f7 brne .-8 ; 0x3b6 <.do_clear_bss_loop> |
||
337 | 3be: 0e 94 f0 01 call 0x3e0 ; 0x3e0 <main> |
||
338 | 3c2: 0c 94 12 1d jmp 0x3a24 ; 0x3a24 <_exit> |
||
339 | |||
340 | 000003c6 <__bad_interrupt>: |
||
341 | 3c6: 0c 94 e5 01 jmp 0x3ca ; 0x3ca <__vector_default> |
||
342 | |||
343 | 000003ca <__vector_default>: |
||
344 | |||
345 | /** |
||
346 | * handler for undefined Interrupts |
||
347 | * if not defined AVR will reset in case any unhandled interrupts occur |
||
348 | */ |
||
349 | ISR(__vector_default) { |
||
350 | 3ca: 1f 92 push r1 |
||
351 | 3cc: 0f 92 push r0 |
||
352 | 3ce: 0f b6 in r0, 0x3f ; 63 |
||
353 | 3d0: 0f 92 push r0 |
||
354 | 3d2: 11 24 eor r1, r1 |
||
355 | asm("nop"); |
||
356 | 3d4: 00 00 nop |
||
357 | } |
||
358 | 3d6: 0f 90 pop r0 |
||
359 | 3d8: 0f be out 0x3f, r0 ; 63 |
||
360 | 3da: 0f 90 pop r0 |
||
361 | 3dc: 1f 90 pop r1 |
||
362 | 3de: 18 95 reti |
||
363 | |||
364 | 000003e0 <main>: |
||
365 | /* ########################################################################## |
||
366 | * MAIN |
||
367 | * ##########################################################################*/ |
||
368 | int main(void) { |
||
369 | // set up FLAGS |
||
370 | COSD_FLAGS_MODES = 0, COSD_FLAGS_CONFIG = 0, COSD_FLAGS_RUNTIME = 0; |
||
371 | 3e0: 10 92 1c 01 sts 0x011C, r1 |
||
372 | 3e4: 10 92 1d 01 sts 0x011D, r1 |
||
373 | #endif |
||
374 | #if STATS |
||
375 | COSD_FLAGS_MODES |= COSD_FLAG_STATS; |
||
376 | #endif |
||
377 | #if WARNINGS |
||
378 | COSD_FLAGS_MODES |= COSD_FLAG_WARNINGS; |
||
379 | 3e8: 89 e1 ldi r24, 0x19 ; 25 |
||
380 | 3ea: 80 93 1b 01 sts 0x011B, r24 |
||
381 | COSD_FLAGS_CONFIG |= COSD_FLAG_FCMODE; |
||
382 | #endif |
||
383 | |||
384 | |||
385 | // set up Atmega162 Ports |
||
386 | DDRA |= (1 << PA1); // PA1 output (/CS) |
||
387 | 3ee: d1 9a sbi 0x1a, 1 ; 26 |
||
388 | MAX_CS_HIGH |
||
389 | 3f0: d9 9a sbi 0x1b, 1 ; 27 |
||
390 | DDRA |= (1 << PA2); // PA2 output (SDIN) |
||
391 | 3f2: d2 9a sbi 0x1a, 2 ; 26 |
||
392 | MAX_SDIN_LOW |
||
393 | 3f4: da 98 cbi 0x1b, 2 ; 27 |
||
394 | DDRA |= (1 << PA3); // PA3 output (SCLK) |
||
395 | 3f6: d3 9a sbi 0x1a, 3 ; 26 |
||
396 | MAX_SCLK_LOW |
||
397 | 3f8: db 98 cbi 0x1b, 3 ; 27 |
||
398 | DDRA |= (1 << PA5); // PA5 output (RESET) |
||
399 | 3fa: d5 9a sbi 0x1a, 5 ; 26 |
||
400 | MAX_RESET_HIGH |
||
401 | 3fc: dd 9a sbi 0x1b, 5 ; 27 |
||
402 | |||
403 | DDRC |= (1 << PC0); // PC0 output (LED1 gn) |
||
404 | 3fe: a0 9a sbi 0x14, 0 ; 20 |
||
405 | LED1_OFF |
||
406 | 400: a8 98 cbi 0x15, 0 ; 21 |
||
407 | DDRC |= (1 << PC1); // PC1 output (LED2 rt) |
||
408 | 402: a1 9a sbi 0x14, 1 ; 20 |
||
409 | LED2_OFF |
||
410 | 404: a9 98 cbi 0x15, 1 ; 21 |
||
411 | DDRC |= (1 << PC2); // PC2 output (LED3 gn) |
||
412 | 406: a2 9a sbi 0x14, 2 ; 20 |
||
413 | LED3_OFF |
||
414 | 408: aa 98 cbi 0x15, 2 ; 21 |
||
415 | DDRC |= (1 << PC3); // PC3 output (LED4 rt) |
||
416 | 40a: a3 9a sbi 0x14, 3 ; 20 |
||
417 | LED4_OFF |
||
418 | 40c: ab 98 cbi 0x15, 3 ; 21 |
||
419 | |||
420 | DDRC &= ~(1 << PC4); // PC4 input (MODE) |
||
421 | 40e: a4 98 cbi 0x14, 4 ; 20 |
||
422 | PORTC |= (1 << PC4); // pullup |
||
423 | 410: ac 9a sbi 0x15, 4 ; 21 |
||
424 | DDRC &= ~(1 << PC5); // PC5 input (SET) |
||
425 | 412: a5 98 cbi 0x14, 5 ; 20 |
||
426 | PORTC |= (1 << PC5); // pullup |
||
427 | 414: ad 9a sbi 0x15, 5 ; 21 |
||
428 | |||
429 | // reset the MAX7456 to be sure any undefined states do no harm |
||
430 | MAX_RESET_LOW |
||
431 | 416: dd 98 cbi 0x1b, 5 ; 27 |
||
432 | MAX_RESET_HIGH |
||
433 | 418: dd 9a sbi 0x1b, 5 ; 27 |
||
434 | |||
435 | // give the FC/NC and the maxim time to come up |
||
436 | LED4_ON |
||
437 | 41a: ab 9a sbi 0x15, 3 ; 21 |
||
438 | 41c: 80 e1 ldi r24, 0x10 ; 16 |
||
439 | 41e: 97 e2 ldi r25, 0x27 ; 39 |
||
440 | milliseconds can be achieved. |
||
441 | */ |
||
442 | void |
||
443 | _delay_loop_2(uint16_t __count) |
||
444 | { |
||
445 | __asm__ volatile ( |
||
446 | 420: 20 e9 ldi r18, 0x90 ; 144 |
||
447 | 422: 31 e0 ldi r19, 0x01 ; 1 |
||
448 | 424: f9 01 movw r30, r18 |
||
449 | 426: 31 97 sbiw r30, 0x01 ; 1 |
||
450 | 428: f1 f7 brne .-4 ; 0x426 <main+0x46> |
||
451 | __ticks = (uint16_t) (__ms * 10.0); |
||
452 | while(__ticks) |
||
453 | { |
||
454 | // wait 1/10 ms |
||
455 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
456 | __ticks --; |
||
457 | 42a: 01 97 sbiw r24, 0x01 ; 1 |
||
458 | __ticks = 1; |
||
459 | else if (__tmp > 65535) |
||
460 | { |
||
461 | // __ticks = requested delay in 1/10 ms |
||
462 | __ticks = (uint16_t) (__ms * 10.0); |
||
463 | while(__ticks) |
||
464 | 42c: d9 f7 brne .-10 ; 0x424 <main+0x44> |
||
465 | _delay_ms(1000); |
||
466 | LED4_OFF |
||
467 | 42e: ab 98 cbi 0x15, 3 ; 21 |
||
468 | // DISABLE display (VM0) |
||
469 | spi_send_byte(0x00, 0b00000000); |
||
470 | learn_all_chars_pgm(); |
||
471 | #else |
||
472 | // read out config for NTSC/PAL distinguishing |
||
473 | get_eeprom(0); |
||
474 | 430: 80 e0 ldi r24, 0x00 ; 0 |
||
475 | 432: 0e 94 bd 0c call 0x197a ; 0x197a <get_eeprom> |
||
476 | #endif |
||
477 | |||
478 | // Setup Video Mode |
||
479 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
480 | 436: 80 91 1c 01 lds r24, 0x011C |
||
481 | 43a: 80 ff sbrs r24, 0 |
||
482 | 43c: b2 c0 rjmp .+356 ; 0x5a2 <__stack+0xa3> |
||
483 | // NTSC + enable display immediately (VM0) |
||
484 | spi_send_byte(0x00, 0b00001000); |
||
485 | 43e: 80 e0 ldi r24, 0x00 ; 0 |
||
486 | 440: 68 e0 ldi r22, 0x08 ; 8 |
||
487 | 442: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
488 | |||
489 | bottom_line = 12; |
||
490 | 446: 8c e0 ldi r24, 0x0C ; 12 |
||
491 | 448: 80 93 03 01 sts 0x0103, r24 |
||
492 | |||
493 | // 8bit mode |
||
494 | spi_send_byte(0x04, 0b01000000);*/ |
||
495 | |||
496 | // clear display memory and set to 8bit mode |
||
497 | clear(); |
||
498 | 44c: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
499 | |||
500 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
501 | // init usart |
||
502 | usart1_init(); |
||
503 | 450: 0e 94 31 03 call 0x662 ; 0x662 <usart1_init> |
||
504 | |||
505 | // keep serial port clean |
||
506 | usart1_DisableTXD(); |
||
507 | 454: 0e 94 39 03 call 0x672 ; 0x672 <usart1_DisableTXD> |
||
508 | |||
509 | // set up timer |
||
510 | // CTC, Prescaler /64 |
||
511 | TCCR0 = (1 << WGM01) | (0 << WGM00) | (0 << CS02) | (1 << CS01) | (1 << CS00); |
||
512 | 458: 8b e0 ldi r24, 0x0B ; 11 |
||
513 | 45a: 83 bf out 0x33, r24 ; 51 |
||
514 | |||
515 | TCNT0 = 0; |
||
516 | 45c: 12 be out 0x32, r1 ; 50 |
||
517 | OCR0 = 250; |
||
518 | 45e: 8a ef ldi r24, 0xFA ; 250 |
||
519 | 460: 81 bf out 0x31, r24 ; 49 |
||
520 | |||
521 | // enable timer output compare interrupt |
||
522 | TIMSK &= ~(1 << TOIE0); |
||
523 | 462: 89 b7 in r24, 0x39 ; 57 |
||
524 | 464: 8d 7f andi r24, 0xFD ; 253 |
||
525 | 466: 89 bf out 0x39, r24 ; 57 |
||
526 | TIMSK |= (1 << OCIE0); |
||
527 | 468: 89 b7 in r24, 0x39 ; 57 |
||
528 | 46a: 81 60 ori r24, 0x01 ; 1 |
||
529 | 46c: 89 bf out 0x39, r24 ; 57 |
||
530 | |||
531 | // SPI setup |
||
532 | DDRD |= (1 << PD2); // PD2 output (INT0) |
||
533 | 46e: 8a 9a sbi 0x11, 2 ; 17 |
||
534 | SpiMasterInit(); |
||
535 | 470: 0e 94 f5 0d call 0x1bea ; 0x1bea <SpiMasterInit> |
||
536 | |||
537 | // PPM detection setup |
||
538 | ppm_init(); |
||
539 | 474: 0e 94 98 0e call 0x1d30 ; 0x1d30 <ppm_init> |
||
540 | |||
541 | // enable interrupts |
||
542 | sei(); |
||
543 | 478: 78 94 sei |
||
544 | //write_ascii_string(2, 7, " CaScAdE "); |
||
545 | //write_ascii_string(2, 8, "is TESTING his open source"); |
||
546 | //write_ascii_string(2, 9, " EPi OSD Firmware"); |
||
547 | |||
548 | // we are ready |
||
549 | LED3_ON |
||
550 | 47a: aa 9a sbi 0x15, 2 ; 21 |
||
551 | 47c: 04 c0 rjmp .+8 ; 0x486 <main+0xa6> |
||
552 | } |
||
553 | // handle keypress |
||
554 | if (s1_pressed()) { |
||
555 | config_menu(); |
||
556 | } |
||
557 | if (seconds_since_last_data > 0) { |
||
558 | 47e: 80 91 18 01 lds r24, 0x0118 |
||
559 | 482: 88 23 and r24, r24 |
||
560 | 484: 61 f5 brne .+88 ; 0x4de <main+0xfe> |
||
561 | //usart1_puts("\x1B[2J\x1B[H"); |
||
562 | //usart1_puts("hello world!123\r\n"); |
||
563 | |||
564 | while (1) { |
||
565 | // in case SPI is ready and there is nothing to send right now |
||
566 | if (!icnt && spi_ready) { |
||
567 | 486: 80 91 34 01 lds r24, 0x0134 |
||
568 | 48a: 90 91 35 01 lds r25, 0x0135 |
||
569 | 48e: 89 2b or r24, r25 |
||
570 | 490: 91 f4 brne .+36 ; 0x4b6 <main+0xd6> |
||
571 | 492: 80 91 10 01 lds r24, 0x0110 |
||
572 | 496: 88 23 and r24, r24 |
||
573 | 498: 71 f0 breq .+28 ; 0x4b6 <main+0xd6> |
||
574 | // correct transfer ends with d (done) |
||
575 | if (SPI_buffer.buffer.chk == 'd') { |
||
576 | 49a: 80 91 95 01 lds r24, 0x0195 |
||
577 | 49e: 84 36 cpi r24, 0x64 ; 100 |
||
578 | 4a0: 09 f4 brne .+2 ; 0x4a4 <main+0xc4> |
||
579 | 4a2: 4c c0 rjmp .+152 ; 0x53c <__stack+0x3d> |
||
580 | // update this flag |
||
581 | COSD_FLAGS_RUNTIME |= COSD_FLAG_STROMREC; |
||
582 | } |
||
583 | } else { |
||
584 | // update flags |
||
585 | COSD_FLAGS_RUNTIME &= ~COSD_FLAG_STROMREC; |
||
586 | 4a4: 80 91 1d 01 lds r24, 0x011D |
||
587 | 4a8: 8e 7f andi r24, 0xFE ; 254 |
||
588 | 4aa: 80 93 1d 01 sts 0x011D, r24 |
||
589 | } |
||
590 | StartTransfer(9); |
||
591 | 4ae: 89 e0 ldi r24, 0x09 ; 9 |
||
592 | 4b0: 90 e0 ldi r25, 0x00 ; 0 |
||
593 | 4b2: 0e 94 48 0e call 0x1c90 ; 0x1c90 <StartTransfer> |
||
594 | } |
||
595 | if (rxd_buffer_locked) { |
||
596 | 4b6: 80 91 29 01 lds r24, 0x0129 |
||
597 | 4ba: 88 23 and r24, r24 |
||
598 | 4bc: 31 f0 breq .+12 ; 0x4ca <main+0xea> |
||
599 | osd_fcmode(); |
||
600 | } |
||
601 | seconds_since_last_data = 0; |
||
602 | } |
||
603 | #else |
||
604 | if (rxd_buffer[2] == 'O') { // NC OSD Data |
||
605 | 4be: 80 91 ee 01 lds r24, 0x01EE |
||
606 | 4c2: 8f 34 cpi r24, 0x4F ; 79 |
||
607 | 4c4: b9 f0 breq .+46 ; 0x4f4 <main+0x114> |
||
608 | osd_ncmode(); |
||
609 | } |
||
610 | //seconds_since_last_data = 0; |
||
611 | } |
||
612 | #endif |
||
613 | rxd_buffer_locked = 0; |
||
614 | 4c6: 10 92 29 01 sts 0x0129, r1 |
||
615 | } |
||
616 | // handle keypress |
||
617 | if (s1_pressed()) { |
||
618 | 4ca: 0e 94 58 0e call 0x1cb0 ; 0x1cb0 <s1_pressed> |
||
619 | 4ce: 89 2b or r24, r25 |
||
620 | 4d0: b1 f2 breq .-84 ; 0x47e <main+0x9e> |
||
621 | config_menu(); |
||
622 | 4d2: 0e 94 9c 0b call 0x1738 ; 0x1738 <config_menu> |
||
623 | } |
||
624 | if (seconds_since_last_data > 0) { |
||
625 | 4d6: 80 91 18 01 lds r24, 0x0118 |
||
626 | 4da: 88 23 and r24, r24 |
||
627 | 4dc: a1 f2 breq .-88 ; 0x486 <main+0xa6> |
||
628 | usart1_EnableTXD(); |
||
629 | 4de: 0e 94 3e 03 call 0x67c ; 0x67c <usart1_EnableTXD> |
||
630 | //usart1_request_mk_data(0, 'd', 100); |
||
631 | usart1_puts_pgm(PSTR(REQUEST_DBG_DATA)); |
||
632 | #else |
||
633 | // request OSD Data from NC every 100ms |
||
634 | //usart1_request_mk_data(1, 'o', 100); |
||
635 | usart1_puts_pgm(PSTR(REQUEST_OSD_DATA)); |
||
636 | 4e2: 80 e4 ldi r24, 0x40 ; 64 |
||
637 | 4e4: 91 e0 ldi r25, 0x01 ; 1 |
||
638 | 4e6: 0e 94 47 03 call 0x68e ; 0x68e <usart1_puts_pgm> |
||
639 | |||
640 | // and disable debug... |
||
641 | //usart1_request_mk_data(0, 'd', 0); |
||
642 | #endif |
||
643 | // reset last time counter |
||
644 | seconds_since_last_data = 0; |
||
645 | 4ea: 10 92 18 01 sts 0x0118, r1 |
||
646 | usart1_DisableTXD(); |
||
647 | 4ee: 0e 94 39 03 call 0x672 ; 0x672 <usart1_DisableTXD> |
||
648 | 4f2: c9 cf rjmp .-110 ; 0x486 <main+0xa6> |
||
649 | } |
||
650 | seconds_since_last_data = 0; |
||
651 | } |
||
652 | #else |
||
653 | if (rxd_buffer[2] == 'O') { // NC OSD Data |
||
654 | Decode64(); |
||
655 | 4f4: 0e 94 30 04 call 0x860 ; 0x860 <Decode64> |
||
656 | naviData = *((NaviData_t*) pRxData); |
||
657 | 4f8: aa e9 ldi r26, 0x9A ; 154 |
||
658 | 4fa: b1 e0 ldi r27, 0x01 ; 1 |
||
659 | 4fc: 80 91 2b 01 lds r24, 0x012B |
||
660 | 500: 90 91 2c 01 lds r25, 0x012C |
||
661 | 504: 9c 01 movw r18, r24 |
||
662 | 506: f9 01 movw r30, r18 |
||
663 | 508: 82 e5 ldi r24, 0x52 ; 82 |
||
664 | 50a: 01 90 ld r0, Z+ |
||
665 | 50c: 0d 92 st X+, r0 |
||
666 | 50e: 81 50 subi r24, 0x01 ; 1 |
||
667 | 510: e1 f7 brne .-8 ; 0x50a <__stack+0xb> |
||
668 | |||
669 | // init on first data retrival, distinguished by last battery :) |
||
670 | if (last_UBat == 255) { |
||
671 | 512: 80 91 00 01 lds r24, 0x0100 |
||
672 | 516: 8f 3f cpi r24, 0xFF ; 255 |
||
673 | 518: f1 f5 brne .+124 ; 0x596 <__stack+0x97> |
||
674 | if (naviData.UBat > 40) { |
||
675 | 51a: 80 91 d3 01 lds r24, 0x01D3 |
||
676 | 51e: 89 32 cpi r24, 0x29 ; 41 |
||
677 | 520: 90 f2 brcs .-92 ; 0x4c6 <main+0xe6> |
||
678 | // fix for min_UBat |
||
679 | min_UBat = naviData.UBat; |
||
680 | 522: 80 91 d3 01 lds r24, 0x01D3 |
||
681 | 526: 80 93 04 01 sts 0x0104, r24 |
||
682 | last_UBat = naviData.UBat; |
||
683 | 52a: 80 91 d3 01 lds r24, 0x01D3 |
||
684 | 52e: 80 93 00 01 sts 0x0100, r24 |
||
685 | init_cosd(last_UBat); |
||
686 | 532: 80 91 00 01 lds r24, 0x0100 |
||
687 | 536: 0e 94 f1 0c call 0x19e2 ; 0x19e2 <init_cosd> |
||
688 | 53a: c5 cf rjmp .-118 ; 0x4c6 <main+0xe6> |
||
689 | while (1) { |
||
690 | // in case SPI is ready and there is nothing to send right now |
||
691 | if (!icnt && spi_ready) { |
||
692 | // correct transfer ends with d (done) |
||
693 | if (SPI_buffer.buffer.chk == 'd') { |
||
694 | ampere = SPI_buffer.data.ampere; |
||
695 | 53c: 80 91 8b 01 lds r24, 0x018B |
||
696 | 540: 90 91 8c 01 lds r25, 0x018C |
||
697 | 544: 90 93 38 01 sts 0x0138, r25 |
||
698 | 548: 80 93 37 01 sts 0x0137, r24 |
||
699 | ampere_wasted = SPI_buffer.data.mah; |
||
700 | 54c: 80 91 8d 01 lds r24, 0x018D |
||
701 | 550: 90 91 8e 01 lds r25, 0x018E |
||
702 | 554: a0 91 8f 01 lds r26, 0x018F |
||
703 | 558: b0 91 90 01 lds r27, 0x0190 |
||
704 | 55c: 80 93 3b 01 sts 0x013B, r24 |
||
705 | 560: 90 93 3c 01 sts 0x013C, r25 |
||
706 | 564: a0 93 3d 01 sts 0x013D, r26 |
||
707 | 568: b0 93 3e 01 sts 0x013E, r27 |
||
708 | s_volt = SPI_buffer.data.volt; |
||
709 | 56c: 80 91 91 01 lds r24, 0x0191 |
||
710 | 570: 90 91 92 01 lds r25, 0x0192 |
||
711 | 574: 90 93 a0 02 sts 0x02A0, r25 |
||
712 | 578: 80 93 9f 02 sts 0x029F, r24 |
||
713 | |||
714 | // if this is the first receival we should print the small A |
||
715 | if (!(COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC)) { |
||
716 | 57c: 80 91 1d 01 lds r24, 0x011D |
||
717 | 580: 80 fd sbrc r24, 0 |
||
718 | 582: 95 cf rjmp .-214 ; 0x4ae <main+0xce> |
||
719 | clear(); |
||
720 | 584: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
721 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
722 | 588: 80 91 1d 01 lds r24, 0x011D |
||
723 | 58c: 8d 7f andi r24, 0xFD ; 253 |
||
724 | // update this flag |
||
725 | COSD_FLAGS_RUNTIME |= COSD_FLAG_STROMREC; |
||
726 | 58e: 81 60 ori r24, 0x01 ; 1 |
||
727 | 590: 80 93 1d 01 sts 0x011D, r24 |
||
728 | 594: 8c cf rjmp .-232 ; 0x4ae <main+0xce> |
||
729 | min_UBat = naviData.UBat; |
||
730 | last_UBat = naviData.UBat; |
||
731 | init_cosd(last_UBat); |
||
732 | } |
||
733 | } else { |
||
734 | osd_ncmode(); |
||
735 | 596: e0 91 05 01 lds r30, 0x0105 |
||
736 | 59a: f0 91 06 01 lds r31, 0x0106 |
||
737 | 59e: 09 95 icall |
||
738 | 5a0: 92 cf rjmp .-220 ; 0x4c6 <main+0xe6> |
||
739 | spi_send_byte(0x00, 0b00001000); |
||
740 | |||
741 | bottom_line = 12; |
||
742 | } else { |
||
743 | // PAL + enable display immediately (VM0) |
||
744 | spi_send_byte(0x00, 0b01001000); |
||
745 | 5a2: 80 e0 ldi r24, 0x00 ; 0 |
||
746 | 5a4: 68 e4 ldi r22, 0x48 ; 72 |
||
747 | 5a6: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
748 | |||
749 | bottom_line = 14; |
||
750 | 5aa: 8e e0 ldi r24, 0x0E ; 14 |
||
751 | 5ac: 80 93 03 01 sts 0x0103, r24 |
||
752 | 5b0: 4d cf rjmp .-358 ; 0x44c <main+0x6c> |
||
753 | |||
754 | 000005b2 <__vector_16>: |
||
755 | static uint8_t delay_spi = 0; |
||
756 | |||
757 | /** |
||
758 | * timer kicks in every 1000uS ^= 1ms |
||
759 | */ |
||
760 | ISR(TIMER0_COMP_vect) { |
||
761 | 5b2: 1f 92 push r1 |
||
762 | 5b4: 0f 92 push r0 |
||
763 | 5b6: 0f b6 in r0, 0x3f ; 63 |
||
764 | 5b8: 0f 92 push r0 |
||
765 | 5ba: 11 24 eor r1, r1 |
||
766 | 5bc: 2f 93 push r18 |
||
767 | 5be: 3f 93 push r19 |
||
768 | 5c0: 4f 93 push r20 |
||
769 | 5c2: 5f 93 push r21 |
||
770 | 5c4: 6f 93 push r22 |
||
771 | 5c6: 7f 93 push r23 |
||
772 | 5c8: 8f 93 push r24 |
||
773 | 5ca: 9f 93 push r25 |
||
774 | 5cc: af 93 push r26 |
||
775 | 5ce: bf 93 push r27 |
||
776 | 5d0: ef 93 push r30 |
||
777 | 5d2: ff 93 push r31 |
||
778 | if (!timer--) { |
||
779 | 5d4: 80 91 14 01 lds r24, 0x0114 |
||
780 | 5d8: 90 91 15 01 lds r25, 0x0115 |
||
781 | 5dc: 01 97 sbiw r24, 0x01 ; 1 |
||
782 | 5de: 90 93 15 01 sts 0x0115, r25 |
||
783 | 5e2: 80 93 14 01 sts 0x0114, r24 |
||
784 | 5e6: 01 96 adiw r24, 0x01 ; 1 |
||
785 | 5e8: a1 f4 brne .+40 ; 0x612 <__vector_16+0x60> |
||
786 | uptime++; |
||
787 | 5ea: 80 91 12 01 lds r24, 0x0112 |
||
788 | 5ee: 90 91 13 01 lds r25, 0x0113 |
||
789 | 5f2: 01 96 adiw r24, 0x01 ; 1 |
||
790 | 5f4: 90 93 13 01 sts 0x0113, r25 |
||
791 | 5f8: 80 93 12 01 sts 0x0112, r24 |
||
792 | if (debugData.Analog[12]>10) { |
||
793 | flytime_fc++; |
||
794 | } |
||
795 | #endif |
||
796 | |||
797 | timer = 999; |
||
798 | 5fc: 87 ee ldi r24, 0xE7 ; 231 |
||
799 | 5fe: 93 e0 ldi r25, 0x03 ; 3 |
||
800 | 600: 90 93 15 01 sts 0x0115, r25 |
||
801 | 604: 80 93 14 01 sts 0x0114, r24 |
||
802 | seconds_since_last_data++; |
||
803 | 608: 80 91 18 01 lds r24, 0x0118 |
||
804 | 60c: 8f 5f subi r24, 0xFF ; 255 |
||
805 | 60e: 80 93 18 01 sts 0x0118, r24 |
||
806 | } |
||
807 | // in case there is still some spi data to send do it now |
||
808 | // delay to give the slave some time to compute values |
||
809 | if (spi_ready && icnt) { |
||
810 | 612: 80 91 10 01 lds r24, 0x0110 |
||
811 | 616: 88 23 and r24, r24 |
||
812 | 618: 69 f0 breq .+26 ; 0x634 <__vector_16+0x82> |
||
813 | 61a: 80 91 34 01 lds r24, 0x0134 |
||
814 | 61e: 90 91 35 01 lds r25, 0x0135 |
||
815 | 622: 89 2b or r24, r25 |
||
816 | 624: 39 f0 breq .+14 ; 0x634 <__vector_16+0x82> |
||
817 | if (!delay_spi--) { |
||
818 | 626: 80 91 28 01 lds r24, 0x0128 |
||
819 | 62a: 81 50 subi r24, 0x01 ; 1 |
||
820 | 62c: 80 93 28 01 sts 0x0128, r24 |
||
821 | 630: 8f 5f subi r24, 0xFF ; 255 |
||
822 | 632: 89 f0 breq .+34 ; 0x656 <__vector_16+0xa4> |
||
823 | delay_spi = 8; |
||
824 | spi_send_next(); |
||
825 | } |
||
826 | } |
||
827 | } |
||
828 | 634: ff 91 pop r31 |
||
829 | 636: ef 91 pop r30 |
||
830 | 638: bf 91 pop r27 |
||
831 | 63a: af 91 pop r26 |
||
832 | 63c: 9f 91 pop r25 |
||
833 | 63e: 8f 91 pop r24 |
||
834 | 640: 7f 91 pop r23 |
||
835 | 642: 6f 91 pop r22 |
||
836 | 644: 5f 91 pop r21 |
||
837 | 646: 4f 91 pop r20 |
||
838 | 648: 3f 91 pop r19 |
||
839 | 64a: 2f 91 pop r18 |
||
840 | 64c: 0f 90 pop r0 |
||
841 | 64e: 0f be out 0x3f, r0 ; 63 |
||
842 | 650: 0f 90 pop r0 |
||
843 | 652: 1f 90 pop r1 |
||
844 | 654: 18 95 reti |
||
845 | } |
||
846 | // in case there is still some spi data to send do it now |
||
847 | // delay to give the slave some time to compute values |
||
848 | if (spi_ready && icnt) { |
||
849 | if (!delay_spi--) { |
||
850 | delay_spi = 8; |
||
851 | 656: 88 e0 ldi r24, 0x08 ; 8 |
||
852 | 658: 80 93 28 01 sts 0x0128, r24 |
||
853 | spi_send_next(); |
||
854 | 65c: 0e 94 53 0e call 0x1ca6 ; 0x1ca6 <spi_send_next> |
||
855 | 660: e9 cf rjmp .-46 ; 0x634 <__vector_16+0x82> |
||
856 | |||
857 | 00000662 <usart1_init>: |
||
858 | |||
859 | /** |
||
860 | * init usart1 |
||
861 | */ |
||
862 | void usart1_init() { |
||
863 | UBRR1H = ((F_CPU / (16UL * baud)) - 1) >> 8; |
||
864 | 662: 1c be out 0x3c, r1 ; 60 |
||
865 | UBRR1L = (F_CPU / (16UL * baud)) - 1; |
||
866 | 664: 80 e1 ldi r24, 0x10 ; 16 |
||
867 | 666: 80 b9 out 0x00, r24 ; 0 |
||
868 | |||
869 | // Enable receiver and transmitter; enable RX interrupt |
||
870 | UCSR1B = (1 << RXEN1) | (1 << TXEN1) | (1 << RXCIE1); |
||
871 | 668: 88 e9 ldi r24, 0x98 ; 152 |
||
872 | 66a: 81 b9 out 0x01, r24 ; 1 |
||
873 | |||
874 | //asynchronous 8N1 |
||
875 | UCSR1C = (1 << URSEL1) | (3 << UCSZ10); |
||
876 | 66c: 86 e8 ldi r24, 0x86 ; 134 |
||
877 | 66e: 8c bf out 0x3c, r24 ; 60 |
||
878 | } |
||
879 | 670: 08 95 ret |
||
880 | |||
881 | 00000672 <usart1_DisableTXD>: |
||
882 | |||
883 | /** |
||
884 | * disable the txd pin of usart1 |
||
885 | */ |
||
886 | void usart1_DisableTXD(void) { |
||
887 | UCSR1B &= ~(1 << TXCIE1); // disable TX-Interrupt |
||
888 | 672: 0e 98 cbi 0x01, 6 ; 1 |
||
889 | UCSR1B &= ~(1 << TXEN1); // disable TX in USART |
||
890 | 674: 0b 98 cbi 0x01, 3 ; 1 |
||
891 | DDRB &= ~(1 << DDB3); // set TXD pin as input |
||
892 | 676: bb 98 cbi 0x17, 3 ; 23 |
||
893 | PORTB &= ~(1 << PORTB3); // disable pullup on TXD pin |
||
894 | 678: c3 98 cbi 0x18, 3 ; 24 |
||
895 | } |
||
896 | 67a: 08 95 ret |
||
897 | |||
898 | 0000067c <usart1_EnableTXD>: |
||
899 | |||
900 | /** |
||
901 | * enable the txd pin of usart1 |
||
902 | */ |
||
903 | void usart1_EnableTXD(void) { |
||
904 | DDRB |= (1 << DDB3); // set TXD pin as output |
||
905 | 67c: bb 9a sbi 0x17, 3 ; 23 |
||
906 | PORTB &= ~(1 << PORTB3); // disable pullup on TXD pin |
||
907 | 67e: c3 98 cbi 0x18, 3 ; 24 |
||
908 | UCSR1B |= (1 << TXEN1); // enable TX in USART |
||
909 | 680: 0b 9a sbi 0x01, 3 ; 1 |
||
910 | UCSR1B |= (1 << TXCIE1); // enable TX-Interrupt |
||
911 | 682: 0e 9a sbi 0x01, 6 ; 1 |
||
912 | } |
||
913 | 684: 08 95 ret |
||
914 | |||
915 | 00000686 <usart1_putc>: |
||
916 | /** |
||
917 | * send a single <character> through usart1 |
||
918 | */ |
||
919 | void usart1_putc(unsigned char character) { |
||
920 | // wait until UDR ready |
||
921 | while (!(UCSR1A & (1 << UDRE1))); |
||
922 | 686: 15 9b sbis 0x02, 5 ; 2 |
||
923 | 688: fe cf rjmp .-4 ; 0x686 <usart1_putc> |
||
924 | UDR1 = character; |
||
925 | 68a: 83 b9 out 0x03, r24 ; 3 |
||
926 | } |
||
927 | 68c: 08 95 ret |
||
928 | |||
929 | 0000068e <usart1_puts_pgm>: |
||
930 | |||
931 | |||
932 | /** |
||
933 | * send a PGM<string> throught usart1 |
||
934 | */ |
||
935 | void usart1_puts_pgm(const char* string) { |
||
936 | 68e: ac 01 movw r20, r24 |
||
937 | while (pgm_read_byte(string) != 0x00) |
||
938 | 690: 9a 01 movw r18, r20 |
||
939 | 692: fa 01 movw r30, r20 |
||
940 | 694: 84 91 lpm r24, Z+ |
||
941 | 696: 88 23 and r24, r24 |
||
942 | 698: 61 f0 breq .+24 ; 0x6b2 <usart1_puts_pgm+0x24> |
||
943 | usart1_putc(pgm_read_byte(string++)); |
||
944 | 69a: 4f 5f subi r20, 0xFF ; 255 |
||
945 | 69c: 5f 4f sbci r21, 0xFF ; 255 |
||
946 | 69e: f9 01 movw r30, r18 |
||
947 | 6a0: 84 91 lpm r24, Z+ |
||
948 | /** |
||
949 | * send a single <character> through usart1 |
||
950 | */ |
||
951 | void usart1_putc(unsigned char character) { |
||
952 | // wait until UDR ready |
||
953 | while (!(UCSR1A & (1 << UDRE1))); |
||
954 | 6a2: 15 9b sbis 0x02, 5 ; 2 |
||
955 | 6a4: fe cf rjmp .-4 ; 0x6a2 <usart1_puts_pgm+0x14> |
||
956 | UDR1 = character; |
||
957 | 6a6: 83 b9 out 0x03, r24 ; 3 |
||
958 | |||
959 | /** |
||
960 | * send a PGM<string> throught usart1 |
||
961 | */ |
||
962 | void usart1_puts_pgm(const char* string) { |
||
963 | while (pgm_read_byte(string) != 0x00) |
||
964 | 6a8: 9a 01 movw r18, r20 |
||
965 | 6aa: fa 01 movw r30, r20 |
||
966 | 6ac: 84 91 lpm r24, Z+ |
||
967 | 6ae: 88 23 and r24, r24 |
||
968 | 6b0: a1 f7 brne .-24 ; 0x69a <usart1_puts_pgm+0xc> |
||
969 | 6b2: 08 95 ret |
||
970 | |||
971 | 000006b4 <__vector_22>: |
||
972 | |||
973 | /** |
||
974 | * transmit interrupt handler |
||
975 | * unused |
||
976 | */ |
||
977 | ISR(SIG_USART1_DATA) { |
||
978 | 6b4: 1f 92 push r1 |
||
979 | 6b6: 0f 92 push r0 |
||
980 | 6b8: 0f b6 in r0, 0x3f ; 63 |
||
981 | 6ba: 0f 92 push r0 |
||
982 | 6bc: 11 24 eor r1, r1 |
||
983 | } |
||
984 | 6be: 0f 90 pop r0 |
||
985 | 6c0: 0f be out 0x3f, r0 ; 63 |
||
986 | 6c2: 0f 90 pop r0 |
||
987 | 6c4: 1f 90 pop r1 |
||
988 | 6c6: 18 95 reti |
||
989 | |||
990 | 000006c8 <__vector_20>: |
||
991 | /* |
||
992 | * receive data through usart1 |
||
993 | * portions taken and adapted from |
||
994 | * http://svn.mikrokopter.de/mikrowebsvn/filedetails.php?repname=FlightCtrl&path=%2Fbranches%2FV0.72p+Code+Redesign+killagreg%2Fuart0.c |
||
995 | */ |
||
996 | ISR(SIG_USART1_RECV) { |
||
997 | 6c8: 1f 92 push r1 |
||
998 | 6ca: 0f 92 push r0 |
||
999 | 6cc: 0f b6 in r0, 0x3f ; 63 |
||
1000 | 6ce: 0f 92 push r0 |
||
1001 | 6d0: 11 24 eor r1, r1 |
||
1002 | 6d2: 2f 93 push r18 |
||
1003 | 6d4: 3f 93 push r19 |
||
1004 | 6d6: 4f 93 push r20 |
||
1005 | 6d8: 5f 93 push r21 |
||
1006 | 6da: 6f 93 push r22 |
||
1007 | 6dc: 8f 93 push r24 |
||
1008 | 6de: 9f 93 push r25 |
||
1009 | 6e0: af 93 push r26 |
||
1010 | 6e2: bf 93 push r27 |
||
1011 | 6e4: cf 93 push r28 |
||
1012 | 6e6: df 93 push r29 |
||
1013 | 6e8: ef 93 push r30 |
||
1014 | 6ea: ff 93 push r31 |
||
1015 | uint8_t c; |
||
1016 | // catch the received byte |
||
1017 | c = UDR1; |
||
1018 | 6ec: 63 b1 in r22, 0x03 ; 3 |
||
1019 | if (rxd_buffer_locked) return; // if rxd buffer is locked immediately return |
||
1020 | 6ee: 80 91 29 01 lds r24, 0x0129 |
||
1021 | 6f2: 88 23 and r24, r24 |
||
1022 | 6f4: 71 f4 brne .+28 ; 0x712 <__vector_20+0x4a> |
||
1023 | static uint8_t c1 = 0; |
||
1024 | static uint8_t c2 = 0; |
||
1025 | static uint8_t usart_rx_ok = 0; |
||
1026 | uint8_t crc1, crc2; |
||
1027 | // the rxd buffer is unlocked |
||
1028 | if (usart_rx_ok == 0) { |
||
1029 | 6f6: 80 91 2e 01 lds r24, 0x012E |
||
1030 | 6fa: 88 23 and r24, r24 |
||
1031 | 6fc: e1 f4 brne .+56 ; 0x736 <__vector_20+0x6e> |
||
1032 | // if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && (c == 'D' || c == 'V' || c == 'O')) { |
||
1033 | if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && |
||
1034 | 6fe: 80 91 2f 01 lds r24, 0x012F |
||
1035 | 702: 83 32 cpi r24, 0x23 ; 35 |
||
1036 | 704: d1 f1 breq .+116 ; 0x77a <__vector_20+0xb2> |
||
1037 | 706: 20 91 30 01 lds r18, 0x0130 |
||
1038 | c2 = 0; |
||
1039 | c1 = 0; |
||
1040 | LED1_ON |
||
1041 | LED2_OFF |
||
1042 | } else { |
||
1043 | c2 = c1; |
||
1044 | 70a: 20 93 2f 01 sts 0x012F, r18 |
||
1045 | c1 = c; |
||
1046 | 70e: 60 93 30 01 sts 0x0130, r22 |
||
1047 | ptr_rxd_buffer = 0; // reset rxd buffer |
||
1048 | rxd_buffer_locked = 0; // unlock rxd buffer |
||
1049 | usart_rx_ok = 0; |
||
1050 | LED2_ON |
||
1051 | } |
||
1052 | } |
||
1053 | 712: ff 91 pop r31 |
||
1054 | 714: ef 91 pop r30 |
||
1055 | 716: df 91 pop r29 |
||
1056 | 718: cf 91 pop r28 |
||
1057 | 71a: bf 91 pop r27 |
||
1058 | 71c: af 91 pop r26 |
||
1059 | 71e: 9f 91 pop r25 |
||
1060 | 720: 8f 91 pop r24 |
||
1061 | 722: 6f 91 pop r22 |
||
1062 | 724: 5f 91 pop r21 |
||
1063 | 726: 4f 91 pop r20 |
||
1064 | 728: 3f 91 pop r19 |
||
1065 | 72a: 2f 91 pop r18 |
||
1066 | 72c: 0f 90 pop r0 |
||
1067 | 72e: 0f be out 0x3f, r0 ; 63 |
||
1068 | 730: 0f 90 pop r0 |
||
1069 | 732: 1f 90 pop r1 |
||
1070 | 734: 18 95 reti |
||
1071 | LED2_OFF |
||
1072 | } else { |
||
1073 | c2 = c1; |
||
1074 | c1 = c; |
||
1075 | } |
||
1076 | } else if (ptr_rxd_buffer < RXD_BUFFER_LEN) { // collect incomming bytes |
||
1077 | 736: 30 91 31 01 lds r19, 0x0131 |
||
1078 | 73a: 36 39 cpi r19, 0x96 ; 150 |
||
1079 | 73c: b0 f4 brcc .+44 ; 0x76a <__vector_20+0xa2> |
||
1080 | if (c != '\r') { // no termination character |
||
1081 | 73e: 6d 30 cpi r22, 0x0D ; 13 |
||
1082 | 740: 09 f4 brne .+2 ; 0x744 <__vector_20+0x7c> |
||
1083 | 742: 50 c0 rjmp .+160 ; 0x7e4 <__vector_20+0x11c> |
||
1084 | rxd_buffer[ptr_rxd_buffer++] = c; // copy byte to rxd buffer |
||
1085 | 744: e3 2f mov r30, r19 |
||
1086 | 746: f0 e0 ldi r31, 0x00 ; 0 |
||
1087 | 748: e4 51 subi r30, 0x14 ; 20 |
||
1088 | 74a: fe 4f sbci r31, 0xFE ; 254 |
||
1089 | 74c: 60 83 st Z, r22 |
||
1090 | 74e: 3f 5f subi r19, 0xFF ; 255 |
||
1091 | 750: 30 93 31 01 sts 0x0131, r19 |
||
1092 | crc += c; // update crc |
||
1093 | 754: 80 91 32 01 lds r24, 0x0132 |
||
1094 | 758: 90 91 33 01 lds r25, 0x0133 |
||
1095 | 75c: 86 0f add r24, r22 |
||
1096 | 75e: 91 1d adc r25, r1 |
||
1097 | 760: 90 93 33 01 sts 0x0133, r25 |
||
1098 | 764: 80 93 32 01 sts 0x0132, r24 |
||
1099 | 768: d4 cf rjmp .-88 ; 0x712 <__vector_20+0x4a> |
||
1100 | } |
||
1101 | ptr_rxd_buffer = 0; // reset rxd buffer pointer |
||
1102 | usart_rx_ok = 0; |
||
1103 | } |
||
1104 | } else { // rxd buffer overrun |
||
1105 | ptr_rxd_buffer = 0; // reset rxd buffer |
||
1106 | 76a: 10 92 31 01 sts 0x0131, r1 |
||
1107 | rxd_buffer_locked = 0; // unlock rxd buffer |
||
1108 | 76e: 10 92 29 01 sts 0x0129, r1 |
||
1109 | usart_rx_ok = 0; |
||
1110 | 772: 10 92 2e 01 sts 0x012E, r1 |
||
1111 | LED2_ON |
||
1112 | 776: a9 9a sbi 0x15, 1 ; 21 |
||
1113 | 778: cc cf rjmp .-104 ; 0x712 <__vector_20+0x4a> |
||
1114 | static uint8_t usart_rx_ok = 0; |
||
1115 | uint8_t crc1, crc2; |
||
1116 | // the rxd buffer is unlocked |
||
1117 | if (usart_rx_ok == 0) { |
||
1118 | // if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && (c == 'D' || c == 'V' || c == 'O')) { |
||
1119 | if ((c2 == '#') && (c1 == 'b' || c1 == 'c') && |
||
1120 | 77a: 20 91 30 01 lds r18, 0x0130 |
||
1121 | 77e: 82 2f mov r24, r18 |
||
1122 | 780: 82 56 subi r24, 0x62 ; 98 |
||
1123 | 782: 82 30 cpi r24, 0x02 ; 2 |
||
1124 | 784: 10 f6 brcc .-124 ; 0x70a <__vector_20+0x42> |
||
1125 | 786: 66 35 cpi r22, 0x56 ; 86 |
||
1126 | 788: 19 f0 breq .+6 ; 0x790 <__vector_20+0xc8> |
||
1127 | 78a: 6f 34 cpi r22, 0x4F ; 79 |
||
1128 | 78c: 09 f0 breq .+2 ; 0x790 <__vector_20+0xc8> |
||
1129 | 78e: bd cf rjmp .-134 ; 0x70a <__vector_20+0x42> |
||
1130 | #if FCONLY |
||
1131 | (c == 'V' || c == 'D')) { // version and debug |
||
1132 | #else |
||
1133 | (c == 'V' || c == 'O')) { // version and OSD |
||
1134 | #endif |
||
1135 | usart_rx_ok = 1; |
||
1136 | 790: 81 e0 ldi r24, 0x01 ; 1 |
||
1137 | 792: 80 93 2e 01 sts 0x012E, r24 |
||
1138 | rxd_buffer[ptr_rxd_buffer++] = c2; |
||
1139 | 796: 80 91 31 01 lds r24, 0x0131 |
||
1140 | 79a: e8 2f mov r30, r24 |
||
1141 | 79c: f0 e0 ldi r31, 0x00 ; 0 |
||
1142 | 79e: e4 51 subi r30, 0x14 ; 20 |
||
1143 | 7a0: fe 4f sbci r31, 0xFE ; 254 |
||
1144 | 7a2: 93 e2 ldi r25, 0x23 ; 35 |
||
1145 | 7a4: 90 83 st Z, r25 |
||
1146 | 7a6: 8f 5f subi r24, 0xFF ; 255 |
||
1147 | crc = c2; |
||
1148 | rxd_buffer[ptr_rxd_buffer++] = c1; |
||
1149 | 7a8: e8 2f mov r30, r24 |
||
1150 | 7aa: f0 e0 ldi r31, 0x00 ; 0 |
||
1151 | 7ac: e4 51 subi r30, 0x14 ; 20 |
||
1152 | 7ae: fe 4f sbci r31, 0xFE ; 254 |
||
1153 | 7b0: 20 83 st Z, r18 |
||
1154 | 7b2: 8f 5f subi r24, 0xFF ; 255 |
||
1155 | crc += c1; |
||
1156 | rxd_buffer[ptr_rxd_buffer++] = c; |
||
1157 | 7b4: e8 2f mov r30, r24 |
||
1158 | 7b6: f0 e0 ldi r31, 0x00 ; 0 |
||
1159 | 7b8: e4 51 subi r30, 0x14 ; 20 |
||
1160 | 7ba: fe 4f sbci r31, 0xFE ; 254 |
||
1161 | 7bc: 60 83 st Z, r22 |
||
1162 | 7be: 8f 5f subi r24, 0xFF ; 255 |
||
1163 | 7c0: 80 93 31 01 sts 0x0131, r24 |
||
1164 | crc += c; |
||
1165 | 7c4: 86 2f mov r24, r22 |
||
1166 | 7c6: 90 e0 ldi r25, 0x00 ; 0 |
||
1167 | 7c8: 82 0f add r24, r18 |
||
1168 | 7ca: 91 1d adc r25, r1 |
||
1169 | 7cc: 83 96 adiw r24, 0x23 ; 35 |
||
1170 | 7ce: 90 93 33 01 sts 0x0133, r25 |
||
1171 | 7d2: 80 93 32 01 sts 0x0132, r24 |
||
1172 | c2 = 0; |
||
1173 | 7d6: 10 92 2f 01 sts 0x012F, r1 |
||
1174 | c1 = 0; |
||
1175 | 7da: 10 92 30 01 sts 0x0130, r1 |
||
1176 | LED1_ON |
||
1177 | 7de: a8 9a sbi 0x15, 0 ; 21 |
||
1178 | LED2_OFF |
||
1179 | 7e0: a9 98 cbi 0x15, 1 ; 21 |
||
1180 | 7e2: 97 cf rjmp .-210 ; 0x712 <__vector_20+0x4a> |
||
1181 | rxd_buffer[ptr_rxd_buffer++] = c; // copy byte to rxd buffer |
||
1182 | crc += c; // update crc |
||
1183 | } else { // termination character was received |
||
1184 | // the last 2 bytes are no subject for checksum calculation |
||
1185 | // they are the checksum itself |
||
1186 | crc -= rxd_buffer[ptr_rxd_buffer - 2]; |
||
1187 | 7e4: a3 2f mov r26, r19 |
||
1188 | 7e6: b0 e0 ldi r27, 0x00 ; 0 |
||
1189 | 7e8: fd 01 movw r30, r26 |
||
1190 | 7ea: e6 51 subi r30, 0x16 ; 22 |
||
1191 | 7ec: fe 4f sbci r31, 0xFE ; 254 |
||
1192 | 7ee: 90 81 ld r25, Z |
||
1193 | crc -= rxd_buffer[ptr_rxd_buffer - 1]; |
||
1194 | 7f0: ed 01 movw r28, r26 |
||
1195 | 7f2: c5 51 subi r28, 0x15 ; 21 |
||
1196 | 7f4: de 4f sbci r29, 0xFE ; 254 |
||
1197 | 7f6: 88 81 ld r24, Y |
||
1198 | // calculate checksum from transmitted data |
||
1199 | crc %= 4096; |
||
1200 | 7f8: 40 91 32 01 lds r20, 0x0132 |
||
1201 | 7fc: 50 91 33 01 lds r21, 0x0133 |
||
1202 | 800: 49 1b sub r20, r25 |
||
1203 | 802: 51 09 sbc r21, r1 |
||
1204 | 804: 48 1b sub r20, r24 |
||
1205 | 806: 51 09 sbc r21, r1 |
||
1206 | 808: 5f 70 andi r21, 0x0F ; 15 |
||
1207 | 80a: 50 93 33 01 sts 0x0133, r21 |
||
1208 | 80e: 40 93 32 01 sts 0x0132, r20 |
||
1209 | crc1 = '=' + crc / 64; |
||
1210 | crc2 = '=' + crc % 64; |
||
1211 | // compare checksum to transmitted checksum bytes |
||
1212 | if ((crc1 == rxd_buffer[ptr_rxd_buffer - 2]) && (crc2 == rxd_buffer[ptr_rxd_buffer - 1])) { // checksum valid |
||
1213 | 812: 20 81 ld r18, Z |
||
1214 | 814: ca 01 movw r24, r20 |
||
1215 | 816: 00 24 eor r0, r0 |
||
1216 | 818: 88 0f add r24, r24 |
||
1217 | 81a: 99 1f adc r25, r25 |
||
1218 | 81c: 00 1c adc r0, r0 |
||
1219 | 81e: 88 0f add r24, r24 |
||
1220 | 820: 99 1f adc r25, r25 |
||
1221 | 822: 00 1c adc r0, r0 |
||
1222 | 824: 89 2f mov r24, r25 |
||
1223 | 826: 90 2d mov r25, r0 |
||
1224 | 828: 83 5c subi r24, 0xC3 ; 195 |
||
1225 | 82a: 28 17 cp r18, r24 |
||
1226 | 82c: 41 f0 breq .+16 ; 0x83e <__vector_20+0x176> |
||
1227 | rxd_buffer[ptr_rxd_buffer] = '\r'; // set termination character |
||
1228 | ReceivedBytes = ptr_rxd_buffer + 1; // store number of received bytes |
||
1229 | rxd_buffer_locked = 1; // lock the rxd buffer |
||
1230 | LED1_OFF |
||
1231 | } else { // checksum invalid |
||
1232 | rxd_buffer_locked = 0; // unlock rxd buffer |
||
1233 | 82e: 10 92 29 01 sts 0x0129, r1 |
||
1234 | LED2_ON |
||
1235 | 832: a9 9a sbi 0x15, 1 ; 21 |
||
1236 | } |
||
1237 | ptr_rxd_buffer = 0; // reset rxd buffer pointer |
||
1238 | 834: 10 92 31 01 sts 0x0131, r1 |
||
1239 | usart_rx_ok = 0; |
||
1240 | 838: 10 92 2e 01 sts 0x012E, r1 |
||
1241 | 83c: 6a cf rjmp .-300 ; 0x712 <__vector_20+0x4a> |
||
1242 | // calculate checksum from transmitted data |
||
1243 | crc %= 4096; |
||
1244 | crc1 = '=' + crc / 64; |
||
1245 | crc2 = '=' + crc % 64; |
||
1246 | // compare checksum to transmitted checksum bytes |
||
1247 | if ((crc1 == rxd_buffer[ptr_rxd_buffer - 2]) && (crc2 == rxd_buffer[ptr_rxd_buffer - 1])) { // checksum valid |
||
1248 | 83e: 98 81 ld r25, Y |
||
1249 | 840: 84 2f mov r24, r20 |
||
1250 | 842: 8f 73 andi r24, 0x3F ; 63 |
||
1251 | 844: 83 5c subi r24, 0xC3 ; 195 |
||
1252 | 846: 98 17 cp r25, r24 |
||
1253 | 848: 91 f7 brne .-28 ; 0x82e <__vector_20+0x166> |
||
1254 | rxd_buffer[ptr_rxd_buffer] = '\r'; // set termination character |
||
1255 | 84a: a4 51 subi r26, 0x14 ; 20 |
||
1256 | 84c: be 4f sbci r27, 0xFE ; 254 |
||
1257 | 84e: 6c 93 st X, r22 |
||
1258 | ReceivedBytes = ptr_rxd_buffer + 1; // store number of received bytes |
||
1259 | 850: 3f 5f subi r19, 0xFF ; 255 |
||
1260 | 852: 30 93 2a 01 sts 0x012A, r19 |
||
1261 | rxd_buffer_locked = 1; // lock the rxd buffer |
||
1262 | 856: 81 e0 ldi r24, 0x01 ; 1 |
||
1263 | 858: 80 93 29 01 sts 0x0129, r24 |
||
1264 | LED1_OFF |
||
1265 | 85c: a8 98 cbi 0x15, 0 ; 21 |
||
1266 | 85e: ea cf rjmp .-44 ; 0x834 <__vector_20+0x16c> |
||
1267 | |||
1268 | 00000860 <Decode64>: |
||
1269 | void Decode64(void) { |
||
1270 | uint8_t a, b, c, d; |
||
1271 | uint8_t x, y, z; |
||
1272 | uint8_t ptrIn = 3; |
||
1273 | uint8_t ptrOut = 3; |
||
1274 | uint8_t len = ReceivedBytes - 6; |
||
1275 | 860: 50 91 2a 01 lds r21, 0x012A |
||
1276 | 864: 56 50 subi r21, 0x06 ; 6 |
||
1277 | |||
1278 | while (len) { |
||
1279 | 866: 09 f4 brne .+2 ; 0x86a <Decode64+0xa> |
||
1280 | 868: 57 c0 rjmp .+174 ; 0x918 <Decode64+0xb8> |
||
1281 | 86a: 33 e0 ldi r19, 0x03 ; 3 |
||
1282 | 86c: 43 e0 ldi r20, 0x03 ; 3 |
||
1283 | 86e: 1e c0 rjmp .+60 ; 0x8ac <Decode64+0x4c> |
||
1284 | a = rxd_buffer[ptrIn++] - '='; |
||
1285 | b = rxd_buffer[ptrIn++] - '='; |
||
1286 | c = rxd_buffer[ptrIn++] - '='; |
||
1287 | 870: 97 2f mov r25, r23 |
||
1288 | 872: 9d 53 subi r25, 0x3D ; 61 |
||
1289 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
1290 | z = ((c & 0x03) << 6) | d; |
||
1291 | |||
1292 | if (len--) rxd_buffer[ptrOut++] = x; |
||
1293 | else break; |
||
1294 | if (len--) rxd_buffer[ptrOut++] = y; |
||
1295 | 874: f0 e0 ldi r31, 0x00 ; 0 |
||
1296 | b = rxd_buffer[ptrIn++] - '='; |
||
1297 | c = rxd_buffer[ptrIn++] - '='; |
||
1298 | d = rxd_buffer[ptrIn++] - '='; |
||
1299 | |||
1300 | x = (a << 2) | (b >> 4); |
||
1301 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
1302 | 876: 22 95 swap r18 |
||
1303 | 878: 20 7f andi r18, 0xF0 ; 240 |
||
1304 | 87a: 89 2f mov r24, r25 |
||
1305 | 87c: 86 95 lsr r24 |
||
1306 | 87e: 86 95 lsr r24 |
||
1307 | 880: 28 2b or r18, r24 |
||
1308 | z = ((c & 0x03) << 6) | d; |
||
1309 | |||
1310 | if (len--) rxd_buffer[ptrOut++] = x; |
||
1311 | else break; |
||
1312 | if (len--) rxd_buffer[ptrOut++] = y; |
||
1313 | 882: e4 51 subi r30, 0x14 ; 20 |
||
1314 | 884: fe 4f sbci r31, 0xFE ; 254 |
||
1315 | 886: 20 83 st Z, r18 |
||
1316 | 888: e4 2f mov r30, r20 |
||
1317 | 88a: ee 5f subi r30, 0xFE ; 254 |
||
1318 | else break; |
||
1319 | if (len--) rxd_buffer[ptrOut++] = z; |
||
1320 | 88c: 52 30 cpi r21, 0x02 ; 2 |
||
1321 | 88e: c1 f1 breq .+112 ; 0x900 <Decode64+0xa0> |
||
1322 | 890: 53 50 subi r21, 0x03 ; 3 |
||
1323 | 892: f0 e0 ldi r31, 0x00 ; 0 |
||
1324 | c = rxd_buffer[ptrIn++] - '='; |
||
1325 | d = rxd_buffer[ptrIn++] - '='; |
||
1326 | |||
1327 | x = (a << 2) | (b >> 4); |
||
1328 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
1329 | z = ((c & 0x03) << 6) | d; |
||
1330 | 894: 92 95 swap r25 |
||
1331 | 896: 99 0f add r25, r25 |
||
1332 | 898: 99 0f add r25, r25 |
||
1333 | 89a: 90 7c andi r25, 0xC0 ; 192 |
||
1334 | 89c: 6d 53 subi r22, 0x3D ; 61 |
||
1335 | 89e: 96 2b or r25, r22 |
||
1336 | |||
1337 | if (len--) rxd_buffer[ptrOut++] = x; |
||
1338 | else break; |
||
1339 | if (len--) rxd_buffer[ptrOut++] = y; |
||
1340 | else break; |
||
1341 | if (len--) rxd_buffer[ptrOut++] = z; |
||
1342 | 8a0: e4 51 subi r30, 0x14 ; 20 |
||
1343 | 8a2: fe 4f sbci r31, 0xFE ; 254 |
||
1344 | 8a4: 90 83 st Z, r25 |
||
1345 | 8a6: 4d 5f subi r20, 0xFD ; 253 |
||
1346 | uint8_t x, y, z; |
||
1347 | uint8_t ptrIn = 3; |
||
1348 | uint8_t ptrOut = 3; |
||
1349 | uint8_t len = ReceivedBytes - 6; |
||
1350 | |||
1351 | while (len) { |
||
1352 | 8a8: 55 23 and r21, r21 |
||
1353 | 8aa: a1 f1 breq .+104 ; 0x914 <Decode64+0xb4> |
||
1354 | a = rxd_buffer[ptrIn++] - '='; |
||
1355 | 8ac: e3 2f mov r30, r19 |
||
1356 | 8ae: f0 e0 ldi r31, 0x00 ; 0 |
||
1357 | 8b0: e4 51 subi r30, 0x14 ; 20 |
||
1358 | 8b2: fe 4f sbci r31, 0xFE ; 254 |
||
1359 | 8b4: 80 81 ld r24, Z |
||
1360 | b = rxd_buffer[ptrIn++] - '='; |
||
1361 | 8b6: 3f 5f subi r19, 0xFF ; 255 |
||
1362 | 8b8: e3 2f mov r30, r19 |
||
1363 | 8ba: f0 e0 ldi r31, 0x00 ; 0 |
||
1364 | 8bc: e4 51 subi r30, 0x14 ; 20 |
||
1365 | 8be: fe 4f sbci r31, 0xFE ; 254 |
||
1366 | 8c0: 20 81 ld r18, Z |
||
1367 | 8c2: 2d 53 subi r18, 0x3D ; 61 |
||
1368 | c = rxd_buffer[ptrIn++] - '='; |
||
1369 | 8c4: 3f 5f subi r19, 0xFF ; 255 |
||
1370 | 8c6: e3 2f mov r30, r19 |
||
1371 | 8c8: f0 e0 ldi r31, 0x00 ; 0 |
||
1372 | 8ca: e4 51 subi r30, 0x14 ; 20 |
||
1373 | 8cc: fe 4f sbci r31, 0xFE ; 254 |
||
1374 | 8ce: 70 81 ld r23, Z |
||
1375 | d = rxd_buffer[ptrIn++] - '='; |
||
1376 | 8d0: 3f 5f subi r19, 0xFF ; 255 |
||
1377 | 8d2: e3 2f mov r30, r19 |
||
1378 | 8d4: f0 e0 ldi r31, 0x00 ; 0 |
||
1379 | 8d6: e4 51 subi r30, 0x14 ; 20 |
||
1380 | 8d8: fe 4f sbci r31, 0xFE ; 254 |
||
1381 | 8da: 60 81 ld r22, Z |
||
1382 | 8dc: 3f 5f subi r19, 0xFF ; 255 |
||
1383 | |||
1384 | x = (a << 2) | (b >> 4); |
||
1385 | 8de: 92 2f mov r25, r18 |
||
1386 | 8e0: 92 95 swap r25 |
||
1387 | 8e2: 9f 70 andi r25, 0x0F ; 15 |
||
1388 | 8e4: 8d 53 subi r24, 0x3D ; 61 |
||
1389 | 8e6: 88 0f add r24, r24 |
||
1390 | 8e8: 88 0f add r24, r24 |
||
1391 | 8ea: 89 2b or r24, r25 |
||
1392 | y = ((b & 0x0f) << 4) | (c >> 2); |
||
1393 | z = ((c & 0x03) << 6) | d; |
||
1394 | |||
1395 | if (len--) rxd_buffer[ptrOut++] = x; |
||
1396 | 8ec: e4 2f mov r30, r20 |
||
1397 | 8ee: f0 e0 ldi r31, 0x00 ; 0 |
||
1398 | 8f0: e4 51 subi r30, 0x14 ; 20 |
||
1399 | 8f2: fe 4f sbci r31, 0xFE ; 254 |
||
1400 | 8f4: 80 83 st Z, r24 |
||
1401 | 8f6: e4 2f mov r30, r20 |
||
1402 | 8f8: ef 5f subi r30, 0xFF ; 255 |
||
1403 | else break; |
||
1404 | if (len--) rxd_buffer[ptrOut++] = y; |
||
1405 | 8fa: 51 30 cpi r21, 0x01 ; 1 |
||
1406 | 8fc: 09 f0 breq .+2 ; 0x900 <Decode64+0xa0> |
||
1407 | 8fe: b8 cf rjmp .-144 ; 0x870 <Decode64+0x10> |
||
1408 | uint8_t x, y, z; |
||
1409 | uint8_t ptrIn = 3; |
||
1410 | uint8_t ptrOut = 3; |
||
1411 | uint8_t len = ReceivedBytes - 6; |
||
1412 | |||
1413 | while (len) { |
||
1414 | 900: e3 50 subi r30, 0x03 ; 3 |
||
1415 | if (len--) rxd_buffer[ptrOut++] = y; |
||
1416 | else break; |
||
1417 | if (len--) rxd_buffer[ptrOut++] = z; |
||
1418 | else break; |
||
1419 | } |
||
1420 | pRxData = &rxd_buffer[3]; |
||
1421 | 902: 8f ee ldi r24, 0xEF ; 239 |
||
1422 | 904: 91 e0 ldi r25, 0x01 ; 1 |
||
1423 | 906: 90 93 2c 01 sts 0x012C, r25 |
||
1424 | 90a: 80 93 2b 01 sts 0x012B, r24 |
||
1425 | RxDataLen = ptrOut - 3; |
||
1426 | 90e: e0 93 2d 01 sts 0x012D, r30 |
||
1427 | } |
||
1428 | 912: 08 95 ret |
||
1429 | uint8_t x, y, z; |
||
1430 | uint8_t ptrIn = 3; |
||
1431 | uint8_t ptrOut = 3; |
||
1432 | uint8_t len = ReceivedBytes - 6; |
||
1433 | |||
1434 | while (len) { |
||
1435 | 914: e4 2f mov r30, r20 |
||
1436 | 916: f4 cf rjmp .-24 ; 0x900 <Decode64+0xa0> |
||
1437 | 918: e0 e0 ldi r30, 0x00 ; 0 |
||
1438 | 91a: f3 cf rjmp .-26 ; 0x902 <Decode64+0xa2> |
||
1439 | |||
1440 | 0000091c <spi_send>: |
||
1441 | * Send a byte through SPI |
||
1442 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1443 | * the context-change on every char and attribute which is at least done twice |
||
1444 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1445 | */ |
||
1446 | inline void spi_send(uint8_t byte) { |
||
1447 | 91c: 48 2f mov r20, r24 |
||
1448 | 91e: 50 e0 ldi r21, 0x00 ; 0 |
||
1449 | 920: 27 e0 ldi r18, 0x07 ; 7 |
||
1450 | 922: 30 e0 ldi r19, 0x00 ; 0 |
||
1451 | 924: 09 c0 rjmp .+18 ; 0x938 <spi_send+0x1c> |
||
1452 | for (int8_t i = 7; i >= 0; i--) { |
||
1453 | if (((byte >> i) & 1)) { |
||
1454 | MAX_SDIN_HIGH |
||
1455 | 926: da 9a sbi 0x1b, 2 ; 27 |
||
1456 | } else { |
||
1457 | MAX_SDIN_LOW |
||
1458 | } |
||
1459 | MAX_SCLK_HIGH |
||
1460 | 928: db 9a sbi 0x1b, 3 ; 27 |
||
1461 | MAX_SCLK_LOW |
||
1462 | 92a: db 98 cbi 0x1b, 3 ; 27 |
||
1463 | 92c: 21 50 subi r18, 0x01 ; 1 |
||
1464 | 92e: 30 40 sbci r19, 0x00 ; 0 |
||
1465 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1466 | * the context-change on every char and attribute which is at least done twice |
||
1467 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1468 | */ |
||
1469 | inline void spi_send(uint8_t byte) { |
||
1470 | for (int8_t i = 7; i >= 0; i--) { |
||
1471 | 930: 8f ef ldi r24, 0xFF ; 255 |
||
1472 | 932: 2f 3f cpi r18, 0xFF ; 255 |
||
1473 | 934: 38 07 cpc r19, r24 |
||
1474 | 936: 91 f0 breq .+36 ; 0x95c <spi_send+0x40> |
||
1475 | if (((byte >> i) & 1)) { |
||
1476 | 938: ca 01 movw r24, r20 |
||
1477 | 93a: 02 2e mov r0, r18 |
||
1478 | 93c: 02 c0 rjmp .+4 ; 0x942 <spi_send+0x26> |
||
1479 | 93e: 95 95 asr r25 |
||
1480 | 940: 87 95 ror r24 |
||
1481 | 942: 0a 94 dec r0 |
||
1482 | 944: e2 f7 brpl .-8 ; 0x93e <spi_send+0x22> |
||
1483 | 946: 80 fd sbrc r24, 0 |
||
1484 | 948: ee cf rjmp .-36 ; 0x926 <spi_send+0xa> |
||
1485 | MAX_SDIN_HIGH |
||
1486 | } else { |
||
1487 | MAX_SDIN_LOW |
||
1488 | 94a: da 98 cbi 0x1b, 2 ; 27 |
||
1489 | } |
||
1490 | MAX_SCLK_HIGH |
||
1491 | 94c: db 9a sbi 0x1b, 3 ; 27 |
||
1492 | MAX_SCLK_LOW |
||
1493 | 94e: db 98 cbi 0x1b, 3 ; 27 |
||
1494 | 950: 21 50 subi r18, 0x01 ; 1 |
||
1495 | 952: 30 40 sbci r19, 0x00 ; 0 |
||
1496 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1497 | * the context-change on every char and attribute which is at least done twice |
||
1498 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1499 | */ |
||
1500 | inline void spi_send(uint8_t byte) { |
||
1501 | for (int8_t i = 7; i >= 0; i--) { |
||
1502 | 954: 8f ef ldi r24, 0xFF ; 255 |
||
1503 | 956: 2f 3f cpi r18, 0xFF ; 255 |
||
1504 | 958: 38 07 cpc r19, r24 |
||
1505 | 95a: 71 f7 brne .-36 ; 0x938 <spi_send+0x1c> |
||
1506 | MAX_SDIN_LOW |
||
1507 | } |
||
1508 | MAX_SCLK_HIGH |
||
1509 | MAX_SCLK_LOW |
||
1510 | } |
||
1511 | } |
||
1512 | 95c: 08 95 ret |
||
1513 | |||
1514 | 0000095e <spi_send_byte>: |
||
1515 | /** |
||
1516 | * Send <byte> to <address> of MAX7456 |
||
1517 | */ |
||
1518 | void spi_send_byte(uint8_t address, uint8_t byte) { |
||
1519 | // start sending |
||
1520 | MAX_CS_LOW |
||
1521 | 95e: d9 98 cbi 0x1b, 1 ; 27 |
||
1522 | 960: 48 2f mov r20, r24 |
||
1523 | 962: 50 e0 ldi r21, 0x00 ; 0 |
||
1524 | 964: 27 e0 ldi r18, 0x07 ; 7 |
||
1525 | 966: 30 e0 ldi r19, 0x00 ; 0 |
||
1526 | 968: 09 c0 rjmp .+18 ; 0x97c <spi_send_byte+0x1e> |
||
1527 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1528 | */ |
||
1529 | inline void spi_send(uint8_t byte) { |
||
1530 | for (int8_t i = 7; i >= 0; i--) { |
||
1531 | if (((byte >> i) & 1)) { |
||
1532 | MAX_SDIN_HIGH |
||
1533 | 96a: da 9a sbi 0x1b, 2 ; 27 |
||
1534 | } else { |
||
1535 | MAX_SDIN_LOW |
||
1536 | } |
||
1537 | MAX_SCLK_HIGH |
||
1538 | 96c: db 9a sbi 0x1b, 3 ; 27 |
||
1539 | MAX_SCLK_LOW |
||
1540 | 96e: db 98 cbi 0x1b, 3 ; 27 |
||
1541 | 970: 21 50 subi r18, 0x01 ; 1 |
||
1542 | 972: 30 40 sbci r19, 0x00 ; 0 |
||
1543 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1544 | * the context-change on every char and attribute which is at least done twice |
||
1545 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1546 | */ |
||
1547 | inline void spi_send(uint8_t byte) { |
||
1548 | for (int8_t i = 7; i >= 0; i--) { |
||
1549 | 974: 8f ef ldi r24, 0xFF ; 255 |
||
1550 | 976: 2f 3f cpi r18, 0xFF ; 255 |
||
1551 | 978: 38 07 cpc r19, r24 |
||
1552 | 97a: 91 f0 breq .+36 ; 0x9a0 <spi_send_byte+0x42> |
||
1553 | if (((byte >> i) & 1)) { |
||
1554 | 97c: ca 01 movw r24, r20 |
||
1555 | 97e: 02 2e mov r0, r18 |
||
1556 | 980: 02 c0 rjmp .+4 ; 0x986 <spi_send_byte+0x28> |
||
1557 | 982: 95 95 asr r25 |
||
1558 | 984: 87 95 ror r24 |
||
1559 | 986: 0a 94 dec r0 |
||
1560 | 988: e2 f7 brpl .-8 ; 0x982 <spi_send_byte+0x24> |
||
1561 | 98a: 80 fd sbrc r24, 0 |
||
1562 | 98c: ee cf rjmp .-36 ; 0x96a <spi_send_byte+0xc> |
||
1563 | MAX_SDIN_HIGH |
||
1564 | } else { |
||
1565 | MAX_SDIN_LOW |
||
1566 | 98e: da 98 cbi 0x1b, 2 ; 27 |
||
1567 | } |
||
1568 | MAX_SCLK_HIGH |
||
1569 | 990: db 9a sbi 0x1b, 3 ; 27 |
||
1570 | MAX_SCLK_LOW |
||
1571 | 992: db 98 cbi 0x1b, 3 ; 27 |
||
1572 | 994: 21 50 subi r18, 0x01 ; 1 |
||
1573 | 996: 30 40 sbci r19, 0x00 ; 0 |
||
1574 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1575 | * the context-change on every char and attribute which is at least done twice |
||
1576 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1577 | */ |
||
1578 | inline void spi_send(uint8_t byte) { |
||
1579 | for (int8_t i = 7; i >= 0; i--) { |
||
1580 | 998: 8f ef ldi r24, 0xFF ; 255 |
||
1581 | 99a: 2f 3f cpi r18, 0xFF ; 255 |
||
1582 | 99c: 38 07 cpc r19, r24 |
||
1583 | 99e: 71 f7 brne .-36 ; 0x97c <spi_send_byte+0x1e> |
||
1584 | 9a0: 70 e0 ldi r23, 0x00 ; 0 |
||
1585 | 9a2: 27 e0 ldi r18, 0x07 ; 7 |
||
1586 | 9a4: 30 e0 ldi r19, 0x00 ; 0 |
||
1587 | 9a6: 09 c0 rjmp .+18 ; 0x9ba <spi_send_byte+0x5c> |
||
1588 | if (((byte >> i) & 1)) { |
||
1589 | MAX_SDIN_HIGH |
||
1590 | 9a8: da 9a sbi 0x1b, 2 ; 27 |
||
1591 | } else { |
||
1592 | MAX_SDIN_LOW |
||
1593 | } |
||
1594 | MAX_SCLK_HIGH |
||
1595 | 9aa: db 9a sbi 0x1b, 3 ; 27 |
||
1596 | MAX_SCLK_LOW |
||
1597 | 9ac: db 98 cbi 0x1b, 3 ; 27 |
||
1598 | 9ae: 21 50 subi r18, 0x01 ; 1 |
||
1599 | 9b0: 30 40 sbci r19, 0x00 ; 0 |
||
1600 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1601 | * the context-change on every char and attribute which is at least done twice |
||
1602 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1603 | */ |
||
1604 | inline void spi_send(uint8_t byte) { |
||
1605 | for (int8_t i = 7; i >= 0; i--) { |
||
1606 | 9b2: 8f ef ldi r24, 0xFF ; 255 |
||
1607 | 9b4: 2f 3f cpi r18, 0xFF ; 255 |
||
1608 | 9b6: 38 07 cpc r19, r24 |
||
1609 | 9b8: 91 f0 breq .+36 ; 0x9de <spi_send_byte+0x80> |
||
1610 | if (((byte >> i) & 1)) { |
||
1611 | 9ba: cb 01 movw r24, r22 |
||
1612 | 9bc: 02 2e mov r0, r18 |
||
1613 | 9be: 02 c0 rjmp .+4 ; 0x9c4 <spi_send_byte+0x66> |
||
1614 | 9c0: 95 95 asr r25 |
||
1615 | 9c2: 87 95 ror r24 |
||
1616 | 9c4: 0a 94 dec r0 |
||
1617 | 9c6: e2 f7 brpl .-8 ; 0x9c0 <spi_send_byte+0x62> |
||
1618 | 9c8: 80 fd sbrc r24, 0 |
||
1619 | 9ca: ee cf rjmp .-36 ; 0x9a8 <spi_send_byte+0x4a> |
||
1620 | MAX_SDIN_HIGH |
||
1621 | } else { |
||
1622 | MAX_SDIN_LOW |
||
1623 | 9cc: da 98 cbi 0x1b, 2 ; 27 |
||
1624 | } |
||
1625 | MAX_SCLK_HIGH |
||
1626 | 9ce: db 9a sbi 0x1b, 3 ; 27 |
||
1627 | MAX_SCLK_LOW |
||
1628 | 9d0: db 98 cbi 0x1b, 3 ; 27 |
||
1629 | 9d2: 21 50 subi r18, 0x01 ; 1 |
||
1630 | 9d4: 30 40 sbci r19, 0x00 ; 0 |
||
1631 | * inline because it increases the codesize currenlty 'only' by 110byte but saves |
||
1632 | * the context-change on every char and attribute which is at least done twice |
||
1633 | * (address and data byte), a significant speed-bost we do not want to miss :) |
||
1634 | */ |
||
1635 | inline void spi_send(uint8_t byte) { |
||
1636 | for (int8_t i = 7; i >= 0; i--) { |
||
1637 | 9d6: 8f ef ldi r24, 0xFF ; 255 |
||
1638 | 9d8: 2f 3f cpi r18, 0xFF ; 255 |
||
1639 | 9da: 38 07 cpc r19, r24 |
||
1640 | 9dc: 71 f7 brne .-36 ; 0x9ba <spi_send_byte+0x5c> |
||
1641 | |||
1642 | spi_send(address); |
||
1643 | spi_send(byte); |
||
1644 | |||
1645 | // end sending |
||
1646 | MAX_CS_HIGH |
||
1647 | 9de: d9 9a sbi 0x1b, 1 ; 27 |
||
1648 | } |
||
1649 | 9e0: 08 95 ret |
||
1650 | |||
1651 | 000009e2 <write_char>: |
||
1652 | |||
1653 | |||
1654 | /** |
||
1655 | * write a <character> to <address> of MAX7456 display memory |
||
1656 | */ |
||
1657 | void write_char(uint16_t address, char character) { |
||
1658 | 9e2: 0f 93 push r16 |
||
1659 | 9e4: 1f 93 push r17 |
||
1660 | 9e6: 18 2f mov r17, r24 |
||
1661 | 9e8: 06 2f mov r16, r22 |
||
1662 | spi_send_byte(0x05, (address & 0xFF00) >> 8); // DMAH |
||
1663 | 9ea: 85 e0 ldi r24, 0x05 ; 5 |
||
1664 | 9ec: 69 2f mov r22, r25 |
||
1665 | 9ee: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
1666 | spi_send_byte(0x06, (address & 0x00FF)); // DMAL |
||
1667 | 9f2: 86 e0 ldi r24, 0x06 ; 6 |
||
1668 | 9f4: 61 2f mov r22, r17 |
||
1669 | 9f6: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
1670 | spi_send_byte(0x07, character); // DMDI |
||
1671 | 9fa: 87 e0 ldi r24, 0x07 ; 7 |
||
1672 | 9fc: 60 2f mov r22, r16 |
||
1673 | 9fe: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
1674 | } |
||
1675 | a02: 1f 91 pop r17 |
||
1676 | a04: 0f 91 pop r16 |
||
1677 | a06: 08 95 ret |
||
1678 | |||
1679 | 00000a08 <write_char_xy>: |
||
1680 | /** |
||
1681 | * write a <character> at <x>/<y> to MAX7456 display memory |
||
1682 | */ |
||
1683 | void write_char_xy(uint8_t x, uint8_t y, char character) { |
||
1684 | uint16_t address = y * 30 + x; |
||
1685 | write_char(address, character); |
||
1686 | a08: 9e e1 ldi r25, 0x1E ; 30 |
||
1687 | a0a: 69 9f mul r22, r25 |
||
1688 | a0c: b0 01 movw r22, r0 |
||
1689 | a0e: 11 24 eor r1, r1 |
||
1690 | a10: 9b 01 movw r18, r22 |
||
1691 | a12: 28 0f add r18, r24 |
||
1692 | a14: 31 1d adc r19, r1 |
||
1693 | a16: c9 01 movw r24, r18 |
||
1694 | a18: 64 2f mov r22, r20 |
||
1695 | a1a: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
1696 | } |
||
1697 | a1e: 08 95 ret |
||
1698 | |||
1699 | 00000a20 <write_ascii_char>: |
||
1700 | } |
||
1701 | |||
1702 | /** |
||
1703 | * write an ascii <character> to <address> of MAX7456 display memory |
||
1704 | */ |
||
1705 | void write_ascii_char(uint16_t address, char c) { |
||
1706 | a20: 9c 01 movw r18, r24 |
||
1707 | if (c == 32) c = 0; // remap space |
||
1708 | a22: 60 32 cpi r22, 0x20 ; 32 |
||
1709 | a24: 19 f1 breq .+70 ; 0xa6c <write_ascii_char+0x4c> |
||
1710 | else if (c > 48 && c <= 57) c -= 48; // remap numbers |
||
1711 | a26: 86 2f mov r24, r22 |
||
1712 | a28: 81 53 subi r24, 0x31 ; 49 |
||
1713 | a2a: 89 30 cpi r24, 0x09 ; 9 |
||
1714 | a2c: d0 f0 brcs .+52 ; 0xa62 <write_ascii_char+0x42> |
||
1715 | else if (c == '0') c = 10; // remap zero |
||
1716 | a2e: 60 33 cpi r22, 0x30 ; 48 |
||
1717 | a30: 39 f1 breq .+78 ; 0xa80 <write_ascii_char+0x60> |
||
1718 | else if (c >= 65 && c <= 90) c -= 54; // remap big letters |
||
1719 | a32: 86 2f mov r24, r22 |
||
1720 | a34: 81 54 subi r24, 0x41 ; 65 |
||
1721 | a36: 8a 31 cpi r24, 0x1A ; 26 |
||
1722 | a38: f0 f0 brcs .+60 ; 0xa76 <write_ascii_char+0x56> |
||
1723 | else if (c >= 97 && c <= 122) c -= 60; // remap small letters |
||
1724 | a3a: 86 2f mov r24, r22 |
||
1725 | a3c: 81 56 subi r24, 0x61 ; 97 |
||
1726 | a3e: 8a 31 cpi r24, 0x1A ; 26 |
||
1727 | a40: 20 f1 brcs .+72 ; 0xa8a <write_ascii_char+0x6a> |
||
1728 | else if (c == '(') c = 63; // remap |
||
1729 | a42: 68 32 cpi r22, 0x28 ; 40 |
||
1730 | a44: 31 f1 breq .+76 ; 0xa92 <write_ascii_char+0x72> |
||
1731 | else if (c == ')') c = 64; // remap |
||
1732 | a46: 69 32 cpi r22, 0x29 ; 41 |
||
1733 | a48: 11 f1 breq .+68 ; 0xa8e <write_ascii_char+0x6e> |
||
1734 | else if (c == '.') c = 65; // remap |
||
1735 | a4a: 6e 32 cpi r22, 0x2E ; 46 |
||
1736 | a4c: 21 f1 breq .+72 ; 0xa96 <write_ascii_char+0x76> |
||
1737 | else if (c == '-') c = 73; // remap minus |
||
1738 | a4e: 6d 32 cpi r22, 0x2D ; 45 |
||
1739 | a50: 21 f1 breq .+72 ; 0xa9a <write_ascii_char+0x7a> |
||
1740 | else if (c == ';') c = 67; // remap |
||
1741 | a52: 6b 33 cpi r22, 0x3B ; 59 |
||
1742 | a54: 21 f1 breq .+72 ; 0xa9e <write_ascii_char+0x7e> |
||
1743 | else if (c == ':') c = 68; // remap |
||
1744 | a56: 6a 33 cpi r22, 0x3A ; 58 |
||
1745 | a58: 21 f1 breq .+72 ; 0xaa2 <write_ascii_char+0x82> |
||
1746 | else if (c == ',') c = 69; // remap |
||
1747 | a5a: 6c 32 cpi r22, 0x2C ; 44 |
||
1748 | a5c: 19 f4 brne .+6 ; 0xa64 <write_ascii_char+0x44> |
||
1749 | a5e: 65 e4 ldi r22, 0x45 ; 69 |
||
1750 | a60: 01 c0 rjmp .+2 ; 0xa64 <write_ascii_char+0x44> |
||
1751 | /** |
||
1752 | * write an ascii <character> to <address> of MAX7456 display memory |
||
1753 | */ |
||
1754 | void write_ascii_char(uint16_t address, char c) { |
||
1755 | if (c == 32) c = 0; // remap space |
||
1756 | else if (c > 48 && c <= 57) c -= 48; // remap numbers |
||
1757 | a62: 60 53 subi r22, 0x30 ; 48 |
||
1758 | // else if (c == '/') c = 71; // remap |
||
1759 | // else if (c == '"') c = 72; // remap |
||
1760 | // else if (c == '<') c = 74; // remap |
||
1761 | // else if (c == '>') c = 75; // remap |
||
1762 | // else if (c == '@') c = 76; // remap |
||
1763 | write_char(address, c); |
||
1764 | a64: c9 01 movw r24, r18 |
||
1765 | a66: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
1766 | } |
||
1767 | a6a: 08 95 ret |
||
1768 | |||
1769 | /** |
||
1770 | * write an ascii <character> to <address> of MAX7456 display memory |
||
1771 | */ |
||
1772 | void write_ascii_char(uint16_t address, char c) { |
||
1773 | if (c == 32) c = 0; // remap space |
||
1774 | a6c: 60 e0 ldi r22, 0x00 ; 0 |
||
1775 | // else if (c == '/') c = 71; // remap |
||
1776 | // else if (c == '"') c = 72; // remap |
||
1777 | // else if (c == '<') c = 74; // remap |
||
1778 | // else if (c == '>') c = 75; // remap |
||
1779 | // else if (c == '@') c = 76; // remap |
||
1780 | write_char(address, c); |
||
1781 | a6e: c9 01 movw r24, r18 |
||
1782 | a70: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
1783 | } |
||
1784 | a74: 08 95 ret |
||
1785 | */ |
||
1786 | void write_ascii_char(uint16_t address, char c) { |
||
1787 | if (c == 32) c = 0; // remap space |
||
1788 | else if (c > 48 && c <= 57) c -= 48; // remap numbers |
||
1789 | else if (c == '0') c = 10; // remap zero |
||
1790 | else if (c >= 65 && c <= 90) c -= 54; // remap big letters |
||
1791 | a76: 66 53 subi r22, 0x36 ; 54 |
||
1792 | // else if (c == '/') c = 71; // remap |
||
1793 | // else if (c == '"') c = 72; // remap |
||
1794 | // else if (c == '<') c = 74; // remap |
||
1795 | // else if (c == '>') c = 75; // remap |
||
1796 | // else if (c == '@') c = 76; // remap |
||
1797 | write_char(address, c); |
||
1798 | a78: c9 01 movw r24, r18 |
||
1799 | a7a: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
1800 | } |
||
1801 | a7e: 08 95 ret |
||
1802 | * write an ascii <character> to <address> of MAX7456 display memory |
||
1803 | */ |
||
1804 | void write_ascii_char(uint16_t address, char c) { |
||
1805 | if (c == 32) c = 0; // remap space |
||
1806 | else if (c > 48 && c <= 57) c -= 48; // remap numbers |
||
1807 | else if (c == '0') c = 10; // remap zero |
||
1808 | a80: 6a e0 ldi r22, 0x0A ; 10 |
||
1809 | // else if (c == '/') c = 71; // remap |
||
1810 | // else if (c == '"') c = 72; // remap |
||
1811 | // else if (c == '<') c = 74; // remap |
||
1812 | // else if (c == '>') c = 75; // remap |
||
1813 | // else if (c == '@') c = 76; // remap |
||
1814 | write_char(address, c); |
||
1815 | a82: c9 01 movw r24, r18 |
||
1816 | a84: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
1817 | } |
||
1818 | a88: 08 95 ret |
||
1819 | void write_ascii_char(uint16_t address, char c) { |
||
1820 | if (c == 32) c = 0; // remap space |
||
1821 | else if (c > 48 && c <= 57) c -= 48; // remap numbers |
||
1822 | else if (c == '0') c = 10; // remap zero |
||
1823 | else if (c >= 65 && c <= 90) c -= 54; // remap big letters |
||
1824 | else if (c >= 97 && c <= 122) c -= 60; // remap small letters |
||
1825 | a8a: 6c 53 subi r22, 0x3C ; 60 |
||
1826 | a8c: eb cf rjmp .-42 ; 0xa64 <write_ascii_char+0x44> |
||
1827 | else if (c == '(') c = 63; // remap |
||
1828 | else if (c == ')') c = 64; // remap |
||
1829 | a8e: 60 e4 ldi r22, 0x40 ; 64 |
||
1830 | a90: e9 cf rjmp .-46 ; 0xa64 <write_ascii_char+0x44> |
||
1831 | if (c == 32) c = 0; // remap space |
||
1832 | else if (c > 48 && c <= 57) c -= 48; // remap numbers |
||
1833 | else if (c == '0') c = 10; // remap zero |
||
1834 | else if (c >= 65 && c <= 90) c -= 54; // remap big letters |
||
1835 | else if (c >= 97 && c <= 122) c -= 60; // remap small letters |
||
1836 | else if (c == '(') c = 63; // remap |
||
1837 | a92: 6f e3 ldi r22, 0x3F ; 63 |
||
1838 | a94: e7 cf rjmp .-50 ; 0xa64 <write_ascii_char+0x44> |
||
1839 | else if (c == ')') c = 64; // remap |
||
1840 | else if (c == '.') c = 65; // remap |
||
1841 | a96: 61 e4 ldi r22, 0x41 ; 65 |
||
1842 | a98: e5 cf rjmp .-54 ; 0xa64 <write_ascii_char+0x44> |
||
1843 | else if (c == '-') c = 73; // remap minus |
||
1844 | a9a: 69 e4 ldi r22, 0x49 ; 73 |
||
1845 | a9c: e3 cf rjmp .-58 ; 0xa64 <write_ascii_char+0x44> |
||
1846 | else if (c == ';') c = 67; // remap |
||
1847 | a9e: 63 e4 ldi r22, 0x43 ; 67 |
||
1848 | aa0: e1 cf rjmp .-62 ; 0xa64 <write_ascii_char+0x44> |
||
1849 | else if (c == ':') c = 68; // remap |
||
1850 | aa2: 64 e4 ldi r22, 0x44 ; 68 |
||
1851 | aa4: df cf rjmp .-66 ; 0xa64 <write_ascii_char+0x44> |
||
1852 | |||
1853 | 00000aa6 <write_ascii_string>: |
||
1854 | } |
||
1855 | |||
1856 | /** |
||
1857 | * write an ascii <string> at <x>/<y> to MAX7456 display memory |
||
1858 | */ |
||
1859 | void write_ascii_string(uint8_t x, uint8_t y, char *string) { |
||
1860 | aa6: ff 92 push r15 |
||
1861 | aa8: 0f 93 push r16 |
||
1862 | aaa: 1f 93 push r17 |
||
1863 | aac: cf 93 push r28 |
||
1864 | aae: df 93 push r29 |
||
1865 | ab0: f8 2e mov r15, r24 |
||
1866 | ab2: ea 01 movw r28, r20 |
||
1867 | while (*string) { |
||
1868 | ab4: 48 81 ld r20, Y |
||
1869 | ab6: 44 23 and r20, r20 |
||
1870 | ab8: d9 f0 breq .+54 ; 0xaf0 <write_ascii_string+0x4a> |
||
1871 | aba: 26 2f mov r18, r22 |
||
1872 | abc: 30 e0 ldi r19, 0x00 ; 0 |
||
1873 | abe: c9 01 movw r24, r18 |
||
1874 | ac0: 88 0f add r24, r24 |
||
1875 | ac2: 99 1f adc r25, r25 |
||
1876 | ac4: 82 0f add r24, r18 |
||
1877 | ac6: 93 1f adc r25, r19 |
||
1878 | ac8: 8c 01 movw r16, r24 |
||
1879 | aca: 00 0f add r16, r16 |
||
1880 | acc: 11 1f adc r17, r17 |
||
1881 | ace: 00 0f add r16, r16 |
||
1882 | ad0: 11 1f adc r17, r17 |
||
1883 | ad2: 08 0f add r16, r24 |
||
1884 | ad4: 19 1f adc r17, r25 |
||
1885 | ad6: 00 0f add r16, r16 |
||
1886 | ad8: 11 1f adc r17, r17 |
||
1887 | write_ascii_char(((x++)+(y * 30)), *string); |
||
1888 | ada: c8 01 movw r24, r16 |
||
1889 | adc: 8f 0d add r24, r15 |
||
1890 | ade: 91 1d adc r25, r1 |
||
1891 | ae0: f3 94 inc r15 |
||
1892 | ae2: 64 2f mov r22, r20 |
||
1893 | ae4: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
1894 | string++; |
||
1895 | ae8: 21 96 adiw r28, 0x01 ; 1 |
||
1896 | |||
1897 | /** |
||
1898 | * write an ascii <string> at <x>/<y> to MAX7456 display memory |
||
1899 | */ |
||
1900 | void write_ascii_string(uint8_t x, uint8_t y, char *string) { |
||
1901 | while (*string) { |
||
1902 | aea: 48 81 ld r20, Y |
||
1903 | aec: 44 23 and r20, r20 |
||
1904 | aee: a9 f7 brne .-22 ; 0xada <write_ascii_string+0x34> |
||
1905 | write_ascii_char(((x++)+(y * 30)), *string); |
||
1906 | string++; |
||
1907 | } |
||
1908 | } |
||
1909 | af0: df 91 pop r29 |
||
1910 | af2: cf 91 pop r28 |
||
1911 | af4: 1f 91 pop r17 |
||
1912 | af6: 0f 91 pop r16 |
||
1913 | af8: ff 90 pop r15 |
||
1914 | afa: 08 95 ret |
||
1915 | |||
1916 | 00000afc <write_ascii_string_pgm>: |
||
1917 | |||
1918 | /** |
||
1919 | * write an ascii <string> from progmen at <x>/<y> to MAX7456 display memory |
||
1920 | */ |
||
1921 | void write_ascii_string_pgm(uint8_t x, uint8_t y, const char *string) { |
||
1922 | afc: ff 92 push r15 |
||
1923 | afe: 0f 93 push r16 |
||
1924 | b00: 1f 93 push r17 |
||
1925 | b02: cf 93 push r28 |
||
1926 | b04: df 93 push r29 |
||
1927 | b06: f8 2e mov r15, r24 |
||
1928 | b08: ea 01 movw r28, r20 |
||
1929 | while (pgm_read_byte(string) != 0x00) |
||
1930 | b0a: fe 01 movw r30, r28 |
||
1931 | b0c: 84 91 lpm r24, Z+ |
||
1932 | b0e: 88 23 and r24, r24 |
||
1933 | b10: f1 f0 breq .+60 ; 0xb4e <write_ascii_string_pgm+0x52> |
||
1934 | b12: 26 2f mov r18, r22 |
||
1935 | b14: 30 e0 ldi r19, 0x00 ; 0 |
||
1936 | b16: c9 01 movw r24, r18 |
||
1937 | b18: 88 0f add r24, r24 |
||
1938 | b1a: 99 1f adc r25, r25 |
||
1939 | b1c: 82 0f add r24, r18 |
||
1940 | b1e: 93 1f adc r25, r19 |
||
1941 | b20: 8c 01 movw r16, r24 |
||
1942 | b22: 00 0f add r16, r16 |
||
1943 | b24: 11 1f adc r17, r17 |
||
1944 | b26: 00 0f add r16, r16 |
||
1945 | b28: 11 1f adc r17, r17 |
||
1946 | b2a: 08 0f add r16, r24 |
||
1947 | b2c: 19 1f adc r17, r25 |
||
1948 | b2e: 00 0f add r16, r16 |
||
1949 | b30: 11 1f adc r17, r17 |
||
1950 | write_ascii_char(((x++)+(y * 30)), pgm_read_byte(string++)); |
||
1951 | b32: c8 01 movw r24, r16 |
||
1952 | b34: 8f 0d add r24, r15 |
||
1953 | b36: 91 1d adc r25, r1 |
||
1954 | b38: f3 94 inc r15 |
||
1955 | b3a: 21 96 adiw r28, 0x01 ; 1 |
||
1956 | b3c: fa 01 movw r30, r20 |
||
1957 | b3e: 64 91 lpm r22, Z+ |
||
1958 | b40: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
1959 | b44: ae 01 movw r20, r28 |
||
1960 | |||
1961 | /** |
||
1962 | * write an ascii <string> from progmen at <x>/<y> to MAX7456 display memory |
||
1963 | */ |
||
1964 | void write_ascii_string_pgm(uint8_t x, uint8_t y, const char *string) { |
||
1965 | while (pgm_read_byte(string) != 0x00) |
||
1966 | b46: fe 01 movw r30, r28 |
||
1967 | b48: 84 91 lpm r24, Z+ |
||
1968 | b4a: 88 23 and r24, r24 |
||
1969 | b4c: 91 f7 brne .-28 ; 0xb32 <write_ascii_string_pgm+0x36> |
||
1970 | write_ascii_char(((x++)+(y * 30)), pgm_read_byte(string++)); |
||
1971 | } |
||
1972 | b4e: df 91 pop r29 |
||
1973 | b50: cf 91 pop r28 |
||
1974 | b52: 1f 91 pop r17 |
||
1975 | b54: 0f 91 pop r16 |
||
1976 | b56: ff 90 pop r15 |
||
1977 | b58: 08 95 ret |
||
1978 | |||
1979 | 00000b5a <write_string_pgm_down>: |
||
1980 | |||
1981 | /** |
||
1982 | * write an <string> from progmen at <x>/<y> downwards to MAX7456 display memory |
||
1983 | */ |
||
1984 | void write_string_pgm_down(uint8_t x, uint8_t y, const char *string, uint8_t length) { |
||
1985 | b5a: df 92 push r13 |
||
1986 | b5c: ef 92 push r14 |
||
1987 | b5e: ff 92 push r15 |
||
1988 | b60: 0f 93 push r16 |
||
1989 | b62: 1f 93 push r17 |
||
1990 | b64: cf 93 push r28 |
||
1991 | b66: df 93 push r29 |
||
1992 | b68: 06 2f mov r16, r22 |
||
1993 | b6a: ea 01 movw r28, r20 |
||
1994 | b6c: 12 2f mov r17, r18 |
||
1995 | while (length--) |
||
1996 | b6e: 22 23 and r18, r18 |
||
1997 | b70: 91 f0 breq .+36 ; 0xb96 <write_string_pgm_down+0x3c> |
||
1998 | b72: e8 2e mov r14, r24 |
||
1999 | b74: ff 24 eor r15, r15 |
||
2000 | write_char((x+(y++ * 30)), pgm_read_byte(string++)); |
||
2001 | b76: fe e1 ldi r31, 0x1E ; 30 |
||
2002 | b78: df 2e mov r13, r31 |
||
2003 | b7a: 0d 9d mul r16, r13 |
||
2004 | b7c: c0 01 movw r24, r0 |
||
2005 | b7e: 11 24 eor r1, r1 |
||
2006 | b80: 0f 5f subi r16, 0xFF ; 255 |
||
2007 | b82: fe 01 movw r30, r28 |
||
2008 | b84: 21 96 adiw r28, 0x01 ; 1 |
||
2009 | b86: e4 91 lpm r30, Z+ |
||
2010 | b88: 8e 0d add r24, r14 |
||
2011 | b8a: 9f 1d adc r25, r15 |
||
2012 | b8c: 6e 2f mov r22, r30 |
||
2013 | b8e: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2014 | b92: 11 50 subi r17, 0x01 ; 1 |
||
2015 | |||
2016 | /** |
||
2017 | * write an <string> from progmen at <x>/<y> downwards to MAX7456 display memory |
||
2018 | */ |
||
2019 | void write_string_pgm_down(uint8_t x, uint8_t y, const char *string, uint8_t length) { |
||
2020 | while (length--) |
||
2021 | b94: 91 f7 brne .-28 ; 0xb7a <write_string_pgm_down+0x20> |
||
2022 | write_char((x+(y++ * 30)), pgm_read_byte(string++)); |
||
2023 | } |
||
2024 | b96: df 91 pop r29 |
||
2025 | b98: cf 91 pop r28 |
||
2026 | b9a: 1f 91 pop r17 |
||
2027 | b9c: 0f 91 pop r16 |
||
2028 | b9e: ff 90 pop r15 |
||
2029 | ba0: ef 90 pop r14 |
||
2030 | ba2: df 90 pop r13 |
||
2031 | ba4: 08 95 ret |
||
2032 | |||
2033 | 00000ba6 <write_ndigit_number_s_10th>: |
||
2034 | /** |
||
2035 | * Write a signed <number> at <x>/<y> to MAX7456 display memory as /10th of value |
||
2036 | * <length> represents the length to rightbound the number |
||
2037 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2038 | */ |
||
2039 | void write_ndigit_number_s_10th(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2040 | ba6: 8f 92 push r8 |
||
2041 | ba8: 9f 92 push r9 |
||
2042 | baa: af 92 push r10 |
||
2043 | bac: bf 92 push r11 |
||
2044 | bae: cf 92 push r12 |
||
2045 | bb0: df 92 push r13 |
||
2046 | bb2: ef 92 push r14 |
||
2047 | bb4: ff 92 push r15 |
||
2048 | bb6: 0f 93 push r16 |
||
2049 | bb8: 1f 93 push r17 |
||
2050 | bba: cf 93 push r28 |
||
2051 | bbc: df 93 push r29 |
||
2052 | bbe: d8 2e mov r13, r24 |
||
2053 | bc0: 86 2e mov r8, r22 |
||
2054 | bc2: ca 01 movw r24, r20 |
||
2055 | bc4: e9 01 movw r28, r18 |
||
2056 | bc6: c0 2e mov r12, r16 |
||
2057 | itoa(number, conv_array, 10 ); |
||
2058 | bc8: 06 e9 ldi r16, 0x96 ; 150 |
||
2059 | bca: 12 e0 ldi r17, 0x02 ; 2 |
||
2060 | bcc: b8 01 movw r22, r16 |
||
2061 | bce: 4a e0 ldi r20, 0x0A ; 10 |
||
2062 | bd0: 50 e0 ldi r21, 0x00 ; 0 |
||
2063 | bd2: 0e 94 cc 1c call 0x3998 ; 0x3998 <itoa> |
||
2064 | uint8_t len = strlen(conv_array); |
||
2065 | bd6: f8 01 movw r30, r16 |
||
2066 | bd8: 01 90 ld r0, Z+ |
||
2067 | bda: 00 20 and r0, r0 |
||
2068 | bdc: e9 f7 brne .-6 ; 0xbd8 <write_ndigit_number_s_10th+0x32> |
||
2069 | bde: 8f 01 movw r16, r30 |
||
2070 | be0: 01 50 subi r16, 0x01 ; 1 |
||
2071 | be2: 10 40 sbci r17, 0x00 ; 0 |
||
2072 | be4: 06 59 subi r16, 0x96 ; 150 |
||
2073 | be6: 12 40 sbci r17, 0x02 ; 2 |
||
2074 | be8: 90 2e mov r9, r16 |
||
2075 | for (uint8_t i = 0; i < length - len; i++) { |
||
2076 | bea: a0 2e mov r10, r16 |
||
2077 | bec: bb 24 eor r11, r11 |
||
2078 | bee: ca 19 sub r28, r10 |
||
2079 | bf0: db 09 sbc r29, r11 |
||
2080 | bf2: 1c 16 cp r1, r28 |
||
2081 | bf4: 1d 06 cpc r1, r29 |
||
2082 | bf6: 0c f0 brlt .+2 ; 0xbfa <write_ndigit_number_s_10th+0x54> |
||
2083 | bf8: 74 c0 rjmp .+232 ; 0xce2 <write_ndigit_number_s_10th+0x13c> |
||
2084 | bfa: 8e e1 ldi r24, 0x1E ; 30 |
||
2085 | bfc: 88 9e mul r8, r24 |
||
2086 | bfe: 70 01 movw r14, r0 |
||
2087 | c00: 11 24 eor r1, r1 |
||
2088 | c02: d3 94 inc r13 |
||
2089 | c04: 10 e0 ldi r17, 0x00 ; 0 |
||
2090 | c06: 10 c0 rjmp .+32 ; 0xc28 <write_ndigit_number_s_10th+0x82> |
||
2091 | if (pad) write_char((x++)+(y * 30), 10); // zero |
||
2092 | c08: 97 01 movw r18, r14 |
||
2093 | c0a: 28 0f add r18, r24 |
||
2094 | c0c: 31 1d adc r19, r1 |
||
2095 | c0e: c9 01 movw r24, r18 |
||
2096 | c10: 6a e0 ldi r22, 0x0A ; 10 |
||
2097 | c12: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2098 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2099 | */ |
||
2100 | void write_ndigit_number_s_10th(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2101 | itoa(number, conv_array, 10 ); |
||
2102 | uint8_t len = strlen(conv_array); |
||
2103 | for (uint8_t i = 0; i < length - len; i++) { |
||
2104 | c16: 1f 5f subi r17, 0xFF ; 255 |
||
2105 | c18: 2d 2d mov r18, r13 |
||
2106 | c1a: 2f 5f subi r18, 0xFF ; 255 |
||
2107 | c1c: 81 2f mov r24, r17 |
||
2108 | c1e: 90 e0 ldi r25, 0x00 ; 0 |
||
2109 | c20: 8c 17 cp r24, r28 |
||
2110 | c22: 9d 07 cpc r25, r29 |
||
2111 | c24: a4 f4 brge .+40 ; 0xc4e <write_ndigit_number_s_10th+0xa8> |
||
2112 | c26: d2 2e mov r13, r18 |
||
2113 | c28: 8d 2d mov r24, r13 |
||
2114 | c2a: 81 50 subi r24, 0x01 ; 1 |
||
2115 | if (pad) write_char((x++)+(y * 30), 10); // zero |
||
2116 | c2c: cc 20 and r12, r12 |
||
2117 | c2e: 61 f7 brne .-40 ; 0xc08 <write_ndigit_number_s_10th+0x62> |
||
2118 | else write_char((x++)+(y * 30), 0); // blank |
||
2119 | c30: f7 01 movw r30, r14 |
||
2120 | c32: e8 0f add r30, r24 |
||
2121 | c34: f1 1d adc r31, r1 |
||
2122 | c36: cf 01 movw r24, r30 |
||
2123 | c38: 60 e0 ldi r22, 0x00 ; 0 |
||
2124 | c3a: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2125 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2126 | */ |
||
2127 | void write_ndigit_number_s_10th(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2128 | itoa(number, conv_array, 10 ); |
||
2129 | uint8_t len = strlen(conv_array); |
||
2130 | for (uint8_t i = 0; i < length - len; i++) { |
||
2131 | c3e: 1f 5f subi r17, 0xFF ; 255 |
||
2132 | c40: 2d 2d mov r18, r13 |
||
2133 | c42: 2f 5f subi r18, 0xFF ; 255 |
||
2134 | c44: 81 2f mov r24, r17 |
||
2135 | c46: 90 e0 ldi r25, 0x00 ; 0 |
||
2136 | c48: 8c 17 cp r24, r28 |
||
2137 | c4a: 9d 07 cpc r25, r29 |
||
2138 | c4c: 64 f3 brlt .-40 ; 0xc26 <write_ndigit_number_s_10th+0x80> |
||
2139 | if (pad) write_char((x++)+(y * 30), 10); // zero |
||
2140 | else write_char((x++)+(y * 30), 0); // blank |
||
2141 | } |
||
2142 | char rest = conv_array[len - 1]; |
||
2143 | c4e: f5 01 movw r30, r10 |
||
2144 | c50: eb 56 subi r30, 0x6B ; 107 |
||
2145 | c52: fd 4f sbci r31, 0xFD ; 253 |
||
2146 | c54: c0 80 ld r12, Z |
||
2147 | conv_array[len - 1] = 0; |
||
2148 | c56: 10 82 st Z, r1 |
||
2149 | if (len == 1) { |
||
2150 | c58: f1 e0 ldi r31, 0x01 ; 1 |
||
2151 | c5a: 9f 16 cp r9, r31 |
||
2152 | c5c: d1 f1 breq .+116 ; 0xcd2 <write_ndigit_number_s_10th+0x12c> |
||
2153 | write_char((x-1)+(y * 30), 10); // zero |
||
2154 | } else if (len == 2 && conv_array[0] == '-') { |
||
2155 | c5e: 22 e0 ldi r18, 0x02 ; 2 |
||
2156 | c60: 92 16 cp r9, r18 |
||
2157 | c62: 19 f1 breq .+70 ; 0xcaa <write_ndigit_number_s_10th+0x104> |
||
2158 | write_char((x-1)+(y * 30), 0x49); // minus |
||
2159 | write_char((x)+(y * 30), 10); // zero |
||
2160 | } else { |
||
2161 | write_ascii_string(x, y, conv_array); |
||
2162 | c64: 8d 2d mov r24, r13 |
||
2163 | c66: 68 2d mov r22, r8 |
||
2164 | c68: 46 e9 ldi r20, 0x96 ; 150 |
||
2165 | c6a: 52 e0 ldi r21, 0x02 ; 2 |
||
2166 | c6c: 0e 94 53 05 call 0xaa6 ; 0xaa6 <write_ascii_string> |
||
2167 | } |
||
2168 | x += len - 1; |
||
2169 | c70: 19 2d mov r17, r9 |
||
2170 | c72: 11 50 subi r17, 0x01 ; 1 |
||
2171 | c74: 1d 0d add r17, r13 |
||
2172 | write_char((x++)+(y * 30), 65); // decimal point |
||
2173 | c76: c7 01 movw r24, r14 |
||
2174 | c78: 81 0f add r24, r17 |
||
2175 | c7a: 91 1d adc r25, r1 |
||
2176 | c7c: 61 e4 ldi r22, 0x41 ; 65 |
||
2177 | c7e: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2178 | write_ascii_char((x++)+(y * 30), rest); // after dot |
||
2179 | c82: 1f 5f subi r17, 0xFF ; 255 |
||
2180 | c84: c7 01 movw r24, r14 |
||
2181 | c86: 81 0f add r24, r17 |
||
2182 | c88: 91 1d adc r25, r1 |
||
2183 | c8a: 6c 2d mov r22, r12 |
||
2184 | c8c: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
2185 | } |
||
2186 | c90: df 91 pop r29 |
||
2187 | c92: cf 91 pop r28 |
||
2188 | c94: 1f 91 pop r17 |
||
2189 | c96: 0f 91 pop r16 |
||
2190 | c98: ff 90 pop r15 |
||
2191 | c9a: ef 90 pop r14 |
||
2192 | c9c: df 90 pop r13 |
||
2193 | c9e: cf 90 pop r12 |
||
2194 | ca0: bf 90 pop r11 |
||
2195 | ca2: af 90 pop r10 |
||
2196 | ca4: 9f 90 pop r9 |
||
2197 | ca6: 8f 90 pop r8 |
||
2198 | ca8: 08 95 ret |
||
2199 | } |
||
2200 | char rest = conv_array[len - 1]; |
||
2201 | conv_array[len - 1] = 0; |
||
2202 | if (len == 1) { |
||
2203 | write_char((x-1)+(y * 30), 10); // zero |
||
2204 | } else if (len == 2 && conv_array[0] == '-') { |
||
2205 | caa: 80 91 96 02 lds r24, 0x0296 |
||
2206 | cae: 8d 32 cpi r24, 0x2D ; 45 |
||
2207 | cb0: c9 f6 brne .-78 ; 0xc64 <write_ndigit_number_s_10th+0xbe> |
||
2208 | write_char((x-1)+(y * 30), 0x49); // minus |
||
2209 | cb2: 0d 2d mov r16, r13 |
||
2210 | cb4: 10 e0 ldi r17, 0x00 ; 0 |
||
2211 | cb6: c7 01 movw r24, r14 |
||
2212 | cb8: 01 97 sbiw r24, 0x01 ; 1 |
||
2213 | cba: 80 0f add r24, r16 |
||
2214 | cbc: 91 1f adc r25, r17 |
||
2215 | cbe: 69 e4 ldi r22, 0x49 ; 73 |
||
2216 | cc0: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2217 | write_char((x)+(y * 30), 10); // zero |
||
2218 | cc4: c8 01 movw r24, r16 |
||
2219 | cc6: 8e 0d add r24, r14 |
||
2220 | cc8: 9f 1d adc r25, r15 |
||
2221 | cca: 6a e0 ldi r22, 0x0A ; 10 |
||
2222 | ccc: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2223 | cd0: cf cf rjmp .-98 ; 0xc70 <write_ndigit_number_s_10th+0xca> |
||
2224 | else write_char((x++)+(y * 30), 0); // blank |
||
2225 | } |
||
2226 | char rest = conv_array[len - 1]; |
||
2227 | conv_array[len - 1] = 0; |
||
2228 | if (len == 1) { |
||
2229 | write_char((x-1)+(y * 30), 10); // zero |
||
2230 | cd2: c7 01 movw r24, r14 |
||
2231 | cd4: 01 97 sbiw r24, 0x01 ; 1 |
||
2232 | cd6: 8d 0d add r24, r13 |
||
2233 | cd8: 91 1d adc r25, r1 |
||
2234 | cda: 6a e0 ldi r22, 0x0A ; 10 |
||
2235 | cdc: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2236 | ce0: c7 cf rjmp .-114 ; 0xc70 <write_ndigit_number_s_10th+0xca> |
||
2237 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2238 | */ |
||
2239 | void write_ndigit_number_s_10th(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2240 | itoa(number, conv_array, 10 ); |
||
2241 | uint8_t len = strlen(conv_array); |
||
2242 | for (uint8_t i = 0; i < length - len; i++) { |
||
2243 | ce2: 8e e1 ldi r24, 0x1E ; 30 |
||
2244 | ce4: 88 9e mul r8, r24 |
||
2245 | ce6: 70 01 movw r14, r0 |
||
2246 | ce8: 11 24 eor r1, r1 |
||
2247 | cea: b1 cf rjmp .-158 ; 0xc4e <write_ndigit_number_s_10th+0xa8> |
||
2248 | |||
2249 | 00000cec <write_ndigit_number_u_10th>: |
||
2250 | /** |
||
2251 | * Write a unsigned <number> at <x>/<y> to MAX7456 display memory as /10th of value |
||
2252 | * <length> represents the length to rightbound the number |
||
2253 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2254 | */ |
||
2255 | void write_ndigit_number_u_10th(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2256 | cec: 8f 92 push r8 |
||
2257 | cee: 9f 92 push r9 |
||
2258 | cf0: af 92 push r10 |
||
2259 | cf2: bf 92 push r11 |
||
2260 | cf4: cf 92 push r12 |
||
2261 | cf6: df 92 push r13 |
||
2262 | cf8: ef 92 push r14 |
||
2263 | cfa: ff 92 push r15 |
||
2264 | cfc: 0f 93 push r16 |
||
2265 | cfe: 1f 93 push r17 |
||
2266 | d00: cf 93 push r28 |
||
2267 | d02: df 93 push r29 |
||
2268 | d04: d8 2e mov r13, r24 |
||
2269 | d06: 86 2e mov r8, r22 |
||
2270 | d08: ca 01 movw r24, r20 |
||
2271 | d0a: e9 01 movw r28, r18 |
||
2272 | d0c: c0 2e mov r12, r16 |
||
2273 | itoa(number, conv_array, 10 ); |
||
2274 | d0e: 06 e9 ldi r16, 0x96 ; 150 |
||
2275 | d10: 12 e0 ldi r17, 0x02 ; 2 |
||
2276 | d12: b8 01 movw r22, r16 |
||
2277 | d14: 4a e0 ldi r20, 0x0A ; 10 |
||
2278 | d16: 50 e0 ldi r21, 0x00 ; 0 |
||
2279 | d18: 0e 94 cc 1c call 0x3998 ; 0x3998 <itoa> |
||
2280 | uint8_t len = strlen(conv_array); |
||
2281 | d1c: f8 01 movw r30, r16 |
||
2282 | d1e: 01 90 ld r0, Z+ |
||
2283 | d20: 00 20 and r0, r0 |
||
2284 | d22: e9 f7 brne .-6 ; 0xd1e <write_ndigit_number_u_10th+0x32> |
||
2285 | d24: 8f 01 movw r16, r30 |
||
2286 | d26: 01 50 subi r16, 0x01 ; 1 |
||
2287 | d28: 10 40 sbci r17, 0x00 ; 0 |
||
2288 | d2a: 06 59 subi r16, 0x96 ; 150 |
||
2289 | d2c: 12 40 sbci r17, 0x02 ; 2 |
||
2290 | d2e: 90 2e mov r9, r16 |
||
2291 | for (uint8_t i = 0; i < length - len; i++) { |
||
2292 | d30: a0 2e mov r10, r16 |
||
2293 | d32: bb 24 eor r11, r11 |
||
2294 | d34: ca 19 sub r28, r10 |
||
2295 | d36: db 09 sbc r29, r11 |
||
2296 | d38: 1c 16 cp r1, r28 |
||
2297 | d3a: 1d 06 cpc r1, r29 |
||
2298 | d3c: 0c f0 brlt .+2 ; 0xd40 <write_ndigit_number_u_10th+0x54> |
||
2299 | d3e: 74 c0 rjmp .+232 ; 0xe28 <write_ndigit_number_u_10th+0x13c> |
||
2300 | d40: 8e e1 ldi r24, 0x1E ; 30 |
||
2301 | d42: 88 9e mul r8, r24 |
||
2302 | d44: 70 01 movw r14, r0 |
||
2303 | d46: 11 24 eor r1, r1 |
||
2304 | d48: d3 94 inc r13 |
||
2305 | d4a: 10 e0 ldi r17, 0x00 ; 0 |
||
2306 | d4c: 10 c0 rjmp .+32 ; 0xd6e <write_ndigit_number_u_10th+0x82> |
||
2307 | if (pad) write_char((x++)+(y * 30), 10); // zero |
||
2308 | d4e: 97 01 movw r18, r14 |
||
2309 | d50: 28 0f add r18, r24 |
||
2310 | d52: 31 1d adc r19, r1 |
||
2311 | d54: c9 01 movw r24, r18 |
||
2312 | d56: 6a e0 ldi r22, 0x0A ; 10 |
||
2313 | d58: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2314 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2315 | */ |
||
2316 | void write_ndigit_number_u_10th(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2317 | itoa(number, conv_array, 10 ); |
||
2318 | uint8_t len = strlen(conv_array); |
||
2319 | for (uint8_t i = 0; i < length - len; i++) { |
||
2320 | d5c: 1f 5f subi r17, 0xFF ; 255 |
||
2321 | d5e: 2d 2d mov r18, r13 |
||
2322 | d60: 2f 5f subi r18, 0xFF ; 255 |
||
2323 | d62: 81 2f mov r24, r17 |
||
2324 | d64: 90 e0 ldi r25, 0x00 ; 0 |
||
2325 | d66: 8c 17 cp r24, r28 |
||
2326 | d68: 9d 07 cpc r25, r29 |
||
2327 | d6a: a4 f4 brge .+40 ; 0xd94 <write_ndigit_number_u_10th+0xa8> |
||
2328 | d6c: d2 2e mov r13, r18 |
||
2329 | d6e: 8d 2d mov r24, r13 |
||
2330 | d70: 81 50 subi r24, 0x01 ; 1 |
||
2331 | if (pad) write_char((x++)+(y * 30), 10); // zero |
||
2332 | d72: cc 20 and r12, r12 |
||
2333 | d74: 61 f7 brne .-40 ; 0xd4e <write_ndigit_number_u_10th+0x62> |
||
2334 | else write_char((x++)+(y * 30), 0); // blank |
||
2335 | d76: f7 01 movw r30, r14 |
||
2336 | d78: e8 0f add r30, r24 |
||
2337 | d7a: f1 1d adc r31, r1 |
||
2338 | d7c: cf 01 movw r24, r30 |
||
2339 | d7e: 60 e0 ldi r22, 0x00 ; 0 |
||
2340 | d80: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2341 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2342 | */ |
||
2343 | void write_ndigit_number_u_10th(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2344 | itoa(number, conv_array, 10 ); |
||
2345 | uint8_t len = strlen(conv_array); |
||
2346 | for (uint8_t i = 0; i < length - len; i++) { |
||
2347 | d84: 1f 5f subi r17, 0xFF ; 255 |
||
2348 | d86: 2d 2d mov r18, r13 |
||
2349 | d88: 2f 5f subi r18, 0xFF ; 255 |
||
2350 | d8a: 81 2f mov r24, r17 |
||
2351 | d8c: 90 e0 ldi r25, 0x00 ; 0 |
||
2352 | d8e: 8c 17 cp r24, r28 |
||
2353 | d90: 9d 07 cpc r25, r29 |
||
2354 | d92: 64 f3 brlt .-40 ; 0xd6c <write_ndigit_number_u_10th+0x80> |
||
2355 | if (pad) write_char((x++)+(y * 30), 10); // zero |
||
2356 | else write_char((x++)+(y * 30), 0); // blank |
||
2357 | } |
||
2358 | char rest = conv_array[len - 1]; |
||
2359 | d94: f5 01 movw r30, r10 |
||
2360 | d96: eb 56 subi r30, 0x6B ; 107 |
||
2361 | d98: fd 4f sbci r31, 0xFD ; 253 |
||
2362 | d9a: c0 80 ld r12, Z |
||
2363 | conv_array[len - 1] = 0; |
||
2364 | d9c: 10 82 st Z, r1 |
||
2365 | if (len == 1) { |
||
2366 | d9e: f1 e0 ldi r31, 0x01 ; 1 |
||
2367 | da0: 9f 16 cp r9, r31 |
||
2368 | da2: d1 f1 breq .+116 ; 0xe18 <write_ndigit_number_u_10th+0x12c> |
||
2369 | write_char((x-1)+(y * 30), 10); // zero |
||
2370 | } else if (len == 2 && conv_array[0] == '-') { |
||
2371 | da4: 22 e0 ldi r18, 0x02 ; 2 |
||
2372 | da6: 92 16 cp r9, r18 |
||
2373 | da8: 19 f1 breq .+70 ; 0xdf0 <write_ndigit_number_u_10th+0x104> |
||
2374 | write_char((x-1)+(y * 30), 0x49); // minus |
||
2375 | write_char((x)+(y * 30), 10); // zero |
||
2376 | } else { |
||
2377 | write_ascii_string(x, y, conv_array); |
||
2378 | daa: 8d 2d mov r24, r13 |
||
2379 | dac: 68 2d mov r22, r8 |
||
2380 | dae: 46 e9 ldi r20, 0x96 ; 150 |
||
2381 | db0: 52 e0 ldi r21, 0x02 ; 2 |
||
2382 | db2: 0e 94 53 05 call 0xaa6 ; 0xaa6 <write_ascii_string> |
||
2383 | } |
||
2384 | x += len - 1; |
||
2385 | db6: 19 2d mov r17, r9 |
||
2386 | db8: 11 50 subi r17, 0x01 ; 1 |
||
2387 | dba: 1d 0d add r17, r13 |
||
2388 | write_char((x++)+(y * 30), 65); // decimal point |
||
2389 | dbc: c7 01 movw r24, r14 |
||
2390 | dbe: 81 0f add r24, r17 |
||
2391 | dc0: 91 1d adc r25, r1 |
||
2392 | dc2: 61 e4 ldi r22, 0x41 ; 65 |
||
2393 | dc4: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2394 | write_ascii_char((x++)+(y * 30), rest); // after dot |
||
2395 | dc8: 1f 5f subi r17, 0xFF ; 255 |
||
2396 | dca: c7 01 movw r24, r14 |
||
2397 | dcc: 81 0f add r24, r17 |
||
2398 | dce: 91 1d adc r25, r1 |
||
2399 | dd0: 6c 2d mov r22, r12 |
||
2400 | dd2: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
2401 | } |
||
2402 | dd6: df 91 pop r29 |
||
2403 | dd8: cf 91 pop r28 |
||
2404 | dda: 1f 91 pop r17 |
||
2405 | ddc: 0f 91 pop r16 |
||
2406 | dde: ff 90 pop r15 |
||
2407 | de0: ef 90 pop r14 |
||
2408 | de2: df 90 pop r13 |
||
2409 | de4: cf 90 pop r12 |
||
2410 | de6: bf 90 pop r11 |
||
2411 | de8: af 90 pop r10 |
||
2412 | dea: 9f 90 pop r9 |
||
2413 | dec: 8f 90 pop r8 |
||
2414 | dee: 08 95 ret |
||
2415 | } |
||
2416 | char rest = conv_array[len - 1]; |
||
2417 | conv_array[len - 1] = 0; |
||
2418 | if (len == 1) { |
||
2419 | write_char((x-1)+(y * 30), 10); // zero |
||
2420 | } else if (len == 2 && conv_array[0] == '-') { |
||
2421 | df0: 80 91 96 02 lds r24, 0x0296 |
||
2422 | df4: 8d 32 cpi r24, 0x2D ; 45 |
||
2423 | df6: c9 f6 brne .-78 ; 0xdaa <write_ndigit_number_u_10th+0xbe> |
||
2424 | write_char((x-1)+(y * 30), 0x49); // minus |
||
2425 | df8: 0d 2d mov r16, r13 |
||
2426 | dfa: 10 e0 ldi r17, 0x00 ; 0 |
||
2427 | dfc: c7 01 movw r24, r14 |
||
2428 | dfe: 01 97 sbiw r24, 0x01 ; 1 |
||
2429 | e00: 80 0f add r24, r16 |
||
2430 | e02: 91 1f adc r25, r17 |
||
2431 | e04: 69 e4 ldi r22, 0x49 ; 73 |
||
2432 | e06: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2433 | write_char((x)+(y * 30), 10); // zero |
||
2434 | e0a: c8 01 movw r24, r16 |
||
2435 | e0c: 8e 0d add r24, r14 |
||
2436 | e0e: 9f 1d adc r25, r15 |
||
2437 | e10: 6a e0 ldi r22, 0x0A ; 10 |
||
2438 | e12: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2439 | e16: cf cf rjmp .-98 ; 0xdb6 <write_ndigit_number_u_10th+0xca> |
||
2440 | else write_char((x++)+(y * 30), 0); // blank |
||
2441 | } |
||
2442 | char rest = conv_array[len - 1]; |
||
2443 | conv_array[len - 1] = 0; |
||
2444 | if (len == 1) { |
||
2445 | write_char((x-1)+(y * 30), 10); // zero |
||
2446 | e18: c7 01 movw r24, r14 |
||
2447 | e1a: 01 97 sbiw r24, 0x01 ; 1 |
||
2448 | e1c: 8d 0d add r24, r13 |
||
2449 | e1e: 91 1d adc r25, r1 |
||
2450 | e20: 6a e0 ldi r22, 0x0A ; 10 |
||
2451 | e22: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2452 | e26: c7 cf rjmp .-114 ; 0xdb6 <write_ndigit_number_u_10th+0xca> |
||
2453 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2454 | */ |
||
2455 | void write_ndigit_number_u_10th(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2456 | itoa(number, conv_array, 10 ); |
||
2457 | uint8_t len = strlen(conv_array); |
||
2458 | for (uint8_t i = 0; i < length - len; i++) { |
||
2459 | e28: 8e e1 ldi r24, 0x1E ; 30 |
||
2460 | e2a: 88 9e mul r8, r24 |
||
2461 | e2c: 70 01 movw r14, r0 |
||
2462 | e2e: 11 24 eor r1, r1 |
||
2463 | e30: b1 cf rjmp .-158 ; 0xd94 <write_ndigit_number_u_10th+0xa8> |
||
2464 | |||
2465 | 00000e32 <write_ndigit_number_s>: |
||
2466 | /** |
||
2467 | * Write a signed <number> at <x>/<y> to MAX7456 display memory |
||
2468 | * <length> represents the length to rightbound the number |
||
2469 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2470 | */ |
||
2471 | void write_ndigit_number_s(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2472 | e32: af 92 push r10 |
||
2473 | e34: bf 92 push r11 |
||
2474 | e36: cf 92 push r12 |
||
2475 | e38: df 92 push r13 |
||
2476 | e3a: ef 92 push r14 |
||
2477 | e3c: ff 92 push r15 |
||
2478 | e3e: 0f 93 push r16 |
||
2479 | e40: 1f 93 push r17 |
||
2480 | e42: cf 93 push r28 |
||
2481 | e44: df 93 push r29 |
||
2482 | e46: b8 2e mov r11, r24 |
||
2483 | e48: a6 2e mov r10, r22 |
||
2484 | e4a: ca 01 movw r24, r20 |
||
2485 | e4c: 12 2f mov r17, r18 |
||
2486 | e4e: f3 2e mov r15, r19 |
||
2487 | itoa(number, conv_array, 10 ); |
||
2488 | e50: a6 e9 ldi r26, 0x96 ; 150 |
||
2489 | e52: ca 2e mov r12, r26 |
||
2490 | e54: a2 e0 ldi r26, 0x02 ; 2 |
||
2491 | e56: da 2e mov r13, r26 |
||
2492 | e58: b6 01 movw r22, r12 |
||
2493 | e5a: 4a e0 ldi r20, 0x0A ; 10 |
||
2494 | e5c: 50 e0 ldi r21, 0x00 ; 0 |
||
2495 | e5e: 0e 94 cc 1c call 0x3998 ; 0x3998 <itoa> |
||
2496 | e62: c1 2f mov r28, r17 |
||
2497 | e64: df 2d mov r29, r15 |
||
2498 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2499 | if (pad) write_char((x++)+(y * 30), 10); |
||
2500 | e66: 8e e1 ldi r24, 0x1E ; 30 |
||
2501 | e68: a8 9e mul r10, r24 |
||
2502 | e6a: 70 01 movw r14, r0 |
||
2503 | e6c: 11 24 eor r1, r1 |
||
2504 | e6e: 10 e0 ldi r17, 0x00 ; 0 |
||
2505 | * <length> represents the length to rightbound the number |
||
2506 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2507 | */ |
||
2508 | void write_ndigit_number_s(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2509 | itoa(number, conv_array, 10 ); |
||
2510 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2511 | e70: 41 2f mov r20, r17 |
||
2512 | e72: 4b 0d add r20, r11 |
||
2513 | e74: f6 01 movw r30, r12 |
||
2514 | e76: 01 90 ld r0, Z+ |
||
2515 | e78: 00 20 and r0, r0 |
||
2516 | e7a: e9 f7 brne .-6 ; 0xe76 <write_ndigit_number_s+0x44> |
||
2517 | e7c: ce 01 movw r24, r28 |
||
2518 | e7e: 8e 1b sub r24, r30 |
||
2519 | e80: 9f 0b sbc r25, r31 |
||
2520 | e82: 21 2f mov r18, r17 |
||
2521 | e84: 30 e0 ldi r19, 0x00 ; 0 |
||
2522 | e86: 89 56 subi r24, 0x69 ; 105 |
||
2523 | e88: 9d 4f sbci r25, 0xFD ; 253 |
||
2524 | e8a: 28 17 cp r18, r24 |
||
2525 | e8c: 39 07 cpc r19, r25 |
||
2526 | e8e: 90 f4 brcc .+36 ; 0xeb4 <write_ndigit_number_s+0x82> |
||
2527 | if (pad) write_char((x++)+(y * 30), 10); |
||
2528 | e90: 00 23 and r16, r16 |
||
2529 | e92: 41 f0 breq .+16 ; 0xea4 <write_ndigit_number_s+0x72> |
||
2530 | e94: c7 01 movw r24, r14 |
||
2531 | e96: 84 0f add r24, r20 |
||
2532 | e98: 91 1d adc r25, r1 |
||
2533 | e9a: 6a e0 ldi r22, 0x0A ; 10 |
||
2534 | e9c: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2535 | * <length> represents the length to rightbound the number |
||
2536 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2537 | */ |
||
2538 | void write_ndigit_number_s(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2539 | itoa(number, conv_array, 10 ); |
||
2540 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2541 | ea0: 1f 5f subi r17, 0xFF ; 255 |
||
2542 | ea2: e6 cf rjmp .-52 ; 0xe70 <write_ndigit_number_s+0x3e> |
||
2543 | if (pad) write_char((x++)+(y * 30), 10); |
||
2544 | else write_ascii_char((x++)+(y * 30), 0); |
||
2545 | ea4: c7 01 movw r24, r14 |
||
2546 | ea6: 84 0f add r24, r20 |
||
2547 | ea8: 91 1d adc r25, r1 |
||
2548 | eaa: 60 e0 ldi r22, 0x00 ; 0 |
||
2549 | eac: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
2550 | * <length> represents the length to rightbound the number |
||
2551 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2552 | */ |
||
2553 | void write_ndigit_number_s(uint8_t x, uint8_t y, int16_t number, int16_t length, uint8_t pad) { |
||
2554 | itoa(number, conv_array, 10 ); |
||
2555 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2556 | eb0: 1f 5f subi r17, 0xFF ; 255 |
||
2557 | eb2: de cf rjmp .-68 ; 0xe70 <write_ndigit_number_s+0x3e> |
||
2558 | if (pad) write_char((x++)+(y * 30), 10); |
||
2559 | else write_ascii_char((x++)+(y * 30), 0); |
||
2560 | } |
||
2561 | write_ascii_string(x, y, conv_array); |
||
2562 | eb4: 84 2f mov r24, r20 |
||
2563 | eb6: 6a 2d mov r22, r10 |
||
2564 | eb8: 46 e9 ldi r20, 0x96 ; 150 |
||
2565 | eba: 52 e0 ldi r21, 0x02 ; 2 |
||
2566 | ebc: 0e 94 53 05 call 0xaa6 ; 0xaa6 <write_ascii_string> |
||
2567 | } |
||
2568 | ec0: df 91 pop r29 |
||
2569 | ec2: cf 91 pop r28 |
||
2570 | ec4: 1f 91 pop r17 |
||
2571 | ec6: 0f 91 pop r16 |
||
2572 | ec8: ff 90 pop r15 |
||
2573 | eca: ef 90 pop r14 |
||
2574 | ecc: df 90 pop r13 |
||
2575 | ece: cf 90 pop r12 |
||
2576 | ed0: bf 90 pop r11 |
||
2577 | ed2: af 90 pop r10 |
||
2578 | ed4: 08 95 ret |
||
2579 | |||
2580 | 00000ed6 <write_ndigit_number_u>: |
||
2581 | /** |
||
2582 | * Write a unsigned <number> at <x>/<y> to MAX7456 display memory |
||
2583 | * <length> represents the length to rightbound the number |
||
2584 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2585 | */ |
||
2586 | void write_ndigit_number_u(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2587 | ed6: af 92 push r10 |
||
2588 | ed8: bf 92 push r11 |
||
2589 | eda: cf 92 push r12 |
||
2590 | edc: df 92 push r13 |
||
2591 | ede: ef 92 push r14 |
||
2592 | ee0: ff 92 push r15 |
||
2593 | ee2: 0f 93 push r16 |
||
2594 | ee4: 1f 93 push r17 |
||
2595 | ee6: cf 93 push r28 |
||
2596 | ee8: df 93 push r29 |
||
2597 | eea: b8 2e mov r11, r24 |
||
2598 | eec: a6 2e mov r10, r22 |
||
2599 | eee: ca 01 movw r24, r20 |
||
2600 | ef0: 12 2f mov r17, r18 |
||
2601 | ef2: f3 2e mov r15, r19 |
||
2602 | itoa(number, conv_array, 10 ); |
||
2603 | ef4: b6 e9 ldi r27, 0x96 ; 150 |
||
2604 | ef6: cb 2e mov r12, r27 |
||
2605 | ef8: b2 e0 ldi r27, 0x02 ; 2 |
||
2606 | efa: db 2e mov r13, r27 |
||
2607 | efc: b6 01 movw r22, r12 |
||
2608 | efe: 4a e0 ldi r20, 0x0A ; 10 |
||
2609 | f00: 50 e0 ldi r21, 0x00 ; 0 |
||
2610 | f02: 0e 94 cc 1c call 0x3998 ; 0x3998 <itoa> |
||
2611 | f06: c1 2f mov r28, r17 |
||
2612 | f08: df 2d mov r29, r15 |
||
2613 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2614 | if (pad) write_char((x++)+(y * 30), 10); |
||
2615 | f0a: 8e e1 ldi r24, 0x1E ; 30 |
||
2616 | f0c: a8 9e mul r10, r24 |
||
2617 | f0e: 70 01 movw r14, r0 |
||
2618 | f10: 11 24 eor r1, r1 |
||
2619 | f12: 10 e0 ldi r17, 0x00 ; 0 |
||
2620 | * <length> represents the length to rightbound the number |
||
2621 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2622 | */ |
||
2623 | void write_ndigit_number_u(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2624 | itoa(number, conv_array, 10 ); |
||
2625 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2626 | f14: 41 2f mov r20, r17 |
||
2627 | f16: 4b 0d add r20, r11 |
||
2628 | f18: f6 01 movw r30, r12 |
||
2629 | f1a: 01 90 ld r0, Z+ |
||
2630 | f1c: 00 20 and r0, r0 |
||
2631 | f1e: e9 f7 brne .-6 ; 0xf1a <write_ndigit_number_u+0x44> |
||
2632 | f20: ce 01 movw r24, r28 |
||
2633 | f22: 8e 1b sub r24, r30 |
||
2634 | f24: 9f 0b sbc r25, r31 |
||
2635 | f26: 21 2f mov r18, r17 |
||
2636 | f28: 30 e0 ldi r19, 0x00 ; 0 |
||
2637 | f2a: 89 56 subi r24, 0x69 ; 105 |
||
2638 | f2c: 9d 4f sbci r25, 0xFD ; 253 |
||
2639 | f2e: 28 17 cp r18, r24 |
||
2640 | f30: 39 07 cpc r19, r25 |
||
2641 | f32: 90 f4 brcc .+36 ; 0xf58 <write_ndigit_number_u+0x82> |
||
2642 | if (pad) write_char((x++)+(y * 30), 10); |
||
2643 | f34: 00 23 and r16, r16 |
||
2644 | f36: 41 f0 breq .+16 ; 0xf48 <write_ndigit_number_u+0x72> |
||
2645 | f38: c7 01 movw r24, r14 |
||
2646 | f3a: 84 0f add r24, r20 |
||
2647 | f3c: 91 1d adc r25, r1 |
||
2648 | f3e: 6a e0 ldi r22, 0x0A ; 10 |
||
2649 | f40: 0e 94 f1 04 call 0x9e2 ; 0x9e2 <write_char> |
||
2650 | * <length> represents the length to rightbound the number |
||
2651 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2652 | */ |
||
2653 | void write_ndigit_number_u(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2654 | itoa(number, conv_array, 10 ); |
||
2655 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2656 | f44: 1f 5f subi r17, 0xFF ; 255 |
||
2657 | f46: e6 cf rjmp .-52 ; 0xf14 <write_ndigit_number_u+0x3e> |
||
2658 | if (pad) write_char((x++)+(y * 30), 10); |
||
2659 | else write_ascii_char((x++)+(y * 30), 0); |
||
2660 | f48: c7 01 movw r24, r14 |
||
2661 | f4a: 84 0f add r24, r20 |
||
2662 | f4c: 91 1d adc r25, r1 |
||
2663 | f4e: 60 e0 ldi r22, 0x00 ; 0 |
||
2664 | f50: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
2665 | * <length> represents the length to rightbound the number |
||
2666 | * <pad> = 1 will cause blank spaced to be filled up with zeros e.g. 007 instead of 7 |
||
2667 | */ |
||
2668 | void write_ndigit_number_u(uint8_t x, uint8_t y, uint16_t number, int16_t length, uint8_t pad) { |
||
2669 | itoa(number, conv_array, 10 ); |
||
2670 | for (uint8_t i = 0; i < length - strlen(conv_array); i++) { |
||
2671 | f54: 1f 5f subi r17, 0xFF ; 255 |
||
2672 | f56: de cf rjmp .-68 ; 0xf14 <write_ndigit_number_u+0x3e> |
||
2673 | if (pad) write_char((x++)+(y * 30), 10); |
||
2674 | else write_ascii_char((x++)+(y * 30), 0); |
||
2675 | } |
||
2676 | write_ascii_string(x, y, conv_array); |
||
2677 | f58: 84 2f mov r24, r20 |
||
2678 | f5a: 6a 2d mov r22, r10 |
||
2679 | f5c: 46 e9 ldi r20, 0x96 ; 150 |
||
2680 | f5e: 52 e0 ldi r21, 0x02 ; 2 |
||
2681 | f60: 0e 94 53 05 call 0xaa6 ; 0xaa6 <write_ascii_string> |
||
2682 | } |
||
2683 | f64: df 91 pop r29 |
||
2684 | f66: cf 91 pop r28 |
||
2685 | f68: 1f 91 pop r17 |
||
2686 | f6a: 0f 91 pop r16 |
||
2687 | f6c: ff 90 pop r15 |
||
2688 | f6e: ef 90 pop r14 |
||
2689 | f70: df 90 pop r13 |
||
2690 | f72: cf 90 pop r12 |
||
2691 | f74: bf 90 pop r11 |
||
2692 | f76: af 90 pop r10 |
||
2693 | f78: 08 95 ret |
||
2694 | |||
2695 | 00000f7a <write_gps_pos>: |
||
2696 | } |
||
2697 | |||
2698 | /** |
||
2699 | * wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude |
||
2700 | */ |
||
2701 | void write_gps_pos(uint8_t x, uint8_t y, int32_t position) { |
||
2702 | f7a: 7f 92 push r7 |
||
2703 | f7c: 8f 92 push r8 |
||
2704 | f7e: 9f 92 push r9 |
||
2705 | f80: af 92 push r10 |
||
2706 | f82: bf 92 push r11 |
||
2707 | f84: cf 92 push r12 |
||
2708 | f86: df 92 push r13 |
||
2709 | f88: ef 92 push r14 |
||
2710 | f8a: ff 92 push r15 |
||
2711 | f8c: 0f 93 push r16 |
||
2712 | f8e: 1f 93 push r17 |
||
2713 | f90: 16 2f mov r17, r22 |
||
2714 | f92: 69 01 movw r12, r18 |
||
2715 | f94: 7a 01 movw r14, r20 |
||
2716 | if (position < 0) { |
||
2717 | f96: 57 fd sbrc r21, 7 |
||
2718 | f98: 5e c0 rjmp .+188 ; 0x1056 <write_gps_pos+0xdc> |
||
2719 | position ^= ~0; |
||
2720 | position++; |
||
2721 | write_char_xy(x++, y, 0x49); // minus |
||
2722 | } else { |
||
2723 | write_char_xy(x++, y, 0); // clear ('+' would be nice, maybe later) |
||
2724 | f9a: 78 2e mov r7, r24 |
||
2725 | f9c: 73 94 inc r7 |
||
2726 | f9e: 40 e0 ldi r20, 0x00 ; 0 |
||
2727 | fa0: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
2728 | } |
||
2729 | write_ndigit_number_u(x, y, (uint16_t) (position / (int32_t) 10000000), 3, 1); |
||
2730 | fa4: c7 01 movw r24, r14 |
||
2731 | fa6: b6 01 movw r22, r12 |
||
2732 | fa8: 20 e8 ldi r18, 0x80 ; 128 |
||
2733 | faa: 36 e9 ldi r19, 0x96 ; 150 |
||
2734 | fac: 48 e9 ldi r20, 0x98 ; 152 |
||
2735 | fae: 50 e0 ldi r21, 0x00 ; 0 |
||
2736 | fb0: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
2737 | fb4: 87 2d mov r24, r7 |
||
2738 | fb6: 61 2f mov r22, r17 |
||
2739 | fb8: a9 01 movw r20, r18 |
||
2740 | fba: 23 e0 ldi r18, 0x03 ; 3 |
||
2741 | fbc: 30 e0 ldi r19, 0x00 ; 0 |
||
2742 | fbe: 01 e0 ldi r16, 0x01 ; 1 |
||
2743 | fc0: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
2744 | write_char_xy(x + 3, y, 65); // decimal point |
||
2745 | fc4: 87 2d mov r24, r7 |
||
2746 | fc6: 8d 5f subi r24, 0xFD ; 253 |
||
2747 | fc8: 61 2f mov r22, r17 |
||
2748 | fca: 41 e4 ldi r20, 0x41 ; 65 |
||
2749 | fcc: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
2750 | position = position - ((position / (int32_t) 10000000) * (int32_t) 10000000); |
||
2751 | fd0: c7 01 movw r24, r14 |
||
2752 | fd2: b6 01 movw r22, r12 |
||
2753 | fd4: 20 e8 ldi r18, 0x80 ; 128 |
||
2754 | fd6: 36 e9 ldi r19, 0x96 ; 150 |
||
2755 | fd8: 48 e9 ldi r20, 0x98 ; 152 |
||
2756 | fda: 50 e0 ldi r21, 0x00 ; 0 |
||
2757 | fdc: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
2758 | fe0: 6b 01 movw r12, r22 |
||
2759 | fe2: 7c 01 movw r14, r24 |
||
2760 | write_ndigit_number_u(x + 4, y, (uint16_t) (position / (int32_t) 1000), 4, 1); |
||
2761 | fe4: c7 01 movw r24, r14 |
||
2762 | fe6: b6 01 movw r22, r12 |
||
2763 | fe8: 28 ee ldi r18, 0xE8 ; 232 |
||
2764 | fea: 33 e0 ldi r19, 0x03 ; 3 |
||
2765 | fec: 40 e0 ldi r20, 0x00 ; 0 |
||
2766 | fee: 50 e0 ldi r21, 0x00 ; 0 |
||
2767 | ff0: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
2768 | ff4: 49 01 movw r8, r18 |
||
2769 | ff6: 87 2d mov r24, r7 |
||
2770 | ff8: 8c 5f subi r24, 0xFC ; 252 |
||
2771 | ffa: 61 2f mov r22, r17 |
||
2772 | ffc: a9 01 movw r20, r18 |
||
2773 | ffe: 24 e0 ldi r18, 0x04 ; 4 |
||
2774 | 1000: 30 e0 ldi r19, 0x00 ; 0 |
||
2775 | 1002: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
2776 | position = position - ((uint16_t) (position / (int32_t) 1000) * (int32_t) 1000); |
||
2777 | write_ndigit_number_u(x + 8, y, (uint16_t) position, 3, 1); |
||
2778 | 1006: aa 24 eor r10, r10 |
||
2779 | 1008: bb 24 eor r11, r11 |
||
2780 | 100a: c5 01 movw r24, r10 |
||
2781 | 100c: b4 01 movw r22, r8 |
||
2782 | 100e: 28 e1 ldi r18, 0x18 ; 24 |
||
2783 | 1010: 3c ef ldi r19, 0xFC ; 252 |
||
2784 | 1012: 4f ef ldi r20, 0xFF ; 255 |
||
2785 | 1014: 5f ef ldi r21, 0xFF ; 255 |
||
2786 | 1016: 0e 94 49 1c call 0x3892 ; 0x3892 <__mulsi3> |
||
2787 | 101a: c6 0e add r12, r22 |
||
2788 | 101c: d7 1e adc r13, r23 |
||
2789 | 101e: e8 1e adc r14, r24 |
||
2790 | 1020: f9 1e adc r15, r25 |
||
2791 | 1022: 87 2d mov r24, r7 |
||
2792 | 1024: 88 5f subi r24, 0xF8 ; 248 |
||
2793 | 1026: 61 2f mov r22, r17 |
||
2794 | 1028: a6 01 movw r20, r12 |
||
2795 | 102a: 23 e0 ldi r18, 0x03 ; 3 |
||
2796 | 102c: 30 e0 ldi r19, 0x00 ; 0 |
||
2797 | 102e: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
2798 | write_char_xy(x + 11, y, 0xD0); // degree symbol |
||
2799 | 1032: 87 2d mov r24, r7 |
||
2800 | 1034: 85 5f subi r24, 0xF5 ; 245 |
||
2801 | 1036: 61 2f mov r22, r17 |
||
2802 | 1038: 40 ed ldi r20, 0xD0 ; 208 |
||
2803 | 103a: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
2804 | } |
||
2805 | 103e: 1f 91 pop r17 |
||
2806 | 1040: 0f 91 pop r16 |
||
2807 | 1042: ff 90 pop r15 |
||
2808 | 1044: ef 90 pop r14 |
||
2809 | 1046: df 90 pop r13 |
||
2810 | 1048: cf 90 pop r12 |
||
2811 | 104a: bf 90 pop r11 |
||
2812 | 104c: af 90 pop r10 |
||
2813 | 104e: 9f 90 pop r9 |
||
2814 | 1050: 8f 90 pop r8 |
||
2815 | 1052: 7f 90 pop r7 |
||
2816 | 1054: 08 95 ret |
||
2817 | /** |
||
2818 | * wirte a <position> at <x>/<y> assuming it is a gps position for long-/latitude |
||
2819 | */ |
||
2820 | void write_gps_pos(uint8_t x, uint8_t y, int32_t position) { |
||
2821 | if (position < 0) { |
||
2822 | position ^= ~0; |
||
2823 | 1056: c0 94 com r12 |
||
2824 | 1058: d0 94 com r13 |
||
2825 | 105a: e0 94 com r14 |
||
2826 | 105c: f0 94 com r15 |
||
2827 | position++; |
||
2828 | 105e: 08 94 sec |
||
2829 | 1060: c1 1c adc r12, r1 |
||
2830 | 1062: d1 1c adc r13, r1 |
||
2831 | 1064: e1 1c adc r14, r1 |
||
2832 | 1066: f1 1c adc r15, r1 |
||
2833 | write_char_xy(x++, y, 0x49); // minus |
||
2834 | 1068: 78 2e mov r7, r24 |
||
2835 | 106a: 73 94 inc r7 |
||
2836 | 106c: 49 e4 ldi r20, 0x49 ; 73 |
||
2837 | 106e: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
2838 | 1072: 98 cf rjmp .-208 ; 0xfa4 <write_gps_pos+0x2a> |
||
2839 | |||
2840 | 00001074 <write_time>: |
||
2841 | } |
||
2842 | |||
2843 | /** |
||
2844 | * write <seconds> as human readable time at <x>/<y> to MAX7456 display mem |
||
2845 | */ |
||
2846 | void write_time(uint8_t x, uint8_t y, uint16_t seconds) { |
||
2847 | 1074: bf 92 push r11 |
||
2848 | 1076: cf 92 push r12 |
||
2849 | 1078: df 92 push r13 |
||
2850 | 107a: ef 92 push r14 |
||
2851 | 107c: ff 92 push r15 |
||
2852 | 107e: 0f 93 push r16 |
||
2853 | 1080: 1f 93 push r17 |
||
2854 | 1082: 18 2f mov r17, r24 |
||
2855 | 1084: b6 2e mov r11, r22 |
||
2856 | 1086: 6a 01 movw r12, r20 |
||
2857 | uint16_t min = seconds / 60; |
||
2858 | 1088: ca 01 movw r24, r20 |
||
2859 | 108a: 6c e3 ldi r22, 0x3C ; 60 |
||
2860 | 108c: 70 e0 ldi r23, 0x00 ; 0 |
||
2861 | 108e: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
2862 | 1092: 7b 01 movw r14, r22 |
||
2863 | seconds -= min * 60; |
||
2864 | write_ndigit_number_u(x, y, min, 3, 0); |
||
2865 | 1094: 81 2f mov r24, r17 |
||
2866 | 1096: 6b 2d mov r22, r11 |
||
2867 | 1098: a7 01 movw r20, r14 |
||
2868 | 109a: 23 e0 ldi r18, 0x03 ; 3 |
||
2869 | 109c: 30 e0 ldi r19, 0x00 ; 0 |
||
2870 | 109e: 00 e0 ldi r16, 0x00 ; 0 |
||
2871 | 10a0: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
2872 | write_char_xy(x + 3, y, 68); |
||
2873 | 10a4: 81 2f mov r24, r17 |
||
2874 | 10a6: 8d 5f subi r24, 0xFD ; 253 |
||
2875 | 10a8: 6b 2d mov r22, r11 |
||
2876 | 10aa: 44 e4 ldi r20, 0x44 ; 68 |
||
2877 | 10ac: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
2878 | write_ndigit_number_u(x + 4, y, seconds, 2, 1); |
||
2879 | 10b0: 8c e3 ldi r24, 0x3C ; 60 |
||
2880 | 10b2: 90 e0 ldi r25, 0x00 ; 0 |
||
2881 | 10b4: 9c 01 movw r18, r24 |
||
2882 | 10b6: e2 9e mul r14, r18 |
||
2883 | 10b8: c0 01 movw r24, r0 |
||
2884 | 10ba: e3 9e mul r14, r19 |
||
2885 | 10bc: 90 0d add r25, r0 |
||
2886 | 10be: f2 9e mul r15, r18 |
||
2887 | 10c0: 90 0d add r25, r0 |
||
2888 | 10c2: 11 24 eor r1, r1 |
||
2889 | 10c4: c8 1a sub r12, r24 |
||
2890 | 10c6: d9 0a sbc r13, r25 |
||
2891 | 10c8: 81 2f mov r24, r17 |
||
2892 | 10ca: 8c 5f subi r24, 0xFC ; 252 |
||
2893 | 10cc: 6b 2d mov r22, r11 |
||
2894 | 10ce: a6 01 movw r20, r12 |
||
2895 | 10d0: 22 e0 ldi r18, 0x02 ; 2 |
||
2896 | 10d2: 30 e0 ldi r19, 0x00 ; 0 |
||
2897 | 10d4: 01 e0 ldi r16, 0x01 ; 1 |
||
2898 | 10d6: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
2899 | } |
||
2900 | 10da: 1f 91 pop r17 |
||
2901 | 10dc: 0f 91 pop r16 |
||
2902 | 10de: ff 90 pop r15 |
||
2903 | 10e0: ef 90 pop r14 |
||
2904 | 10e2: df 90 pop r13 |
||
2905 | 10e4: cf 90 pop r12 |
||
2906 | 10e6: bf 90 pop r11 |
||
2907 | 10e8: 08 95 ret |
||
2908 | |||
2909 | 000010ea <clear>: |
||
2910 | /*uint16_t memory_address = 0; |
||
2911 | for (unsigned int a = 0; a < 480; a++) { |
||
2912 | write_char(memory_address++, 0); |
||
2913 | }*/ |
||
2914 | // clear all display-mem (DMM) |
||
2915 | spi_send_byte(0x04, 0b01000100); |
||
2916 | 10ea: 84 e0 ldi r24, 0x04 ; 4 |
||
2917 | 10ec: 64 e4 ldi r22, 0x44 ; 68 |
||
2918 | 10ee: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
2919 | can be achieved. |
||
2920 | */ |
||
2921 | void |
||
2922 | _delay_loop_1(uint8_t __count) |
||
2923 | { |
||
2924 | __asm__ volatile ( |
||
2925 | 10f2: 8a e6 ldi r24, 0x6A ; 106 |
||
2926 | 10f4: 8a 95 dec r24 |
||
2927 | 10f6: f1 f7 brne .-4 ; 0x10f4 <clear+0xa> |
||
2928 | |||
2929 | // clearing takes 12uS according to maxim so lets wait longer |
||
2930 | _delay_us(20); |
||
2931 | } |
||
2932 | 10f8: 08 95 ret |
||
2933 | |||
2934 | 000010fa <write_char_att>: |
||
2935 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
2936 | |||
2937 | /** |
||
2938 | * write a character <attribute> to <address> of MAX7456 display memory |
||
2939 | */ |
||
2940 | void write_char_att(uint16_t address, char attribute) { |
||
2941 | 10fa: 0f 93 push r16 |
||
2942 | 10fc: 1f 93 push r17 |
||
2943 | 10fe: 18 2f mov r17, r24 |
||
2944 | 1100: 06 2f mov r16, r22 |
||
2945 | // the only important part is that the DMAH[1] is set |
||
2946 | // so we add 2 which binary is the 2nd lowest byte |
||
2947 | spi_send_byte(0x05, ((address & 0xFF00) >> 8) | 2); // DMAH |
||
2948 | 1102: 92 60 ori r25, 0x02 ; 2 |
||
2949 | 1104: 85 e0 ldi r24, 0x05 ; 5 |
||
2950 | 1106: 69 2f mov r22, r25 |
||
2951 | 1108: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
2952 | spi_send_byte(0x06, (address & 0x00FF)); // DMAL |
||
2953 | 110c: 86 e0 ldi r24, 0x06 ; 6 |
||
2954 | 110e: 61 2f mov r22, r17 |
||
2955 | 1110: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
2956 | spi_send_byte(0x07, attribute); // DMDI |
||
2957 | 1114: 87 e0 ldi r24, 0x07 ; 7 |
||
2958 | 1116: 60 2f mov r22, r16 |
||
2959 | 1118: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
2960 | } |
||
2961 | 111c: 1f 91 pop r17 |
||
2962 | 111e: 0f 91 pop r16 |
||
2963 | 1120: 08 95 ret |
||
2964 | |||
2965 | 00001122 <write_char_att_xy>: |
||
2966 | /** |
||
2967 | * write a character <attribute> at <x>/<y> to MAX7456 display memory |
||
2968 | */ |
||
2969 | void write_char_att_xy(uint8_t x, uint8_t y, char attribute) { |
||
2970 | uint16_t address = y * 30 + x; |
||
2971 | write_char_att(address, attribute); |
||
2972 | 1122: 9e e1 ldi r25, 0x1E ; 30 |
||
2973 | 1124: 69 9f mul r22, r25 |
||
2974 | 1126: b0 01 movw r22, r0 |
||
2975 | 1128: 11 24 eor r1, r1 |
||
2976 | 112a: 9b 01 movw r18, r22 |
||
2977 | 112c: 28 0f add r18, r24 |
||
2978 | 112e: 31 1d adc r19, r1 |
||
2979 | 1130: c9 01 movw r24, r18 |
||
2980 | 1132: 64 2f mov r22, r20 |
||
2981 | 1134: 0e 94 7d 08 call 0x10fa ; 0x10fa <write_char_att> |
||
2982 | } |
||
2983 | 1138: 08 95 ret |
||
2984 | |||
2985 | 0000113a <heading_conv>: |
||
2986 | * ##########################################################################*/ |
||
2987 | |||
2988 | /** |
||
2989 | * convert the <heading> gotton from NC into an index |
||
2990 | */ |
||
2991 | uint8_t heading_conv(uint16_t heading) { |
||
2992 | 113a: 9c 01 movw r18, r24 |
||
2993 | if (heading > 23 && heading < 68) { |
||
2994 | 113c: 48 97 sbiw r24, 0x18 ; 24 |
||
2995 | 113e: 8c 97 sbiw r24, 0x2c ; 44 |
||
2996 | 1140: 00 f1 brcs .+64 ; 0x1182 <heading_conv+0x48> |
||
2997 | //direction = "NE"; |
||
2998 | return 0; |
||
2999 | } else if (heading > 67 && heading < 113) { |
||
3000 | 1142: c9 01 movw r24, r18 |
||
3001 | 1144: 84 54 subi r24, 0x44 ; 68 |
||
3002 | 1146: 90 40 sbci r25, 0x00 ; 0 |
||
3003 | 1148: 8d 97 sbiw r24, 0x2d ; 45 |
||
3004 | 114a: e8 f0 brcs .+58 ; 0x1186 <heading_conv+0x4c> |
||
3005 | //direction = "E "; |
||
3006 | return 1; |
||
3007 | } else if (heading > 112 && heading < 158) { |
||
3008 | 114c: c9 01 movw r24, r18 |
||
3009 | 114e: 81 57 subi r24, 0x71 ; 113 |
||
3010 | 1150: 90 40 sbci r25, 0x00 ; 0 |
||
3011 | 1152: 8d 97 sbiw r24, 0x2d ; 45 |
||
3012 | 1154: e0 f0 brcs .+56 ; 0x118e <heading_conv+0x54> |
||
3013 | //direction = "SE"; |
||
3014 | return 2; |
||
3015 | } else if (heading > 157 && heading < 203) { |
||
3016 | 1156: c9 01 movw r24, r18 |
||
3017 | 1158: 8e 59 subi r24, 0x9E ; 158 |
||
3018 | 115a: 90 40 sbci r25, 0x00 ; 0 |
||
3019 | 115c: 8d 97 sbiw r24, 0x2d ; 45 |
||
3020 | 115e: a8 f0 brcs .+42 ; 0x118a <heading_conv+0x50> |
||
3021 | //direction = "S "; |
||
3022 | return 3; |
||
3023 | } else if (heading > 202 && heading < 248) { |
||
3024 | 1160: c9 01 movw r24, r18 |
||
3025 | 1162: 8b 5c subi r24, 0xCB ; 203 |
||
3026 | 1164: 90 40 sbci r25, 0x00 ; 0 |
||
3027 | 1166: 8d 97 sbiw r24, 0x2d ; 45 |
||
3028 | 1168: a0 f0 brcs .+40 ; 0x1192 <heading_conv+0x58> |
||
3029 | //direction = "SW"; |
||
3030 | return 4; |
||
3031 | } else if (heading > 247 && heading < 293) { |
||
3032 | 116a: c9 01 movw r24, r18 |
||
3033 | 116c: 88 5f subi r24, 0xF8 ; 248 |
||
3034 | 116e: 90 40 sbci r25, 0x00 ; 0 |
||
3035 | 1170: 8d 97 sbiw r24, 0x2d ; 45 |
||
3036 | 1172: 98 f0 brcs .+38 ; 0x119a <heading_conv+0x60> |
||
3037 | //direction = "W "; |
||
3038 | return 5; |
||
3039 | } else if (heading > 292 && heading < 338) { |
||
3040 | 1174: 25 52 subi r18, 0x25 ; 37 |
||
3041 | 1176: 31 40 sbci r19, 0x01 ; 1 |
||
3042 | 1178: 2d 32 cpi r18, 0x2D ; 45 |
||
3043 | 117a: 31 05 cpc r19, r1 |
||
3044 | 117c: 60 f0 brcs .+24 ; 0x1196 <heading_conv+0x5c> |
||
3045 | 117e: 87 e0 ldi r24, 0x07 ; 7 |
||
3046 | 1180: 08 95 ret |
||
3047 | |||
3048 | /** |
||
3049 | * convert the <heading> gotton from NC into an index |
||
3050 | */ |
||
3051 | uint8_t heading_conv(uint16_t heading) { |
||
3052 | if (heading > 23 && heading < 68) { |
||
3053 | 1182: 80 e0 ldi r24, 0x00 ; 0 |
||
3054 | 1184: 08 95 ret |
||
3055 | //direction = "NE"; |
||
3056 | return 0; |
||
3057 | } else if (heading > 67 && heading < 113) { |
||
3058 | 1186: 81 e0 ldi r24, 0x01 ; 1 |
||
3059 | 1188: 08 95 ret |
||
3060 | //direction = "E "; |
||
3061 | return 1; |
||
3062 | } else if (heading > 112 && heading < 158) { |
||
3063 | //direction = "SE"; |
||
3064 | return 2; |
||
3065 | } else if (heading > 157 && heading < 203) { |
||
3066 | 118a: 83 e0 ldi r24, 0x03 ; 3 |
||
3067 | 118c: 08 95 ret |
||
3068 | //direction = "NE"; |
||
3069 | return 0; |
||
3070 | } else if (heading > 67 && heading < 113) { |
||
3071 | //direction = "E "; |
||
3072 | return 1; |
||
3073 | } else if (heading > 112 && heading < 158) { |
||
3074 | 118e: 82 e0 ldi r24, 0x02 ; 2 |
||
3075 | 1190: 08 95 ret |
||
3076 | //direction = "SE"; |
||
3077 | return 2; |
||
3078 | } else if (heading > 157 && heading < 203) { |
||
3079 | //direction = "S "; |
||
3080 | return 3; |
||
3081 | } else if (heading > 202 && heading < 248) { |
||
3082 | 1192: 84 e0 ldi r24, 0x04 ; 4 |
||
3083 | 1194: 08 95 ret |
||
3084 | //direction = "SW"; |
||
3085 | return 4; |
||
3086 | } else if (heading > 247 && heading < 293) { |
||
3087 | //direction = "W "; |
||
3088 | return 5; |
||
3089 | } else if (heading > 292 && heading < 338) { |
||
3090 | 1196: 86 e0 ldi r24, 0x06 ; 6 |
||
3091 | //direction = "NW"; |
||
3092 | return 6; |
||
3093 | } |
||
3094 | //direction = "N "; |
||
3095 | return 7; |
||
3096 | } |
||
3097 | 1198: 08 95 ret |
||
3098 | //direction = "S "; |
||
3099 | return 3; |
||
3100 | } else if (heading > 202 && heading < 248) { |
||
3101 | //direction = "SW"; |
||
3102 | return 4; |
||
3103 | } else if (heading > 247 && heading < 293) { |
||
3104 | 119a: 85 e0 ldi r24, 0x05 ; 5 |
||
3105 | 119c: 08 95 ret |
||
3106 | |||
3107 | 0000119e <heading_fine_conv>: |
||
3108 | /** |
||
3109 | * convert the <heading> gotton from NC into a more |
||
3110 | * precise index |
||
3111 | */ |
||
3112 | uint8_t heading_fine_conv(uint16_t heading) { |
||
3113 | heading = ((heading * 10) + 113) % 3600; |
||
3114 | 119e: 9c 01 movw r18, r24 |
||
3115 | 11a0: 88 0f add r24, r24 |
||
3116 | 11a2: 99 1f adc r25, r25 |
||
3117 | 11a4: 88 0f add r24, r24 |
||
3118 | 11a6: 99 1f adc r25, r25 |
||
3119 | 11a8: 88 0f add r24, r24 |
||
3120 | 11aa: 99 1f adc r25, r25 |
||
3121 | 11ac: 22 0f add r18, r18 |
||
3122 | 11ae: 33 1f adc r19, r19 |
||
3123 | 11b0: 82 0f add r24, r18 |
||
3124 | 11b2: 93 1f adc r25, r19 |
||
3125 | 11b4: 8f 58 subi r24, 0x8F ; 143 |
||
3126 | 11b6: 9f 4f sbci r25, 0xFF ; 255 |
||
3127 | 11b8: 60 e1 ldi r22, 0x10 ; 16 |
||
3128 | 11ba: 7e e0 ldi r23, 0x0E ; 14 |
||
3129 | 11bc: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
3130 | 11c0: 61 ee ldi r22, 0xE1 ; 225 |
||
3131 | 11c2: 70 e0 ldi r23, 0x00 ; 0 |
||
3132 | 11c4: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
3133 | 11c8: 86 2f mov r24, r22 |
||
3134 | return (heading / 225); |
||
3135 | } |
||
3136 | 11ca: 08 95 ret |
||
3137 | |||
3138 | 000011cc <draw_artificial_horizon>: |
||
3139 | |||
3140 | /** |
||
3141 | * draw roll und nick indicators (could be enhanced to full artificial horizon) |
||
3142 | * from line <firstline> to <listlines> for given <nick> and <roll> values |
||
3143 | */ |
||
3144 | void draw_artificial_horizon(uint8_t firstline, uint8_t lastline, int16_t nick, int16_t roll) { |
||
3145 | 11cc: af 92 push r10 |
||
3146 | 11ce: bf 92 push r11 |
||
3147 | 11d0: cf 92 push r12 |
||
3148 | 11d2: df 92 push r13 |
||
3149 | 11d4: ef 92 push r14 |
||
3150 | 11d6: ff 92 push r15 |
||
3151 | 11d8: 0f 93 push r16 |
||
3152 | 11da: 1f 93 push r17 |
||
3153 | 11dc: df 93 push r29 |
||
3154 | 11de: cf 93 push r28 |
||
3155 | 11e0: 00 d0 rcall .+0 ; 0x11e2 <draw_artificial_horizon+0x16> |
||
3156 | 11e2: 00 d0 rcall .+0 ; 0x11e4 <draw_artificial_horizon+0x18> |
||
3157 | 11e4: 0f 92 push r0 |
||
3158 | 11e6: cd b7 in r28, 0x3d ; 61 |
||
3159 | 11e8: de b7 in r29, 0x3e ; 62 |
||
3160 | 11ea: a8 2e mov r10, r24 |
||
3161 | 11ec: c6 2e mov r12, r22 |
||
3162 | 11ee: 8a 01 movw r16, r20 |
||
3163 | 11f0: d2 2e mov r13, r18 |
||
3164 | 11f2: b3 2e mov r11, r19 |
||
3165 | char noodle[5] = {225, 225, 226, 227, 227}; |
||
3166 | 11f4: 7e 01 movw r14, r28 |
||
3167 | 11f6: 08 94 sec |
||
3168 | 11f8: e1 1c adc r14, r1 |
||
3169 | 11fa: f1 1c adc r15, r1 |
||
3170 | 11fc: d7 01 movw r26, r14 |
||
3171 | 11fe: eb e0 ldi r30, 0x0B ; 11 |
||
3172 | 1200: f1 e0 ldi r31, 0x01 ; 1 |
||
3173 | 1202: 85 e0 ldi r24, 0x05 ; 5 |
||
3174 | 1204: 01 90 ld r0, Z+ |
||
3175 | 1206: 0d 92 st X+, r0 |
||
3176 | 1208: 81 50 subi r24, 0x01 ; 1 |
||
3177 | 120a: e1 f7 brne .-8 ; 0x1204 <draw_artificial_horizon+0x38> |
||
3178 | uint8_t center_x = 15; |
||
3179 | uint8_t center_y = lastline - firstline; |
||
3180 | center_y = 7; |
||
3181 | write_char_xy(center_x,center_y,228); |
||
3182 | 120c: 8f e0 ldi r24, 0x0F ; 15 |
||
3183 | 120e: 67 e0 ldi r22, 0x07 ; 7 |
||
3184 | 1210: 44 ee ldi r20, 0xE4 ; 228 |
||
3185 | 1212: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3186 | uint8_t cpos, nicky, rollx; |
||
3187 | |||
3188 | // which line |
||
3189 | int8_t ypos = nick / 20; |
||
3190 | 1216: c8 01 movw r24, r16 |
||
3191 | 1218: 64 e1 ldi r22, 0x14 ; 20 |
||
3192 | 121a: 70 e0 ldi r23, 0x00 ; 0 |
||
3193 | 121c: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
3194 | 1220: 26 2f mov r18, r22 |
||
3195 | // which character from the array? |
||
3196 | if (nick < 0) { |
||
3197 | 1222: 17 fd sbrc r17, 7 |
||
3198 | 1224: 82 c0 rjmp .+260 ; 0x132a <draw_artificial_horizon+0x15e> |
||
3199 | cpos = -1*((nick - (ypos * 20))/4); |
||
3200 | ypos--; |
||
3201 | } else cpos = 4-((nick - (ypos * 20))/4); |
||
3202 | 1226: 8c ee ldi r24, 0xEC ; 236 |
||
3203 | 1228: 68 02 muls r22, r24 |
||
3204 | 122a: c0 01 movw r24, r0 |
||
3205 | 122c: 11 24 eor r1, r1 |
||
3206 | 122e: 80 0f add r24, r16 |
||
3207 | 1230: 91 1f adc r25, r17 |
||
3208 | 1232: 97 fd sbrc r25, 7 |
||
3209 | 1234: a2 c0 rjmp .+324 ; 0x137a <draw_artificial_horizon+0x1ae> |
||
3210 | 1236: 95 95 asr r25 |
||
3211 | 1238: 87 95 ror r24 |
||
3212 | 123a: 95 95 asr r25 |
||
3213 | 123c: 87 95 ror r24 |
||
3214 | 123e: 90 95 com r25 |
||
3215 | 1240: 81 95 neg r24 |
||
3216 | 1242: 9f 4f sbci r25, 0xFF ; 255 |
||
3217 | 1244: 18 2f mov r17, r24 |
||
3218 | 1246: 1c 5f subi r17, 0xFC ; 252 |
||
3219 | if (cpos > 4) cpos = 4; |
||
3220 | |||
3221 | nicky = center_y - ypos; |
||
3222 | 1248: 67 e0 ldi r22, 0x07 ; 7 |
||
3223 | 124a: 62 1b sub r22, r18 |
||
3224 | if (nicky > lastline) nicky = lastline; |
||
3225 | 124c: c6 16 cp r12, r22 |
||
3226 | 124e: 08 f0 brcs .+2 ; 0x1252 <draw_artificial_horizon+0x86> |
||
3227 | 1250: 80 c0 rjmp .+256 ; 0x1352 <draw_artificial_horizon+0x186> |
||
3228 | 1252: 0c 2d mov r16, r12 |
||
3229 | else if (nicky < firstline) nicky = firstline; |
||
3230 | |||
3231 | // ensure roll-borders |
||
3232 | rollx = (roll / 8)+15; |
||
3233 | 1254: 8d 2d mov r24, r13 |
||
3234 | 1256: 9b 2d mov r25, r11 |
||
3235 | 1258: 9c 01 movw r18, r24 |
||
3236 | 125a: 37 fd sbrc r19, 7 |
||
3237 | 125c: 84 c0 rjmp .+264 ; 0x1366 <draw_artificial_horizon+0x19a> |
||
3238 | 125e: 35 95 asr r19 |
||
3239 | 1260: 27 95 ror r18 |
||
3240 | 1262: 35 95 asr r19 |
||
3241 | 1264: 27 95 ror r18 |
||
3242 | 1266: 35 95 asr r19 |
||
3243 | 1268: 27 95 ror r18 |
||
3244 | 126a: 82 2f mov r24, r18 |
||
3245 | 126c: 81 5f subi r24, 0xF1 ; 241 |
||
3246 | if (rollx < 2) rollx = 2; |
||
3247 | 126e: 82 30 cpi r24, 0x02 ; 2 |
||
3248 | 1270: 08 f4 brcc .+2 ; 0x1274 <draw_artificial_horizon+0xa8> |
||
3249 | 1272: 7c c0 rjmp .+248 ; 0x136c <draw_artificial_horizon+0x1a0> |
||
3250 | 1274: d8 2e mov r13, r24 |
||
3251 | 1276: 8c e1 ldi r24, 0x1C ; 28 |
||
3252 | 1278: 8d 15 cp r24, r13 |
||
3253 | 127a: 10 f4 brcc .+4 ; 0x1280 <draw_artificial_horizon+0xb4> |
||
3254 | 127c: 6c e1 ldi r22, 0x1C ; 28 |
||
3255 | 127e: d6 2e mov r13, r22 |
||
3256 | 1280: 4d 2d mov r20, r13 |
||
3257 | 1282: 50 e0 ldi r21, 0x00 ; 0 |
||
3258 | 1284: bd 2c mov r11, r13 |
||
3259 | else if (rollx > 28) rollx = 28; |
||
3260 | |||
3261 | |||
3262 | // clear roll |
||
3263 | if (old_af_x != rollx && old_af_x >= 0) { |
||
3264 | 1286: 20 91 09 01 lds r18, 0x0109 |
||
3265 | 128a: 82 2f mov r24, r18 |
||
3266 | 128c: 99 27 eor r25, r25 |
||
3267 | 128e: 87 fd sbrc r24, 7 |
||
3268 | 1290: 90 95 com r25 |
||
3269 | 1292: 84 17 cp r24, r20 |
||
3270 | 1294: 95 07 cpc r25, r21 |
||
3271 | 1296: 39 f0 breq .+14 ; 0x12a6 <draw_artificial_horizon+0xda> |
||
3272 | 1298: 27 fd sbrc r18, 7 |
||
3273 | 129a: 05 c0 rjmp .+10 ; 0x12a6 <draw_artificial_horizon+0xda> |
||
3274 | write_char_xy(old_af_x, lastline, 0); |
||
3275 | 129c: 82 2f mov r24, r18 |
||
3276 | 129e: 6c 2d mov r22, r12 |
||
3277 | 12a0: 40 e0 ldi r20, 0x00 ; 0 |
||
3278 | 12a2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3279 | } |
||
3280 | |||
3281 | // clear nick |
||
3282 | if (old_af_y != nicky && old_af_y >= 0) { |
||
3283 | 12a6: 60 91 0a 01 lds r22, 0x010A |
||
3284 | 12aa: 26 2f mov r18, r22 |
||
3285 | 12ac: 33 27 eor r19, r19 |
||
3286 | 12ae: 27 fd sbrc r18, 7 |
||
3287 | 12b0: 30 95 com r19 |
||
3288 | 12b2: 80 2f mov r24, r16 |
||
3289 | 12b4: 90 e0 ldi r25, 0x00 ; 0 |
||
3290 | 12b6: 28 17 cp r18, r24 |
||
3291 | 12b8: 39 07 cpc r19, r25 |
||
3292 | 12ba: 61 f0 breq .+24 ; 0x12d4 <draw_artificial_horizon+0x108> |
||
3293 | 12bc: 67 fd sbrc r22, 7 |
||
3294 | 12be: 0a c0 rjmp .+20 ; 0x12d4 <draw_artificial_horizon+0x108> |
||
3295 | write_char_xy(center_x-1, old_af_y, 0); |
||
3296 | 12c0: 8e e0 ldi r24, 0x0E ; 14 |
||
3297 | 12c2: 40 e0 ldi r20, 0x00 ; 0 |
||
3298 | 12c4: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3299 | write_char_xy(center_x+1, old_af_y, 0); |
||
3300 | 12c8: 80 e1 ldi r24, 0x10 ; 16 |
||
3301 | 12ca: 60 91 0a 01 lds r22, 0x010A |
||
3302 | 12ce: 40 e0 ldi r20, 0x00 ; 0 |
||
3303 | 12d0: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3304 | } |
||
3305 | |||
3306 | |||
3307 | // draw nick |
||
3308 | write_char_xy(center_x-1, nicky, noodle[cpos]); |
||
3309 | 12d4: 81 2f mov r24, r17 |
||
3310 | 12d6: 15 30 cpi r17, 0x05 ; 5 |
||
3311 | 12d8: 08 f0 brcs .+2 ; 0x12dc <draw_artificial_horizon+0x110> |
||
3312 | 12da: 84 e0 ldi r24, 0x04 ; 4 |
||
3313 | 12dc: e8 0e add r14, r24 |
||
3314 | 12de: f1 1c adc r15, r1 |
||
3315 | 12e0: f7 01 movw r30, r14 |
||
3316 | 12e2: 10 81 ld r17, Z |
||
3317 | 12e4: 8e e0 ldi r24, 0x0E ; 14 |
||
3318 | 12e6: 60 2f mov r22, r16 |
||
3319 | 12e8: 41 2f mov r20, r17 |
||
3320 | 12ea: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3321 | write_char_xy(center_x+1, nicky, noodle[cpos]); |
||
3322 | 12ee: 80 e1 ldi r24, 0x10 ; 16 |
||
3323 | 12f0: 60 2f mov r22, r16 |
||
3324 | 12f2: 41 2f mov r20, r17 |
||
3325 | 12f4: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3326 | |||
3327 | // draw roll |
||
3328 | write_char_xy(rollx, lastline, 229); |
||
3329 | 12f8: 8d 2d mov r24, r13 |
||
3330 | 12fa: 6c 2d mov r22, r12 |
||
3331 | 12fc: 45 ee ldi r20, 0xE5 ; 229 |
||
3332 | 12fe: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3333 | |||
3334 | // update old vars |
||
3335 | old_af_x = rollx; |
||
3336 | 1302: b0 92 09 01 sts 0x0109, r11 |
||
3337 | old_af_y = nicky; |
||
3338 | 1306: 00 93 0a 01 sts 0x010A, r16 |
||
3339 | // debug numbers |
||
3340 | //write_3digit_number_u(20,6,cpos); |
||
3341 | //write_number_s(20,7,ypos); |
||
3342 | //write_number_s(0,7,nick); |
||
3343 | //write_number_s(18,11,roll); |
||
3344 | } |
||
3345 | 130a: 0f 90 pop r0 |
||
3346 | 130c: 0f 90 pop r0 |
||
3347 | 130e: 0f 90 pop r0 |
||
3348 | 1310: 0f 90 pop r0 |
||
3349 | 1312: 0f 90 pop r0 |
||
3350 | 1314: cf 91 pop r28 |
||
3351 | 1316: df 91 pop r29 |
||
3352 | 1318: 1f 91 pop r17 |
||
3353 | 131a: 0f 91 pop r16 |
||
3354 | 131c: ff 90 pop r15 |
||
3355 | 131e: ef 90 pop r14 |
||
3356 | 1320: df 90 pop r13 |
||
3357 | 1322: cf 90 pop r12 |
||
3358 | 1324: bf 90 pop r11 |
||
3359 | 1326: af 90 pop r10 |
||
3360 | 1328: 08 95 ret |
||
3361 | |||
3362 | // which line |
||
3363 | int8_t ypos = nick / 20; |
||
3364 | // which character from the array? |
||
3365 | if (nick < 0) { |
||
3366 | cpos = -1*((nick - (ypos * 20))/4); |
||
3367 | 132a: 8c ee ldi r24, 0xEC ; 236 |
||
3368 | 132c: 68 02 muls r22, r24 |
||
3369 | 132e: c0 01 movw r24, r0 |
||
3370 | 1330: 11 24 eor r1, r1 |
||
3371 | 1332: 80 0f add r24, r16 |
||
3372 | 1334: 91 1f adc r25, r17 |
||
3373 | 1336: 97 fd sbrc r25, 7 |
||
3374 | 1338: 22 c0 rjmp .+68 ; 0x137e <draw_artificial_horizon+0x1b2> |
||
3375 | 133a: 95 95 asr r25 |
||
3376 | 133c: 87 95 ror r24 |
||
3377 | 133e: 95 95 asr r25 |
||
3378 | 1340: 87 95 ror r24 |
||
3379 | 1342: 18 2f mov r17, r24 |
||
3380 | 1344: 11 95 neg r17 |
||
3381 | ypos--; |
||
3382 | 1346: 21 50 subi r18, 0x01 ; 1 |
||
3383 | } else cpos = 4-((nick - (ypos * 20))/4); |
||
3384 | if (cpos > 4) cpos = 4; |
||
3385 | |||
3386 | nicky = center_y - ypos; |
||
3387 | 1348: 67 e0 ldi r22, 0x07 ; 7 |
||
3388 | 134a: 62 1b sub r22, r18 |
||
3389 | if (nicky > lastline) nicky = lastline; |
||
3390 | 134c: c6 16 cp r12, r22 |
||
3391 | 134e: 08 f4 brcc .+2 ; 0x1352 <draw_artificial_horizon+0x186> |
||
3392 | 1350: 80 cf rjmp .-256 ; 0x1252 <draw_artificial_horizon+0x86> |
||
3393 | 1352: 06 2f mov r16, r22 |
||
3394 | 1354: 6a 15 cp r22, r10 |
||
3395 | 1356: 08 f0 brcs .+2 ; 0x135a <draw_artificial_horizon+0x18e> |
||
3396 | 1358: 7d cf rjmp .-262 ; 0x1254 <draw_artificial_horizon+0x88> |
||
3397 | 135a: 0a 2d mov r16, r10 |
||
3398 | else if (nicky < firstline) nicky = firstline; |
||
3399 | |||
3400 | // ensure roll-borders |
||
3401 | rollx = (roll / 8)+15; |
||
3402 | 135c: 8d 2d mov r24, r13 |
||
3403 | 135e: 9b 2d mov r25, r11 |
||
3404 | 1360: 9c 01 movw r18, r24 |
||
3405 | 1362: 37 ff sbrs r19, 7 |
||
3406 | 1364: 7c cf rjmp .-264 ; 0x125e <draw_artificial_horizon+0x92> |
||
3407 | 1366: 29 5f subi r18, 0xF9 ; 249 |
||
3408 | 1368: 3f 4f sbci r19, 0xFF ; 255 |
||
3409 | 136a: 79 cf rjmp .-270 ; 0x125e <draw_artificial_horizon+0x92> |
||
3410 | if (rollx < 2) rollx = 2; |
||
3411 | 136c: e2 e0 ldi r30, 0x02 ; 2 |
||
3412 | 136e: de 2e mov r13, r30 |
||
3413 | 1370: 42 e0 ldi r20, 0x02 ; 2 |
||
3414 | 1372: 50 e0 ldi r21, 0x00 ; 0 |
||
3415 | 1374: 72 e0 ldi r23, 0x02 ; 2 |
||
3416 | 1376: b7 2e mov r11, r23 |
||
3417 | 1378: 86 cf rjmp .-244 ; 0x1286 <draw_artificial_horizon+0xba> |
||
3418 | int8_t ypos = nick / 20; |
||
3419 | // which character from the array? |
||
3420 | if (nick < 0) { |
||
3421 | cpos = -1*((nick - (ypos * 20))/4); |
||
3422 | ypos--; |
||
3423 | } else cpos = 4-((nick - (ypos * 20))/4); |
||
3424 | 137a: 03 96 adiw r24, 0x03 ; 3 |
||
3425 | 137c: 5c cf rjmp .-328 ; 0x1236 <draw_artificial_horizon+0x6a> |
||
3426 | |||
3427 | // which line |
||
3428 | int8_t ypos = nick / 20; |
||
3429 | // which character from the array? |
||
3430 | if (nick < 0) { |
||
3431 | cpos = -1*((nick - (ypos * 20))/4); |
||
3432 | 137e: 03 96 adiw r24, 0x03 ; 3 |
||
3433 | 1380: dc cf rjmp .-72 ; 0x133a <draw_artificial_horizon+0x16e> |
||
3434 | |||
3435 | 00001382 <draw_variometer>: |
||
3436 | * variometer |
||
3437 | * ##########################################################################*/ |
||
3438 | /** |
||
3439 | * draw variometer arrows at <x>/<y> according to <variometer> |
||
3440 | */ |
||
3441 | void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) { |
||
3442 | 1382: 28 2f mov r18, r24 |
||
3443 | 1384: 36 2f mov r19, r22 |
||
3444 | if (variometer == 0) { |
||
3445 | 1386: 41 15 cp r20, r1 |
||
3446 | 1388: 51 05 cpc r21, r1 |
||
3447 | 138a: b1 f0 breq .+44 ; 0x13b8 <draw_variometer+0x36> |
||
3448 | write_char_xy(x, y, 0xbb); // plain line |
||
3449 | } else if (variometer > 0) { // gain height |
||
3450 | 138c: 14 16 cp r1, r20 |
||
3451 | 138e: 15 06 cpc r1, r21 |
||
3452 | 1390: bc f4 brge .+46 ; 0x13c0 <draw_variometer+0x3e> |
||
3453 | switch (variometer / 5){ |
||
3454 | 1392: ca 01 movw r24, r20 |
||
3455 | 1394: 65 e0 ldi r22, 0x05 ; 5 |
||
3456 | 1396: 70 e0 ldi r23, 0x00 ; 0 |
||
3457 | 1398: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
3458 | 139c: 61 30 cpi r22, 0x01 ; 1 |
||
3459 | 139e: 71 05 cpc r23, r1 |
||
3460 | 13a0: 11 f1 breq .+68 ; 0x13e6 <draw_variometer+0x64> |
||
3461 | 13a2: 62 30 cpi r22, 0x02 ; 2 |
||
3462 | 13a4: 71 05 cpc r23, r1 |
||
3463 | 13a6: 89 f1 breq .+98 ; 0x140a <draw_variometer+0x88> |
||
3464 | 13a8: 67 2b or r22, r23 |
||
3465 | 13aa: 19 f5 brne .+70 ; 0x13f2 <draw_variometer+0x70> |
||
3466 | case 0: |
||
3467 | //write_char_xy(x, y, 0xba); // smallest arrow up |
||
3468 | write_char_xy(x, y, 0x70); // one arrow up |
||
3469 | 13ac: 82 2f mov r24, r18 |
||
3470 | 13ae: 63 2f mov r22, r19 |
||
3471 | 13b0: 40 e7 ldi r20, 0x70 ; 112 |
||
3472 | 13b2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3473 | 13b6: 08 95 ret |
||
3474 | /** |
||
3475 | * draw variometer arrows at <x>/<y> according to <variometer> |
||
3476 | */ |
||
3477 | void draw_variometer(uint8_t x, uint8_t y, int16_t variometer) { |
||
3478 | if (variometer == 0) { |
||
3479 | write_char_xy(x, y, 0xbb); // plain line |
||
3480 | 13b8: 4b eb ldi r20, 0xBB ; 187 |
||
3481 | 13ba: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3482 | 13be: 08 95 ret |
||
3483 | default: |
||
3484 | //write_char_xy(x, y, 0xb7); // largest arrow up |
||
3485 | write_char_xy(x, y, 0x73); // three black arrows up |
||
3486 | } |
||
3487 | } else { // sink |
||
3488 | switch (variometer / -5){ |
||
3489 | 13c0: ca 01 movw r24, r20 |
||
3490 | 13c2: 6b ef ldi r22, 0xFB ; 251 |
||
3491 | 13c4: 7f ef ldi r23, 0xFF ; 255 |
||
3492 | 13c6: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
3493 | 13ca: 61 30 cpi r22, 0x01 ; 1 |
||
3494 | 13cc: 71 05 cpc r23, r1 |
||
3495 | 13ce: b9 f0 breq .+46 ; 0x13fe <draw_variometer+0x7c> |
||
3496 | 13d0: 62 30 cpi r22, 0x02 ; 2 |
||
3497 | 13d2: 71 05 cpc r23, r1 |
||
3498 | 13d4: 31 f1 breq .+76 ; 0x1422 <draw_variometer+0xa0> |
||
3499 | 13d6: 67 2b or r22, r23 |
||
3500 | 13d8: f1 f4 brne .+60 ; 0x1416 <draw_variometer+0x94> |
||
3501 | case 0: |
||
3502 | //write_char_xy(x, y, 0xbc); // smallest arrow down |
||
3503 | write_char_xy(x, y, 0x77); // one arrow down |
||
3504 | 13da: 82 2f mov r24, r18 |
||
3505 | 13dc: 63 2f mov r22, r19 |
||
3506 | 13de: 47 e7 ldi r20, 0x77 ; 119 |
||
3507 | 13e0: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3508 | 13e4: 08 95 ret |
||
3509 | //write_char_xy(x, y, 0xba); // smallest arrow up |
||
3510 | write_char_xy(x, y, 0x70); // one arrow up |
||
3511 | break; |
||
3512 | case 1: |
||
3513 | //write_char_xy(x, y, 0xb9); // small arrow up |
||
3514 | write_char_xy(x, y, 0x71); // two arrows up |
||
3515 | 13e6: 82 2f mov r24, r18 |
||
3516 | 13e8: 63 2f mov r22, r19 |
||
3517 | 13ea: 41 e7 ldi r20, 0x71 ; 113 |
||
3518 | 13ec: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3519 | 13f0: 08 95 ret |
||
3520 | //write_char_xy(x, y, 0xb8); // large arrow up |
||
3521 | write_char_xy(x, y, 0x72); // three arrows up |
||
3522 | break; |
||
3523 | default: |
||
3524 | //write_char_xy(x, y, 0xb7); // largest arrow up |
||
3525 | write_char_xy(x, y, 0x73); // three black arrows up |
||
3526 | 13f2: 82 2f mov r24, r18 |
||
3527 | 13f4: 63 2f mov r22, r19 |
||
3528 | 13f6: 43 e7 ldi r20, 0x73 ; 115 |
||
3529 | 13f8: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3530 | 13fc: 08 95 ret |
||
3531 | //write_char_xy(x, y, 0xbc); // smallest arrow down |
||
3532 | write_char_xy(x, y, 0x77); // one arrow down |
||
3533 | break; |
||
3534 | case 1: |
||
3535 | //write_char_xy(x, y, 0xbd); // small arrow down |
||
3536 | write_char_xy(x, y, 0x76); // two arrows down |
||
3537 | 13fe: 82 2f mov r24, r18 |
||
3538 | 1400: 63 2f mov r22, r19 |
||
3539 | 1402: 46 e7 ldi r20, 0x76 ; 118 |
||
3540 | 1404: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3541 | 1408: 08 95 ret |
||
3542 | //write_char_xy(x, y, 0xb9); // small arrow up |
||
3543 | write_char_xy(x, y, 0x71); // two arrows up |
||
3544 | break; |
||
3545 | case 2: |
||
3546 | //write_char_xy(x, y, 0xb8); // large arrow up |
||
3547 | write_char_xy(x, y, 0x72); // three arrows up |
||
3548 | 140a: 82 2f mov r24, r18 |
||
3549 | 140c: 63 2f mov r22, r19 |
||
3550 | 140e: 42 e7 ldi r20, 0x72 ; 114 |
||
3551 | 1410: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3552 | 1414: 08 95 ret |
||
3553 | //write_char_xy(x, y, 0xbe); // large arrow down |
||
3554 | write_char_xy(x, y, 0x75); // three arrows down |
||
3555 | break; |
||
3556 | default: |
||
3557 | //write_char_xy(x, y, 0xbf); // largest arrow down |
||
3558 | write_char_xy(x, y, 0x74); // three black arrows down |
||
3559 | 1416: 82 2f mov r24, r18 |
||
3560 | 1418: 63 2f mov r22, r19 |
||
3561 | 141a: 44 e7 ldi r20, 0x74 ; 116 |
||
3562 | 141c: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3563 | 1420: 08 95 ret |
||
3564 | //write_char_xy(x, y, 0xbd); // small arrow down |
||
3565 | write_char_xy(x, y, 0x76); // two arrows down |
||
3566 | break; |
||
3567 | case 2: |
||
3568 | //write_char_xy(x, y, 0xbe); // large arrow down |
||
3569 | write_char_xy(x, y, 0x75); // three arrows down |
||
3570 | 1422: 82 2f mov r24, r18 |
||
3571 | 1424: 63 2f mov r22, r19 |
||
3572 | 1426: 45 e7 ldi r20, 0x75 ; 117 |
||
3573 | 1428: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3574 | 142c: 08 95 ret |
||
3575 | |||
3576 | 0000142e <draw_battery>: |
||
3577 | * battery index |
||
3578 | * ##########################################################################*/ |
||
3579 | /** |
||
3580 | * draw a battery symbol at <x>/<y> according to <voltage> |
||
3581 | */ |
||
3582 | void draw_battery(uint8_t x, uint8_t y, uint8_t min_voltage, uint8_t voltage, uint8_t max_voltage) { |
||
3583 | 142e: 0f 93 push r16 |
||
3584 | 1430: e8 2f mov r30, r24 |
||
3585 | 1432: f6 2f mov r31, r22 |
||
3586 | uint8_t percent = (100* (voltage - min_voltage) / (max_voltage - min_voltage)); |
||
3587 | if (percent > 100) percent = 100; |
||
3588 | if (voltage < min_voltage) percent = 0; |
||
3589 | 1434: 24 17 cp r18, r20 |
||
3590 | 1436: 38 f4 brcc .+14 ; 0x1446 <draw_battery+0x18> |
||
3591 | 1438: 4d e9 ldi r20, 0x9D ; 157 |
||
3592 | write_char_xy(x, y, 0x9d - (percent * 13 / 100)); |
||
3593 | 143a: 8e 2f mov r24, r30 |
||
3594 | 143c: 6f 2f mov r22, r31 |
||
3595 | 143e: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3596 | //write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0); |
||
3597 | } |
||
3598 | 1442: 0f 91 pop r16 |
||
3599 | 1444: 08 95 ret |
||
3600 | * ##########################################################################*/ |
||
3601 | /** |
||
3602 | * draw a battery symbol at <x>/<y> according to <voltage> |
||
3603 | */ |
||
3604 | void draw_battery(uint8_t x, uint8_t y, uint8_t min_voltage, uint8_t voltage, uint8_t max_voltage) { |
||
3605 | uint8_t percent = (100* (voltage - min_voltage) / (max_voltage - min_voltage)); |
||
3606 | 1446: 84 2f mov r24, r20 |
||
3607 | 1448: 90 e0 ldi r25, 0x00 ; 0 |
||
3608 | 144a: 30 e0 ldi r19, 0x00 ; 0 |
||
3609 | 144c: 28 1b sub r18, r24 |
||
3610 | 144e: 39 0b sbc r19, r25 |
||
3611 | 1450: 60 2f mov r22, r16 |
||
3612 | 1452: 70 e0 ldi r23, 0x00 ; 0 |
||
3613 | 1454: 68 1b sub r22, r24 |
||
3614 | 1456: 79 0b sbc r23, r25 |
||
3615 | 1458: 84 e6 ldi r24, 0x64 ; 100 |
||
3616 | 145a: 90 e0 ldi r25, 0x00 ; 0 |
||
3617 | 145c: ac 01 movw r20, r24 |
||
3618 | 145e: 24 9f mul r18, r20 |
||
3619 | 1460: c0 01 movw r24, r0 |
||
3620 | 1462: 25 9f mul r18, r21 |
||
3621 | 1464: 90 0d add r25, r0 |
||
3622 | 1466: 34 9f mul r19, r20 |
||
3623 | 1468: 90 0d add r25, r0 |
||
3624 | 146a: 11 24 eor r1, r1 |
||
3625 | 146c: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
3626 | 1470: 65 36 cpi r22, 0x65 ; 101 |
||
3627 | 1472: 08 f0 brcs .+2 ; 0x1476 <draw_battery+0x48> |
||
3628 | 1474: 64 e6 ldi r22, 0x64 ; 100 |
||
3629 | 1476: 86 2f mov r24, r22 |
||
3630 | 1478: 90 e0 ldi r25, 0x00 ; 0 |
||
3631 | 147a: 9c 01 movw r18, r24 |
||
3632 | 147c: 22 0f add r18, r18 |
||
3633 | 147e: 33 1f adc r19, r19 |
||
3634 | 1480: 28 0f add r18, r24 |
||
3635 | 1482: 39 1f adc r19, r25 |
||
3636 | 1484: 22 0f add r18, r18 |
||
3637 | 1486: 33 1f adc r19, r19 |
||
3638 | 1488: 22 0f add r18, r18 |
||
3639 | 148a: 33 1f adc r19, r19 |
||
3640 | 148c: 28 0f add r18, r24 |
||
3641 | 148e: 39 1f adc r19, r25 |
||
3642 | 1490: c9 01 movw r24, r18 |
||
3643 | 1492: 6c e9 ldi r22, 0x9C ; 156 |
||
3644 | 1494: 7f ef ldi r23, 0xFF ; 255 |
||
3645 | 1496: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
3646 | 149a: 46 2f mov r20, r22 |
||
3647 | 149c: 43 56 subi r20, 0x63 ; 99 |
||
3648 | if (percent > 100) percent = 100; |
||
3649 | if (voltage < min_voltage) percent = 0; |
||
3650 | write_char_xy(x, y, 0x9d - (percent * 13 / 100)); |
||
3651 | 149e: 8e 2f mov r24, r30 |
||
3652 | 14a0: 6f 2f mov r22, r31 |
||
3653 | 14a2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3654 | //write_ndigit_number_u(x, y-1, percent * 13 / 100, 100, 0); |
||
3655 | } |
||
3656 | 14a6: 0f 91 pop r16 |
||
3657 | 14a8: 08 95 ret |
||
3658 | |||
3659 | 000014aa <draw_compass>: |
||
3660 | } |
||
3661 | |||
3662 | /** |
||
3663 | * draw a compass rose at <x>/<y> for <heading> |
||
3664 | */ |
||
3665 | void draw_compass(uint8_t x, uint8_t y, uint16_t heading) { |
||
3666 | 14aa: ef 92 push r14 |
||
3667 | 14ac: ff 92 push r15 |
||
3668 | 14ae: 0f 93 push r16 |
||
3669 | 14b0: 1f 93 push r17 |
||
3670 | 14b2: cf 93 push r28 |
||
3671 | 14b4: df 93 push r29 |
||
3672 | 14b6: 28 2f mov r18, r24 |
||
3673 | 14b8: 06 2f mov r16, r22 |
||
3674 | 14ba: ca 01 movw r24, r20 |
||
3675 | 216, 215, 216, 212, 216, 215, 216, 214, 216, 215, 216, 211, |
||
3676 | 216, 215, 216, 213, 216, 215, 216, 212, 216, 215, 216, 214}; |
||
3677 | // the center is char 19 (north), we add the current heading in 8th |
||
3678 | // which would be 22.5 degrees, but float would bloat up the code |
||
3679 | // and *10 / 225 would take ages... so we take the uncorrect way |
||
3680 | uint8_t front = 19 + (heading / 22); |
||
3681 | 14bc: 66 e1 ldi r22, 0x16 ; 22 |
||
3682 | 14be: 70 e0 ldi r23, 0x00 ; 0 |
||
3683 | 14c0: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
3684 | 14c4: 6d 5e subi r22, 0xED ; 237 |
||
3685 | 14c6: 70 e0 ldi r23, 0x00 ; 0 |
||
3686 | 14c8: eb 01 movw r28, r22 |
||
3687 | 14ca: c0 55 subi r28, 0x50 ; 80 |
||
3688 | 14cc: de 4f sbci r29, 0xFE ; 254 |
||
3689 | for (uint8_t i = 0; i < 9; i++) { |
||
3690 | 14ce: 55 e0 ldi r21, 0x05 ; 5 |
||
3691 | 14d0: e5 2e mov r14, r21 |
||
3692 | 14d2: f1 2c mov r15, r1 |
||
3693 | 14d4: e6 0e add r14, r22 |
||
3694 | 14d6: f7 1e adc r15, r23 |
||
3695 | 14d8: 84 eb ldi r24, 0xB4 ; 180 |
||
3696 | 14da: 91 e0 ldi r25, 0x01 ; 1 |
||
3697 | 14dc: e8 0e add r14, r24 |
||
3698 | 14de: f9 1e adc r15, r25 |
||
3699 | write_char_xy(x++, y, pgm_read_byte(&rose[front - 4 + i])); |
||
3700 | 14e0: 12 2f mov r17, r18 |
||
3701 | 14e2: 1f 5f subi r17, 0xFF ; 255 |
||
3702 | 14e4: fe 01 movw r30, r28 |
||
3703 | 14e6: 44 91 lpm r20, Z+ |
||
3704 | 14e8: 82 2f mov r24, r18 |
||
3705 | 14ea: 60 2f mov r22, r16 |
||
3706 | 14ec: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
3707 | 14f0: 21 96 adiw r28, 0x01 ; 1 |
||
3708 | 14f2: 21 2f mov r18, r17 |
||
3709 | 216, 215, 216, 213, 216, 215, 216, 212, 216, 215, 216, 214}; |
||
3710 | // the center is char 19 (north), we add the current heading in 8th |
||
3711 | // which would be 22.5 degrees, but float would bloat up the code |
||
3712 | // and *10 / 225 would take ages... so we take the uncorrect way |
||
3713 | uint8_t front = 19 + (heading / 22); |
||
3714 | for (uint8_t i = 0; i < 9; i++) { |
||
3715 | 14f4: ce 15 cp r28, r14 |
||
3716 | 14f6: df 05 cpc r29, r15 |
||
3717 | 14f8: 99 f7 brne .-26 ; 0x14e0 <draw_compass+0x36> |
||
3718 | write_char_xy(x++, y, pgm_read_byte(&rose[front - 4 + i])); |
||
3719 | } |
||
3720 | } |
||
3721 | 14fa: df 91 pop r29 |
||
3722 | 14fc: cf 91 pop r28 |
||
3723 | 14fe: 1f 91 pop r17 |
||
3724 | 1500: 0f 91 pop r16 |
||
3725 | 1502: ff 90 pop r15 |
||
3726 | 1504: ef 90 pop r14 |
||
3727 | 1506: 08 95 ret |
||
3728 | |||
3729 | 00001508 <draw_big_variometer>: |
||
3730 | |||
3731 | /** |
||
3732 | * draw a bigger vario with middle at <x>/<y> acording to <variometer> |
||
3733 | */ |
||
3734 | void draw_big_variometer(uint8_t x, uint8_t y, int16_t variometer) { |
||
3735 | int16_t index = 7 + variometer; |
||
3736 | 1508: 49 5f subi r20, 0xF9 ; 249 |
||
3737 | 150a: 5f 4f sbci r21, 0xFF ; 255 |
||
3738 | 150c: 57 fd sbrc r21, 7 |
||
3739 | 150e: 11 c0 rjmp .+34 ; 0x1532 <draw_big_variometer+0x2a> |
||
3740 | if (index > 14) index = 14; |
||
3741 | else if (index < 0) index = 0; |
||
3742 | |||
3743 | write_string_pgm_down(x, y-2, (const char *) (pgm_read_word ( &(vario_pnt[index]))), 5); |
||
3744 | 1510: 4f 30 cpi r20, 0x0F ; 15 |
||
3745 | 1512: 51 05 cpc r21, r1 |
||
3746 | 1514: 14 f0 brlt .+4 ; 0x151a <draw_big_variometer+0x12> |
||
3747 | 1516: 4e e0 ldi r20, 0x0E ; 14 |
||
3748 | 1518: 50 e0 ldi r21, 0x00 ; 0 |
||
3749 | 151a: fa 01 movw r30, r20 |
||
3750 | 151c: ee 0f add r30, r30 |
||
3751 | 151e: ff 1f adc r31, r31 |
||
3752 | 1520: ea 56 subi r30, 0x6A ; 106 |
||
3753 | 1522: fe 4f sbci r31, 0xFE ; 254 |
||
3754 | 1524: 45 91 lpm r20, Z+ |
||
3755 | 1526: 54 91 lpm r21, Z+ |
||
3756 | 1528: 62 50 subi r22, 0x02 ; 2 |
||
3757 | 152a: 25 e0 ldi r18, 0x05 ; 5 |
||
3758 | 152c: 0e 94 ad 05 call 0xb5a ; 0xb5a <write_string_pgm_down> |
||
3759 | } |
||
3760 | 1530: 08 95 ret |
||
3761 | |||
3762 | /** |
||
3763 | * draw a bigger vario with middle at <x>/<y> acording to <variometer> |
||
3764 | */ |
||
3765 | void draw_big_variometer(uint8_t x, uint8_t y, int16_t variometer) { |
||
3766 | int16_t index = 7 + variometer; |
||
3767 | 1532: 40 e0 ldi r20, 0x00 ; 0 |
||
3768 | 1534: 50 e0 ldi r21, 0x00 ; 0 |
||
3769 | 1536: ec cf rjmp .-40 ; 0x1510 <draw_big_variometer+0x8> |
||
3770 | |||
3771 | 00001538 <onoff>: |
||
3772 | * ##########################################################################*/ |
||
3773 | |||
3774 | /** |
||
3775 | * helper function for flag display |
||
3776 | */ |
||
3777 | void onoff(uint8_t line, uint8_t onoff) { |
||
3778 | 1538: 98 2f mov r25, r24 |
||
3779 | if (onoff) { |
||
3780 | 153a: 66 23 and r22, r22 |
||
3781 | 153c: 39 f4 brne .+14 ; 0x154c <onoff+0x14> |
||
3782 | write_ascii_string_pgm(23, line, PSTR("ON ")); |
||
3783 | } else { |
||
3784 | write_ascii_string_pgm(23, line, PSTR("OFF")); |
||
3785 | 153e: 87 e1 ldi r24, 0x17 ; 23 |
||
3786 | 1540: 69 2f mov r22, r25 |
||
3787 | 1542: 48 ee ldi r20, 0xE8 ; 232 |
||
3788 | 1544: 52 e0 ldi r21, 0x02 ; 2 |
||
3789 | 1546: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3790 | 154a: 08 95 ret |
||
3791 | /** |
||
3792 | * helper function for flag display |
||
3793 | */ |
||
3794 | void onoff(uint8_t line, uint8_t onoff) { |
||
3795 | if (onoff) { |
||
3796 | write_ascii_string_pgm(23, line, PSTR("ON ")); |
||
3797 | 154c: 87 e1 ldi r24, 0x17 ; 23 |
||
3798 | 154e: 69 2f mov r22, r25 |
||
3799 | 1550: 4c ee ldi r20, 0xEC ; 236 |
||
3800 | 1552: 52 e0 ldi r21, 0x02 ; 2 |
||
3801 | 1554: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3802 | 1558: 08 95 ret |
||
3803 | |||
3804 | 0000155a <config_menu_drawings>: |
||
3805 | } |
||
3806 | |||
3807 | /** |
||
3808 | * helper function for menu updating |
||
3809 | */ |
||
3810 | void config_menu_drawings(uint8_t chosen) { |
||
3811 | 155a: ff 92 push r15 |
||
3812 | 155c: 0f 93 push r16 |
||
3813 | 155e: 1f 93 push r17 |
||
3814 | 1560: 28 2f mov r18, r24 |
||
3815 | 1562: 90 e0 ldi r25, 0x00 ; 0 |
||
3816 | 1564: 0b 96 adiw r24, 0x0b ; 11 |
||
3817 | 1566: 6c e0 ldi r22, 0x0C ; 12 |
||
3818 | 1568: 70 e0 ldi r23, 0x00 ; 0 |
||
3819 | 156a: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
3820 | 156e: 92 e0 ldi r25, 0x02 ; 2 |
||
3821 | 1570: f9 2e mov r15, r25 |
||
3822 | 1572: f8 0e add r15, r24 |
||
3823 | 1574: 02 2f mov r16, r18 |
||
3824 | 1576: 0e 5f subi r16, 0xFE ; 254 |
||
3825 | 1578: 12 e0 ldi r17, 0x02 ; 2 |
||
3826 | uint8_t line = 2; |
||
3827 | |||
3828 | // clear prevoius _cursor_ |
||
3829 | //write_char_xy(3, line + ((chosen + 11) % 12), 0x00); |
||
3830 | for (uint8_t x = 2; x < 28; x++) { |
||
3831 | write_char_att_xy(x, line + ((chosen + 11) % 12), 0); |
||
3832 | 157a: 81 2f mov r24, r17 |
||
3833 | 157c: 6f 2d mov r22, r15 |
||
3834 | 157e: 40 e0 ldi r20, 0x00 ; 0 |
||
3835 | 1580: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
3836 | write_char_att_xy(x, line + chosen, BLACKBG | INVERT); |
||
3837 | 1584: 81 2f mov r24, r17 |
||
3838 | 1586: 60 2f mov r22, r16 |
||
3839 | 1588: 4f ea ldi r20, 0xAF ; 175 |
||
3840 | 158a: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
3841 | void config_menu_drawings(uint8_t chosen) { |
||
3842 | uint8_t line = 2; |
||
3843 | |||
3844 | // clear prevoius _cursor_ |
||
3845 | //write_char_xy(3, line + ((chosen + 11) % 12), 0x00); |
||
3846 | for (uint8_t x = 2; x < 28; x++) { |
||
3847 | 158e: 1f 5f subi r17, 0xFF ; 255 |
||
3848 | 1590: 1c 31 cpi r17, 0x1C ; 28 |
||
3849 | 1592: 99 f7 brne .-26 ; 0x157a <config_menu_drawings+0x20> |
||
3850 | }; |
||
3851 | // draw current _cursor_ |
||
3852 | //write_char_xy(3, line + chosen, 0xD9); |
||
3853 | |||
3854 | |||
3855 | write_ascii_string_pgm(4, line, PSTR("Video Mode")); |
||
3856 | 1594: 84 e0 ldi r24, 0x04 ; 4 |
||
3857 | 1596: 62 e0 ldi r22, 0x02 ; 2 |
||
3858 | 1598: 4d ed ldi r20, 0xDD ; 221 |
||
3859 | 159a: 52 e0 ldi r21, 0x02 ; 2 |
||
3860 | 159c: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3861 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
3862 | 15a0: 80 91 1c 01 lds r24, 0x011C |
||
3863 | 15a4: 80 ff sbrs r24, 0 |
||
3864 | 15a6: 85 c0 rjmp .+266 ; 0x16b2 <config_menu_drawings+0x158> |
||
3865 | write_ascii_string_pgm(23, line, VM_NTSC); |
||
3866 | 15a8: 87 e1 ldi r24, 0x17 ; 23 |
||
3867 | 15aa: 62 e0 ldi r22, 0x02 ; 2 |
||
3868 | 15ac: 49 ee ldi r20, 0xE9 ; 233 |
||
3869 | 15ae: 51 e0 ldi r21, 0x01 ; 1 |
||
3870 | 15b0: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3871 | } else { |
||
3872 | write_ascii_string_pgm(23, line, VM_PAL); |
||
3873 | } |
||
3874 | |||
3875 | write_ascii_string_pgm(4, ++line, PSTR("Full HUD")); |
||
3876 | 15b4: 84 e0 ldi r24, 0x04 ; 4 |
||
3877 | 15b6: 63 e0 ldi r22, 0x03 ; 3 |
||
3878 | 15b8: 44 ed ldi r20, 0xD4 ; 212 |
||
3879 | 15ba: 52 e0 ldi r21, 0x02 ; 2 |
||
3880 | 15bc: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3881 | onoff(line, COSD_FLAGS_MODES & COSD_FLAG_HUD); |
||
3882 | 15c0: 60 91 1b 01 lds r22, 0x011B |
||
3883 | 15c4: 61 70 andi r22, 0x01 ; 1 |
||
3884 | 15c6: 83 e0 ldi r24, 0x03 ; 3 |
||
3885 | 15c8: 0e 94 9c 0a call 0x1538 ; 0x1538 <onoff> |
||
3886 | |||
3887 | write_ascii_string_pgm(4, ++line, PSTR("Art Horizon in HUD")); |
||
3888 | 15cc: 84 e0 ldi r24, 0x04 ; 4 |
||
3889 | 15ce: 64 e0 ldi r22, 0x04 ; 4 |
||
3890 | 15d0: 41 ec ldi r20, 0xC1 ; 193 |
||
3891 | 15d2: 52 e0 ldi r21, 0x02 ; 2 |
||
3892 | 15d4: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3893 | onoff(line, COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON); |
||
3894 | 15d8: 60 91 1b 01 lds r22, 0x011B |
||
3895 | 15dc: 62 70 andi r22, 0x02 ; 2 |
||
3896 | 15de: 84 e0 ldi r24, 0x04 ; 4 |
||
3897 | 15e0: 0e 94 9c 0a call 0x1538 ; 0x1538 <onoff> |
||
3898 | |||
3899 | write_ascii_string_pgm(4, ++line, PSTR("Big Vario bar")); |
||
3900 | 15e4: 84 e0 ldi r24, 0x04 ; 4 |
||
3901 | 15e6: 65 e0 ldi r22, 0x05 ; 5 |
||
3902 | 15e8: 43 eb ldi r20, 0xB3 ; 179 |
||
3903 | 15ea: 52 e0 ldi r21, 0x02 ; 2 |
||
3904 | 15ec: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3905 | onoff(line, COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO); |
||
3906 | 15f0: 60 91 1b 01 lds r22, 0x011B |
||
3907 | 15f4: 64 70 andi r22, 0x04 ; 4 |
||
3908 | 15f6: 85 e0 ldi r24, 0x05 ; 5 |
||
3909 | 15f8: 0e 94 9c 0a call 0x1538 ; 0x1538 <onoff> |
||
3910 | |||
3911 | write_ascii_string_pgm(4, ++line, PSTR("Statistics")); |
||
3912 | 15fc: 84 e0 ldi r24, 0x04 ; 4 |
||
3913 | 15fe: 66 e0 ldi r22, 0x06 ; 6 |
||
3914 | 1600: 48 ea ldi r20, 0xA8 ; 168 |
||
3915 | 1602: 52 e0 ldi r21, 0x02 ; 2 |
||
3916 | 1604: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3917 | onoff(line, COSD_FLAGS_MODES & COSD_FLAG_STATS); |
||
3918 | 1608: 60 91 1b 01 lds r22, 0x011B |
||
3919 | 160c: 68 70 andi r22, 0x08 ; 8 |
||
3920 | 160e: 86 e0 ldi r24, 0x06 ; 6 |
||
3921 | 1610: 0e 94 9c 0a call 0x1538 ; 0x1538 <onoff> |
||
3922 | |||
3923 | write_ascii_string_pgm(4, ++line, PSTR("Current by FC")); |
||
3924 | 1614: 84 e0 ldi r24, 0x04 ; 4 |
||
3925 | 1616: 67 e0 ldi r22, 0x07 ; 7 |
||
3926 | 1618: 4a e9 ldi r20, 0x9A ; 154 |
||
3927 | 161a: 52 e0 ldi r21, 0x02 ; 2 |
||
3928 | 161c: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3929 | onoff(line, COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT); |
||
3930 | 1620: 60 91 1b 01 lds r22, 0x011B |
||
3931 | 1624: 60 74 andi r22, 0x40 ; 64 |
||
3932 | 1626: 87 e0 ldi r24, 0x07 ; 7 |
||
3933 | 1628: 0e 94 9c 0a call 0x1538 ; 0x1538 <onoff> |
||
3934 | |||
3935 | write_ascii_string_pgm(4, ++line, PSTR("Voltage by C-Strom")); |
||
3936 | 162c: 84 e0 ldi r24, 0x04 ; 4 |
||
3937 | 162e: 68 e0 ldi r22, 0x08 ; 8 |
||
3938 | 1630: 47 e8 ldi r20, 0x87 ; 135 |
||
3939 | 1632: 52 e0 ldi r21, 0x02 ; 2 |
||
3940 | 1634: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3941 | onoff(line, COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT); |
||
3942 | 1638: 60 91 1b 01 lds r22, 0x011B |
||
3943 | 163c: 60 72 andi r22, 0x20 ; 32 |
||
3944 | 163e: 88 e0 ldi r24, 0x08 ; 8 |
||
3945 | 1640: 0e 94 9c 0a call 0x1538 ; 0x1538 <onoff> |
||
3946 | |||
3947 | write_ascii_string_pgm(4, ++line, PSTR("Reset uptime")); |
||
3948 | 1644: 84 e0 ldi r24, 0x04 ; 4 |
||
3949 | 1646: 69 e0 ldi r22, 0x09 ; 9 |
||
3950 | 1648: 4a e7 ldi r20, 0x7A ; 122 |
||
3951 | 164a: 52 e0 ldi r21, 0x02 ; 2 |
||
3952 | 164c: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3953 | |||
3954 | write_ascii_string_pgm(4, ++line, PSTR("Display Mode")); |
||
3955 | 1650: 84 e0 ldi r24, 0x04 ; 4 |
||
3956 | 1652: 6a e0 ldi r22, 0x0A ; 10 |
||
3957 | 1654: 4d e6 ldi r20, 0x6D ; 109 |
||
3958 | 1656: 52 e0 ldi r21, 0x02 ; 2 |
||
3959 | 1658: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3960 | write_ascii_string_pgm(18, line, (const char *) (pgm_read_word(&(mode->desc)))); |
||
3961 | 165c: e0 91 9d 02 lds r30, 0x029D |
||
3962 | 1660: f0 91 9e 02 lds r31, 0x029E |
||
3963 | 1664: 32 96 adiw r30, 0x02 ; 2 |
||
3964 | 1666: 45 91 lpm r20, Z+ |
||
3965 | 1668: 54 91 lpm r21, Z+ |
||
3966 | 166a: 82 e1 ldi r24, 0x12 ; 18 |
||
3967 | 166c: 6a e0 ldi r22, 0x0A ; 10 |
||
3968 | 166e: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3969 | |||
3970 | write_ascii_string_pgm(4, ++line, PSTR("Height by")); |
||
3971 | 1672: 84 e0 ldi r24, 0x04 ; 4 |
||
3972 | 1674: 6b e0 ldi r22, 0x0B ; 11 |
||
3973 | 1676: 43 e6 ldi r20, 0x63 ; 99 |
||
3974 | 1678: 52 e0 ldi r21, 0x02 ; 2 |
||
3975 | 167a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3976 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
||
3977 | 167e: 80 91 1c 01 lds r24, 0x011C |
||
3978 | 1682: 81 fd sbrc r24, 1 |
||
3979 | 1684: 1d c0 rjmp .+58 ; 0x16c0 <config_menu_drawings+0x166> |
||
3980 | write_ascii_string_pgm(20, line, PSTR(" GPS")); |
||
3981 | } else { |
||
3982 | write_ascii_string_pgm(20, line, PSTR("BARO")); |
||
3983 | 1686: 84 e1 ldi r24, 0x14 ; 20 |
||
3984 | 1688: 6b e0 ldi r22, 0x0B ; 11 |
||
3985 | 168a: 49 e5 ldi r20, 0x59 ; 89 |
||
3986 | 168c: 52 e0 ldi r21, 0x02 ; 2 |
||
3987 | 168e: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3988 | } |
||
3989 | |||
3990 | write_ascii_string_pgm(4, ++line, PSTR("Save config")); |
||
3991 | 1692: 84 e0 ldi r24, 0x04 ; 4 |
||
3992 | 1694: 6c e0 ldi r22, 0x0C ; 12 |
||
3993 | 1696: 4d e4 ldi r20, 0x4D ; 77 |
||
3994 | 1698: 52 e0 ldi r21, 0x02 ; 2 |
||
3995 | 169a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
3996 | write_ascii_string_pgm(4, ++line, PSTR("EXIT")); |
||
3997 | 169e: 84 e0 ldi r24, 0x04 ; 4 |
||
3998 | 16a0: 6d e0 ldi r22, 0x0D ; 13 |
||
3999 | 16a2: 48 e4 ldi r20, 0x48 ; 72 |
||
4000 | 16a4: 52 e0 ldi r21, 0x02 ; 2 |
||
4001 | 16a6: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4002 | } |
||
4003 | 16aa: 1f 91 pop r17 |
||
4004 | 16ac: 0f 91 pop r16 |
||
4005 | 16ae: ff 90 pop r15 |
||
4006 | 16b0: 08 95 ret |
||
4007 | |||
4008 | write_ascii_string_pgm(4, line, PSTR("Video Mode")); |
||
4009 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
4010 | write_ascii_string_pgm(23, line, VM_NTSC); |
||
4011 | } else { |
||
4012 | write_ascii_string_pgm(23, line, VM_PAL); |
||
4013 | 16b2: 87 e1 ldi r24, 0x17 ; 23 |
||
4014 | 16b4: 62 e0 ldi r22, 0x02 ; 2 |
||
4015 | 16b6: 44 ee ldi r20, 0xE4 ; 228 |
||
4016 | 16b8: 51 e0 ldi r21, 0x01 ; 1 |
||
4017 | 16ba: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4018 | 16be: 7a cf rjmp .-268 ; 0x15b4 <config_menu_drawings+0x5a> |
||
4019 | write_ascii_string_pgm(4, ++line, PSTR("Display Mode")); |
||
4020 | write_ascii_string_pgm(18, line, (const char *) (pgm_read_word(&(mode->desc)))); |
||
4021 | |||
4022 | write_ascii_string_pgm(4, ++line, PSTR("Height by")); |
||
4023 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
||
4024 | write_ascii_string_pgm(20, line, PSTR(" GPS")); |
||
4025 | 16c0: 84 e1 ldi r24, 0x14 ; 20 |
||
4026 | 16c2: 6b e0 ldi r22, 0x0B ; 11 |
||
4027 | 16c4: 4e e5 ldi r20, 0x5E ; 94 |
||
4028 | 16c6: 52 e0 ldi r21, 0x02 ; 2 |
||
4029 | 16c8: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4030 | 16cc: e2 cf rjmp .-60 ; 0x1692 <config_menu_drawings+0x138> |
||
4031 | |||
4032 | 000016ce <config_menu_doclick>: |
||
4033 | } |
||
4034 | |||
4035 | /** |
||
4036 | * some sort of clicking response in the menu |
||
4037 | */ |
||
4038 | void config_menu_doclick(uint8_t chosen) { |
||
4039 | 16ce: 1f 93 push r17 |
||
4040 | 16d0: 18 2f mov r17, r24 |
||
4041 | write_ascii_string_pgm(4, chosen + 2, PSTR("DONE ")); |
||
4042 | 16d2: 68 2f mov r22, r24 |
||
4043 | 16d4: 6e 5f subi r22, 0xFE ; 254 |
||
4044 | 16d6: 84 e0 ldi r24, 0x04 ; 4 |
||
4045 | 16d8: 45 e3 ldi r20, 0x35 ; 53 |
||
4046 | 16da: 52 e0 ldi r21, 0x02 ; 2 |
||
4047 | 16dc: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4048 | 16e0: 28 e8 ldi r18, 0x88 ; 136 |
||
4049 | 16e2: 33 e1 ldi r19, 0x13 ; 19 |
||
4050 | milliseconds can be achieved. |
||
4051 | */ |
||
4052 | void |
||
4053 | _delay_loop_2(uint16_t __count) |
||
4054 | { |
||
4055 | __asm__ volatile ( |
||
4056 | 16e4: 40 e9 ldi r20, 0x90 ; 144 |
||
4057 | 16e6: 51 e0 ldi r21, 0x01 ; 1 |
||
4058 | 16e8: ca 01 movw r24, r20 |
||
4059 | 16ea: 01 97 sbiw r24, 0x01 ; 1 |
||
4060 | 16ec: f1 f7 brne .-4 ; 0x16ea <config_menu_doclick+0x1c> |
||
4061 | { |
||
4062 | // wait 1/10 ms |
||
4063 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
4064 | __ticks --; |
||
4065 | 16ee: 21 50 subi r18, 0x01 ; 1 |
||
4066 | 16f0: 30 40 sbci r19, 0x00 ; 0 |
||
4067 | __ticks = 1; |
||
4068 | else if (__tmp > 65535) |
||
4069 | { |
||
4070 | // __ticks = requested delay in 1/10 ms |
||
4071 | __ticks = (uint16_t) (__ms * 10.0); |
||
4072 | while(__ticks) |
||
4073 | 16f2: d1 f7 brne .-12 ; 0x16e8 <config_menu_doclick+0x1a> |
||
4074 | _delay_ms(500); |
||
4075 | config_menu_drawings(chosen); |
||
4076 | 16f4: 81 2f mov r24, r17 |
||
4077 | 16f6: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4078 | } |
||
4079 | 16fa: 1f 91 pop r17 |
||
4080 | 16fc: 08 95 ret |
||
4081 | |||
4082 | 000016fe <save_eeprom>: |
||
4083 | |||
4084 | /** |
||
4085 | * save data to eeprom |
||
4086 | */ |
||
4087 | void save_eeprom() { |
||
4088 | eeprom_write_byte(&ee_checkbyte1, CHECKBYTE1); |
||
4089 | 16fe: 80 e0 ldi r24, 0x00 ; 0 |
||
4090 | 1700: 90 e0 ldi r25, 0x00 ; 0 |
||
4091 | 1702: 6e e2 ldi r22, 0x2E ; 46 |
||
4092 | 1704: 0e 94 f5 1c call 0x39ea ; 0x39ea <__eewr_byte_m162> |
||
4093 | eeprom_write_byte(&ee_checkbyte2, CHECKBYTE2); |
||
4094 | 1708: 81 e0 ldi r24, 0x01 ; 1 |
||
4095 | 170a: 90 e0 ldi r25, 0x00 ; 0 |
||
4096 | 170c: 67 e1 ldi r22, 0x17 ; 23 |
||
4097 | 170e: 0e 94 f5 1c call 0x39ea ; 0x39ea <__eewr_byte_m162> |
||
4098 | eeprom_write_byte(&ee_COSD_FLAGS_MODES, COSD_FLAGS_MODES); |
||
4099 | 1712: 82 e0 ldi r24, 0x02 ; 2 |
||
4100 | 1714: 90 e0 ldi r25, 0x00 ; 0 |
||
4101 | 1716: 60 91 1b 01 lds r22, 0x011B |
||
4102 | 171a: 0e 94 f5 1c call 0x39ea ; 0x39ea <__eewr_byte_m162> |
||
4103 | eeprom_write_byte(&ee_COSD_FLAGS_CONFIG, COSD_FLAGS_CONFIG); |
||
4104 | 171e: 83 e0 ldi r24, 0x03 ; 3 |
||
4105 | 1720: 90 e0 ldi r25, 0x00 ; 0 |
||
4106 | 1722: 60 91 1c 01 lds r22, 0x011C |
||
4107 | 1726: 0e 94 f5 1c call 0x39ea ; 0x39ea <__eewr_byte_m162> |
||
4108 | eeprom_write_byte(&ee_COSD_DISPLAYMODE, COSD_DISPLAYMODE); |
||
4109 | 172a: 84 e0 ldi r24, 0x04 ; 4 |
||
4110 | 172c: 90 e0 ldi r25, 0x00 ; 0 |
||
4111 | 172e: 60 91 1e 01 lds r22, 0x011E |
||
4112 | 1732: 0e 94 f5 1c call 0x39ea ; 0x39ea <__eewr_byte_m162> |
||
4113 | } |
||
4114 | 1736: 08 95 ret |
||
4115 | |||
4116 | 00001738 <config_menu>: |
||
4117 | } |
||
4118 | |||
4119 | /** |
||
4120 | * a simple config menu tryout |
||
4121 | */ |
||
4122 | void config_menu(void) { |
||
4123 | 1738: af 92 push r10 |
||
4124 | 173a: bf 92 push r11 |
||
4125 | 173c: cf 92 push r12 |
||
4126 | 173e: df 92 push r13 |
||
4127 | 1740: ef 92 push r14 |
||
4128 | 1742: ff 92 push r15 |
||
4129 | 1744: 0f 93 push r16 |
||
4130 | 1746: 1f 93 push r17 |
||
4131 | 1748: cf 93 push r28 |
||
4132 | 174a: df 93 push r29 |
||
4133 | // disable interrupts (makes the menu more smoothely) |
||
4134 | cli(); |
||
4135 | 174c: f8 94 cli |
||
4136 | |||
4137 | // clear screen |
||
4138 | clear(); |
||
4139 | 174e: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
4140 | |||
4141 | uint8_t chosen = 0; |
||
4142 | uint8_t inmenu = 1; |
||
4143 | write_ascii_string_pgm(6, 1, PSTR("C-OSD Config Menu")); |
||
4144 | 1752: 86 e0 ldi r24, 0x06 ; 6 |
||
4145 | 1754: 61 e0 ldi r22, 0x01 ; 1 |
||
4146 | 1756: 43 e2 ldi r20, 0x23 ; 35 |
||
4147 | 1758: 52 e0 ldi r21, 0x02 ; 2 |
||
4148 | 175a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4149 | 175e: 24 ec ldi r18, 0xC4 ; 196 |
||
4150 | 1760: 39 e0 ldi r19, 0x09 ; 9 |
||
4151 | 1762: 40 e9 ldi r20, 0x90 ; 144 |
||
4152 | 1764: 51 e0 ldi r21, 0x01 ; 1 |
||
4153 | 1766: ca 01 movw r24, r20 |
||
4154 | 1768: 01 97 sbiw r24, 0x01 ; 1 |
||
4155 | 176a: f1 f7 brne .-4 ; 0x1768 <config_menu+0x30> |
||
4156 | { |
||
4157 | // wait 1/10 ms |
||
4158 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
4159 | __ticks --; |
||
4160 | 176c: 21 50 subi r18, 0x01 ; 1 |
||
4161 | 176e: 30 40 sbci r19, 0x00 ; 0 |
||
4162 | __ticks = 1; |
||
4163 | else if (__tmp > 65535) |
||
4164 | { |
||
4165 | // __ticks = requested delay in 1/10 ms |
||
4166 | __ticks = (uint16_t) (__ms * 10.0); |
||
4167 | while(__ticks) |
||
4168 | 1770: d1 f7 brne .-12 ; 0x1766 <config_menu+0x2e> |
||
4169 | |||
4170 | // wait a bit before doing stuff so user has chance to release button |
||
4171 | _delay_ms(250); |
||
4172 | |||
4173 | config_menu_drawings(chosen); |
||
4174 | 1772: 80 e0 ldi r24, 0x00 ; 0 |
||
4175 | 1774: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4176 | 1778: 10 e0 ldi r17, 0x00 ; 0 |
||
4177 | 177a: c0 e9 ldi r28, 0x90 ; 144 |
||
4178 | 177c: d1 e0 ldi r29, 0x01 ; 1 |
||
4179 | /*case 5: // warnings |
||
4180 | COSD_FLAGS_MODES ^= COSD_FLAG_WARNINGS; |
||
4181 | config_menu_drawings(chosen); |
||
4182 | break;*/ |
||
4183 | case 5: // current by fc |
||
4184 | COSD_FLAGS_MODES ^= COSD_FLAG_FCCURRENT; |
||
4185 | 177e: 00 e4 ldi r16, 0x40 ; 64 |
||
4186 | config_menu_drawings(chosen); |
||
4187 | 1780: ff 24 eor r15, r15 |
||
4188 | 1782: f3 94 inc r15 |
||
4189 | osd_ncmode = (int(*)(void)) pgm_read_word(&mode->dfun); |
||
4190 | #endif |
||
4191 | config_menu_drawings(chosen); |
||
4192 | break; |
||
4193 | case 9: // GPS or BARO height |
||
4194 | COSD_FLAGS_CONFIG ^= COSD_FLAG_GPSHEIGHT; |
||
4195 | 1784: 72 e0 ldi r23, 0x02 ; 2 |
||
4196 | 1786: e7 2e mov r14, r23 |
||
4197 | case 5: // current by fc |
||
4198 | COSD_FLAGS_MODES ^= COSD_FLAG_FCCURRENT; |
||
4199 | config_menu_drawings(chosen); |
||
4200 | break; |
||
4201 | case 6: // 2nd voltage by c-strom |
||
4202 | COSD_FLAGS_MODES ^= COSD_FLAG_STROMVOLT; |
||
4203 | 1788: 60 e2 ldi r22, 0x20 ; 32 |
||
4204 | 178a: d6 2e mov r13, r22 |
||
4205 | case 2: // art horizon |
||
4206 | COSD_FLAGS_MODES ^= COSD_FLAG_ARTHORIZON; |
||
4207 | config_menu_drawings(chosen); |
||
4208 | break; |
||
4209 | case 3: // big vario |
||
4210 | COSD_FLAGS_MODES ^= COSD_FLAG_BIGVARIO; |
||
4211 | 178c: 54 e0 ldi r21, 0x04 ; 4 |
||
4212 | 178e: c5 2e mov r12, r21 |
||
4213 | bottom_line = 12; |
||
4214 | } else { |
||
4215 | // PAL + enable display immediately (VM0) |
||
4216 | spi_send_byte(0x00, 0b01001000); |
||
4217 | |||
4218 | bottom_line = 14; |
||
4219 | 1790: 4e e0 ldi r20, 0x0E ; 14 |
||
4220 | 1792: b4 2e mov r11, r20 |
||
4221 | // Setup Video Mode |
||
4222 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
4223 | // NTSC + enable display immediately (VM0) |
||
4224 | spi_send_byte(0x00, 0b00001000); |
||
4225 | |||
4226 | bottom_line = 12; |
||
4227 | 1794: 3c e0 ldi r19, 0x0C ; 12 |
||
4228 | 1796: a3 2e mov r10, r19 |
||
4229 | _delay_ms(250); |
||
4230 | |||
4231 | config_menu_drawings(chosen); |
||
4232 | |||
4233 | while (inmenu) { |
||
4234 | if (s2_pressed()) { |
||
4235 | 1798: 0e 94 79 0e call 0x1cf2 ; 0x1cf2 <s2_pressed> |
||
4236 | 179c: 89 2b or r24, r25 |
||
4237 | 179e: b1 f0 breq .+44 ; 0x17cc <config_menu+0x94> |
||
4238 | chosen = (chosen + 1) % 12; |
||
4239 | 17a0: 81 2f mov r24, r17 |
||
4240 | 17a2: 90 e0 ldi r25, 0x00 ; 0 |
||
4241 | 17a4: 01 96 adiw r24, 0x01 ; 1 |
||
4242 | 17a6: 6c e0 ldi r22, 0x0C ; 12 |
||
4243 | 17a8: 70 e0 ldi r23, 0x00 ; 0 |
||
4244 | 17aa: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
4245 | 17ae: 18 2f mov r17, r24 |
||
4246 | config_menu_drawings(chosen); |
||
4247 | 17b0: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4248 | 17b4: 28 e8 ldi r18, 0x88 ; 136 |
||
4249 | 17b6: 33 e1 ldi r19, 0x13 ; 19 |
||
4250 | 17b8: ce 01 movw r24, r28 |
||
4251 | 17ba: 01 97 sbiw r24, 0x01 ; 1 |
||
4252 | 17bc: f1 f7 brne .-4 ; 0x17ba <config_menu+0x82> |
||
4253 | { |
||
4254 | // wait 1/10 ms |
||
4255 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
4256 | __ticks --; |
||
4257 | 17be: 21 50 subi r18, 0x01 ; 1 |
||
4258 | 17c0: 30 40 sbci r19, 0x00 ; 0 |
||
4259 | __ticks = 1; |
||
4260 | else if (__tmp > 65535) |
||
4261 | { |
||
4262 | // __ticks = requested delay in 1/10 ms |
||
4263 | __ticks = (uint16_t) (__ms * 10.0); |
||
4264 | while(__ticks) |
||
4265 | 17c2: d1 f7 brne .-12 ; 0x17b8 <config_menu+0x80> |
||
4266 | _delay_ms(250); |
||
4267 | |||
4268 | config_menu_drawings(chosen); |
||
4269 | |||
4270 | while (inmenu) { |
||
4271 | if (s2_pressed()) { |
||
4272 | 17c4: 0e 94 79 0e call 0x1cf2 ; 0x1cf2 <s2_pressed> |
||
4273 | 17c8: 89 2b or r24, r25 |
||
4274 | 17ca: 51 f7 brne .-44 ; 0x17a0 <config_menu+0x68> |
||
4275 | chosen = (chosen + 1) % 12; |
||
4276 | config_menu_drawings(chosen); |
||
4277 | _delay_ms(500); |
||
4278 | } else if (s1_pressed()) { |
||
4279 | 17cc: 0e 94 58 0e call 0x1cb0 ; 0x1cb0 <s1_pressed> |
||
4280 | 17d0: 89 2b or r24, r25 |
||
4281 | 17d2: 11 f3 breq .-60 ; 0x1798 <config_menu+0x60> |
||
4282 | switch (chosen) { |
||
4283 | 17d4: 15 30 cpi r17, 0x05 ; 5 |
||
4284 | 17d6: 09 f4 brne .+2 ; 0x17da <config_menu+0xa2> |
||
4285 | 17d8: bf c0 rjmp .+382 ; 0x1958 <config_menu+0x220> |
||
4286 | 17da: 16 30 cpi r17, 0x06 ; 6 |
||
4287 | 17dc: 58 f5 brcc .+86 ; 0x1834 <config_menu+0xfc> |
||
4288 | 17de: 12 30 cpi r17, 0x02 ; 2 |
||
4289 | 17e0: 09 f4 brne .+2 ; 0x17e4 <config_menu+0xac> |
||
4290 | 17e2: b0 c0 rjmp .+352 ; 0x1944 <config_menu+0x20c> |
||
4291 | 17e4: 13 30 cpi r17, 0x03 ; 3 |
||
4292 | 17e6: 08 f4 brcc .+2 ; 0x17ea <config_menu+0xb2> |
||
4293 | 17e8: 41 c0 rjmp .+130 ; 0x186c <config_menu+0x134> |
||
4294 | 17ea: 13 30 cpi r17, 0x03 ; 3 |
||
4295 | 17ec: 09 f4 brne .+2 ; 0x17f0 <config_menu+0xb8> |
||
4296 | 17ee: 62 c0 rjmp .+196 ; 0x18b4 <config_menu+0x17c> |
||
4297 | 17f0: 14 30 cpi r17, 0x04 ; 4 |
||
4298 | 17f2: 09 f4 brne .+2 ; 0x17f6 <config_menu+0xbe> |
||
4299 | 17f4: 54 c0 rjmp .+168 ; 0x189e <config_menu+0x166> |
||
4300 | COSD_FLAGS_CONFIG ^= COSD_FLAG_GPSHEIGHT; |
||
4301 | config_menu_drawings(chosen); |
||
4302 | break; |
||
4303 | case 10: // save |
||
4304 | save_eeprom(); |
||
4305 | config_menu_doclick(chosen); |
||
4306 | 17f6: 41 e0 ldi r20, 0x01 ; 1 |
||
4307 | 17f8: 24 ec ldi r18, 0xC4 ; 196 |
||
4308 | 17fa: 39 e0 ldi r19, 0x09 ; 9 |
||
4309 | 17fc: ce 01 movw r24, r28 |
||
4310 | 17fe: 01 97 sbiw r24, 0x01 ; 1 |
||
4311 | 1800: f1 f7 brne .-4 ; 0x17fe <config_menu+0xc6> |
||
4312 | { |
||
4313 | // wait 1/10 ms |
||
4314 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
4315 | __ticks --; |
||
4316 | 1802: 21 50 subi r18, 0x01 ; 1 |
||
4317 | 1804: 30 40 sbci r19, 0x00 ; 0 |
||
4318 | __ticks = 1; |
||
4319 | else if (__tmp > 65535) |
||
4320 | { |
||
4321 | // __ticks = requested delay in 1/10 ms |
||
4322 | __ticks = (uint16_t) (__ms * 10.0); |
||
4323 | while(__ticks) |
||
4324 | 1806: d1 f7 brne .-12 ; 0x17fc <config_menu+0xc4> |
||
4325 | // wait a bit before doing stuff so user has chance to release button |
||
4326 | _delay_ms(250); |
||
4327 | |||
4328 | config_menu_drawings(chosen); |
||
4329 | |||
4330 | while (inmenu) { |
||
4331 | 1808: 44 23 and r20, r20 |
||
4332 | 180a: 09 f0 breq .+2 ; 0x180e <config_menu+0xd6> |
||
4333 | 180c: c5 cf rjmp .-118 ; 0x1798 <config_menu+0x60> |
||
4334 | _delay_ms(250); |
||
4335 | } |
||
4336 | } |
||
4337 | |||
4338 | // clear screen up again |
||
4339 | clear(); |
||
4340 | 180e: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
4341 | |||
4342 | // update flags to paint display again if needed |
||
4343 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
4344 | 1812: 80 91 1d 01 lds r24, 0x011D |
||
4345 | 1816: 8d 7f andi r24, 0xFD ; 253 |
||
4346 | 1818: 80 93 1d 01 sts 0x011D, r24 |
||
4347 | |||
4348 | // enable interrupts again |
||
4349 | sei(); |
||
4350 | 181c: 78 94 sei |
||
4351 | } |
||
4352 | 181e: df 91 pop r29 |
||
4353 | 1820: cf 91 pop r28 |
||
4354 | 1822: 1f 91 pop r17 |
||
4355 | 1824: 0f 91 pop r16 |
||
4356 | 1826: ff 90 pop r15 |
||
4357 | 1828: ef 90 pop r14 |
||
4358 | 182a: df 90 pop r13 |
||
4359 | 182c: cf 90 pop r12 |
||
4360 | 182e: bf 90 pop r11 |
||
4361 | 1830: af 90 pop r10 |
||
4362 | 1832: 08 95 ret |
||
4363 | if (s2_pressed()) { |
||
4364 | chosen = (chosen + 1) % 12; |
||
4365 | config_menu_drawings(chosen); |
||
4366 | _delay_ms(500); |
||
4367 | } else if (s1_pressed()) { |
||
4368 | switch (chosen) { |
||
4369 | 1834: 18 30 cpi r17, 0x08 ; 8 |
||
4370 | 1836: 09 f4 brne .+2 ; 0x183a <config_menu+0x102> |
||
4371 | 1838: 63 c0 rjmp .+198 ; 0x1900 <config_menu+0x1c8> |
||
4372 | 183a: 19 30 cpi r17, 0x09 ; 9 |
||
4373 | 183c: 48 f0 brcs .+18 ; 0x1850 <config_menu+0x118> |
||
4374 | 183e: 1a 30 cpi r17, 0x0A ; 10 |
||
4375 | 1840: 09 f4 brne .+2 ; 0x1844 <config_menu+0x10c> |
||
4376 | 1842: 7a c0 rjmp .+244 ; 0x1938 <config_menu+0x200> |
||
4377 | 1844: 1a 30 cpi r17, 0x0A ; 10 |
||
4378 | 1846: 08 f1 brcs .+66 ; 0x188a <config_menu+0x152> |
||
4379 | 1848: 1b 30 cpi r17, 0x0B ; 11 |
||
4380 | 184a: a9 f6 brne .-86 ; 0x17f6 <config_menu+0xbe> |
||
4381 | 184c: 40 e0 ldi r20, 0x00 ; 0 |
||
4382 | 184e: d4 cf rjmp .-88 ; 0x17f8 <config_menu+0xc0> |
||
4383 | 1850: 16 30 cpi r17, 0x06 ; 6 |
||
4384 | 1852: 09 f4 brne .+2 ; 0x1856 <config_menu+0x11e> |
||
4385 | 1854: 4b c0 rjmp .+150 ; 0x18ec <config_menu+0x1b4> |
||
4386 | 1856: 17 30 cpi r17, 0x07 ; 7 |
||
4387 | 1858: 71 f6 brne .-100 ; 0x17f6 <config_menu+0xbe> |
||
4388 | case 6: // 2nd voltage by c-strom |
||
4389 | COSD_FLAGS_MODES ^= COSD_FLAG_STROMVOLT; |
||
4390 | config_menu_drawings(chosen); |
||
4391 | break; |
||
4392 | case 7: // reset uptime |
||
4393 | uptime = 0; |
||
4394 | 185a: 10 92 13 01 sts 0x0113, r1 |
||
4395 | 185e: 10 92 12 01 sts 0x0112, r1 |
||
4396 | config_menu_doclick(chosen); |
||
4397 | 1862: 87 e0 ldi r24, 0x07 ; 7 |
||
4398 | 1864: 0e 94 67 0b call 0x16ce ; 0x16ce <config_menu_doclick> |
||
4399 | 1868: 41 e0 ldi r20, 0x01 ; 1 |
||
4400 | 186a: c6 cf rjmp .-116 ; 0x17f8 <config_menu+0xc0> |
||
4401 | if (s2_pressed()) { |
||
4402 | chosen = (chosen + 1) % 12; |
||
4403 | config_menu_drawings(chosen); |
||
4404 | _delay_ms(500); |
||
4405 | } else if (s1_pressed()) { |
||
4406 | switch (chosen) { |
||
4407 | 186c: 11 23 and r17, r17 |
||
4408 | 186e: 61 f1 breq .+88 ; 0x18c8 <config_menu+0x190> |
||
4409 | 1870: 11 30 cpi r17, 0x01 ; 1 |
||
4410 | 1872: 09 f0 breq .+2 ; 0x1876 <config_menu+0x13e> |
||
4411 | 1874: c0 cf rjmp .-128 ; 0x17f6 <config_menu+0xbe> |
||
4412 | bottom_line = 14; |
||
4413 | } |
||
4414 | config_menu_drawings(chosen); |
||
4415 | break; |
||
4416 | case 1: // full HUD |
||
4417 | COSD_FLAGS_MODES ^= COSD_FLAG_HUD; |
||
4418 | 1876: 80 91 1b 01 lds r24, 0x011B |
||
4419 | 187a: 81 27 eor r24, r17 |
||
4420 | 187c: 80 93 1b 01 sts 0x011B, r24 |
||
4421 | config_menu_drawings(chosen); |
||
4422 | 1880: 81 e0 ldi r24, 0x01 ; 1 |
||
4423 | 1882: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4424 | 1886: 41 e0 ldi r20, 0x01 ; 1 |
||
4425 | 1888: b7 cf rjmp .-146 ; 0x17f8 <config_menu+0xc0> |
||
4426 | osd_ncmode = (int(*)(void)) pgm_read_word(&mode->dfun); |
||
4427 | #endif |
||
4428 | config_menu_drawings(chosen); |
||
4429 | break; |
||
4430 | case 9: // GPS or BARO height |
||
4431 | COSD_FLAGS_CONFIG ^= COSD_FLAG_GPSHEIGHT; |
||
4432 | 188a: 80 91 1c 01 lds r24, 0x011C |
||
4433 | 188e: 8e 25 eor r24, r14 |
||
4434 | 1890: 80 93 1c 01 sts 0x011C, r24 |
||
4435 | config_menu_drawings(chosen); |
||
4436 | 1894: 89 e0 ldi r24, 0x09 ; 9 |
||
4437 | 1896: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4438 | 189a: 41 e0 ldi r20, 0x01 ; 1 |
||
4439 | 189c: ad cf rjmp .-166 ; 0x17f8 <config_menu+0xc0> |
||
4440 | case 3: // big vario |
||
4441 | COSD_FLAGS_MODES ^= COSD_FLAG_BIGVARIO; |
||
4442 | config_menu_drawings(chosen); |
||
4443 | break; |
||
4444 | case 4: // statistics |
||
4445 | COSD_FLAGS_MODES ^= COSD_FLAG_STATS; |
||
4446 | 189e: 80 91 1b 01 lds r24, 0x011B |
||
4447 | 18a2: 98 e0 ldi r25, 0x08 ; 8 |
||
4448 | 18a4: 89 27 eor r24, r25 |
||
4449 | 18a6: 80 93 1b 01 sts 0x011B, r24 |
||
4450 | config_menu_drawings(chosen); |
||
4451 | 18aa: 84 e0 ldi r24, 0x04 ; 4 |
||
4452 | 18ac: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4453 | 18b0: 41 e0 ldi r20, 0x01 ; 1 |
||
4454 | 18b2: a2 cf rjmp .-188 ; 0x17f8 <config_menu+0xc0> |
||
4455 | case 2: // art horizon |
||
4456 | COSD_FLAGS_MODES ^= COSD_FLAG_ARTHORIZON; |
||
4457 | config_menu_drawings(chosen); |
||
4458 | break; |
||
4459 | case 3: // big vario |
||
4460 | COSD_FLAGS_MODES ^= COSD_FLAG_BIGVARIO; |
||
4461 | 18b4: 80 91 1b 01 lds r24, 0x011B |
||
4462 | 18b8: 8c 25 eor r24, r12 |
||
4463 | 18ba: 80 93 1b 01 sts 0x011B, r24 |
||
4464 | config_menu_drawings(chosen); |
||
4465 | 18be: 83 e0 ldi r24, 0x03 ; 3 |
||
4466 | 18c0: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4467 | 18c4: 41 e0 ldi r20, 0x01 ; 1 |
||
4468 | 18c6: 98 cf rjmp .-208 ; 0x17f8 <config_menu+0xc0> |
||
4469 | config_menu_drawings(chosen); |
||
4470 | _delay_ms(500); |
||
4471 | } else if (s1_pressed()) { |
||
4472 | switch (chosen) { |
||
4473 | case 0: // NTSC or PAL |
||
4474 | COSD_FLAGS_CONFIG ^= COSD_FLAG_NTSC; |
||
4475 | 18c8: 80 91 1c 01 lds r24, 0x011C |
||
4476 | 18cc: 8f 25 eor r24, r15 |
||
4477 | 18ce: 80 93 1c 01 sts 0x011C, r24 |
||
4478 | // Setup Video Mode |
||
4479 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
4480 | 18d2: 80 fd sbrc r24, 0 |
||
4481 | 18d4: 4b c0 rjmp .+150 ; 0x196c <config_menu+0x234> |
||
4482 | spi_send_byte(0x00, 0b00001000); |
||
4483 | |||
4484 | bottom_line = 12; |
||
4485 | } else { |
||
4486 | // PAL + enable display immediately (VM0) |
||
4487 | spi_send_byte(0x00, 0b01001000); |
||
4488 | 18d6: 80 e0 ldi r24, 0x00 ; 0 |
||
4489 | 18d8: 68 e4 ldi r22, 0x48 ; 72 |
||
4490 | 18da: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
4491 | |||
4492 | bottom_line = 14; |
||
4493 | 18de: b0 92 03 01 sts 0x0103, r11 |
||
4494 | } |
||
4495 | config_menu_drawings(chosen); |
||
4496 | 18e2: 80 e0 ldi r24, 0x00 ; 0 |
||
4497 | 18e4: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4498 | 18e8: 41 e0 ldi r20, 0x01 ; 1 |
||
4499 | 18ea: 86 cf rjmp .-244 ; 0x17f8 <config_menu+0xc0> |
||
4500 | case 5: // current by fc |
||
4501 | COSD_FLAGS_MODES ^= COSD_FLAG_FCCURRENT; |
||
4502 | config_menu_drawings(chosen); |
||
4503 | break; |
||
4504 | case 6: // 2nd voltage by c-strom |
||
4505 | COSD_FLAGS_MODES ^= COSD_FLAG_STROMVOLT; |
||
4506 | 18ec: 80 91 1b 01 lds r24, 0x011B |
||
4507 | 18f0: 8d 25 eor r24, r13 |
||
4508 | 18f2: 80 93 1b 01 sts 0x011B, r24 |
||
4509 | config_menu_drawings(chosen); |
||
4510 | 18f6: 86 e0 ldi r24, 0x06 ; 6 |
||
4511 | 18f8: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4512 | 18fc: 41 e0 ldi r20, 0x01 ; 1 |
||
4513 | 18fe: 7c cf rjmp .-264 ; 0x17f8 <config_menu+0xc0> |
||
4514 | COSD_DISPLAYMODE = (COSD_DISPLAYMODE + 1) % (sizeof(fcdisplaymodes) / sizeof(displaymode_t)); |
||
4515 | mode = fcdisplaymodes; |
||
4516 | mode += COSD_DISPLAYMODE; |
||
4517 | osd_fcmode = (int(*)(void)) pgm_read_word(&mode->dfun); |
||
4518 | #else |
||
4519 | COSD_DISPLAYMODE = (COSD_DISPLAYMODE + 1) % (sizeof(ncdisplaymodes) / sizeof(displaymode_t)); |
||
4520 | 1900: e0 91 1e 01 lds r30, 0x011E |
||
4521 | 1904: ef 5f subi r30, 0xFF ; 255 |
||
4522 | 1906: e1 70 andi r30, 0x01 ; 1 |
||
4523 | 1908: e0 93 1e 01 sts 0x011E, r30 |
||
4524 | mode = ncdisplaymodes; |
||
4525 | mode += COSD_DISPLAYMODE; |
||
4526 | 190c: f0 e0 ldi r31, 0x00 ; 0 |
||
4527 | 190e: ee 0f add r30, r30 |
||
4528 | 1910: ff 1f adc r31, r31 |
||
4529 | 1912: ee 0f add r30, r30 |
||
4530 | 1914: ff 1f adc r31, r31 |
||
4531 | 1916: e0 5d subi r30, 0xD0 ; 208 |
||
4532 | 1918: fe 4f sbci r31, 0xFE ; 254 |
||
4533 | 191a: f0 93 9e 02 sts 0x029E, r31 |
||
4534 | 191e: e0 93 9d 02 sts 0x029D, r30 |
||
4535 | osd_ncmode = (int(*)(void)) pgm_read_word(&mode->dfun); |
||
4536 | 1922: 85 91 lpm r24, Z+ |
||
4537 | 1924: 94 91 lpm r25, Z+ |
||
4538 | 1926: 90 93 06 01 sts 0x0106, r25 |
||
4539 | 192a: 80 93 05 01 sts 0x0105, r24 |
||
4540 | #endif |
||
4541 | config_menu_drawings(chosen); |
||
4542 | 192e: 88 e0 ldi r24, 0x08 ; 8 |
||
4543 | 1930: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4544 | 1934: 41 e0 ldi r20, 0x01 ; 1 |
||
4545 | 1936: 60 cf rjmp .-320 ; 0x17f8 <config_menu+0xc0> |
||
4546 | case 9: // GPS or BARO height |
||
4547 | COSD_FLAGS_CONFIG ^= COSD_FLAG_GPSHEIGHT; |
||
4548 | config_menu_drawings(chosen); |
||
4549 | break; |
||
4550 | case 10: // save |
||
4551 | save_eeprom(); |
||
4552 | 1938: 0e 94 7f 0b call 0x16fe ; 0x16fe <save_eeprom> |
||
4553 | config_menu_doclick(chosen); |
||
4554 | 193c: 8a e0 ldi r24, 0x0A ; 10 |
||
4555 | 193e: 0e 94 67 0b call 0x16ce ; 0x16ce <config_menu_doclick> |
||
4556 | 1942: 59 cf rjmp .-334 ; 0x17f6 <config_menu+0xbe> |
||
4557 | case 1: // full HUD |
||
4558 | COSD_FLAGS_MODES ^= COSD_FLAG_HUD; |
||
4559 | config_menu_drawings(chosen); |
||
4560 | break; |
||
4561 | case 2: // art horizon |
||
4562 | COSD_FLAGS_MODES ^= COSD_FLAG_ARTHORIZON; |
||
4563 | 1944: 80 91 1b 01 lds r24, 0x011B |
||
4564 | 1948: 81 27 eor r24, r17 |
||
4565 | 194a: 80 93 1b 01 sts 0x011B, r24 |
||
4566 | config_menu_drawings(chosen); |
||
4567 | 194e: 82 e0 ldi r24, 0x02 ; 2 |
||
4568 | 1950: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4569 | 1954: 41 e0 ldi r20, 0x01 ; 1 |
||
4570 | 1956: 50 cf rjmp .-352 ; 0x17f8 <config_menu+0xc0> |
||
4571 | /*case 5: // warnings |
||
4572 | COSD_FLAGS_MODES ^= COSD_FLAG_WARNINGS; |
||
4573 | config_menu_drawings(chosen); |
||
4574 | break;*/ |
||
4575 | case 5: // current by fc |
||
4576 | COSD_FLAGS_MODES ^= COSD_FLAG_FCCURRENT; |
||
4577 | 1958: 80 91 1b 01 lds r24, 0x011B |
||
4578 | 195c: 80 27 eor r24, r16 |
||
4579 | 195e: 80 93 1b 01 sts 0x011B, r24 |
||
4580 | config_menu_drawings(chosen); |
||
4581 | 1962: 85 e0 ldi r24, 0x05 ; 5 |
||
4582 | 1964: 0e 94 ad 0a call 0x155a ; 0x155a <config_menu_drawings> |
||
4583 | 1968: 41 e0 ldi r20, 0x01 ; 1 |
||
4584 | 196a: 46 cf rjmp .-372 ; 0x17f8 <config_menu+0xc0> |
||
4585 | case 0: // NTSC or PAL |
||
4586 | COSD_FLAGS_CONFIG ^= COSD_FLAG_NTSC; |
||
4587 | // Setup Video Mode |
||
4588 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
4589 | // NTSC + enable display immediately (VM0) |
||
4590 | spi_send_byte(0x00, 0b00001000); |
||
4591 | 196c: 80 e0 ldi r24, 0x00 ; 0 |
||
4592 | 196e: 68 e0 ldi r22, 0x08 ; 8 |
||
4593 | 1970: 0e 94 af 04 call 0x95e ; 0x95e <spi_send_byte> |
||
4594 | |||
4595 | bottom_line = 12; |
||
4596 | 1974: a0 92 03 01 sts 0x0103, r10 |
||
4597 | 1978: b4 cf rjmp .-152 ; 0x18e2 <config_menu+0x1aa> |
||
4598 | |||
4599 | 0000197a <get_eeprom>: |
||
4600 | const char* ee_msg[] PROGMEM = {ee_message0, ee_message1}; |
||
4601 | |||
4602 | /** |
||
4603 | * read data saved in eeprom, print out message if <verbose> is set |
||
4604 | */ |
||
4605 | void get_eeprom(uint8_t verbose) { |
||
4606 | 197a: 1f 93 push r17 |
||
4607 | 197c: 18 2f mov r17, r24 |
||
4608 | if (eeprom_read_byte(&ee_checkbyte1) == CHECKBYTE1 && eeprom_read_byte(&ee_checkbyte2) == CHECKBYTE2) { |
||
4609 | 197e: 80 e0 ldi r24, 0x00 ; 0 |
||
4610 | 1980: 90 e0 ldi r25, 0x00 ; 0 |
||
4611 | 1982: 0e 94 ed 1c call 0x39da ; 0x39da <__eerd_byte_m162> |
||
4612 | 1986: 8e 32 cpi r24, 0x2E ; 46 |
||
4613 | 1988: 51 f0 breq .+20 ; 0x199e <get_eeprom+0x24> |
||
4614 | COSD_FLAGS_CONFIG = eeprom_read_byte(&ee_COSD_FLAGS_CONFIG); |
||
4615 | COSD_DISPLAYMODE = eeprom_read_byte(&ee_COSD_DISPLAYMODE); |
||
4616 | //if (verbose) write_ndigit_number_u(23, 11, COSD_DISPLAYMODE, 2, 0); |
||
4617 | } else { |
||
4618 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
4619 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[1]); // Loading data |
||
4620 | 198a: 11 23 and r17, r17 |
||
4621 | 198c: 31 f0 breq .+12 ; 0x199a <get_eeprom+0x20> |
||
4622 | 198e: 82 e0 ldi r24, 0x02 ; 2 |
||
4623 | 1990: 69 e0 ldi r22, 0x09 ; 9 |
||
4624 | 1992: 47 e0 ldi r20, 0x07 ; 7 |
||
4625 | 1994: 52 e0 ldi r21, 0x02 ; 2 |
||
4626 | 1996: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4627 | #endif |
||
4628 | } |
||
4629 | } |
||
4630 | 199a: 1f 91 pop r17 |
||
4631 | 199c: 08 95 ret |
||
4632 | |||
4633 | /** |
||
4634 | * read data saved in eeprom, print out message if <verbose> is set |
||
4635 | */ |
||
4636 | void get_eeprom(uint8_t verbose) { |
||
4637 | if (eeprom_read_byte(&ee_checkbyte1) == CHECKBYTE1 && eeprom_read_byte(&ee_checkbyte2) == CHECKBYTE2) { |
||
4638 | 199e: 81 e0 ldi r24, 0x01 ; 1 |
||
4639 | 19a0: 90 e0 ldi r25, 0x00 ; 0 |
||
4640 | 19a2: 0e 94 ed 1c call 0x39da ; 0x39da <__eerd_byte_m162> |
||
4641 | 19a6: 87 31 cpi r24, 0x17 ; 23 |
||
4642 | 19a8: 81 f7 brne .-32 ; 0x198a <get_eeprom+0x10> |
||
4643 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
4644 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[0]); // Loading data |
||
4645 | 19aa: 11 23 and r17, r17 |
||
4646 | 19ac: 99 f4 brne .+38 ; 0x19d4 <get_eeprom+0x5a> |
||
4647 | #endif |
||
4648 | COSD_FLAGS_MODES = eeprom_read_byte(&ee_COSD_FLAGS_MODES); |
||
4649 | 19ae: 82 e0 ldi r24, 0x02 ; 2 |
||
4650 | 19b0: 90 e0 ldi r25, 0x00 ; 0 |
||
4651 | 19b2: 0e 94 ed 1c call 0x39da ; 0x39da <__eerd_byte_m162> |
||
4652 | 19b6: 80 93 1b 01 sts 0x011B, r24 |
||
4653 | COSD_FLAGS_CONFIG = eeprom_read_byte(&ee_COSD_FLAGS_CONFIG); |
||
4654 | 19ba: 83 e0 ldi r24, 0x03 ; 3 |
||
4655 | 19bc: 90 e0 ldi r25, 0x00 ; 0 |
||
4656 | 19be: 0e 94 ed 1c call 0x39da ; 0x39da <__eerd_byte_m162> |
||
4657 | 19c2: 80 93 1c 01 sts 0x011C, r24 |
||
4658 | COSD_DISPLAYMODE = eeprom_read_byte(&ee_COSD_DISPLAYMODE); |
||
4659 | 19c6: 84 e0 ldi r24, 0x04 ; 4 |
||
4660 | 19c8: 90 e0 ldi r25, 0x00 ; 0 |
||
4661 | 19ca: 0e 94 ed 1c call 0x39da ; 0x39da <__eerd_byte_m162> |
||
4662 | 19ce: 80 93 1e 01 sts 0x011E, r24 |
||
4663 | 19d2: e3 cf rjmp .-58 ; 0x199a <get_eeprom+0x20> |
||
4664 | * read data saved in eeprom, print out message if <verbose> is set |
||
4665 | */ |
||
4666 | void get_eeprom(uint8_t verbose) { |
||
4667 | if (eeprom_read_byte(&ee_checkbyte1) == CHECKBYTE1 && eeprom_read_byte(&ee_checkbyte2) == CHECKBYTE2) { |
||
4668 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
4669 | if (verbose) write_ascii_string_pgm(2, 9, ee_msg[0]); // Loading data |
||
4670 | 19d4: 82 e0 ldi r24, 0x02 ; 2 |
||
4671 | 19d6: 69 e0 ldi r22, 0x09 ; 9 |
||
4672 | 19d8: 4e ee ldi r20, 0xEE ; 238 |
||
4673 | 19da: 51 e0 ldi r21, 0x01 ; 1 |
||
4674 | 19dc: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4675 | 19e0: e6 cf rjmp .-52 ; 0x19ae <get_eeprom+0x34> |
||
4676 | |||
4677 | 000019e2 <init_cosd>: |
||
4678 | |||
4679 | /** |
||
4680 | * auto config some stuff on startup, currently only battery cells |
||
4681 | * TODO: this is testing stuff, strings should go progmem and so on... |
||
4682 | */ |
||
4683 | void init_cosd(uint8_t UBat) { |
||
4684 | 19e2: ff 92 push r15 |
||
4685 | 19e4: 0f 93 push r16 |
||
4686 | 19e6: 1f 93 push r17 |
||
4687 | 19e8: df 93 push r29 |
||
4688 | 19ea: cf 93 push r28 |
||
4689 | 19ec: cd b7 in r28, 0x3d ; 61 |
||
4690 | 19ee: de b7 in r29, 0x3e ; 62 |
||
4691 | 19f0: 2a 97 sbiw r28, 0x0a ; 10 |
||
4692 | 19f2: 0f b6 in r0, 0x3f ; 63 |
||
4693 | 19f4: f8 94 cli |
||
4694 | 19f6: de bf out 0x3e, r29 ; 62 |
||
4695 | 19f8: 0f be out 0x3f, r0 ; 63 |
||
4696 | 19fa: cd bf out 0x3d, r28 ; 61 |
||
4697 | 19fc: 18 2f mov r17, r24 |
||
4698 | clear(); |
||
4699 | 19fe: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
4700 | write_ascii_string_pgm(2, 1, PSTR("C-OSD Initialisation")); // C-OSD Initialisation |
||
4701 | 1a02: 82 e0 ldi r24, 0x02 ; 2 |
||
4702 | 1a04: 61 e0 ldi r22, 0x01 ; 1 |
||
4703 | 1a06: 46 e7 ldi r20, 0x76 ; 118 |
||
4704 | 1a08: 53 e0 ldi r21, 0x03 ; 3 |
||
4705 | 1a0a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4706 | #if FCONLY |
||
4707 | write_ascii_string_pgm(2, 2, PSTR("FC only Mode")); // FC only mode |
||
4708 | #else |
||
4709 | write_ascii_string_pgm(2, 2, PSTR("NaviCtrl Mode")); // NaviCtrl Mode |
||
4710 | 1a0e: 82 e0 ldi r24, 0x02 ; 2 |
||
4711 | 1a10: 62 e0 ldi r22, 0x02 ; 2 |
||
4712 | 1a12: 48 e6 ldi r20, 0x68 ; 104 |
||
4713 | 1a14: 53 e0 ldi r21, 0x03 ; 3 |
||
4714 | 1a16: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4715 | #endif |
||
4716 | write_ascii_string_pgm(2, 3, PSTR(BUILDDATE)); |
||
4717 | 1a1a: 82 e0 ldi r24, 0x02 ; 2 |
||
4718 | 1a1c: 63 e0 ldi r22, 0x03 ; 3 |
||
4719 | 1a1e: 4c e5 ldi r20, 0x5C ; 92 |
||
4720 | 1a20: 53 e0 ldi r21, 0x03 ; 3 |
||
4721 | 1a22: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4722 | uint8_t cellnum = 0; |
||
4723 | if (CELL_NUM == -1) { |
||
4724 | write_ascii_string_pgm(2, 4, PSTR("Guessing Number of Cells")); // Guessing Number of Cells |
||
4725 | 1a26: 82 e0 ldi r24, 0x02 ; 2 |
||
4726 | 1a28: 64 e0 ldi r22, 0x04 ; 4 |
||
4727 | 1a2a: 43 e4 ldi r20, 0x43 ; 67 |
||
4728 | 1a2c: 53 e0 ldi r21, 0x03 ; 3 |
||
4729 | 1a2e: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4730 | 1a32: 61 2f mov r22, r17 |
||
4731 | 1a34: 70 e0 ldi r23, 0x00 ; 0 |
||
4732 | 1a36: 00 e0 ldi r16, 0x00 ; 0 |
||
4733 | do { |
||
4734 | cellnum++; |
||
4735 | 1a38: 0f 5f subi r16, 0xFF ; 255 |
||
4736 | } while (UBat > ((cellnum * CELL_VOLT_MAX) + 23)); |
||
4737 | 1a3a: 40 2f mov r20, r16 |
||
4738 | 1a3c: 50 e0 ldi r21, 0x00 ; 0 |
||
4739 | 1a3e: ca 01 movw r24, r20 |
||
4740 | 1a40: 88 0f add r24, r24 |
||
4741 | 1a42: 99 1f adc r25, r25 |
||
4742 | 1a44: 88 0f add r24, r24 |
||
4743 | 1a46: 99 1f adc r25, r25 |
||
4744 | 1a48: 9c 01 movw r18, r24 |
||
4745 | 1a4a: 22 0f add r18, r18 |
||
4746 | 1a4c: 33 1f adc r19, r19 |
||
4747 | 1a4e: 22 0f add r18, r18 |
||
4748 | 1a50: 33 1f adc r19, r19 |
||
4749 | 1a52: 22 0f add r18, r18 |
||
4750 | 1a54: 33 1f adc r19, r19 |
||
4751 | 1a56: 28 0f add r18, r24 |
||
4752 | 1a58: 39 1f adc r19, r25 |
||
4753 | 1a5a: 24 0f add r18, r20 |
||
4754 | 1a5c: 35 1f adc r19, r21 |
||
4755 | 1a5e: c9 01 movw r24, r18 |
||
4756 | 1a60: 47 96 adiw r24, 0x17 ; 23 |
||
4757 | 1a62: 86 17 cp r24, r22 |
||
4758 | 1a64: 97 07 cpc r25, r23 |
||
4759 | 1a66: 44 f3 brlt .-48 ; 0x1a38 <init_cosd+0x56> |
||
4760 | } else { |
||
4761 | cellnum = CELL_NUM; |
||
4762 | } |
||
4763 | min_voltage = cellnum * CELL_VOLT_MIN; |
||
4764 | 1a68: 44 0f add r20, r20 |
||
4765 | 1a6a: 55 1f adc r21, r21 |
||
4766 | 1a6c: 42 95 swap r20 |
||
4767 | 1a6e: 52 95 swap r21 |
||
4768 | 1a70: 50 7f andi r21, 0xF0 ; 240 |
||
4769 | 1a72: 54 27 eor r21, r20 |
||
4770 | 1a74: 40 7f andi r20, 0xF0 ; 240 |
||
4771 | 1a76: 54 27 eor r21, r20 |
||
4772 | 1a78: 40 93 19 01 sts 0x0119, r20 |
||
4773 | max_voltage = cellnum * CELL_VOLT_MAX; |
||
4774 | 1a7c: 20 93 1a 01 sts 0x011A, r18 |
||
4775 | write_ascii_string_pgm(2, 5, PSTR("Number of Cells:")); // Number of Cells |
||
4776 | 1a80: 82 e0 ldi r24, 0x02 ; 2 |
||
4777 | 1a82: 65 e0 ldi r22, 0x05 ; 5 |
||
4778 | 1a84: 42 e3 ldi r20, 0x32 ; 50 |
||
4779 | 1a86: 53 e0 ldi r21, 0x03 ; 3 |
||
4780 | 1a88: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4781 | write_ndigit_number_u(21, 5, cellnum, 1, 0); |
||
4782 | 1a8c: 85 e1 ldi r24, 0x15 ; 21 |
||
4783 | 1a8e: 65 e0 ldi r22, 0x05 ; 5 |
||
4784 | 1a90: 40 2f mov r20, r16 |
||
4785 | 1a92: 50 e0 ldi r21, 0x00 ; 0 |
||
4786 | 1a94: 21 e0 ldi r18, 0x01 ; 1 |
||
4787 | 1a96: 30 e0 ldi r19, 0x00 ; 0 |
||
4788 | 1a98: 00 e0 ldi r16, 0x00 ; 0 |
||
4789 | 1a9a: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
4790 | write_ascii_string_pgm(2, 6, PSTR("Warn Voltage :")); // Warn Voltage |
||
4791 | 1a9e: 82 e0 ldi r24, 0x02 ; 2 |
||
4792 | 1aa0: 66 e0 ldi r22, 0x06 ; 6 |
||
4793 | 1aa2: 41 e2 ldi r20, 0x21 ; 33 |
||
4794 | 1aa4: 53 e0 ldi r21, 0x03 ; 3 |
||
4795 | 1aa6: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4796 | write_ndigit_number_s_10th(20, 6, min_voltage, 3, 0); |
||
4797 | 1aaa: 40 91 19 01 lds r20, 0x0119 |
||
4798 | 1aae: 84 e1 ldi r24, 0x14 ; 20 |
||
4799 | 1ab0: 66 e0 ldi r22, 0x06 ; 6 |
||
4800 | 1ab2: 50 e0 ldi r21, 0x00 ; 0 |
||
4801 | 1ab4: 23 e0 ldi r18, 0x03 ; 3 |
||
4802 | 1ab6: 30 e0 ldi r19, 0x00 ; 0 |
||
4803 | 1ab8: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
4804 | write_ascii_string_pgm(2, 7, PSTR("Max Voltage :")); // Max Voltage |
||
4805 | 1abc: 82 e0 ldi r24, 0x02 ; 2 |
||
4806 | 1abe: 67 e0 ldi r22, 0x07 ; 7 |
||
4807 | 1ac0: 40 e1 ldi r20, 0x10 ; 16 |
||
4808 | 1ac2: 53 e0 ldi r21, 0x03 ; 3 |
||
4809 | 1ac4: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4810 | write_ndigit_number_s_10th(20, 7, max_voltage, 3, 0); |
||
4811 | 1ac8: 40 91 1a 01 lds r20, 0x011A |
||
4812 | 1acc: 84 e1 ldi r24, 0x14 ; 20 |
||
4813 | 1ace: 67 e0 ldi r22, 0x07 ; 7 |
||
4814 | 1ad0: 50 e0 ldi r21, 0x00 ; 0 |
||
4815 | 1ad2: 23 e0 ldi r18, 0x03 ; 3 |
||
4816 | 1ad4: 30 e0 ldi r19, 0x00 ; 0 |
||
4817 | 1ad6: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
4818 | |||
4819 | get_eeprom(1); |
||
4820 | 1ada: 81 e0 ldi r24, 0x01 ; 1 |
||
4821 | 1adc: 0e 94 bd 0c call 0x197a ; 0x197a <get_eeprom> |
||
4822 | |||
4823 | //write_ascii_string_pgm(23, 2, vm[COSD_FLAGS & COSD_FLAG_NTSC]); |
||
4824 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
4825 | 1ae0: 80 91 1c 01 lds r24, 0x011C |
||
4826 | 1ae4: 80 ff sbrs r24, 0 |
||
4827 | 1ae6: 7a c0 rjmp .+244 ; 0x1bdc <init_cosd+0x1fa> |
||
4828 | write_ascii_string_pgm(23, 2, VM_NTSC); |
||
4829 | 1ae8: 87 e1 ldi r24, 0x17 ; 23 |
||
4830 | 1aea: 62 e0 ldi r22, 0x02 ; 2 |
||
4831 | 1aec: 49 ee ldi r20, 0xE9 ; 233 |
||
4832 | 1aee: 51 e0 ldi r21, 0x01 ; 1 |
||
4833 | 1af0: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4834 | } else { |
||
4835 | write_ascii_string_pgm(23, 2, VM_PAL); |
||
4836 | } |
||
4837 | |||
4838 | // request version from board |
||
4839 | rxd_buffer_locked = 0; |
||
4840 | 1af4: 10 92 29 01 sts 0x0129, r1 |
||
4841 | usart1_EnableTXD(); |
||
4842 | 1af8: 0e 94 3e 03 call 0x67c ; 0x67c <usart1_EnableTXD> |
||
4843 | //usart1_request_mk_data(0, 'v', 0); |
||
4844 | write_ascii_string_pgm(2, 11, PSTR("FC VERSION: ........")); |
||
4845 | usart1_puts_pgm(PSTR(REQUEST_FC_VERSION)); |
||
4846 | #else |
||
4847 | //usart1_request_mk_data(1, 'v', 0); |
||
4848 | usart1_puts_pgm(PSTR(REQUEST_NC_VERSION)); |
||
4849 | 1afc: 85 e0 ldi r24, 0x05 ; 5 |
||
4850 | 1afe: 93 e0 ldi r25, 0x03 ; 3 |
||
4851 | 1b00: 0e 94 47 03 call 0x68e ; 0x68e <usart1_puts_pgm> |
||
4852 | write_ascii_string_pgm(2, 11, PSTR("NC VERSION: ........")); |
||
4853 | 1b04: 82 e0 ldi r24, 0x02 ; 2 |
||
4854 | 1b06: 6b e0 ldi r22, 0x0B ; 11 |
||
4855 | 1b08: 40 ef ldi r20, 0xF0 ; 240 |
||
4856 | 1b0a: 52 e0 ldi r21, 0x02 ; 2 |
||
4857 | 1b0c: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
4858 | #endif |
||
4859 | usart1_DisableTXD(); |
||
4860 | 1b10: 0e 94 39 03 call 0x672 ; 0x672 <usart1_DisableTXD> |
||
4861 | // wait for response |
||
4862 | while (rxd_buffer_locked == 0) { |
||
4863 | 1b14: 80 91 29 01 lds r24, 0x0129 |
||
4864 | 1b18: 88 23 and r24, r24 |
||
4865 | 1b1a: 29 f4 brne .+10 ; 0x1b26 <init_cosd+0x144> |
||
4866 | asm("nop"); |
||
4867 | 1b1c: 00 00 nop |
||
4868 | usart1_puts_pgm(PSTR(REQUEST_NC_VERSION)); |
||
4869 | write_ascii_string_pgm(2, 11, PSTR("NC VERSION: ........")); |
||
4870 | #endif |
||
4871 | usart1_DisableTXD(); |
||
4872 | // wait for response |
||
4873 | while (rxd_buffer_locked == 0) { |
||
4874 | 1b1e: 80 91 29 01 lds r24, 0x0129 |
||
4875 | 1b22: 88 23 and r24, r24 |
||
4876 | 1b24: d9 f3 breq .-10 ; 0x1b1c <init_cosd+0x13a> |
||
4877 | asm("nop"); |
||
4878 | } |
||
4879 | Decode64(); |
||
4880 | 1b26: 0e 94 30 04 call 0x860 ; 0x860 <Decode64> |
||
4881 | str_VersionInfo VersionInfo; |
||
4882 | VersionInfo = *((str_VersionInfo*) pRxData); |
||
4883 | 1b2a: de 01 movw r26, r28 |
||
4884 | 1b2c: 11 96 adiw r26, 0x01 ; 1 |
||
4885 | 1b2e: 80 91 2b 01 lds r24, 0x012B |
||
4886 | 1b32: 90 91 2c 01 lds r25, 0x012C |
||
4887 | 1b36: 9c 01 movw r18, r24 |
||
4888 | 1b38: f9 01 movw r30, r18 |
||
4889 | 1b3a: 8a e0 ldi r24, 0x0A ; 10 |
||
4890 | 1b3c: 01 90 ld r0, Z+ |
||
4891 | 1b3e: 0d 92 st X+, r0 |
||
4892 | 1b40: 81 50 subi r24, 0x01 ; 1 |
||
4893 | 1b42: e1 f7 brne .-8 ; 0x1b3c <init_cosd+0x15a> |
||
4894 | 1b44: fa 80 ldd r15, Y+2 ; 0x02 |
||
4895 | 1b46: 1d 81 ldd r17, Y+5 ; 0x05 |
||
4896 | |||
4897 | write_ndigit_number_u(14, 11, VersionInfo.SWMajor, 3, 1); |
||
4898 | 1b48: 49 81 ldd r20, Y+1 ; 0x01 |
||
4899 | 1b4a: 8e e0 ldi r24, 0x0E ; 14 |
||
4900 | 1b4c: 6b e0 ldi r22, 0x0B ; 11 |
||
4901 | 1b4e: 50 e0 ldi r21, 0x00 ; 0 |
||
4902 | 1b50: 23 e0 ldi r18, 0x03 ; 3 |
||
4903 | 1b52: 30 e0 ldi r19, 0x00 ; 0 |
||
4904 | 1b54: 01 e0 ldi r16, 0x01 ; 1 |
||
4905 | 1b56: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
4906 | write_ndigit_number_u(18, 11, VersionInfo.SWMinor, 3, 1); |
||
4907 | 1b5a: 82 e1 ldi r24, 0x12 ; 18 |
||
4908 | 1b5c: 6b e0 ldi r22, 0x0B ; 11 |
||
4909 | 1b5e: 4f 2d mov r20, r15 |
||
4910 | 1b60: 50 e0 ldi r21, 0x00 ; 0 |
||
4911 | 1b62: 23 e0 ldi r18, 0x03 ; 3 |
||
4912 | 1b64: 30 e0 ldi r19, 0x00 ; 0 |
||
4913 | 1b66: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
4914 | write_ascii_char(22 + 11*30, 'a' + VersionInfo.SWPatch); |
||
4915 | 1b6a: 1f 59 subi r17, 0x9F ; 159 |
||
4916 | 1b6c: 80 e6 ldi r24, 0x60 ; 96 |
||
4917 | 1b6e: 91 e0 ldi r25, 0x01 ; 1 |
||
4918 | 1b70: 61 2f mov r22, r17 |
||
4919 | 1b72: 0e 94 10 05 call 0xa20 ; 0xa20 <write_ascii_char> |
||
4920 | mode += COSD_DISPLAYMODE; |
||
4921 | osd_fcmode = (int(*)(void)) pgm_read_word(&mode->dfun); |
||
4922 | // re-request data ever 100ms from FC; |
||
4923 | //usart1_request_mk_data(0, 'd', 100); |
||
4924 | #else |
||
4925 | COSD_DISPLAYMODE %= (sizeof(ncdisplaymodes) / sizeof(displaymode_t)); |
||
4926 | 1b76: e0 91 1e 01 lds r30, 0x011E |
||
4927 | 1b7a: e1 70 andi r30, 0x01 ; 1 |
||
4928 | 1b7c: e0 93 1e 01 sts 0x011E, r30 |
||
4929 | mode = ncdisplaymodes; |
||
4930 | mode += COSD_DISPLAYMODE; |
||
4931 | 1b80: f0 e0 ldi r31, 0x00 ; 0 |
||
4932 | 1b82: ee 0f add r30, r30 |
||
4933 | 1b84: ff 1f adc r31, r31 |
||
4934 | 1b86: ee 0f add r30, r30 |
||
4935 | 1b88: ff 1f adc r31, r31 |
||
4936 | 1b8a: e0 5d subi r30, 0xD0 ; 208 |
||
4937 | 1b8c: fe 4f sbci r31, 0xFE ; 254 |
||
4938 | 1b8e: f0 93 9e 02 sts 0x029E, r31 |
||
4939 | 1b92: e0 93 9d 02 sts 0x029D, r30 |
||
4940 | osd_ncmode = (int(*)(void)) pgm_read_word(&mode->dfun); |
||
4941 | 1b96: 85 91 lpm r24, Z+ |
||
4942 | 1b98: 94 91 lpm r25, Z+ |
||
4943 | 1b9a: 90 93 06 01 sts 0x0106, r25 |
||
4944 | 1b9e: 80 93 05 01 sts 0x0105, r24 |
||
4945 | 1ba2: 20 e3 ldi r18, 0x30 ; 48 |
||
4946 | 1ba4: 35 e7 ldi r19, 0x75 ; 117 |
||
4947 | 1ba6: 40 e9 ldi r20, 0x90 ; 144 |
||
4948 | 1ba8: 51 e0 ldi r21, 0x01 ; 1 |
||
4949 | 1baa: ca 01 movw r24, r20 |
||
4950 | 1bac: 01 97 sbiw r24, 0x01 ; 1 |
||
4951 | 1bae: f1 f7 brne .-4 ; 0x1bac <init_cosd+0x1ca> |
||
4952 | { |
||
4953 | // wait 1/10 ms |
||
4954 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
4955 | __ticks --; |
||
4956 | 1bb0: 21 50 subi r18, 0x01 ; 1 |
||
4957 | 1bb2: 30 40 sbci r19, 0x00 ; 0 |
||
4958 | __ticks = 1; |
||
4959 | else if (__tmp > 65535) |
||
4960 | { |
||
4961 | // __ticks = requested delay in 1/10 ms |
||
4962 | __ticks = (uint16_t) (__ms * 10.0); |
||
4963 | while(__ticks) |
||
4964 | 1bb4: d1 f7 brne .-12 ; 0x1baa <init_cosd+0x1c8> |
||
4965 | // re-request OSD Data from NC every 100ms |
||
4966 | //usart1_request_mk_data(1, 'o', 100); |
||
4967 | #endif |
||
4968 | |||
4969 | _delay_ms(3000); |
||
4970 | clear(); |
||
4971 | 1bb6: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
4972 | // update flags to paint display again because of clear |
||
4973 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
4974 | 1bba: 80 91 1d 01 lds r24, 0x011D |
||
4975 | 1bbe: 8d 7f andi r24, 0xFD ; 253 |
||
4976 | 1bc0: 80 93 1d 01 sts 0x011D, r24 |
||
4977 | } |
||
4978 | 1bc4: 2a 96 adiw r28, 0x0a ; 10 |
||
4979 | 1bc6: 0f b6 in r0, 0x3f ; 63 |
||
4980 | 1bc8: f8 94 cli |
||
4981 | 1bca: de bf out 0x3e, r29 ; 62 |
||
4982 | 1bcc: 0f be out 0x3f, r0 ; 63 |
||
4983 | 1bce: cd bf out 0x3d, r28 ; 61 |
||
4984 | 1bd0: cf 91 pop r28 |
||
4985 | 1bd2: df 91 pop r29 |
||
4986 | 1bd4: 1f 91 pop r17 |
||
4987 | 1bd6: 0f 91 pop r16 |
||
4988 | 1bd8: ff 90 pop r15 |
||
4989 | 1bda: 08 95 ret |
||
4990 | |||
4991 | //write_ascii_string_pgm(23, 2, vm[COSD_FLAGS & COSD_FLAG_NTSC]); |
||
4992 | if (COSD_FLAGS_CONFIG & COSD_FLAG_NTSC) { |
||
4993 | write_ascii_string_pgm(23, 2, VM_NTSC); |
||
4994 | } else { |
||
4995 | write_ascii_string_pgm(23, 2, VM_PAL); |
||
4996 | 1bdc: 87 e1 ldi r24, 0x17 ; 23 |
||
4997 | 1bde: 62 e0 ldi r22, 0x02 ; 2 |
||
4998 | 1be0: 44 ee ldi r20, 0xE4 ; 228 |
||
4999 | 1be2: 51 e0 ldi r21, 0x01 ; 1 |
||
5000 | 1be4: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
5001 | 1be8: 85 cf rjmp .-246 ; 0x1af4 <init_cosd+0x112> |
||
5002 | |||
5003 | 00001bea <SpiMasterInit>: |
||
5004 | #define INT0_LOW PORTD &= ~(1 << PD2); |
||
5005 | |||
5006 | /** |
||
5007 | * init the SPI as master |
||
5008 | */ |
||
5009 | void SpiMasterInit(void) { |
||
5010 | 1bea: df 93 push r29 |
||
5011 | 1bec: cf 93 push r28 |
||
5012 | 1bee: 0f 92 push r0 |
||
5013 | 1bf0: cd b7 in r28, 0x3d ; 61 |
||
5014 | 1bf2: de b7 in r29, 0x3e ; 62 |
||
5015 | volatile char IOReg; |
||
5016 | // set PB4(/SS), PB5(MOSI), PB7(SCK) as output |
||
5017 | DDRB = (1 << PB4) | (1 << PB5) | (1 << PB7); |
||
5018 | 1bf4: 80 eb ldi r24, 0xB0 ; 176 |
||
5019 | 1bf6: 87 bb out 0x17, r24 ; 23 |
||
5020 | PORTB |= (1 << PB4); // pullup SS |
||
5021 | 1bf8: c4 9a sbi 0x18, 4 ; 24 |
||
5022 | // enable SPI Interrupt and SPI in Master Mode with SCK = CK/128 |
||
5023 | SPCR = (1 << SPIE) | (1 << SPE) | (1 << MSTR) | (1 << SPR0) | (1 << SPR1); |
||
5024 | 1bfa: 83 ed ldi r24, 0xD3 ; 211 |
||
5025 | 1bfc: 8d b9 out 0x0d, r24 ; 13 |
||
5026 | IOReg = SPSR; // clear SPIF bit in SPSR |
||
5027 | 1bfe: 8e b1 in r24, 0x0e ; 14 |
||
5028 | 1c00: 89 83 std Y+1, r24 ; 0x01 |
||
5029 | IOReg = SPDR; |
||
5030 | 1c02: 8f b1 in r24, 0x0f ; 15 |
||
5031 | 1c04: 89 83 std Y+1, r24 ; 0x01 |
||
5032 | //sei(); // we do it later |
||
5033 | } |
||
5034 | 1c06: 0f 90 pop r0 |
||
5035 | 1c08: cf 91 pop r28 |
||
5036 | 1c0a: df 91 pop r29 |
||
5037 | 1c0c: 08 95 ret |
||
5038 | |||
5039 | 00001c0e <__vector_18>: |
||
5040 | |||
5041 | |||
5042 | /** |
||
5043 | * SPI interrupt handler |
||
5044 | */ |
||
5045 | ISR(SPI_STC_vect) { |
||
5046 | 1c0e: 1f 92 push r1 |
||
5047 | 1c10: 0f 92 push r0 |
||
5048 | 1c12: 0f b6 in r0, 0x3f ; 63 |
||
5049 | 1c14: 0f 92 push r0 |
||
5050 | 1c16: 11 24 eor r1, r1 |
||
5051 | 1c18: 8f 93 push r24 |
||
5052 | 1c1a: 9f 93 push r25 |
||
5053 | 1c1c: ef 93 push r30 |
||
5054 | 1c1e: ff 93 push r31 |
||
5055 | if (request_count == 0) { |
||
5056 | 1c20: 80 91 36 01 lds r24, 0x0136 |
||
5057 | 1c24: 88 23 and r24, r24 |
||
5058 | 1c26: 11 f5 brne .+68 ; 0x1c6c <__vector_18+0x5e> |
||
5059 | SPI_buffer.buffer.chk = SPDR; // firs char received is check byte from last transfer |
||
5060 | 1c28: 8f b1 in r24, 0x0f ; 15 |
||
5061 | 1c2a: 80 93 95 01 sts 0x0195, r24 |
||
5062 | } else { |
||
5063 | SPI_buffer.buffer.c[request_count - 1] = SPDR; // safe received byte to buffer |
||
5064 | } |
||
5065 | request_count++; |
||
5066 | 1c2e: 80 91 36 01 lds r24, 0x0136 |
||
5067 | 1c32: 8f 5f subi r24, 0xFF ; 255 |
||
5068 | 1c34: 80 93 36 01 sts 0x0136, r24 |
||
5069 | if (--icnt) { |
||
5070 | 1c38: 80 91 34 01 lds r24, 0x0134 |
||
5071 | 1c3c: 90 91 35 01 lds r25, 0x0135 |
||
5072 | 1c40: 01 97 sbiw r24, 0x01 ; 1 |
||
5073 | 1c42: 90 93 35 01 sts 0x0135, r25 |
||
5074 | 1c46: 80 93 34 01 sts 0x0134, r24 |
||
5075 | 1c4a: 80 91 34 01 lds r24, 0x0134 |
||
5076 | 1c4e: 90 91 35 01 lds r25, 0x0135 |
||
5077 | 1c52: 89 2b or r24, r25 |
||
5078 | 1c54: 99 f4 brne .+38 ; 0x1c7c <__vector_18+0x6e> |
||
5079 | //SPDR = *iptr; // send next byte |
||
5080 | spi_ready = 1; // we _should_ send later because the slave needs more time |
||
5081 | } else { |
||
5082 | SPCR &= ~_BV(SPIE); // deactivate interrupt |
||
5083 | 1c56: 6f 98 cbi 0x0d, 7 ; 13 |
||
5084 | INT0_HIGH // transfer is done, slave does not need to listen |
||
5085 | 1c58: 92 9a sbi 0x12, 2 ; 18 |
||
5086 | } |
||
5087 | } |
||
5088 | 1c5a: ff 91 pop r31 |
||
5089 | 1c5c: ef 91 pop r30 |
||
5090 | 1c5e: 9f 91 pop r25 |
||
5091 | 1c60: 8f 91 pop r24 |
||
5092 | 1c62: 0f 90 pop r0 |
||
5093 | 1c64: 0f be out 0x3f, r0 ; 63 |
||
5094 | 1c66: 0f 90 pop r0 |
||
5095 | 1c68: 1f 90 pop r1 |
||
5096 | 1c6a: 18 95 reti |
||
5097 | */ |
||
5098 | ISR(SPI_STC_vect) { |
||
5099 | if (request_count == 0) { |
||
5100 | SPI_buffer.buffer.chk = SPDR; // firs char received is check byte from last transfer |
||
5101 | } else { |
||
5102 | SPI_buffer.buffer.c[request_count - 1] = SPDR; // safe received byte to buffer |
||
5103 | 1c6c: e0 91 36 01 lds r30, 0x0136 |
||
5104 | 1c70: f0 e0 ldi r31, 0x00 ; 0 |
||
5105 | 1c72: 8f b1 in r24, 0x0f ; 15 |
||
5106 | 1c74: e6 57 subi r30, 0x76 ; 118 |
||
5107 | 1c76: fe 4f sbci r31, 0xFE ; 254 |
||
5108 | 1c78: 80 83 st Z, r24 |
||
5109 | 1c7a: d9 cf rjmp .-78 ; 0x1c2e <__vector_18+0x20> |
||
5110 | } |
||
5111 | request_count++; |
||
5112 | if (--icnt) { |
||
5113 | //SPDR = *iptr; // send next byte |
||
5114 | spi_ready = 1; // we _should_ send later because the slave needs more time |
||
5115 | 1c7c: 81 e0 ldi r24, 0x01 ; 1 |
||
5116 | 1c7e: 80 93 10 01 sts 0x0110, r24 |
||
5117 | 1c82: eb cf rjmp .-42 ; 0x1c5a <__vector_18+0x4c> |
||
5118 | |||
5119 | 00001c84 <TransferIsBusy>: |
||
5120 | |||
5121 | /** |
||
5122 | * check if SPI transfer is still busy |
||
5123 | */ |
||
5124 | int TransferIsBusy(void) { |
||
5125 | return SPCR & _BV(SPIE); |
||
5126 | 1c84: 2d b1 in r18, 0x0d ; 13 |
||
5127 | 1c86: 30 e0 ldi r19, 0x00 ; 0 |
||
5128 | 1c88: 20 78 andi r18, 0x80 ; 128 |
||
5129 | 1c8a: 30 70 andi r19, 0x00 ; 0 |
||
5130 | } |
||
5131 | 1c8c: c9 01 movw r24, r18 |
||
5132 | 1c8e: 08 95 ret |
||
5133 | |||
5134 | 00001c90 <StartTransfer>: |
||
5135 | |||
5136 | /** |
||
5137 | * start a new transfer with length <len> |
||
5138 | */ |
||
5139 | void StartTransfer(uint16_t len) { |
||
5140 | INT0_LOW // /SS LOW ^= SS HIGH ^= slave should listen |
||
5141 | 1c90: 92 98 cbi 0x12, 2 ; 18 |
||
5142 | |||
5143 | // this is a new request |
||
5144 | request_count = 0; |
||
5145 | 1c92: 10 92 36 01 sts 0x0136, r1 |
||
5146 | |||
5147 | // set up pointer and length for interrupt handler |
||
5148 | icnt = len; |
||
5149 | 1c96: 90 93 35 01 sts 0x0135, r25 |
||
5150 | 1c9a: 80 93 34 01 sts 0x0134, r24 |
||
5151 | |||
5152 | SPCR |= _BV(SPIE); // enable spi interrupt |
||
5153 | 1c9e: 6f 9a sbi 0x0d, 7 ; 13 |
||
5154 | SPDR = 'A'; // start transfer by first command char |
||
5155 | 1ca0: 81 e4 ldi r24, 0x41 ; 65 |
||
5156 | 1ca2: 8f b9 out 0x0f, r24 ; 15 |
||
5157 | } |
||
5158 | 1ca4: 08 95 ret |
||
5159 | |||
5160 | 00001ca6 <spi_send_next>: |
||
5161 | |||
5162 | /** |
||
5163 | * send next command through spi |
||
5164 | */ |
||
5165 | void spi_send_next() { |
||
5166 | SPDR = 'A' + request_count; |
||
5167 | 1ca6: 80 91 36 01 lds r24, 0x0136 |
||
5168 | 1caa: 8f 5b subi r24, 0xBF ; 191 |
||
5169 | 1cac: 8f b9 out 0x0f, r24 ; 15 |
||
5170 | } |
||
5171 | 1cae: 08 95 ret |
||
5172 | |||
5173 | 00001cb0 <s1_pressed>: |
||
5174 | |||
5175 | /* ########################################################################## |
||
5176 | * debounce buttons |
||
5177 | * ##########################################################################*/ |
||
5178 | int s1_pressed() { |
||
5179 | if (S1_PRESSED) { |
||
5180 | 1cb0: 9d 9b sbis 0x13, 5 ; 19 |
||
5181 | 1cb2: 04 c0 rjmp .+8 ; 0x1cbc <s1_pressed+0xc> |
||
5182 | 1cb4: 20 e0 ldi r18, 0x00 ; 0 |
||
5183 | 1cb6: 30 e0 ldi r19, 0x00 ; 0 |
||
5184 | _delay_ms(25); |
||
5185 | if (S1_PRESSED) return 1; |
||
5186 | } |
||
5187 | return 0; |
||
5188 | } |
||
5189 | 1cb8: c9 01 movw r24, r18 |
||
5190 | 1cba: 08 95 ret |
||
5191 | |||
5192 | /* ########################################################################## |
||
5193 | * debounce buttons |
||
5194 | * ##########################################################################*/ |
||
5195 | int s1_pressed() { |
||
5196 | if (S1_PRESSED) { |
||
5197 | 1cbc: 2a ef ldi r18, 0xFA ; 250 |
||
5198 | 1cbe: 30 e0 ldi r19, 0x00 ; 0 |
||
5199 | 1cc0: 40 e9 ldi r20, 0x90 ; 144 |
||
5200 | 1cc2: 51 e0 ldi r21, 0x01 ; 1 |
||
5201 | 1cc4: ca 01 movw r24, r20 |
||
5202 | 1cc6: 01 97 sbiw r24, 0x01 ; 1 |
||
5203 | 1cc8: f1 f7 brne .-4 ; 0x1cc6 <s1_pressed+0x16> |
||
5204 | { |
||
5205 | // wait 1/10 ms |
||
5206 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
5207 | __ticks --; |
||
5208 | 1cca: 21 50 subi r18, 0x01 ; 1 |
||
5209 | 1ccc: 30 40 sbci r19, 0x00 ; 0 |
||
5210 | __ticks = 1; |
||
5211 | else if (__tmp > 65535) |
||
5212 | { |
||
5213 | // __ticks = requested delay in 1/10 ms |
||
5214 | __ticks = (uint16_t) (__ms * 10.0); |
||
5215 | while(__ticks) |
||
5216 | 1cce: d1 f7 brne .-12 ; 0x1cc4 <s1_pressed+0x14> |
||
5217 | _delay_ms(25); |
||
5218 | if (S1_PRESSED) return 1; |
||
5219 | 1cd0: 83 b3 in r24, 0x13 ; 19 |
||
5220 | 1cd2: 28 2f mov r18, r24 |
||
5221 | 1cd4: 30 e0 ldi r19, 0x00 ; 0 |
||
5222 | 1cd6: 36 95 lsr r19 |
||
5223 | 1cd8: 27 95 ror r18 |
||
5224 | 1cda: 32 95 swap r19 |
||
5225 | 1cdc: 22 95 swap r18 |
||
5226 | 1cde: 2f 70 andi r18, 0x0F ; 15 |
||
5227 | 1ce0: 23 27 eor r18, r19 |
||
5228 | 1ce2: 3f 70 andi r19, 0x0F ; 15 |
||
5229 | 1ce4: 23 27 eor r18, r19 |
||
5230 | 1ce6: 20 95 com r18 |
||
5231 | 1ce8: 30 95 com r19 |
||
5232 | 1cea: 21 70 andi r18, 0x01 ; 1 |
||
5233 | 1cec: 30 70 andi r19, 0x00 ; 0 |
||
5234 | } |
||
5235 | return 0; |
||
5236 | } |
||
5237 | 1cee: c9 01 movw r24, r18 |
||
5238 | 1cf0: 08 95 ret |
||
5239 | |||
5240 | 00001cf2 <s2_pressed>: |
||
5241 | |||
5242 | int s2_pressed() { |
||
5243 | if (S2_PRESSED) { |
||
5244 | 1cf2: 9c 9b sbis 0x13, 4 ; 19 |
||
5245 | 1cf4: 04 c0 rjmp .+8 ; 0x1cfe <s2_pressed+0xc> |
||
5246 | 1cf6: 20 e0 ldi r18, 0x00 ; 0 |
||
5247 | 1cf8: 30 e0 ldi r19, 0x00 ; 0 |
||
5248 | _delay_ms(25); |
||
5249 | if (S2_PRESSED) return 1; |
||
5250 | } |
||
5251 | return 0; |
||
5252 | } |
||
5253 | 1cfa: c9 01 movw r24, r18 |
||
5254 | 1cfc: 08 95 ret |
||
5255 | } |
||
5256 | return 0; |
||
5257 | } |
||
5258 | |||
5259 | int s2_pressed() { |
||
5260 | if (S2_PRESSED) { |
||
5261 | 1cfe: 2a ef ldi r18, 0xFA ; 250 |
||
5262 | 1d00: 30 e0 ldi r19, 0x00 ; 0 |
||
5263 | 1d02: 40 e9 ldi r20, 0x90 ; 144 |
||
5264 | 1d04: 51 e0 ldi r21, 0x01 ; 1 |
||
5265 | 1d06: ca 01 movw r24, r20 |
||
5266 | 1d08: 01 97 sbiw r24, 0x01 ; 1 |
||
5267 | 1d0a: f1 f7 brne .-4 ; 0x1d08 <s2_pressed+0x16> |
||
5268 | { |
||
5269 | // wait 1/10 ms |
||
5270 | _delay_loop_2(((F_CPU) / 4e3) / 10); |
||
5271 | __ticks --; |
||
5272 | 1d0c: 21 50 subi r18, 0x01 ; 1 |
||
5273 | 1d0e: 30 40 sbci r19, 0x00 ; 0 |
||
5274 | __ticks = 1; |
||
5275 | else if (__tmp > 65535) |
||
5276 | { |
||
5277 | // __ticks = requested delay in 1/10 ms |
||
5278 | __ticks = (uint16_t) (__ms * 10.0); |
||
5279 | while(__ticks) |
||
5280 | 1d10: d1 f7 brne .-12 ; 0x1d06 <s2_pressed+0x14> |
||
5281 | _delay_ms(25); |
||
5282 | if (S2_PRESSED) return 1; |
||
5283 | 1d12: 83 b3 in r24, 0x13 ; 19 |
||
5284 | 1d14: 28 2f mov r18, r24 |
||
5285 | 1d16: 30 e0 ldi r19, 0x00 ; 0 |
||
5286 | 1d18: 32 95 swap r19 |
||
5287 | 1d1a: 22 95 swap r18 |
||
5288 | 1d1c: 2f 70 andi r18, 0x0F ; 15 |
||
5289 | 1d1e: 23 27 eor r18, r19 |
||
5290 | 1d20: 3f 70 andi r19, 0x0F ; 15 |
||
5291 | 1d22: 23 27 eor r18, r19 |
||
5292 | 1d24: 20 95 com r18 |
||
5293 | 1d26: 30 95 com r19 |
||
5294 | 1d28: 21 70 andi r18, 0x01 ; 1 |
||
5295 | 1d2a: 30 70 andi r19, 0x00 ; 0 |
||
5296 | } |
||
5297 | return 0; |
||
5298 | } |
||
5299 | 1d2c: c9 01 movw r24, r18 |
||
5300 | 1d2e: 08 95 ret |
||
5301 | |||
5302 | 00001d30 <ppm_init>: |
||
5303 | |||
5304 | /** |
||
5305 | * init ppm, including timer1 for measurement |
||
5306 | */ |
||
5307 | void ppm_init() { |
||
5308 | PORTE |= (1 << PORTE0); // enable pullup on INT0 pin |
||
5309 | 1d30: 38 9a sbi 0x07, 0 ; 7 |
||
5310 | GICR |= (1<<INT2); // External Interrupt Request 2 Enable |
||
5311 | 1d32: 8b b7 in r24, 0x3b ; 59 |
||
5312 | 1d34: 80 62 ori r24, 0x20 ; 32 |
||
5313 | 1d36: 8b bf out 0x3b, r24 ; 59 |
||
5314 | EMCUCR |= (1<<ISC2); // a rising edge on INT2 activates the interrupt |
||
5315 | 1d38: 86 b7 in r24, 0x36 ; 54 |
||
5316 | 1d3a: 81 60 ori r24, 0x01 ; 1 |
||
5317 | 1d3c: 86 bf out 0x36, r24 ; 54 |
||
5318 | TCCR1B |= (0<<CS12)|(1<<CS10)|(1<<CS11); // timer1 up with prescaler 64 |
||
5319 | 1d3e: 8e b5 in r24, 0x2e ; 46 |
||
5320 | 1d40: 83 60 ori r24, 0x03 ; 3 |
||
5321 | 1d42: 8e bd out 0x2e, r24 ; 46 |
||
5322 | } |
||
5323 | 1d44: 08 95 ret |
||
5324 | |||
5325 | 00001d46 <__vector_3>: |
||
5326 | |||
5327 | /** |
||
5328 | * Handle INT2 interrupts that occur on changing edges of ppm signal |
||
5329 | */ |
||
5330 | ISR(INT2_vect) { |
||
5331 | 1d46: 1f 92 push r1 |
||
5332 | 1d48: 0f 92 push r0 |
||
5333 | 1d4a: 0f b6 in r0, 0x3f ; 63 |
||
5334 | 1d4c: 0f 92 push r0 |
||
5335 | 1d4e: 11 24 eor r1, r1 |
||
5336 | 1d50: 2f 93 push r18 |
||
5337 | 1d52: 3f 93 push r19 |
||
5338 | 1d54: 4f 93 push r20 |
||
5339 | 1d56: 5f 93 push r21 |
||
5340 | 1d58: 6f 93 push r22 |
||
5341 | 1d5a: 7f 93 push r23 |
||
5342 | 1d5c: 8f 93 push r24 |
||
5343 | 1d5e: 9f 93 push r25 |
||
5344 | 1d60: af 93 push r26 |
||
5345 | 1d62: bf 93 push r27 |
||
5346 | 1d64: ef 93 push r30 |
||
5347 | 1d66: ff 93 push r31 |
||
5348 | // since the pin might get bogus reads we wait for 123 signals |
||
5349 | static uint8_t valid_ppm_to_go = 123; |
||
5350 | if (EMCUCR & (1<<ISC2)) { // rising |
||
5351 | 1d68: 06 b6 in r0, 0x36 ; 54 |
||
5352 | 1d6a: 00 fc sbrc r0, 0 |
||
5353 | 1d6c: 40 c0 rjmp .+128 ; 0x1dee <__vector_3+0xa8> |
||
5354 | old_timer1 = TCNT1; |
||
5355 | EMCUCR &= ~(1<<ISC2); // next one is falling |
||
5356 | } else { |
||
5357 | if (valid_ppm_to_go) { |
||
5358 | 1d6e: 80 91 11 01 lds r24, 0x0111 |
||
5359 | 1d72: 88 23 and r24, r24 |
||
5360 | 1d74: b9 f0 breq .+46 ; 0x1da4 <__vector_3+0x5e> |
||
5361 | valid_ppm_to_go--; |
||
5362 | 1d76: 81 50 subi r24, 0x01 ; 1 |
||
5363 | 1d78: 80 93 11 01 sts 0x0111, r24 |
||
5364 | clear(); |
||
5365 | } |
||
5366 | COSD_FLAGS_CONFIG &= ~COSD_FLAG_HUD; |
||
5367 | } |
||
5368 | } |
||
5369 | EMCUCR |= (1<<ISC2); // next one is rising |
||
5370 | 1d7c: 86 b7 in r24, 0x36 ; 54 |
||
5371 | 1d7e: 81 60 ori r24, 0x01 ; 1 |
||
5372 | 1d80: 86 bf out 0x36, r24 ; 54 |
||
5373 | } |
||
5374 | //write_ndigit_number_u(2, 2, ppm, 1000, 0); // debug |
||
5375 | //write_ndigit_number_u(2, 3, valid_ppm_to_go, 100, 0); // debug |
||
5376 | //write_ndigit_number_u(2, 4, COSD_FLAGS, 100, 0); // debug |
||
5377 | } |
||
5378 | 1d82: ff 91 pop r31 |
||
5379 | 1d84: ef 91 pop r30 |
||
5380 | 1d86: bf 91 pop r27 |
||
5381 | 1d88: af 91 pop r26 |
||
5382 | 1d8a: 9f 91 pop r25 |
||
5383 | 1d8c: 8f 91 pop r24 |
||
5384 | 1d8e: 7f 91 pop r23 |
||
5385 | 1d90: 6f 91 pop r22 |
||
5386 | 1d92: 5f 91 pop r21 |
||
5387 | 1d94: 4f 91 pop r20 |
||
5388 | 1d96: 3f 91 pop r19 |
||
5389 | 1d98: 2f 91 pop r18 |
||
5390 | 1d9a: 0f 90 pop r0 |
||
5391 | 1d9c: 0f be out 0x3f, r0 ; 63 |
||
5392 | 1d9e: 0f 90 pop r0 |
||
5393 | 1da0: 1f 90 pop r1 |
||
5394 | 1da2: 18 95 reti |
||
5395 | EMCUCR &= ~(1<<ISC2); // next one is falling |
||
5396 | } else { |
||
5397 | if (valid_ppm_to_go) { |
||
5398 | valid_ppm_to_go--; |
||
5399 | } else { |
||
5400 | ppm = TCNT1 - old_timer1; |
||
5401 | 1da4: 8c b5 in r24, 0x2c ; 44 |
||
5402 | 1da6: 9d b5 in r25, 0x2d ; 45 |
||
5403 | 1da8: 20 91 3f 01 lds r18, 0x013F |
||
5404 | 1dac: 30 91 40 01 lds r19, 0x0140 |
||
5405 | 1db0: 82 1b sub r24, r18 |
||
5406 | 1db2: 93 0b sbc r25, r19 |
||
5407 | 1db4: 90 93 42 01 sts 0x0142, r25 |
||
5408 | 1db8: 80 93 41 01 sts 0x0141, r24 |
||
5409 | ppm -= 256; |
||
5410 | 1dbc: 80 91 41 01 lds r24, 0x0141 |
||
5411 | 1dc0: 90 91 42 01 lds r25, 0x0142 |
||
5412 | 1dc4: 80 50 subi r24, 0x00 ; 0 |
||
5413 | 1dc6: 91 40 sbci r25, 0x01 ; 1 |
||
5414 | 1dc8: 90 93 42 01 sts 0x0142, r25 |
||
5415 | 1dcc: 80 93 41 01 sts 0x0141, r24 |
||
5416 | if (ppm < 128) { // we want HUD |
||
5417 | 1dd0: 80 91 41 01 lds r24, 0x0141 |
||
5418 | 1dd4: 90 91 42 01 lds r25, 0x0142 |
||
5419 | 1dd8: 80 38 cpi r24, 0x80 ; 128 |
||
5420 | 1dda: 91 05 cpc r25, r1 |
||
5421 | 1ddc: 90 f0 brcs .+36 ; 0x1e02 <__vector_3+0xbc> |
||
5422 | COSD_FLAGS_CONFIG |= COSD_FLAG_HUD; |
||
5423 | } else { // we do not want hud |
||
5424 | if (COSD_FLAGS_CONFIG & COSD_FLAG_HUD) { |
||
5425 | 1dde: 80 91 1c 01 lds r24, 0x011C |
||
5426 | 1de2: 80 fd sbrc r24, 0 |
||
5427 | 1de4: 14 c0 rjmp .+40 ; 0x1e0e <__vector_3+0xc8> |
||
5428 | clear(); |
||
5429 | } |
||
5430 | COSD_FLAGS_CONFIG &= ~COSD_FLAG_HUD; |
||
5431 | 1de6: 8e 7f andi r24, 0xFE ; 254 |
||
5432 | 1de8: 80 93 1c 01 sts 0x011C, r24 |
||
5433 | 1dec: c7 cf rjmp .-114 ; 0x1d7c <__vector_3+0x36> |
||
5434 | */ |
||
5435 | ISR(INT2_vect) { |
||
5436 | // since the pin might get bogus reads we wait for 123 signals |
||
5437 | static uint8_t valid_ppm_to_go = 123; |
||
5438 | if (EMCUCR & (1<<ISC2)) { // rising |
||
5439 | old_timer1 = TCNT1; |
||
5440 | 1dee: 8c b5 in r24, 0x2c ; 44 |
||
5441 | 1df0: 9d b5 in r25, 0x2d ; 45 |
||
5442 | 1df2: 90 93 40 01 sts 0x0140, r25 |
||
5443 | 1df6: 80 93 3f 01 sts 0x013F, r24 |
||
5444 | EMCUCR &= ~(1<<ISC2); // next one is falling |
||
5445 | 1dfa: 86 b7 in r24, 0x36 ; 54 |
||
5446 | 1dfc: 8e 7f andi r24, 0xFE ; 254 |
||
5447 | 1dfe: 86 bf out 0x36, r24 ; 54 |
||
5448 | 1e00: c0 cf rjmp .-128 ; 0x1d82 <__vector_3+0x3c> |
||
5449 | valid_ppm_to_go--; |
||
5450 | } else { |
||
5451 | ppm = TCNT1 - old_timer1; |
||
5452 | ppm -= 256; |
||
5453 | if (ppm < 128) { // we want HUD |
||
5454 | COSD_FLAGS_CONFIG |= COSD_FLAG_HUD; |
||
5455 | 1e02: 80 91 1c 01 lds r24, 0x011C |
||
5456 | 1e06: 81 60 ori r24, 0x01 ; 1 |
||
5457 | 1e08: 80 93 1c 01 sts 0x011C, r24 |
||
5458 | 1e0c: b7 cf rjmp .-146 ; 0x1d7c <__vector_3+0x36> |
||
5459 | } else { // we do not want hud |
||
5460 | if (COSD_FLAGS_CONFIG & COSD_FLAG_HUD) { |
||
5461 | clear(); |
||
5462 | 1e0e: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
5463 | 1e12: 80 91 1c 01 lds r24, 0x011C |
||
5464 | 1e16: e7 cf rjmp .-50 ; 0x1de6 <__vector_3+0xa0> |
||
5465 | |||
5466 | 00001e18 <osd_ncmode_default>: |
||
5467 | #include "osd_helpers.h" |
||
5468 | #include "osd_ncmode_default.h" |
||
5469 | |||
5470 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
5471 | |||
5472 | int osd_ncmode_default() { |
||
5473 | 1e18: ef 92 push r14 |
||
5474 | 1e1a: ff 92 push r15 |
||
5475 | 1e1c: 0f 93 push r16 |
||
5476 | 1e1e: 1f 93 push r17 |
||
5477 | 1e20: cf 93 push r28 |
||
5478 | 1e22: df 93 push r29 |
||
5479 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
5480 | 1e24: 80 91 1b 01 lds r24, 0x011B |
||
5481 | 1e28: 80 ff sbrs r24, 0 |
||
5482 | 1e2a: e5 c1 rjmp .+970 ; 0x21f6 <osd_ncmode_default+0x3de> |
||
5483 | // write icons at init or after menu/mode-switch |
||
5484 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
5485 | 1e2c: 80 91 1d 01 lds r24, 0x011D |
||
5486 | 1e30: 81 ff sbrs r24, 1 |
||
5487 | 1e32: f4 c2 rjmp .+1512 ; 0x241c <osd_ncmode_default+0x604> |
||
5488 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
||
5489 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
5490 | } |
||
5491 | |||
5492 | // first line |
||
5493 | write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
||
5494 | 1e34: 20 91 d4 01 lds r18, 0x01D4 |
||
5495 | 1e38: 30 91 d5 01 lds r19, 0x01D5 |
||
5496 | 1e3c: 40 e0 ldi r20, 0x00 ; 0 |
||
5497 | 1e3e: 50 e0 ldi r21, 0x00 ; 0 |
||
5498 | 1e40: ca 01 movw r24, r20 |
||
5499 | 1e42: b9 01 movw r22, r18 |
||
5500 | 1e44: 66 0f add r22, r22 |
||
5501 | 1e46: 77 1f adc r23, r23 |
||
5502 | 1e48: 88 1f adc r24, r24 |
||
5503 | 1e4a: 99 1f adc r25, r25 |
||
5504 | 1e4c: 66 0f add r22, r22 |
||
5505 | 1e4e: 77 1f adc r23, r23 |
||
5506 | 1e50: 88 1f adc r24, r24 |
||
5507 | 1e52: 99 1f adc r25, r25 |
||
5508 | 1e54: 66 0f add r22, r22 |
||
5509 | 1e56: 77 1f adc r23, r23 |
||
5510 | 1e58: 88 1f adc r24, r24 |
||
5511 | 1e5a: 99 1f adc r25, r25 |
||
5512 | 1e5c: 62 0f add r22, r18 |
||
5513 | 1e5e: 73 1f adc r23, r19 |
||
5514 | 1e60: 84 1f adc r24, r20 |
||
5515 | 1e62: 95 1f adc r25, r21 |
||
5516 | 1e64: 2a ef ldi r18, 0xFA ; 250 |
||
5517 | 1e66: 30 e0 ldi r19, 0x00 ; 0 |
||
5518 | 1e68: 40 e0 ldi r20, 0x00 ; 0 |
||
5519 | 1e6a: 50 e0 ldi r21, 0x00 ; 0 |
||
5520 | 1e6c: 0e 94 8f 1c call 0x391e ; 0x391e <__udivmodsi4> |
||
5521 | 1e70: 82 e0 ldi r24, 0x02 ; 2 |
||
5522 | 1e72: 60 91 02 01 lds r22, 0x0102 |
||
5523 | 1e76: a9 01 movw r20, r18 |
||
5524 | 1e78: 23 e0 ldi r18, 0x03 ; 3 |
||
5525 | 1e7a: 30 e0 ldi r19, 0x00 ; 0 |
||
5526 | 1e7c: 00 e0 ldi r16, 0x00 ; 0 |
||
5527 | 1e7e: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
5528 | |||
5529 | write_ndigit_number_u(7, top_line, naviData.RC_Quality, 3, 0); |
||
5530 | 1e82: 40 91 dc 01 lds r20, 0x01DC |
||
5531 | 1e86: 87 e0 ldi r24, 0x07 ; 7 |
||
5532 | 1e88: 60 91 02 01 lds r22, 0x0102 |
||
5533 | 1e8c: 50 e0 ldi r21, 0x00 ; 0 |
||
5534 | 1e8e: 23 e0 ldi r18, 0x03 ; 3 |
||
5535 | 1e90: 30 e0 ldi r19, 0x00 ; 0 |
||
5536 | 1e92: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
5537 | if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
5538 | 1e96: 80 91 dc 01 lds r24, 0x01DC |
||
5539 | 1e9a: 85 36 cpi r24, 0x65 ; 101 |
||
5540 | 1e9c: 08 f4 brcc .+2 ; 0x1ea0 <osd_ncmode_default+0x88> |
||
5541 | 1e9e: 69 c2 rjmp .+1234 ; 0x2372 <osd_ncmode_default+0x55a> |
||
5542 | for (uint8_t x = 0; x < 4; x++) |
||
5543 | write_char_att_xy(7 + x, top_line, BLINK); |
||
5544 | } else if (naviData.RC_Quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
5545 | 1ea0: 80 91 dc 01 lds r24, 0x01DC |
||
5546 | 1ea4: 85 36 cpi r24, 0x65 ; 101 |
||
5547 | 1ea6: 08 f0 brcs .+2 ; 0x1eaa <osd_ncmode_default+0x92> |
||
5548 | 1ea8: a9 c2 rjmp .+1362 ; 0x23fc <osd_ncmode_default+0x5e4> |
||
5549 | for (uint8_t x = 0; x < 4; x++) |
||
5550 | write_char_att_xy(7 + x, top_line, 0); |
||
5551 | } |
||
5552 | |||
5553 | |||
5554 | if (naviData.NCFlags & NC_FLAG_NOSERIALLINK) { |
||
5555 | 1eaa: 80 91 de 01 lds r24, 0x01DE |
||
5556 | 1eae: 84 ff sbrs r24, 4 |
||
5557 | 1eb0: 73 c2 rjmp .+1254 ; 0x2398 <osd_ncmode_default+0x580> |
||
5558 | write_char_xy(11, top_line, 0); // clear |
||
5559 | 1eb2: 8b e0 ldi r24, 0x0B ; 11 |
||
5560 | 1eb4: 60 91 02 01 lds r22, 0x0102 |
||
5561 | 1eb8: 40 e0 ldi r20, 0x00 ; 0 |
||
5562 | 1eba: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
5563 | } else { |
||
5564 | write_char_xy(11, top_line, 0xC6); // PC icon |
||
5565 | } |
||
5566 | |||
5567 | write_ndigit_number_u(13, top_line, naviData.CompassHeading, 3, 0); |
||
5568 | 1ebe: 40 91 d8 01 lds r20, 0x01D8 |
||
5569 | 1ec2: 50 91 d9 01 lds r21, 0x01D9 |
||
5570 | 1ec6: 8d e0 ldi r24, 0x0D ; 13 |
||
5571 | 1ec8: 60 91 02 01 lds r22, 0x0102 |
||
5572 | 1ecc: 23 e0 ldi r18, 0x03 ; 3 |
||
5573 | 1ece: 30 e0 ldi r19, 0x00 ; 0 |
||
5574 | 1ed0: 00 e0 ldi r16, 0x00 ; 0 |
||
5575 | 1ed2: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
5576 | |||
5577 | write_ascii_string_pgm(17, top_line, (const char *) (pgm_read_word ( &(directions[heading_conv(naviData.CompassHeading)])))); |
||
5578 | 1ed6: 10 91 02 01 lds r17, 0x0102 |
||
5579 | 1eda: 80 91 d8 01 lds r24, 0x01D8 |
||
5580 | 1ede: 90 91 d9 01 lds r25, 0x01D9 |
||
5581 | 1ee2: 0e 94 9d 08 call 0x113a ; 0x113a <heading_conv> |
||
5582 | 1ee6: e8 2f mov r30, r24 |
||
5583 | 1ee8: f0 e0 ldi r31, 0x00 ; 0 |
||
5584 | 1eea: ee 0f add r30, r30 |
||
5585 | 1eec: ff 1f adc r31, r31 |
||
5586 | 1eee: e8 5f subi r30, 0xF8 ; 248 |
||
5587 | 1ef0: fe 4f sbci r31, 0xFE ; 254 |
||
5588 | 1ef2: 45 91 lpm r20, Z+ |
||
5589 | 1ef4: 54 91 lpm r21, Z+ |
||
5590 | 1ef6: 81 e1 ldi r24, 0x11 ; 17 |
||
5591 | 1ef8: 61 2f mov r22, r17 |
||
5592 | 1efa: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
5593 | |||
5594 | draw_variometer(21, top_line, naviData.Variometer); |
||
5595 | 1efe: 40 91 cf 01 lds r20, 0x01CF |
||
5596 | 1f02: 50 91 d0 01 lds r21, 0x01D0 |
||
5597 | 1f06: 85 e1 ldi r24, 0x15 ; 21 |
||
5598 | 1f08: 60 91 02 01 lds r22, 0x0102 |
||
5599 | 1f0c: 0e 94 c1 09 call 0x1382 ; 0x1382 <draw_variometer> |
||
5600 | |||
5601 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
||
5602 | 1f10: 80 91 1c 01 lds r24, 0x011C |
||
5603 | 1f14: 81 ff sbrs r24, 1 |
||
5604 | 1f16: 52 c0 rjmp .+164 ; 0x1fbc <osd_ncmode_default+0x1a4> |
||
5605 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > 10 || naviData.CurrentPosition.Altitude / 1000 - altimeter_offset < -10) { |
||
5606 | 1f18: 60 91 a3 01 lds r22, 0x01A3 |
||
5607 | 1f1c: 70 91 a4 01 lds r23, 0x01A4 |
||
5608 | 1f20: 80 91 a5 01 lds r24, 0x01A5 |
||
5609 | 1f24: 90 91 a6 01 lds r25, 0x01A6 |
||
5610 | 1f28: c0 91 98 01 lds r28, 0x0198 |
||
5611 | 1f2c: d0 91 99 01 lds r29, 0x0199 |
||
5612 | 1f30: 7e 01 movw r14, r28 |
||
5613 | 1f32: 00 27 eor r16, r16 |
||
5614 | 1f34: f7 fc sbrc r15, 7 |
||
5615 | 1f36: 00 95 com r16 |
||
5616 | 1f38: 10 2f mov r17, r16 |
||
5617 | 1f3a: 28 ee ldi r18, 0xE8 ; 232 |
||
5618 | 1f3c: 33 e0 ldi r19, 0x03 ; 3 |
||
5619 | 1f3e: 40 e0 ldi r20, 0x00 ; 0 |
||
5620 | 1f40: 50 e0 ldi r21, 0x00 ; 0 |
||
5621 | 1f42: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
5622 | 1f46: 2e 19 sub r18, r14 |
||
5623 | 1f48: 3f 09 sbc r19, r15 |
||
5624 | 1f4a: 40 0b sbc r20, r16 |
||
5625 | 1f4c: 51 0b sbc r21, r17 |
||
5626 | 1f4e: 2b 30 cpi r18, 0x0B ; 11 |
||
5627 | 1f50: 31 05 cpc r19, r1 |
||
5628 | 1f52: 41 05 cpc r20, r1 |
||
5629 | 1f54: 51 05 cpc r21, r1 |
||
5630 | 1f56: c4 f4 brge .+48 ; 0x1f88 <osd_ncmode_default+0x170> |
||
5631 | 1f58: 60 91 a3 01 lds r22, 0x01A3 |
||
5632 | 1f5c: 70 91 a4 01 lds r23, 0x01A4 |
||
5633 | 1f60: 80 91 a5 01 lds r24, 0x01A5 |
||
5634 | 1f64: 90 91 a6 01 lds r25, 0x01A6 |
||
5635 | 1f68: 28 ee ldi r18, 0xE8 ; 232 |
||
5636 | 1f6a: 33 e0 ldi r19, 0x03 ; 3 |
||
5637 | 1f6c: 40 e0 ldi r20, 0x00 ; 0 |
||
5638 | 1f6e: 50 e0 ldi r21, 0x00 ; 0 |
||
5639 | 1f70: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
5640 | 1f74: 2e 19 sub r18, r14 |
||
5641 | 1f76: 3f 09 sbc r19, r15 |
||
5642 | 1f78: 40 0b sbc r20, r16 |
||
5643 | 1f7a: 51 0b sbc r21, r17 |
||
5644 | 1f7c: 26 5f subi r18, 0xF6 ; 246 |
||
5645 | 1f7e: 3f 4f sbci r19, 0xFF ; 255 |
||
5646 | 1f80: 4f 4f sbci r20, 0xFF ; 255 |
||
5647 | 1f82: 5f 4f sbci r21, 0xFF ; 255 |
||
5648 | 1f84: 0c f0 brlt .+2 ; 0x1f88 <osd_ncmode_default+0x170> |
||
5649 | 1f86: 83 c4 rjmp .+2310 ; 0x288e <osd_ncmode_default+0xa76> |
||
5650 | // above 10m only write full meters |
||
5651 | write_ndigit_number_s(23, top_line, (int16_t) (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset), 4, 0); // GPS |
||
5652 | 1f88: 60 91 a3 01 lds r22, 0x01A3 |
||
5653 | 1f8c: 70 91 a4 01 lds r23, 0x01A4 |
||
5654 | 1f90: 80 91 a5 01 lds r24, 0x01A5 |
||
5655 | 1f94: 90 91 a6 01 lds r25, 0x01A6 |
||
5656 | 1f98: 28 ee ldi r18, 0xE8 ; 232 |
||
5657 | 1f9a: 33 e0 ldi r19, 0x03 ; 3 |
||
5658 | 1f9c: 40 e0 ldi r20, 0x00 ; 0 |
||
5659 | 1f9e: 50 e0 ldi r21, 0x00 ; 0 |
||
5660 | 1fa0: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
5661 | 1fa4: 2c 1b sub r18, r28 |
||
5662 | 1fa6: 3d 0b sbc r19, r29 |
||
5663 | 1fa8: 87 e1 ldi r24, 0x17 ; 23 |
||
5664 | 1faa: 60 91 02 01 lds r22, 0x0102 |
||
5665 | 1fae: a9 01 movw r20, r18 |
||
5666 | 1fb0: 24 e0 ldi r18, 0x04 ; 4 |
||
5667 | 1fb2: 30 e0 ldi r19, 0x00 ; 0 |
||
5668 | 1fb4: 00 e0 ldi r16, 0x00 ; 0 |
||
5669 | 1fb6: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
5670 | 1fba: 20 c0 rjmp .+64 ; 0x1ffc <osd_ncmode_default+0x1e4> |
||
5671 | // up to 10m write meters.dm |
||
5672 | write_ndigit_number_s_10th(23, top_line, (int16_t) (naviData.CurrentPosition.Altitude / 100 - altimeter_offset * 10), 3, 0); // GPS |
||
5673 | } |
||
5674 | } else { |
||
5675 | //note:lephisto:according to several sources it's /30 |
||
5676 | if (naviData.Altimeter > 300 || naviData.Altimeter < -300) { |
||
5677 | 1fbc: 80 91 cd 01 lds r24, 0x01CD |
||
5678 | 1fc0: 90 91 ce 01 lds r25, 0x01CE |
||
5679 | 1fc4: 8d 52 subi r24, 0x2D ; 45 |
||
5680 | 1fc6: 91 40 sbci r25, 0x01 ; 1 |
||
5681 | 1fc8: 44 f4 brge .+16 ; 0x1fda <osd_ncmode_default+0x1c2> |
||
5682 | 1fca: 80 91 cd 01 lds r24, 0x01CD |
||
5683 | 1fce: 90 91 ce 01 lds r25, 0x01CE |
||
5684 | 1fd2: 84 5d subi r24, 0xD4 ; 212 |
||
5685 | 1fd4: 9e 4f sbci r25, 0xFE ; 254 |
||
5686 | 1fd6: 0c f0 brlt .+2 ; 0x1fda <osd_ncmode_default+0x1c2> |
||
5687 | 1fd8: 82 c4 rjmp .+2308 ; 0x28de <osd_ncmode_default+0xac6> |
||
5688 | // above 10m only write full meters |
||
5689 | write_ndigit_number_s(23, top_line, naviData.Altimeter / 30, 4, 0); // BARO |
||
5690 | 1fda: 80 91 cd 01 lds r24, 0x01CD |
||
5691 | 1fde: 90 91 ce 01 lds r25, 0x01CE |
||
5692 | 1fe2: 6e e1 ldi r22, 0x1E ; 30 |
||
5693 | 1fe4: 70 e0 ldi r23, 0x00 ; 0 |
||
5694 | 1fe6: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
5695 | 1fea: ab 01 movw r20, r22 |
||
5696 | 1fec: 87 e1 ldi r24, 0x17 ; 23 |
||
5697 | 1fee: 60 91 02 01 lds r22, 0x0102 |
||
5698 | 1ff2: 24 e0 ldi r18, 0x04 ; 4 |
||
5699 | 1ff4: 30 e0 ldi r19, 0x00 ; 0 |
||
5700 | 1ff6: 00 e0 ldi r16, 0x00 ; 0 |
||
5701 | 1ff8: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
5702 | } |
||
5703 | } |
||
5704 | |||
5705 | |||
5706 | // seccond line |
||
5707 | draw_compass(11, top_line + 1, naviData.CompassHeading); |
||
5708 | 1ffc: 40 91 d8 01 lds r20, 0x01D8 |
||
5709 | 2000: 50 91 d9 01 lds r21, 0x01D9 |
||
5710 | 2004: 60 91 02 01 lds r22, 0x0102 |
||
5711 | 2008: 6f 5f subi r22, 0xFF ; 255 |
||
5712 | 200a: 8b e0 ldi r24, 0x0B ; 11 |
||
5713 | 200c: 0e 94 55 0a call 0x14aa ; 0x14aa <draw_compass> |
||
5714 | |||
5715 | // TODO: verify correctness |
||
5716 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
||
5717 | 2010: 80 91 c8 01 lds r24, 0x01C8 |
||
5718 | 2014: 90 91 c9 01 lds r25, 0x01C9 |
||
5719 | 2018: 20 91 d8 01 lds r18, 0x01D8 |
||
5720 | 201c: 30 91 d9 01 lds r19, 0x01D9 |
||
5721 | //write_char_xy(21, top_line + 1, arrowdir[heading_conv(heading_home)]); |
||
5722 | // finer resolution, 0xa0 is first character and we add the index 0 <= index < 16 |
||
5723 | write_char_xy(21, top_line + 1, 0xa0 + heading_fine_conv(heading_home)); |
||
5724 | 2020: 10 91 02 01 lds r17, 0x0102 |
||
5725 | 2024: 1f 5f subi r17, 0xFF ; 255 |
||
5726 | 2026: 88 59 subi r24, 0x98 ; 152 |
||
5727 | 2028: 9e 4f sbci r25, 0xFE ; 254 |
||
5728 | 202a: 82 1b sub r24, r18 |
||
5729 | 202c: 93 0b sbc r25, r19 |
||
5730 | 202e: 68 e6 ldi r22, 0x68 ; 104 |
||
5731 | 2030: 71 e0 ldi r23, 0x01 ; 1 |
||
5732 | 2032: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
5733 | 2036: 0e 94 cf 08 call 0x119e ; 0x119e <heading_fine_conv> |
||
5734 | 203a: 48 2f mov r20, r24 |
||
5735 | 203c: 40 56 subi r20, 0x60 ; 96 |
||
5736 | 203e: 85 e1 ldi r24, 0x15 ; 21 |
||
5737 | 2040: 61 2f mov r22, r17 |
||
5738 | 2042: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
5739 | |||
5740 | write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
||
5741 | 2046: 80 91 c6 01 lds r24, 0x01C6 |
||
5742 | 204a: 90 91 c7 01 lds r25, 0x01C7 |
||
5743 | 204e: 20 91 02 01 lds r18, 0x0102 |
||
5744 | 2052: 2f 5f subi r18, 0xFF ; 255 |
||
5745 | 2054: 6a e0 ldi r22, 0x0A ; 10 |
||
5746 | 2056: 70 e0 ldi r23, 0x00 ; 0 |
||
5747 | 2058: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
5748 | 205c: ab 01 movw r20, r22 |
||
5749 | 205e: 88 e1 ldi r24, 0x18 ; 24 |
||
5750 | 2060: 62 2f mov r22, r18 |
||
5751 | 2062: 23 e0 ldi r18, 0x03 ; 3 |
||
5752 | 2064: 30 e0 ldi r19, 0x00 ; 0 |
||
5753 | 2066: 00 e0 ldi r16, 0x00 ; 0 |
||
5754 | 2068: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
5755 | |||
5756 | // center |
||
5757 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
||
5758 | 206c: 80 91 dd 01 lds r24, 0x01DD |
||
5759 | 2070: 80 ff sbrs r24, 0 |
||
5760 | 2072: 84 c2 rjmp .+1288 ; 0x257c <osd_ncmode_default+0x764> |
||
5761 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
||
5762 | 2074: 80 91 27 01 lds r24, 0x0127 |
||
5763 | 2078: 80 ff sbrs r24, 0 |
||
5764 | 207a: 91 c3 rjmp .+1826 ; 0x279e <osd_ncmode_default+0x986> |
||
5765 | 207c: 10 91 1b 01 lds r17, 0x011B |
||
5766 | 2080: 00 91 1d 01 lds r16, 0x011D |
||
5767 | wasted_ampere_offset = naviData.UsedCapacity; |
||
5768 | } |
||
5769 | // update flags to paint display again if needed |
||
5770 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
5771 | } |
||
5772 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
5773 | 2084: 11 ff sbrs r17, 1 |
||
5774 | 2086: 18 c0 rjmp .+48 ; 0x20b8 <osd_ncmode_default+0x2a0> |
||
5775 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
5776 | 2088: 00 ff sbrs r16, 0 |
||
5777 | 208a: f7 c3 rjmp .+2030 ; 0x287a <osd_ncmode_default+0xa62> |
||
5778 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
5779 | 208c: 40 91 da 01 lds r20, 0x01DA |
||
5780 | 2090: 20 91 db 01 lds r18, 0x01DB |
||
5781 | 2094: 80 91 02 01 lds r24, 0x0102 |
||
5782 | 2098: 60 91 03 01 lds r22, 0x0103 |
||
5783 | 209c: 62 50 subi r22, 0x02 ; 2 |
||
5784 | } else { |
||
5785 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
5786 | 209e: 55 27 eor r21, r21 |
||
5787 | 20a0: 47 fd sbrc r20, 7 |
||
5788 | 20a2: 50 95 com r21 |
||
5789 | 20a4: 33 27 eor r19, r19 |
||
5790 | 20a6: 27 fd sbrc r18, 7 |
||
5791 | 20a8: 30 95 com r19 |
||
5792 | 20aa: 8e 5f subi r24, 0xFE ; 254 |
||
5793 | 20ac: 0e 94 e6 08 call 0x11cc ; 0x11cc <draw_artificial_horizon> |
||
5794 | 20b0: 10 91 1b 01 lds r17, 0x011B |
||
5795 | 20b4: 00 91 1d 01 lds r16, 0x011D |
||
5796 | } |
||
5797 | } |
||
5798 | // motors are on, assume we were/are flying |
||
5799 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
||
5800 | 20b8: 04 60 ori r16, 0x04 ; 4 |
||
5801 | 20ba: 00 93 1d 01 sts 0x011D, r16 |
||
5802 | } else { |
||
5803 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
5804 | } |
||
5805 | } |
||
5806 | } |
||
5807 | if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) { |
||
5808 | 20be: 12 fd sbrc r17, 2 |
||
5809 | 20c0: 7f c2 rjmp .+1278 ; 0x25c0 <osd_ncmode_default+0x7a8> |
||
5810 | draw_big_variometer(27, 8, naviData.Variometer); |
||
5811 | } |
||
5812 | |||
5813 | // pre-bottom line |
||
5814 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
5815 | 20c2: 80 91 1d 01 lds r24, 0x011D |
||
5816 | 20c6: 80 ff sbrs r24, 0 |
||
5817 | 20c8: 56 c2 rjmp .+1196 ; 0x2576 <osd_ncmode_default+0x75e> |
||
5818 | 20ca: 16 ff sbrs r17, 6 |
||
5819 | 20cc: 9a c3 rjmp .+1844 ; 0x2802 <osd_ncmode_default+0x9ea> |
||
5820 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
5821 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
5822 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
5823 | } |
||
5824 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
5825 | write_ndigit_number_u_10th(3, bottom_line - 1, naviData.Current, 3, 0); |
||
5826 | 20ce: 40 91 e8 01 lds r20, 0x01E8 |
||
5827 | 20d2: 50 91 e9 01 lds r21, 0x01E9 |
||
5828 | 20d6: 60 91 03 01 lds r22, 0x0103 |
||
5829 | 20da: 61 50 subi r22, 0x01 ; 1 |
||
5830 | 20dc: 83 e0 ldi r24, 0x03 ; 3 |
||
5831 | 20de: 23 e0 ldi r18, 0x03 ; 3 |
||
5832 | 20e0: 30 e0 ldi r19, 0x00 ; 0 |
||
5833 | 20e2: 00 e0 ldi r16, 0x00 ; 0 |
||
5834 | 20e4: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
5835 | write_ndigit_number_u(10, bottom_line - 1, naviData.UsedCapacity, 4, 0); |
||
5836 | 20e8: 40 91 ea 01 lds r20, 0x01EA |
||
5837 | 20ec: 50 91 eb 01 lds r21, 0x01EB |
||
5838 | 20f0: 60 91 03 01 lds r22, 0x0103 |
||
5839 | 20f4: 61 50 subi r22, 0x01 ; 1 |
||
5840 | 20f6: 8a e0 ldi r24, 0x0A ; 10 |
||
5841 | 20f8: 24 e0 ldi r18, 0x04 ; 4 |
||
5842 | 20fa: 30 e0 ldi r19, 0x00 ; 0 |
||
5843 | 20fc: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
5844 | } |
||
5845 | |||
5846 | //DEBUGwrite_ndigit_number_u(1, 5, COSD_FLAGS_MODES, 3, 0); |
||
5847 | |||
5848 | // bottom line |
||
5849 | draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
||
5850 | 2100: 20 91 d3 01 lds r18, 0x01D3 |
||
5851 | 2104: 82 e0 ldi r24, 0x02 ; 2 |
||
5852 | 2106: 60 91 03 01 lds r22, 0x0103 |
||
5853 | 210a: 40 91 19 01 lds r20, 0x0119 |
||
5854 | 210e: 00 91 1a 01 lds r16, 0x011A |
||
5855 | 2112: 0e 94 17 0a call 0x142e ; 0x142e <draw_battery> |
||
5856 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 3, 0); |
||
5857 | 2116: 40 91 d3 01 lds r20, 0x01D3 |
||
5858 | 211a: 83 e0 ldi r24, 0x03 ; 3 |
||
5859 | 211c: 60 91 03 01 lds r22, 0x0103 |
||
5860 | 2120: 50 e0 ldi r21, 0x00 ; 0 |
||
5861 | 2122: 23 e0 ldi r18, 0x03 ; 3 |
||
5862 | 2124: 30 e0 ldi r19, 0x00 ; 0 |
||
5863 | 2126: 00 e0 ldi r16, 0x00 ; 0 |
||
5864 | 2128: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
5865 | if (naviData.UBat <= min_voltage && last_UBat > min_voltage) { |
||
5866 | 212c: 80 91 d3 01 lds r24, 0x01D3 |
||
5867 | 2130: 90 91 19 01 lds r25, 0x0119 |
||
5868 | 2134: 98 17 cp r25, r24 |
||
5869 | 2136: 08 f4 brcc .+2 ; 0x213a <osd_ncmode_default+0x322> |
||
5870 | 2138: ef c1 rjmp .+990 ; 0x2518 <osd_ncmode_default+0x700> |
||
5871 | 213a: 80 91 00 01 lds r24, 0x0100 |
||
5872 | 213e: 98 17 cp r25, r24 |
||
5873 | 2140: 08 f0 brcs .+2 ; 0x2144 <osd_ncmode_default+0x32c> |
||
5874 | 2142: ea c1 rjmp .+980 ; 0x2518 <osd_ncmode_default+0x700> |
||
5875 | for (uint8_t x = 2; x < 8; x++) |
||
5876 | write_char_att_xy(x, bottom_line, BLINK); |
||
5877 | 2144: 82 e0 ldi r24, 0x02 ; 2 |
||
5878 | 2146: 60 91 03 01 lds r22, 0x0103 |
||
5879 | 214a: 4f e4 ldi r20, 0x4F ; 79 |
||
5880 | 214c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
5881 | 2150: 83 e0 ldi r24, 0x03 ; 3 |
||
5882 | 2152: 60 91 03 01 lds r22, 0x0103 |
||
5883 | 2156: 4f e4 ldi r20, 0x4F ; 79 |
||
5884 | 2158: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
5885 | 215c: 84 e0 ldi r24, 0x04 ; 4 |
||
5886 | 215e: 60 91 03 01 lds r22, 0x0103 |
||
5887 | 2162: 4f e4 ldi r20, 0x4F ; 79 |
||
5888 | 2164: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
5889 | 2168: 85 e0 ldi r24, 0x05 ; 5 |
||
5890 | 216a: 60 91 03 01 lds r22, 0x0103 |
||
5891 | 216e: 4f e4 ldi r20, 0x4F ; 79 |
||
5892 | 2170: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
5893 | 2174: 86 e0 ldi r24, 0x06 ; 6 |
||
5894 | 2176: 60 91 03 01 lds r22, 0x0103 |
||
5895 | 217a: 4f e4 ldi r20, 0x4F ; 79 |
||
5896 | 217c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
5897 | 2180: 87 e0 ldi r24, 0x07 ; 7 |
||
5898 | 2182: 60 91 03 01 lds r22, 0x0103 |
||
5899 | 2186: 4f e4 ldi r20, 0x4F ; 79 |
||
5900 | 2188: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
5901 | } else if (naviData.UBat > min_voltage && last_UBat < min_voltage) { |
||
5902 | for (uint8_t x = 2; x < 8; x++) |
||
5903 | write_char_att_xy(x, bottom_line, 0); |
||
5904 | } |
||
5905 | |||
5906 | write_time(8, bottom_line, uptime); |
||
5907 | 218c: 40 91 12 01 lds r20, 0x0112 |
||
5908 | 2190: 50 91 13 01 lds r21, 0x0113 |
||
5909 | 2194: 88 e0 ldi r24, 0x08 ; 8 |
||
5910 | 2196: 60 91 03 01 lds r22, 0x0103 |
||
5911 | 219a: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
5912 | write_time(15, bottom_line, naviData.FlyingTime); |
||
5913 | 219e: 40 91 d1 01 lds r20, 0x01D1 |
||
5914 | 21a2: 50 91 d2 01 lds r21, 0x01D2 |
||
5915 | 21a6: 8f e0 ldi r24, 0x0F ; 15 |
||
5916 | 21a8: 60 91 03 01 lds r22, 0x0103 |
||
5917 | 21ac: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
5918 | |||
5919 | write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 2, 0); |
||
5920 | 21b0: 40 91 cc 01 lds r20, 0x01CC |
||
5921 | 21b4: 88 e1 ldi r24, 0x18 ; 24 |
||
5922 | 21b6: 60 91 03 01 lds r22, 0x0103 |
||
5923 | 21ba: 50 e0 ldi r21, 0x00 ; 0 |
||
5924 | 21bc: 22 e0 ldi r18, 0x02 ; 2 |
||
5925 | 21be: 30 e0 ldi r19, 0x00 ; 0 |
||
5926 | 21c0: 00 e0 ldi r16, 0x00 ; 0 |
||
5927 | 21c2: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
5928 | |||
5929 | if (naviData.NCFlags & NC_FLAG_MANUAL_CONTROL) { |
||
5930 | 21c6: 80 91 de 01 lds r24, 0x01DE |
||
5931 | 21ca: 86 ff sbrs r24, 6 |
||
5932 | 21cc: 04 c2 rjmp .+1032 ; 0x25d6 <osd_ncmode_default+0x7be> |
||
5933 | write_char_xy(23, bottom_line, 0xB3); // rc transmitter |
||
5934 | 21ce: 87 e1 ldi r24, 0x17 ; 23 |
||
5935 | 21d0: 60 91 03 01 lds r22, 0x0103 |
||
5936 | 21d4: 43 eb ldi r20, 0xB3 ; 179 |
||
5937 | 21d6: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
5938 | } else { |
||
5939 | write_char_xy(23, bottom_line, 0); // clear |
||
5940 | } |
||
5941 | |||
5942 | if (naviData.NCFlags & NC_FLAG_CH) { |
||
5943 | 21da: 80 91 de 01 lds r24, 0x01DE |
||
5944 | 21de: 82 fd sbrc r24, 2 |
||
5945 | 21e0: 04 c2 rjmp .+1032 ; 0x25ea <osd_ncmode_default+0x7d2> |
||
5946 | write_char_xy(27, bottom_line, 231); // gps ch |
||
5947 | } else if (naviData.NCFlags & NC_FLAG_PH) { |
||
5948 | 21e2: 80 91 de 01 lds r24, 0x01DE |
||
5949 | 21e6: 81 ff sbrs r24, 1 |
||
5950 | 21e8: 07 c2 rjmp .+1038 ; 0x25f8 <osd_ncmode_default+0x7e0> |
||
5951 | write_char_xy(27, bottom_line, 230); // gps ph |
||
5952 | 21ea: 8b e1 ldi r24, 0x1B ; 27 |
||
5953 | 21ec: 60 91 03 01 lds r22, 0x0103 |
||
5954 | 21f0: 46 ee ldi r20, 0xE6 ; 230 |
||
5955 | 21f2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
5956 | |||
5957 | //write_number_s(8, 5, RxDataLen); |
||
5958 | //write_number_s(16, 5, setsReceived++); |
||
5959 | |||
5960 | // remember statistics (only when engines running) |
||
5961 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { |
||
5962 | 21f6: 80 91 dd 01 lds r24, 0x01DD |
||
5963 | 21fa: 80 ff sbrs r24, 0 |
||
5964 | 21fc: 86 c0 rjmp .+268 ; 0x230a <osd_ncmode_default+0x4f2> |
||
5965 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
||
5966 | 21fe: 80 91 1c 01 lds r24, 0x011C |
||
5967 | 2202: 81 ff sbrs r24, 1 |
||
5968 | 2204: 99 c0 rjmp .+306 ; 0x2338 <osd_ncmode_default+0x520> |
||
5969 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
||
5970 | 2206: 60 91 a3 01 lds r22, 0x01A3 |
||
5971 | 220a: 70 91 a4 01 lds r23, 0x01A4 |
||
5972 | 220e: 80 91 a5 01 lds r24, 0x01A5 |
||
5973 | 2212: 90 91 a6 01 lds r25, 0x01A6 |
||
5974 | 2216: 28 ee ldi r18, 0xE8 ; 232 |
||
5975 | 2218: 33 e0 ldi r19, 0x03 ; 3 |
||
5976 | 221a: 40 e0 ldi r20, 0x00 ; 0 |
||
5977 | 221c: 50 e0 ldi r21, 0x00 ; 0 |
||
5978 | 221e: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
5979 | 2222: 80 91 98 01 lds r24, 0x0198 |
||
5980 | 2226: 90 91 99 01 lds r25, 0x0199 |
||
5981 | 222a: aa 27 eor r26, r26 |
||
5982 | 222c: 97 fd sbrc r25, 7 |
||
5983 | 222e: a0 95 com r26 |
||
5984 | 2230: ba 2f mov r27, r26 |
||
5985 | 2232: 28 1b sub r18, r24 |
||
5986 | 2234: 39 0b sbc r19, r25 |
||
5987 | 2236: 4a 0b sbc r20, r26 |
||
5988 | 2238: 5b 0b sbc r21, r27 |
||
5989 | 223a: 80 91 1f 01 lds r24, 0x011F |
||
5990 | 223e: 90 91 20 01 lds r25, 0x0120 |
||
5991 | 2242: aa 27 eor r26, r26 |
||
5992 | 2244: 97 fd sbrc r25, 7 |
||
5993 | 2246: a0 95 com r26 |
||
5994 | 2248: ba 2f mov r27, r26 |
||
5995 | 224a: 82 17 cp r24, r18 |
||
5996 | 224c: 93 07 cpc r25, r19 |
||
5997 | 224e: a4 07 cpc r26, r20 |
||
5998 | 2250: b5 07 cpc r27, r21 |
||
5999 | 2252: 0c f4 brge .+2 ; 0x2256 <osd_ncmode_default+0x43e> |
||
6000 | 2254: 4e c1 rjmp .+668 ; 0x24f2 <osd_ncmode_default+0x6da> |
||
6001 | } else { |
||
6002 | if (naviData.Altimeter / 30 > max_Altimeter) max_Altimeter = naviData.Altimeter / 30; |
||
6003 | } |
||
6004 | if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
||
6005 | 2256: 20 91 d4 01 lds r18, 0x01D4 |
||
6006 | 225a: 30 91 d5 01 lds r19, 0x01D5 |
||
6007 | 225e: 80 91 21 01 lds r24, 0x0121 |
||
6008 | 2262: 90 91 22 01 lds r25, 0x0122 |
||
6009 | 2266: 82 17 cp r24, r18 |
||
6010 | 2268: 93 07 cpc r25, r19 |
||
6011 | 226a: 40 f4 brcc .+16 ; 0x227c <osd_ncmode_default+0x464> |
||
6012 | 226c: 80 91 d4 01 lds r24, 0x01D4 |
||
6013 | 2270: 90 91 d5 01 lds r25, 0x01D5 |
||
6014 | 2274: 90 93 22 01 sts 0x0122, r25 |
||
6015 | 2278: 80 93 21 01 sts 0x0121, r24 |
||
6016 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
||
6017 | 227c: 20 91 c6 01 lds r18, 0x01C6 |
||
6018 | 2280: 30 91 c7 01 lds r19, 0x01C7 |
||
6019 | 2284: 80 91 23 01 lds r24, 0x0123 |
||
6020 | 2288: 90 91 24 01 lds r25, 0x0124 |
||
6021 | 228c: 82 17 cp r24, r18 |
||
6022 | 228e: 93 07 cpc r25, r19 |
||
6023 | 2290: 40 f4 brcc .+16 ; 0x22a2 <osd_ncmode_default+0x48a> |
||
6024 | max_Distance = naviData.HomePositionDeviation.Distance; |
||
6025 | 2292: 80 91 c6 01 lds r24, 0x01C6 |
||
6026 | 2296: 90 91 c7 01 lds r25, 0x01C7 |
||
6027 | 229a: 90 93 24 01 sts 0x0124, r25 |
||
6028 | 229e: 80 93 23 01 sts 0x0123, r24 |
||
6029 | } |
||
6030 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
||
6031 | 22a2: 90 91 d3 01 lds r25, 0x01D3 |
||
6032 | 22a6: 80 91 04 01 lds r24, 0x0104 |
||
6033 | 22aa: 98 17 cp r25, r24 |
||
6034 | 22ac: 20 f4 brcc .+8 ; 0x22b6 <osd_ncmode_default+0x49e> |
||
6035 | 22ae: 80 91 d3 01 lds r24, 0x01D3 |
||
6036 | 22b2: 80 93 04 01 sts 0x0104, r24 |
||
6037 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
||
6038 | 22b6: 20 91 d1 01 lds r18, 0x01D1 |
||
6039 | 22ba: 30 91 d2 01 lds r19, 0x01D2 |
||
6040 | 22be: 80 91 25 01 lds r24, 0x0125 |
||
6041 | 22c2: 90 91 26 01 lds r25, 0x0126 |
||
6042 | 22c6: 82 17 cp r24, r18 |
||
6043 | 22c8: 93 07 cpc r25, r19 |
||
6044 | 22ca: 40 f4 brcc .+16 ; 0x22dc <osd_ncmode_default+0x4c4> |
||
6045 | 22cc: 80 91 d1 01 lds r24, 0x01D1 |
||
6046 | 22d0: 90 91 d2 01 lds r25, 0x01D2 |
||
6047 | 22d4: 90 93 26 01 sts 0x0126, r25 |
||
6048 | 22d8: 80 93 25 01 sts 0x0125, r24 |
||
6049 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6050 | 22dc: 80 91 1d 01 lds r24, 0x011D |
||
6051 | 22e0: 80 ff sbrs r24, 0 |
||
6052 | 22e2: 61 c0 rjmp .+194 ; 0x23a6 <osd_ncmode_default+0x58e> |
||
6053 | 22e4: 80 91 1b 01 lds r24, 0x011B |
||
6054 | 22e8: 86 fd sbrc r24, 6 |
||
6055 | 22ea: 61 c0 rjmp .+194 ; 0x23ae <osd_ncmode_default+0x596> |
||
6056 | if (ampere > max_ampere) max_ampere = ampere; |
||
6057 | 22ec: 20 91 37 01 lds r18, 0x0137 |
||
6058 | 22f0: 30 91 38 01 lds r19, 0x0138 |
||
6059 | 22f4: 80 91 39 01 lds r24, 0x0139 |
||
6060 | 22f8: 90 91 3a 01 lds r25, 0x013A |
||
6061 | 22fc: 82 17 cp r24, r18 |
||
6062 | 22fe: 93 07 cpc r25, r19 |
||
6063 | 2300: 24 f4 brge .+8 ; 0x230a <osd_ncmode_default+0x4f2> |
||
6064 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6065 | if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10; |
||
6066 | 2302: 30 93 3a 01 sts 0x013A, r19 |
||
6067 | 2306: 20 93 39 01 sts 0x0139, r18 |
||
6068 | } |
||
6069 | } |
||
6070 | |||
6071 | // remember last values |
||
6072 | last_RC_Quality = naviData.RC_Quality; |
||
6073 | 230a: 80 91 dc 01 lds r24, 0x01DC |
||
6074 | 230e: 80 93 01 01 sts 0x0101, r24 |
||
6075 | last_UBat = naviData.UBat; |
||
6076 | 2312: 80 91 d3 01 lds r24, 0x01D3 |
||
6077 | 2316: 80 93 00 01 sts 0x0100, r24 |
||
6078 | old_MKFlags = naviData.FCFlags; |
||
6079 | 231a: 80 91 dd 01 lds r24, 0x01DD |
||
6080 | 231e: 80 93 27 01 sts 0x0127, r24 |
||
6081 | seconds_since_last_data = 0; |
||
6082 | 2322: 10 92 18 01 sts 0x0118, r1 |
||
6083 | |||
6084 | return 0; |
||
6085 | } |
||
6086 | 2326: 80 e0 ldi r24, 0x00 ; 0 |
||
6087 | 2328: 90 e0 ldi r25, 0x00 ; 0 |
||
6088 | 232a: df 91 pop r29 |
||
6089 | 232c: cf 91 pop r28 |
||
6090 | 232e: 1f 91 pop r17 |
||
6091 | 2330: 0f 91 pop r16 |
||
6092 | 2332: ff 90 pop r15 |
||
6093 | 2334: ef 90 pop r14 |
||
6094 | 2336: 08 95 ret |
||
6095 | // remember statistics (only when engines running) |
||
6096 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { |
||
6097 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
||
6098 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
||
6099 | } else { |
||
6100 | if (naviData.Altimeter / 30 > max_Altimeter) max_Altimeter = naviData.Altimeter / 30; |
||
6101 | 2338: 80 91 cd 01 lds r24, 0x01CD |
||
6102 | 233c: 90 91 ce 01 lds r25, 0x01CE |
||
6103 | 2340: 6e e1 ldi r22, 0x1E ; 30 |
||
6104 | 2342: 70 e0 ldi r23, 0x00 ; 0 |
||
6105 | 2344: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
6106 | 2348: 80 91 1f 01 lds r24, 0x011F |
||
6107 | 234c: 90 91 20 01 lds r25, 0x0120 |
||
6108 | 2350: 86 17 cp r24, r22 |
||
6109 | 2352: 97 07 cpc r25, r23 |
||
6110 | 2354: 0c f0 brlt .+2 ; 0x2358 <osd_ncmode_default+0x540> |
||
6111 | 2356: 7f cf rjmp .-258 ; 0x2256 <osd_ncmode_default+0x43e> |
||
6112 | 2358: 80 91 cd 01 lds r24, 0x01CD |
||
6113 | 235c: 90 91 ce 01 lds r25, 0x01CE |
||
6114 | 2360: 6e e1 ldi r22, 0x1E ; 30 |
||
6115 | 2362: 70 e0 ldi r23, 0x00 ; 0 |
||
6116 | 2364: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
6117 | 2368: 70 93 20 01 sts 0x0120, r23 |
||
6118 | 236c: 60 93 1f 01 sts 0x011F, r22 |
||
6119 | 2370: 72 cf rjmp .-284 ; 0x2256 <osd_ncmode_default+0x43e> |
||
6120 | |||
6121 | // first line |
||
6122 | write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
||
6123 | |||
6124 | write_ndigit_number_u(7, top_line, naviData.RC_Quality, 3, 0); |
||
6125 | if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
6126 | 2372: 80 91 01 01 lds r24, 0x0101 |
||
6127 | 2376: 85 36 cpi r24, 0x65 ; 101 |
||
6128 | 2378: 08 f4 brcc .+2 ; 0x237c <osd_ncmode_default+0x564> |
||
6129 | 237a: 92 cd rjmp .-1244 ; 0x1ea0 <osd_ncmode_default+0x88> |
||
6130 | 237c: 17 e0 ldi r17, 0x07 ; 7 |
||
6131 | for (uint8_t x = 0; x < 4; x++) |
||
6132 | write_char_att_xy(7 + x, top_line, BLINK); |
||
6133 | 237e: 81 2f mov r24, r17 |
||
6134 | 2380: 60 91 02 01 lds r22, 0x0102 |
||
6135 | 2384: 4f e4 ldi r20, 0x4F ; 79 |
||
6136 | 2386: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6137 | 238a: 1f 5f subi r17, 0xFF ; 255 |
||
6138 | // first line |
||
6139 | write_ndigit_number_u(2, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
||
6140 | |||
6141 | write_ndigit_number_u(7, top_line, naviData.RC_Quality, 3, 0); |
||
6142 | if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
6143 | for (uint8_t x = 0; x < 4; x++) |
||
6144 | 238c: 1b 30 cpi r17, 0x0B ; 11 |
||
6145 | 238e: b9 f7 brne .-18 ; 0x237e <osd_ncmode_default+0x566> |
||
6146 | for (uint8_t x = 0; x < 4; x++) |
||
6147 | write_char_att_xy(7 + x, top_line, 0); |
||
6148 | } |
||
6149 | |||
6150 | |||
6151 | if (naviData.NCFlags & NC_FLAG_NOSERIALLINK) { |
||
6152 | 2390: 80 91 de 01 lds r24, 0x01DE |
||
6153 | 2394: 84 fd sbrc r24, 4 |
||
6154 | 2396: 8d cd rjmp .-1254 ; 0x1eb2 <osd_ncmode_default+0x9a> |
||
6155 | write_char_xy(11, top_line, 0); // clear |
||
6156 | } else { |
||
6157 | write_char_xy(11, top_line, 0xC6); // PC icon |
||
6158 | 2398: 8b e0 ldi r24, 0x0B ; 11 |
||
6159 | 239a: 60 91 02 01 lds r22, 0x0102 |
||
6160 | 239e: 46 ec ldi r20, 0xC6 ; 198 |
||
6161 | 23a0: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6162 | 23a4: 8c cd rjmp .-1256 ; 0x1ebe <osd_ncmode_default+0xa6> |
||
6163 | } |
||
6164 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
||
6165 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
||
6166 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6167 | if (ampere > max_ampere) max_ampere = ampere; |
||
6168 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6169 | 23a6: 80 91 1b 01 lds r24, 0x011B |
||
6170 | 23aa: 86 ff sbrs r24, 6 |
||
6171 | 23ac: ae cf rjmp .-164 ; 0x230a <osd_ncmode_default+0x4f2> |
||
6172 | if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10; |
||
6173 | 23ae: 80 91 e8 01 lds r24, 0x01E8 |
||
6174 | 23b2: 90 91 e9 01 lds r25, 0x01E9 |
||
6175 | 23b6: 9c 01 movw r18, r24 |
||
6176 | 23b8: 22 0f add r18, r18 |
||
6177 | 23ba: 33 1f adc r19, r19 |
||
6178 | 23bc: 22 0f add r18, r18 |
||
6179 | 23be: 33 1f adc r19, r19 |
||
6180 | 23c0: 22 0f add r18, r18 |
||
6181 | 23c2: 33 1f adc r19, r19 |
||
6182 | 23c4: 88 0f add r24, r24 |
||
6183 | 23c6: 99 1f adc r25, r25 |
||
6184 | 23c8: 28 0f add r18, r24 |
||
6185 | 23ca: 39 1f adc r19, r25 |
||
6186 | 23cc: 80 91 39 01 lds r24, 0x0139 |
||
6187 | 23d0: 90 91 3a 01 lds r25, 0x013A |
||
6188 | 23d4: 82 17 cp r24, r18 |
||
6189 | 23d6: 93 07 cpc r25, r19 |
||
6190 | 23d8: 08 f0 brcs .+2 ; 0x23dc <osd_ncmode_default+0x5c4> |
||
6191 | 23da: 97 cf rjmp .-210 ; 0x230a <osd_ncmode_default+0x4f2> |
||
6192 | 23dc: 80 91 e8 01 lds r24, 0x01E8 |
||
6193 | 23e0: 90 91 e9 01 lds r25, 0x01E9 |
||
6194 | 23e4: 9c 01 movw r18, r24 |
||
6195 | 23e6: 22 0f add r18, r18 |
||
6196 | 23e8: 33 1f adc r19, r19 |
||
6197 | 23ea: 22 0f add r18, r18 |
||
6198 | 23ec: 33 1f adc r19, r19 |
||
6199 | 23ee: 22 0f add r18, r18 |
||
6200 | 23f0: 33 1f adc r19, r19 |
||
6201 | 23f2: 88 0f add r24, r24 |
||
6202 | 23f4: 99 1f adc r25, r25 |
||
6203 | 23f6: 28 0f add r18, r24 |
||
6204 | 23f8: 39 1f adc r19, r25 |
||
6205 | 23fa: 83 cf rjmp .-250 ; 0x2302 <osd_ncmode_default+0x4ea> |
||
6206 | |||
6207 | write_ndigit_number_u(7, top_line, naviData.RC_Quality, 3, 0); |
||
6208 | if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
6209 | for (uint8_t x = 0; x < 4; x++) |
||
6210 | write_char_att_xy(7 + x, top_line, BLINK); |
||
6211 | } else if (naviData.RC_Quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
6212 | 23fc: 80 91 01 01 lds r24, 0x0101 |
||
6213 | 2400: 85 36 cpi r24, 0x65 ; 101 |
||
6214 | 2402: 08 f0 brcs .+2 ; 0x2406 <osd_ncmode_default+0x5ee> |
||
6215 | 2404: 52 cd rjmp .-1372 ; 0x1eaa <osd_ncmode_default+0x92> |
||
6216 | 2406: 17 e0 ldi r17, 0x07 ; 7 |
||
6217 | for (uint8_t x = 0; x < 4; x++) |
||
6218 | write_char_att_xy(7 + x, top_line, 0); |
||
6219 | 2408: 81 2f mov r24, r17 |
||
6220 | 240a: 60 91 02 01 lds r22, 0x0102 |
||
6221 | 240e: 40 e0 ldi r20, 0x00 ; 0 |
||
6222 | 2410: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6223 | 2414: 1f 5f subi r17, 0xFF ; 255 |
||
6224 | write_ndigit_number_u(7, top_line, naviData.RC_Quality, 3, 0); |
||
6225 | if (naviData.RC_Quality <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
6226 | for (uint8_t x = 0; x < 4; x++) |
||
6227 | write_char_att_xy(7 + x, top_line, BLINK); |
||
6228 | } else if (naviData.RC_Quality > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
6229 | for (uint8_t x = 0; x < 4; x++) |
||
6230 | 2416: 1b 30 cpi r17, 0x0B ; 11 |
||
6231 | 2418: b9 f7 brne .-18 ; 0x2408 <osd_ncmode_default+0x5f0> |
||
6232 | 241a: 47 cd rjmp .-1394 ; 0x1eaa <osd_ncmode_default+0x92> |
||
6233 | |||
6234 | int osd_ncmode_default() { |
||
6235 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
6236 | // write icons at init or after menu/mode-switch |
||
6237 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
6238 | write_char_xy(5, top_line, 0xCB); // km/h |
||
6239 | 241c: 85 e0 ldi r24, 0x05 ; 5 |
||
6240 | 241e: 60 91 02 01 lds r22, 0x0102 |
||
6241 | 2422: 4b ec ldi r20, 0xCB ; 203 |
||
6242 | 2424: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6243 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
||
6244 | 2428: 8a e0 ldi r24, 0x0A ; 10 |
||
6245 | 242a: 60 91 02 01 lds r22, 0x0102 |
||
6246 | 242e: 4a ec ldi r20, 0xCA ; 202 |
||
6247 | 2430: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6248 | write_char_xy(16, top_line, 0xD0); // degree symbol |
||
6249 | 2434: 80 e1 ldi r24, 0x10 ; 16 |
||
6250 | 2436: 60 91 02 01 lds r22, 0x0102 |
||
6251 | 243a: 40 ed ldi r20, 0xD0 ; 208 |
||
6252 | 243c: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6253 | write_char_xy(27, top_line, 0xCC); // small meters m height |
||
6254 | 2440: 8b e1 ldi r24, 0x1B ; 27 |
||
6255 | 2442: 60 91 02 01 lds r22, 0x0102 |
||
6256 | 2446: 4c ec ldi r20, 0xCC ; 204 |
||
6257 | 2448: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6258 | write_char_xy(20, top_line + 1, 0xB0); // left circle |
||
6259 | 244c: 60 91 02 01 lds r22, 0x0102 |
||
6260 | 2450: 6f 5f subi r22, 0xFF ; 255 |
||
6261 | 2452: 84 e1 ldi r24, 0x14 ; 20 |
||
6262 | 2454: 40 eb ldi r20, 0xB0 ; 176 |
||
6263 | 2456: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6264 | write_char_xy(22, top_line + 1, 0xB2); // right circle |
||
6265 | 245a: 60 91 02 01 lds r22, 0x0102 |
||
6266 | 245e: 6f 5f subi r22, 0xFF ; 255 |
||
6267 | 2460: 86 e1 ldi r24, 0x16 ; 22 |
||
6268 | 2462: 42 eb ldi r20, 0xB2 ; 178 |
||
6269 | 2464: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6270 | write_char_xy(27, top_line + 1, 0xCC); // small meters m home |
||
6271 | 2468: 60 91 02 01 lds r22, 0x0102 |
||
6272 | 246c: 6f 5f subi r22, 0xFF ; 255 |
||
6273 | 246e: 8b e1 ldi r24, 0x1B ; 27 |
||
6274 | 2470: 4c ec ldi r20, 0xCC ; 204 |
||
6275 | 2472: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6276 | write_char_xy(7, bottom_line, 0x9E); // small V |
||
6277 | 2476: 87 e0 ldi r24, 0x07 ; 7 |
||
6278 | 2478: 60 91 03 01 lds r22, 0x0103 |
||
6279 | 247c: 4e e9 ldi r20, 0x9E ; 158 |
||
6280 | 247e: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6281 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6282 | 2482: 80 91 1d 01 lds r24, 0x011D |
||
6283 | 2486: 80 fd sbrc r24, 0 |
||
6284 | 2488: 04 c0 rjmp .+8 ; 0x2492 <osd_ncmode_default+0x67a> |
||
6285 | 248a: 80 91 1b 01 lds r24, 0x011B |
||
6286 | 248e: 86 ff sbrs r24, 6 |
||
6287 | 2490: 12 c0 rjmp .+36 ; 0x24b6 <osd_ncmode_default+0x69e> |
||
6288 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
||
6289 | 2492: 60 91 03 01 lds r22, 0x0103 |
||
6290 | 2496: 61 50 subi r22, 0x01 ; 1 |
||
6291 | 2498: 87 e0 ldi r24, 0x07 ; 7 |
||
6292 | 249a: 4f e9 ldi r20, 0x9F ; 159 |
||
6293 | 249c: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6294 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
||
6295 | 24a0: 60 91 03 01 lds r22, 0x0103 |
||
6296 | 24a4: 61 50 subi r22, 0x01 ; 1 |
||
6297 | 24a6: 8e e0 ldi r24, 0x0E ; 14 |
||
6298 | 24a8: 45 eb ldi r20, 0xB5 ; 181 |
||
6299 | 24aa: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6300 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
6301 | 24ae: 80 91 1b 01 lds r24, 0x011B |
||
6302 | 24b2: 85 fd sbrc r24, 5 |
||
6303 | 24b4: 33 c2 rjmp .+1126 ; 0x291c <osd_ncmode_default+0xb04> |
||
6304 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
||
6305 | } |
||
6306 | } |
||
6307 | write_char_xy(14, bottom_line, 0xD1); // on clock |
||
6308 | 24b6: 8e e0 ldi r24, 0x0E ; 14 |
||
6309 | 24b8: 60 91 03 01 lds r22, 0x0103 |
||
6310 | 24bc: 41 ed ldi r20, 0xD1 ; 209 |
||
6311 | 24be: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6312 | write_char_xy(21, bottom_line, 0xD2); // fly clock |
||
6313 | 24c2: 85 e1 ldi r24, 0x15 ; 21 |
||
6314 | 24c4: 60 91 03 01 lds r22, 0x0103 |
||
6315 | 24c8: 42 ed ldi r20, 0xD2 ; 210 |
||
6316 | 24ca: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6317 | write_char_xy(26, bottom_line, 0xC8); // sat1 |
||
6318 | 24ce: 8a e1 ldi r24, 0x1A ; 26 |
||
6319 | 24d0: 60 91 03 01 lds r22, 0x0103 |
||
6320 | 24d4: 48 ec ldi r20, 0xC8 ; 200 |
||
6321 | 24d6: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6322 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
||
6323 | 24da: 8b e1 ldi r24, 0x1B ; 27 |
||
6324 | 24dc: 60 91 03 01 lds r22, 0x0103 |
||
6325 | 24e0: 49 ec ldi r20, 0xC9 ; 201 |
||
6326 | 24e2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6327 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
6328 | 24e6: 80 91 1d 01 lds r24, 0x011D |
||
6329 | 24ea: 82 60 ori r24, 0x02 ; 2 |
||
6330 | 24ec: 80 93 1d 01 sts 0x011D, r24 |
||
6331 | 24f0: a1 cc rjmp .-1726 ; 0x1e34 <osd_ncmode_default+0x1c> |
||
6332 | //write_number_s(16, 5, setsReceived++); |
||
6333 | |||
6334 | // remember statistics (only when engines running) |
||
6335 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { |
||
6336 | if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
||
6337 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
||
6338 | 24f2: 60 91 a3 01 lds r22, 0x01A3 |
||
6339 | 24f6: 70 91 a4 01 lds r23, 0x01A4 |
||
6340 | 24fa: 80 91 a5 01 lds r24, 0x01A5 |
||
6341 | 24fe: 90 91 a6 01 lds r25, 0x01A6 |
||
6342 | 2502: 28 ee ldi r18, 0xE8 ; 232 |
||
6343 | 2504: 33 e0 ldi r19, 0x03 ; 3 |
||
6344 | 2506: 40 e0 ldi r20, 0x00 ; 0 |
||
6345 | 2508: 50 e0 ldi r21, 0x00 ; 0 |
||
6346 | 250a: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
6347 | 250e: 30 93 20 01 sts 0x0120, r19 |
||
6348 | 2512: 20 93 1f 01 sts 0x011F, r18 |
||
6349 | 2516: 9f ce rjmp .-706 ; 0x2256 <osd_ncmode_default+0x43e> |
||
6350 | draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
||
6351 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 3, 0); |
||
6352 | if (naviData.UBat <= min_voltage && last_UBat > min_voltage) { |
||
6353 | for (uint8_t x = 2; x < 8; x++) |
||
6354 | write_char_att_xy(x, bottom_line, BLINK); |
||
6355 | } else if (naviData.UBat > min_voltage && last_UBat < min_voltage) { |
||
6356 | 2518: 80 91 d3 01 lds r24, 0x01D3 |
||
6357 | 251c: 98 17 cp r25, r24 |
||
6358 | 251e: 08 f0 brcs .+2 ; 0x2522 <osd_ncmode_default+0x70a> |
||
6359 | 2520: 35 ce rjmp .-918 ; 0x218c <osd_ncmode_default+0x374> |
||
6360 | 2522: 80 91 00 01 lds r24, 0x0100 |
||
6361 | 2526: 89 17 cp r24, r25 |
||
6362 | 2528: 08 f0 brcs .+2 ; 0x252c <osd_ncmode_default+0x714> |
||
6363 | 252a: 30 ce rjmp .-928 ; 0x218c <osd_ncmode_default+0x374> |
||
6364 | for (uint8_t x = 2; x < 8; x++) |
||
6365 | write_char_att_xy(x, bottom_line, 0); |
||
6366 | 252c: 82 e0 ldi r24, 0x02 ; 2 |
||
6367 | 252e: 60 91 03 01 lds r22, 0x0103 |
||
6368 | 2532: 40 e0 ldi r20, 0x00 ; 0 |
||
6369 | 2534: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6370 | 2538: 83 e0 ldi r24, 0x03 ; 3 |
||
6371 | 253a: 60 91 03 01 lds r22, 0x0103 |
||
6372 | 253e: 40 e0 ldi r20, 0x00 ; 0 |
||
6373 | 2540: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6374 | 2544: 84 e0 ldi r24, 0x04 ; 4 |
||
6375 | 2546: 60 91 03 01 lds r22, 0x0103 |
||
6376 | 254a: 40 e0 ldi r20, 0x00 ; 0 |
||
6377 | 254c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6378 | 2550: 85 e0 ldi r24, 0x05 ; 5 |
||
6379 | 2552: 60 91 03 01 lds r22, 0x0103 |
||
6380 | 2556: 40 e0 ldi r20, 0x00 ; 0 |
||
6381 | 2558: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6382 | 255c: 86 e0 ldi r24, 0x06 ; 6 |
||
6383 | 255e: 60 91 03 01 lds r22, 0x0103 |
||
6384 | 2562: 40 e0 ldi r20, 0x00 ; 0 |
||
6385 | 2564: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6386 | 2568: 87 e0 ldi r24, 0x07 ; 7 |
||
6387 | 256a: 60 91 03 01 lds r22, 0x0103 |
||
6388 | 256e: 40 e0 ldi r20, 0x00 ; 0 |
||
6389 | 2570: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
6390 | 2574: 0b ce rjmp .-1002 ; 0x218c <osd_ncmode_default+0x374> |
||
6391 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
||
6392 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
6393 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
6394 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
6395 | } |
||
6396 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6397 | 2576: 16 ff sbrs r17, 6 |
||
6398 | 2578: c3 cd rjmp .-1146 ; 0x2100 <osd_ncmode_default+0x2e8> |
||
6399 | 257a: a9 cd rjmp .-1198 ; 0x20ce <osd_ncmode_default+0x2b6> |
||
6400 | } |
||
6401 | // motors are on, assume we were/are flying |
||
6402 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
||
6403 | } else { |
||
6404 | // stats |
||
6405 | if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) { |
||
6406 | 257c: 80 91 1d 01 lds r24, 0x011D |
||
6407 | 2580: 82 fd sbrc r24, 2 |
||
6408 | 2582: 41 c0 rjmp .+130 ; 0x2606 <osd_ncmode_default+0x7ee> |
||
6409 | 2584: 10 91 1b 01 lds r17, 0x011B |
||
6410 | write_char_xy(20, line, 210); // fly clock |
||
6411 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[5])))); // longitude |
||
6412 | write_gps_pos(14, line, naviData.CurrentPosition.Longitude); |
||
6413 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
||
6414 | write_gps_pos(14, line, naviData.CurrentPosition.Latitude); |
||
6415 | } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
||
6416 | 2588: 11 ff sbrs r17, 1 |
||
6417 | 258a: 99 cd rjmp .-1230 ; 0x20be <osd_ncmode_default+0x2a6> |
||
6418 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6419 | 258c: 80 fd sbrc r24, 0 |
||
6420 | 258e: 02 c0 rjmp .+4 ; 0x2594 <osd_ncmode_default+0x77c> |
||
6421 | 2590: 16 ff sbrs r17, 6 |
||
6422 | 2592: 0c c2 rjmp .+1048 ; 0x29ac <osd_ncmode_default+0xb94> |
||
6423 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
6424 | 2594: 40 91 da 01 lds r20, 0x01DA |
||
6425 | 2598: 20 91 db 01 lds r18, 0x01DB |
||
6426 | 259c: 80 91 02 01 lds r24, 0x0102 |
||
6427 | 25a0: 60 91 03 01 lds r22, 0x0103 |
||
6428 | 25a4: 62 50 subi r22, 0x02 ; 2 |
||
6429 | } else { |
||
6430 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
6431 | 25a6: 55 27 eor r21, r21 |
||
6432 | 25a8: 47 fd sbrc r20, 7 |
||
6433 | 25aa: 50 95 com r21 |
||
6434 | 25ac: 33 27 eor r19, r19 |
||
6435 | 25ae: 27 fd sbrc r18, 7 |
||
6436 | 25b0: 30 95 com r19 |
||
6437 | 25b2: 8e 5f subi r24, 0xFE ; 254 |
||
6438 | 25b4: 0e 94 e6 08 call 0x11cc ; 0x11cc <draw_artificial_horizon> |
||
6439 | 25b8: 10 91 1b 01 lds r17, 0x011B |
||
6440 | } |
||
6441 | } |
||
6442 | } |
||
6443 | if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) { |
||
6444 | 25bc: 12 ff sbrs r17, 2 |
||
6445 | 25be: 81 cd rjmp .-1278 ; 0x20c2 <osd_ncmode_default+0x2aa> |
||
6446 | draw_big_variometer(27, 8, naviData.Variometer); |
||
6447 | 25c0: 40 91 cf 01 lds r20, 0x01CF |
||
6448 | 25c4: 50 91 d0 01 lds r21, 0x01D0 |
||
6449 | 25c8: 8b e1 ldi r24, 0x1B ; 27 |
||
6450 | 25ca: 68 e0 ldi r22, 0x08 ; 8 |
||
6451 | 25cc: 0e 94 84 0a call 0x1508 ; 0x1508 <draw_big_variometer> |
||
6452 | 25d0: 10 91 1b 01 lds r17, 0x011B |
||
6453 | 25d4: 76 cd rjmp .-1300 ; 0x20c2 <osd_ncmode_default+0x2aa> |
||
6454 | write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 2, 0); |
||
6455 | |||
6456 | if (naviData.NCFlags & NC_FLAG_MANUAL_CONTROL) { |
||
6457 | write_char_xy(23, bottom_line, 0xB3); // rc transmitter |
||
6458 | } else { |
||
6459 | write_char_xy(23, bottom_line, 0); // clear |
||
6460 | 25d6: 87 e1 ldi r24, 0x17 ; 23 |
||
6461 | 25d8: 60 91 03 01 lds r22, 0x0103 |
||
6462 | 25dc: 40 e0 ldi r20, 0x00 ; 0 |
||
6463 | 25de: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6464 | } |
||
6465 | |||
6466 | if (naviData.NCFlags & NC_FLAG_CH) { |
||
6467 | 25e2: 80 91 de 01 lds r24, 0x01DE |
||
6468 | 25e6: 82 ff sbrs r24, 2 |
||
6469 | 25e8: fc cd rjmp .-1032 ; 0x21e2 <osd_ncmode_default+0x3ca> |
||
6470 | write_char_xy(27, bottom_line, 231); // gps ch |
||
6471 | 25ea: 8b e1 ldi r24, 0x1B ; 27 |
||
6472 | 25ec: 60 91 03 01 lds r22, 0x0103 |
||
6473 | 25f0: 47 ee ldi r20, 0xE7 ; 231 |
||
6474 | 25f2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6475 | 25f6: ff cd rjmp .-1026 ; 0x21f6 <osd_ncmode_default+0x3de> |
||
6476 | } else if (naviData.NCFlags & NC_FLAG_PH) { |
||
6477 | write_char_xy(27, bottom_line, 230); // gps ph |
||
6478 | } else { // (naviData.NCFlags & NC_FLAG_FREE) |
||
6479 | write_char_xy(27, bottom_line, 201); // sat2 (free) |
||
6480 | 25f8: 8b e1 ldi r24, 0x1B ; 27 |
||
6481 | 25fa: 60 91 03 01 lds r22, 0x0103 |
||
6482 | 25fe: 49 ec ldi r20, 0xC9 ; 201 |
||
6483 | 2600: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6484 | 2604: f8 cd rjmp .-1040 ; 0x21f6 <osd_ncmode_default+0x3de> |
||
6485 | } |
||
6486 | // motors are on, assume we were/are flying |
||
6487 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
||
6488 | } else { |
||
6489 | // stats |
||
6490 | if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) { |
||
6491 | 2606: 10 91 1b 01 lds r17, 0x011B |
||
6492 | 260a: 13 ff sbrs r17, 3 |
||
6493 | 260c: bd cf rjmp .-134 ; 0x2588 <osd_ncmode_default+0x770> |
||
6494 | uint8_t line = 3; |
||
6495 | write_ascii_string_pgm(1, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude |
||
6496 | 260e: e0 ee ldi r30, 0xE0 ; 224 |
||
6497 | 2610: f0 e0 ldi r31, 0x00 ; 0 |
||
6498 | 2612: 45 91 lpm r20, Z+ |
||
6499 | 2614: 54 91 lpm r21, Z+ |
||
6500 | 2616: 81 e0 ldi r24, 0x01 ; 1 |
||
6501 | 2618: 63 e0 ldi r22, 0x03 ; 3 |
||
6502 | 261a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6503 | write_ndigit_number_s(16, line, max_Altimeter, 4, 0); |
||
6504 | 261e: 40 91 1f 01 lds r20, 0x011F |
||
6505 | 2622: 50 91 20 01 lds r21, 0x0120 |
||
6506 | 2626: 80 e1 ldi r24, 0x10 ; 16 |
||
6507 | 2628: 63 e0 ldi r22, 0x03 ; 3 |
||
6508 | 262a: 24 e0 ldi r18, 0x04 ; 4 |
||
6509 | 262c: 30 e0 ldi r19, 0x00 ; 0 |
||
6510 | 262e: 00 e0 ldi r16, 0x00 ; 0 |
||
6511 | 2630: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
6512 | write_char_xy(20, line, 204); // small meters m |
||
6513 | 2634: 84 e1 ldi r24, 0x14 ; 20 |
||
6514 | 2636: 63 e0 ldi r22, 0x03 ; 3 |
||
6515 | 2638: 4c ec ldi r20, 0xCC ; 204 |
||
6516 | 263a: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6517 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed |
||
6518 | 263e: e2 ee ldi r30, 0xE2 ; 226 |
||
6519 | 2640: f0 e0 ldi r31, 0x00 ; 0 |
||
6520 | 2642: 45 91 lpm r20, Z+ |
||
6521 | 2644: 54 91 lpm r21, Z+ |
||
6522 | 2646: 81 e0 ldi r24, 0x01 ; 1 |
||
6523 | 2648: 64 e0 ldi r22, 0x04 ; 4 |
||
6524 | 264a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6525 | write_ndigit_number_u(17, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
||
6526 | 264e: 20 91 21 01 lds r18, 0x0121 |
||
6527 | 2652: 30 91 22 01 lds r19, 0x0122 |
||
6528 | 2656: 40 e0 ldi r20, 0x00 ; 0 |
||
6529 | 2658: 50 e0 ldi r21, 0x00 ; 0 |
||
6530 | 265a: ca 01 movw r24, r20 |
||
6531 | 265c: b9 01 movw r22, r18 |
||
6532 | 265e: 66 0f add r22, r22 |
||
6533 | 2660: 77 1f adc r23, r23 |
||
6534 | 2662: 88 1f adc r24, r24 |
||
6535 | 2664: 99 1f adc r25, r25 |
||
6536 | 2666: 66 0f add r22, r22 |
||
6537 | 2668: 77 1f adc r23, r23 |
||
6538 | 266a: 88 1f adc r24, r24 |
||
6539 | 266c: 99 1f adc r25, r25 |
||
6540 | 266e: 66 0f add r22, r22 |
||
6541 | 2670: 77 1f adc r23, r23 |
||
6542 | 2672: 88 1f adc r24, r24 |
||
6543 | 2674: 99 1f adc r25, r25 |
||
6544 | 2676: 62 0f add r22, r18 |
||
6545 | 2678: 73 1f adc r23, r19 |
||
6546 | 267a: 84 1f adc r24, r20 |
||
6547 | 267c: 95 1f adc r25, r21 |
||
6548 | 267e: 2a ef ldi r18, 0xFA ; 250 |
||
6549 | 2680: 30 e0 ldi r19, 0x00 ; 0 |
||
6550 | 2682: 40 e0 ldi r20, 0x00 ; 0 |
||
6551 | 2684: 50 e0 ldi r21, 0x00 ; 0 |
||
6552 | 2686: 0e 94 8f 1c call 0x391e ; 0x391e <__udivmodsi4> |
||
6553 | 268a: 81 e1 ldi r24, 0x11 ; 17 |
||
6554 | 268c: 64 e0 ldi r22, 0x04 ; 4 |
||
6555 | 268e: a9 01 movw r20, r18 |
||
6556 | 2690: 23 e0 ldi r18, 0x03 ; 3 |
||
6557 | 2692: 30 e0 ldi r19, 0x00 ; 0 |
||
6558 | 2694: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
6559 | write_char_xy(20, line, 203); // km/h |
||
6560 | 2698: 84 e1 ldi r24, 0x14 ; 20 |
||
6561 | 269a: 64 e0 ldi r22, 0x04 ; 4 |
||
6562 | 269c: 4b ec ldi r20, 0xCB ; 203 |
||
6563 | 269e: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6564 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance |
||
6565 | 26a2: e4 ee ldi r30, 0xE4 ; 228 |
||
6566 | 26a4: f0 e0 ldi r31, 0x00 ; 0 |
||
6567 | 26a6: 45 91 lpm r20, Z+ |
||
6568 | 26a8: 54 91 lpm r21, Z+ |
||
6569 | 26aa: 81 e0 ldi r24, 0x01 ; 1 |
||
6570 | 26ac: 65 e0 ldi r22, 0x05 ; 5 |
||
6571 | 26ae: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6572 | write_ndigit_number_u(17, line, max_Distance / 10, 3, 0); |
||
6573 | 26b2: 80 91 23 01 lds r24, 0x0123 |
||
6574 | 26b6: 90 91 24 01 lds r25, 0x0124 |
||
6575 | 26ba: 6a e0 ldi r22, 0x0A ; 10 |
||
6576 | 26bc: 70 e0 ldi r23, 0x00 ; 0 |
||
6577 | 26be: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
6578 | 26c2: ab 01 movw r20, r22 |
||
6579 | 26c4: 81 e1 ldi r24, 0x11 ; 17 |
||
6580 | 26c6: 65 e0 ldi r22, 0x05 ; 5 |
||
6581 | 26c8: 23 e0 ldi r18, 0x03 ; 3 |
||
6582 | 26ca: 30 e0 ldi r19, 0x00 ; 0 |
||
6583 | 26cc: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
6584 | write_char_xy(20, line, 204); // small meters m |
||
6585 | 26d0: 84 e1 ldi r24, 0x14 ; 20 |
||
6586 | 26d2: 65 e0 ldi r22, 0x05 ; 5 |
||
6587 | 26d4: 4c ec ldi r20, 0xCC ; 204 |
||
6588 | 26d6: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6589 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
||
6590 | 26da: e6 ee ldi r30, 0xE6 ; 230 |
||
6591 | 26dc: f0 e0 ldi r31, 0x00 ; 0 |
||
6592 | 26de: 45 91 lpm r20, Z+ |
||
6593 | 26e0: 54 91 lpm r21, Z+ |
||
6594 | 26e2: 81 e0 ldi r24, 0x01 ; 1 |
||
6595 | 26e4: 66 e0 ldi r22, 0x06 ; 6 |
||
6596 | 26e6: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6597 | write_ndigit_number_u_10th(16, line, min_UBat, 3, 0); |
||
6598 | 26ea: 40 91 04 01 lds r20, 0x0104 |
||
6599 | 26ee: 80 e1 ldi r24, 0x10 ; 16 |
||
6600 | 26f0: 66 e0 ldi r22, 0x06 ; 6 |
||
6601 | 26f2: 50 e0 ldi r21, 0x00 ; 0 |
||
6602 | 26f4: 23 e0 ldi r18, 0x03 ; 3 |
||
6603 | 26f6: 30 e0 ldi r19, 0x00 ; 0 |
||
6604 | 26f8: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
6605 | write_char_xy(20, line, 0x9E); // small V |
||
6606 | 26fc: 84 e1 ldi r24, 0x14 ; 20 |
||
6607 | 26fe: 66 e0 ldi r22, 0x06 ; 6 |
||
6608 | 2700: 4e e9 ldi r20, 0x9E ; 158 |
||
6609 | 2702: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6610 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6611 | 2706: 80 91 1d 01 lds r24, 0x011D |
||
6612 | 270a: 80 fd sbrc r24, 0 |
||
6613 | 270c: 0f c1 rjmp .+542 ; 0x292c <osd_ncmode_default+0xb14> |
||
6614 | 270e: 80 91 1b 01 lds r24, 0x011B |
||
6615 | 2712: 86 fd sbrc r24, 6 |
||
6616 | 2714: 0b c1 rjmp .+534 ; 0x292c <osd_ncmode_default+0xb14> |
||
6617 | 2716: 17 e0 ldi r17, 0x07 ; 7 |
||
6618 | 2718: 08 e0 ldi r16, 0x08 ; 8 |
||
6619 | 271a: f9 e0 ldi r31, 0x09 ; 9 |
||
6620 | 271c: ff 2e mov r15, r31 |
||
6621 | write_ndigit_number_u(21, line, naviData.UsedCapacity - wasted_ampere_offset, 5, 0); |
||
6622 | } |
||
6623 | |||
6624 | write_char_xy(26, line, 0xB5); // mah |
||
6625 | } |
||
6626 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
||
6627 | 271e: e8 ee ldi r30, 0xE8 ; 232 |
||
6628 | 2720: f0 e0 ldi r31, 0x00 ; 0 |
||
6629 | 2722: 45 91 lpm r20, Z+ |
||
6630 | 2724: 54 91 lpm r21, Z+ |
||
6631 | 2726: 81 e0 ldi r24, 0x01 ; 1 |
||
6632 | 2728: 61 2f mov r22, r17 |
||
6633 | 272a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6634 | write_time(14, line, max_FlyingTime); |
||
6635 | 272e: 40 91 25 01 lds r20, 0x0125 |
||
6636 | 2732: 50 91 26 01 lds r21, 0x0126 |
||
6637 | 2736: 8e e0 ldi r24, 0x0E ; 14 |
||
6638 | 2738: 61 2f mov r22, r17 |
||
6639 | 273a: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
6640 | write_char_xy(20, line, 210); // fly clock |
||
6641 | 273e: 84 e1 ldi r24, 0x14 ; 20 |
||
6642 | 2740: 61 2f mov r22, r17 |
||
6643 | 2742: 42 ed ldi r20, 0xD2 ; 210 |
||
6644 | 2744: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6645 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[5])))); // longitude |
||
6646 | 2748: ea ee ldi r30, 0xEA ; 234 |
||
6647 | 274a: f0 e0 ldi r31, 0x00 ; 0 |
||
6648 | 274c: 45 91 lpm r20, Z+ |
||
6649 | 274e: 54 91 lpm r21, Z+ |
||
6650 | 2750: 81 e0 ldi r24, 0x01 ; 1 |
||
6651 | 2752: 60 2f mov r22, r16 |
||
6652 | 2754: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6653 | write_gps_pos(14, line, naviData.CurrentPosition.Longitude); |
||
6654 | 2758: 20 91 9b 01 lds r18, 0x019B |
||
6655 | 275c: 30 91 9c 01 lds r19, 0x019C |
||
6656 | 2760: 40 91 9d 01 lds r20, 0x019D |
||
6657 | 2764: 50 91 9e 01 lds r21, 0x019E |
||
6658 | 2768: 8e e0 ldi r24, 0x0E ; 14 |
||
6659 | 276a: 60 2f mov r22, r16 |
||
6660 | 276c: 0e 94 bd 07 call 0xf7a ; 0xf7a <write_gps_pos> |
||
6661 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
||
6662 | 2770: ec ee ldi r30, 0xEC ; 236 |
||
6663 | 2772: f0 e0 ldi r31, 0x00 ; 0 |
||
6664 | 2774: 45 91 lpm r20, Z+ |
||
6665 | 2776: 54 91 lpm r21, Z+ |
||
6666 | 2778: 81 e0 ldi r24, 0x01 ; 1 |
||
6667 | 277a: 6f 2d mov r22, r15 |
||
6668 | 277c: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6669 | write_gps_pos(14, line, naviData.CurrentPosition.Latitude); |
||
6670 | 2780: 20 91 9f 01 lds r18, 0x019F |
||
6671 | 2784: 30 91 a0 01 lds r19, 0x01A0 |
||
6672 | 2788: 40 91 a1 01 lds r20, 0x01A1 |
||
6673 | 278c: 50 91 a2 01 lds r21, 0x01A2 |
||
6674 | 2790: 8e e0 ldi r24, 0x0E ; 14 |
||
6675 | 2792: 6f 2d mov r22, r15 |
||
6676 | 2794: 0e 94 bd 07 call 0xf7a ; 0xf7a <write_gps_pos> |
||
6677 | 2798: 10 91 1b 01 lds r17, 0x011B |
||
6678 | 279c: 90 cc rjmp .-1760 ; 0x20be <osd_ncmode_default+0x2a6> |
||
6679 | write_ndigit_number_u(24, top_line + 1, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
||
6680 | |||
6681 | // center |
||
6682 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
||
6683 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
||
6684 | clear(); |
||
6685 | 279e: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
6686 | // remember current heigth for gps offset |
||
6687 | altimeter_offset = naviData.CurrentPosition.Altitude / 1000; |
||
6688 | 27a2: 60 91 a3 01 lds r22, 0x01A3 |
||
6689 | 27a6: 70 91 a4 01 lds r23, 0x01A4 |
||
6690 | 27aa: 80 91 a5 01 lds r24, 0x01A5 |
||
6691 | 27ae: 90 91 a6 01 lds r25, 0x01A6 |
||
6692 | 27b2: 28 ee ldi r18, 0xE8 ; 232 |
||
6693 | 27b4: 33 e0 ldi r19, 0x03 ; 3 |
||
6694 | 27b6: 40 e0 ldi r20, 0x00 ; 0 |
||
6695 | 27b8: 50 e0 ldi r21, 0x00 ; 0 |
||
6696 | 27ba: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
6697 | 27be: 30 93 99 01 sts 0x0199, r19 |
||
6698 | 27c2: 20 93 98 01 sts 0x0198, r18 |
||
6699 | // set wasted counter to current offset |
||
6700 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6701 | 27c6: 00 91 1d 01 lds r16, 0x011D |
||
6702 | 27ca: 00 ff sbrs r16, 0 |
||
6703 | 27cc: 9a c0 rjmp .+308 ; 0x2902 <osd_ncmode_default+0xaea> |
||
6704 | 27ce: 10 91 1b 01 lds r17, 0x011B |
||
6705 | 27d2: 16 fd sbrc r17, 6 |
||
6706 | 27d4: 9a c0 rjmp .+308 ; 0x290a <osd_ncmode_default+0xaf2> |
||
6707 | wasted_ampere_offset = ampere_wasted / 10; |
||
6708 | 27d6: 60 91 3b 01 lds r22, 0x013B |
||
6709 | 27da: 70 91 3c 01 lds r23, 0x013C |
||
6710 | 27de: 80 91 3d 01 lds r24, 0x013D |
||
6711 | 27e2: 90 91 3e 01 lds r25, 0x013E |
||
6712 | 27e6: 2a e0 ldi r18, 0x0A ; 10 |
||
6713 | 27e8: 30 e0 ldi r19, 0x00 ; 0 |
||
6714 | 27ea: 40 e0 ldi r20, 0x00 ; 0 |
||
6715 | 27ec: 50 e0 ldi r21, 0x00 ; 0 |
||
6716 | 27ee: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
6717 | 27f2: 30 93 48 01 sts 0x0148, r19 |
||
6718 | 27f6: 20 93 47 01 sts 0x0147, r18 |
||
6719 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6720 | wasted_ampere_offset = naviData.UsedCapacity; |
||
6721 | } |
||
6722 | // update flags to paint display again if needed |
||
6723 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
6724 | 27fa: 0d 7f andi r16, 0xFD ; 253 |
||
6725 | 27fc: 00 93 1d 01 sts 0x011D, r16 |
||
6726 | 2800: 41 cc rjmp .-1918 ; 0x2084 <osd_ncmode_default+0x26c> |
||
6727 | } |
||
6728 | |||
6729 | // pre-bottom line |
||
6730 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6731 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
||
6732 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
||
6733 | 2802: 20 91 03 01 lds r18, 0x0103 |
||
6734 | 2806: 21 50 subi r18, 0x01 ; 1 |
||
6735 | 2808: 80 91 37 01 lds r24, 0x0137 |
||
6736 | 280c: 90 91 38 01 lds r25, 0x0138 |
||
6737 | 2810: 6a e0 ldi r22, 0x0A ; 10 |
||
6738 | 2812: 70 e0 ldi r23, 0x00 ; 0 |
||
6739 | 2814: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
6740 | 2818: ab 01 movw r20, r22 |
||
6741 | 281a: 83 e0 ldi r24, 0x03 ; 3 |
||
6742 | 281c: 62 2f mov r22, r18 |
||
6743 | 281e: 23 e0 ldi r18, 0x03 ; 3 |
||
6744 | 2820: 30 e0 ldi r19, 0x00 ; 0 |
||
6745 | 2822: 00 e0 ldi r16, 0x00 ; 0 |
||
6746 | 2824: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
6747 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
6748 | 2828: 10 91 03 01 lds r17, 0x0103 |
||
6749 | 282c: 11 50 subi r17, 0x01 ; 1 |
||
6750 | 282e: 60 91 3b 01 lds r22, 0x013B |
||
6751 | 2832: 70 91 3c 01 lds r23, 0x013C |
||
6752 | 2836: 80 91 3d 01 lds r24, 0x013D |
||
6753 | 283a: 90 91 3e 01 lds r25, 0x013E |
||
6754 | 283e: 2a e0 ldi r18, 0x0A ; 10 |
||
6755 | 2840: 30 e0 ldi r19, 0x00 ; 0 |
||
6756 | 2842: 40 e0 ldi r20, 0x00 ; 0 |
||
6757 | 2844: 50 e0 ldi r21, 0x00 ; 0 |
||
6758 | 2846: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
6759 | 284a: 8a e0 ldi r24, 0x0A ; 10 |
||
6760 | 284c: 61 2f mov r22, r17 |
||
6761 | 284e: a9 01 movw r20, r18 |
||
6762 | 2850: 24 e0 ldi r18, 0x04 ; 4 |
||
6763 | 2852: 30 e0 ldi r19, 0x00 ; 0 |
||
6764 | 2854: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
6765 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
6766 | 2858: 80 91 1b 01 lds r24, 0x011B |
||
6767 | 285c: 85 ff sbrs r24, 5 |
||
6768 | 285e: 50 cc rjmp .-1888 ; 0x2100 <osd_ncmode_default+0x2e8> |
||
6769 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
6770 | 2860: 60 91 03 01 lds r22, 0x0103 |
||
6771 | 2864: 61 50 subi r22, 0x01 ; 1 |
||
6772 | 2866: 40 91 9f 02 lds r20, 0x029F |
||
6773 | 286a: 50 91 a0 02 lds r21, 0x02A0 |
||
6774 | 286e: 81 e1 ldi r24, 0x11 ; 17 |
||
6775 | 2870: 23 e0 ldi r18, 0x03 ; 3 |
||
6776 | 2872: 30 e0 ldi r19, 0x00 ; 0 |
||
6777 | 2874: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
6778 | 2878: 43 cc rjmp .-1914 ; 0x2100 <osd_ncmode_default+0x2e8> |
||
6779 | } |
||
6780 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
6781 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
6782 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
6783 | } else { |
||
6784 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
6785 | 287a: 40 91 da 01 lds r20, 0x01DA |
||
6786 | 287e: 20 91 db 01 lds r18, 0x01DB |
||
6787 | 2882: 80 91 02 01 lds r24, 0x0102 |
||
6788 | 2886: 60 91 03 01 lds r22, 0x0103 |
||
6789 | 288a: 61 50 subi r22, 0x01 ; 1 |
||
6790 | 288c: 08 cc rjmp .-2032 ; 0x209e <osd_ncmode_default+0x286> |
||
6791 | if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > 10 || naviData.CurrentPosition.Altitude / 1000 - altimeter_offset < -10) { |
||
6792 | // above 10m only write full meters |
||
6793 | write_ndigit_number_s(23, top_line, (int16_t) (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset), 4, 0); // GPS |
||
6794 | } else { |
||
6795 | // up to 10m write meters.dm |
||
6796 | write_ndigit_number_s_10th(23, top_line, (int16_t) (naviData.CurrentPosition.Altitude / 100 - altimeter_offset * 10), 3, 0); // GPS |
||
6797 | 288e: 60 91 a3 01 lds r22, 0x01A3 |
||
6798 | 2892: 70 91 a4 01 lds r23, 0x01A4 |
||
6799 | 2896: 80 91 a5 01 lds r24, 0x01A5 |
||
6800 | 289a: 90 91 a6 01 lds r25, 0x01A6 |
||
6801 | 289e: 8e 01 movw r16, r28 |
||
6802 | 28a0: 00 0f add r16, r16 |
||
6803 | 28a2: 11 1f adc r17, r17 |
||
6804 | 28a4: 00 0f add r16, r16 |
||
6805 | 28a6: 11 1f adc r17, r17 |
||
6806 | 28a8: 00 0f add r16, r16 |
||
6807 | 28aa: 11 1f adc r17, r17 |
||
6808 | 28ac: cc 0f add r28, r28 |
||
6809 | 28ae: dd 1f adc r29, r29 |
||
6810 | 28b0: 0c 0f add r16, r28 |
||
6811 | 28b2: 1d 1f adc r17, r29 |
||
6812 | 28b4: 10 95 com r17 |
||
6813 | 28b6: 01 95 neg r16 |
||
6814 | 28b8: 1f 4f sbci r17, 0xFF ; 255 |
||
6815 | 28ba: 24 e6 ldi r18, 0x64 ; 100 |
||
6816 | 28bc: 30 e0 ldi r19, 0x00 ; 0 |
||
6817 | 28be: 40 e0 ldi r20, 0x00 ; 0 |
||
6818 | 28c0: 50 e0 ldi r21, 0x00 ; 0 |
||
6819 | 28c2: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
6820 | 28c6: 02 0f add r16, r18 |
||
6821 | 28c8: 13 1f adc r17, r19 |
||
6822 | 28ca: 87 e1 ldi r24, 0x17 ; 23 |
||
6823 | 28cc: 60 91 02 01 lds r22, 0x0102 |
||
6824 | 28d0: a8 01 movw r20, r16 |
||
6825 | 28d2: 23 e0 ldi r18, 0x03 ; 3 |
||
6826 | 28d4: 30 e0 ldi r19, 0x00 ; 0 |
||
6827 | 28d6: 00 e0 ldi r16, 0x00 ; 0 |
||
6828 | 28d8: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
6829 | 28dc: 8f cb rjmp .-2274 ; 0x1ffc <osd_ncmode_default+0x1e4> |
||
6830 | if (naviData.Altimeter > 300 || naviData.Altimeter < -300) { |
||
6831 | // above 10m only write full meters |
||
6832 | write_ndigit_number_s(23, top_line, naviData.Altimeter / 30, 4, 0); // BARO |
||
6833 | } else { |
||
6834 | // up to 10m write meters.dm |
||
6835 | write_ndigit_number_s_10th(23, top_line, naviData.Altimeter / 3, 3, 0); // BARO |
||
6836 | 28de: 80 91 cd 01 lds r24, 0x01CD |
||
6837 | 28e2: 90 91 ce 01 lds r25, 0x01CE |
||
6838 | 28e6: 63 e0 ldi r22, 0x03 ; 3 |
||
6839 | 28e8: 70 e0 ldi r23, 0x00 ; 0 |
||
6840 | 28ea: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
6841 | 28ee: ab 01 movw r20, r22 |
||
6842 | 28f0: 87 e1 ldi r24, 0x17 ; 23 |
||
6843 | 28f2: 60 91 02 01 lds r22, 0x0102 |
||
6844 | 28f6: 23 e0 ldi r18, 0x03 ; 3 |
||
6845 | 28f8: 30 e0 ldi r19, 0x00 ; 0 |
||
6846 | 28fa: 00 e0 ldi r16, 0x00 ; 0 |
||
6847 | 28fc: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
6848 | 2900: 7d cb rjmp .-2310 ; 0x1ffc <osd_ncmode_default+0x1e4> |
||
6849 | // remember current heigth for gps offset |
||
6850 | altimeter_offset = naviData.CurrentPosition.Altitude / 1000; |
||
6851 | // set wasted counter to current offset |
||
6852 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6853 | wasted_ampere_offset = ampere_wasted / 10; |
||
6854 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6855 | 2902: 10 91 1b 01 lds r17, 0x011B |
||
6856 | 2906: 16 ff sbrs r17, 6 |
||
6857 | 2908: 78 cf rjmp .-272 ; 0x27fa <osd_ncmode_default+0x9e2> |
||
6858 | wasted_ampere_offset = naviData.UsedCapacity; |
||
6859 | 290a: 80 91 ea 01 lds r24, 0x01EA |
||
6860 | 290e: 90 91 eb 01 lds r25, 0x01EB |
||
6861 | 2912: 90 93 48 01 sts 0x0148, r25 |
||
6862 | 2916: 80 93 47 01 sts 0x0147, r24 |
||
6863 | 291a: 6f cf rjmp .-290 ; 0x27fa <osd_ncmode_default+0x9e2> |
||
6864 | write_char_xy(7, bottom_line, 0x9E); // small V |
||
6865 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6866 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
||
6867 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
||
6868 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
6869 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
||
6870 | 291c: 60 91 03 01 lds r22, 0x0103 |
||
6871 | 2920: 61 50 subi r22, 0x01 ; 1 |
||
6872 | 2922: 85 e1 ldi r24, 0x15 ; 21 |
||
6873 | 2924: 4e e9 ldi r20, 0x9E ; 158 |
||
6874 | 2926: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6875 | 292a: c5 cd rjmp .-1142 ; 0x24b6 <osd_ncmode_default+0x69e> |
||
6876 | write_char_xy(20, line, 204); // small meters m |
||
6877 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
||
6878 | write_ndigit_number_u_10th(16, line, min_UBat, 3, 0); |
||
6879 | write_char_xy(20, line, 0x9E); // small V |
||
6880 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6881 | write_ascii_string_pgm(1, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
||
6882 | 292c: ee ee ldi r30, 0xEE ; 238 |
||
6883 | 292e: f0 e0 ldi r31, 0x00 ; 0 |
||
6884 | 2930: 45 91 lpm r20, Z+ |
||
6885 | 2932: 54 91 lpm r21, Z+ |
||
6886 | 2934: 81 e0 ldi r24, 0x01 ; 1 |
||
6887 | 2936: 67 e0 ldi r22, 0x07 ; 7 |
||
6888 | 2938: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
6889 | write_ndigit_number_u_10th(16, line, max_ampere / 10, 3, 0); |
||
6890 | 293c: 80 91 39 01 lds r24, 0x0139 |
||
6891 | 2940: 90 91 3a 01 lds r25, 0x013A |
||
6892 | 2944: 6a e0 ldi r22, 0x0A ; 10 |
||
6893 | 2946: 70 e0 ldi r23, 0x00 ; 0 |
||
6894 | 2948: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
6895 | 294c: ab 01 movw r20, r22 |
||
6896 | 294e: 80 e1 ldi r24, 0x10 ; 16 |
||
6897 | 2950: 67 e0 ldi r22, 0x07 ; 7 |
||
6898 | 2952: 23 e0 ldi r18, 0x03 ; 3 |
||
6899 | 2954: 30 e0 ldi r19, 0x00 ; 0 |
||
6900 | 2956: 00 e0 ldi r16, 0x00 ; 0 |
||
6901 | 2958: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
6902 | write_char_xy(20, line, 0x9F); // small A |
||
6903 | 295c: 84 e1 ldi r24, 0x14 ; 20 |
||
6904 | 295e: 67 e0 ldi r22, 0x07 ; 7 |
||
6905 | 2960: 4f e9 ldi r20, 0x9F ; 159 |
||
6906 | 2962: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6907 | |||
6908 | // wasted mampere in this flight (will count up after landing) |
||
6909 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6910 | 2966: 80 91 1d 01 lds r24, 0x011D |
||
6911 | 296a: 80 ff sbrs r24, 0 |
||
6912 | 296c: 29 c0 rjmp .+82 ; 0x29c0 <osd_ncmode_default+0xba8> |
||
6913 | 296e: 80 91 1b 01 lds r24, 0x011B |
||
6914 | 2972: 86 ff sbrs r24, 6 |
||
6915 | 2974: 2a c0 rjmp .+84 ; 0x29ca <osd_ncmode_default+0xbb2> |
||
6916 | write_ndigit_number_u(21, line, (ampere_wasted / 10) - wasted_ampere_offset, 5, 0); |
||
6917 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6918 | |||
6919 | write_ndigit_number_u(21, line, naviData.UsedCapacity - wasted_ampere_offset, 5, 0); |
||
6920 | 2976: 40 91 ea 01 lds r20, 0x01EA |
||
6921 | 297a: 50 91 eb 01 lds r21, 0x01EB |
||
6922 | 297e: 80 91 47 01 lds r24, 0x0147 |
||
6923 | 2982: 90 91 48 01 lds r25, 0x0148 |
||
6924 | 2986: 48 1b sub r20, r24 |
||
6925 | 2988: 59 0b sbc r21, r25 |
||
6926 | 298a: 85 e1 ldi r24, 0x15 ; 21 |
||
6927 | 298c: 67 e0 ldi r22, 0x07 ; 7 |
||
6928 | 298e: 25 e0 ldi r18, 0x05 ; 5 |
||
6929 | 2990: 30 e0 ldi r19, 0x00 ; 0 |
||
6930 | 2992: 00 e0 ldi r16, 0x00 ; 0 |
||
6931 | 2994: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
6932 | } |
||
6933 | |||
6934 | write_char_xy(26, line, 0xB5); // mah |
||
6935 | 2998: 8a e1 ldi r24, 0x1A ; 26 |
||
6936 | 299a: 67 e0 ldi r22, 0x07 ; 7 |
||
6937 | 299c: 45 eb ldi r20, 0xB5 ; 181 |
||
6938 | 299e: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
6939 | 29a2: 18 e0 ldi r17, 0x08 ; 8 |
||
6940 | 29a4: 09 e0 ldi r16, 0x09 ; 9 |
||
6941 | 29a6: ea e0 ldi r30, 0x0A ; 10 |
||
6942 | 29a8: fe 2e mov r15, r30 |
||
6943 | 29aa: b9 ce rjmp .-654 ; 0x271e <osd_ncmode_default+0x906> |
||
6944 | write_gps_pos(14, line, naviData.CurrentPosition.Latitude); |
||
6945 | } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
||
6946 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) || (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6947 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
6948 | } else { |
||
6949 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
6950 | 29ac: 40 91 da 01 lds r20, 0x01DA |
||
6951 | 29b0: 20 91 db 01 lds r18, 0x01DB |
||
6952 | 29b4: 80 91 02 01 lds r24, 0x0102 |
||
6953 | 29b8: 60 91 03 01 lds r22, 0x0103 |
||
6954 | 29bc: 61 50 subi r22, 0x01 ; 1 |
||
6955 | 29be: f3 cd rjmp .-1050 ; 0x25a6 <osd_ncmode_default+0x78e> |
||
6956 | write_char_xy(20, line, 0x9F); // small A |
||
6957 | |||
6958 | // wasted mampere in this flight (will count up after landing) |
||
6959 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6960 | write_ndigit_number_u(21, line, (ampere_wasted / 10) - wasted_ampere_offset, 5, 0); |
||
6961 | } else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
||
6962 | 29c0: 80 91 1b 01 lds r24, 0x011B |
||
6963 | 29c4: 86 ff sbrs r24, 6 |
||
6964 | 29c6: e8 cf rjmp .-48 ; 0x2998 <osd_ncmode_default+0xb80> |
||
6965 | 29c8: d6 cf rjmp .-84 ; 0x2976 <osd_ncmode_default+0xb5e> |
||
6966 | write_ndigit_number_u_10th(16, line, max_ampere / 10, 3, 0); |
||
6967 | write_char_xy(20, line, 0x9F); // small A |
||
6968 | |||
6969 | // wasted mampere in this flight (will count up after landing) |
||
6970 | if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
||
6971 | write_ndigit_number_u(21, line, (ampere_wasted / 10) - wasted_ampere_offset, 5, 0); |
||
6972 | 29ca: 00 91 47 01 lds r16, 0x0147 |
||
6973 | 29ce: 10 91 48 01 lds r17, 0x0148 |
||
6974 | 29d2: 60 91 3b 01 lds r22, 0x013B |
||
6975 | 29d6: 70 91 3c 01 lds r23, 0x013C |
||
6976 | 29da: 80 91 3d 01 lds r24, 0x013D |
||
6977 | 29de: 90 91 3e 01 lds r25, 0x013E |
||
6978 | 29e2: 2a e0 ldi r18, 0x0A ; 10 |
||
6979 | 29e4: 30 e0 ldi r19, 0x00 ; 0 |
||
6980 | 29e6: 40 e0 ldi r20, 0x00 ; 0 |
||
6981 | 29e8: 50 e0 ldi r21, 0x00 ; 0 |
||
6982 | 29ea: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
6983 | 29ee: 20 1b sub r18, r16 |
||
6984 | 29f0: 31 0b sbc r19, r17 |
||
6985 | 29f2: 85 e1 ldi r24, 0x15 ; 21 |
||
6986 | 29f4: 67 e0 ldi r22, 0x07 ; 7 |
||
6987 | 29f6: a9 01 movw r20, r18 |
||
6988 | 29f8: 25 e0 ldi r18, 0x05 ; 5 |
||
6989 | 29fa: 30 e0 ldi r19, 0x00 ; 0 |
||
6990 | 29fc: 00 e0 ldi r16, 0x00 ; 0 |
||
6991 | 29fe: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
6992 | 2a02: ca cf rjmp .-108 ; 0x2998 <osd_ncmode_default+0xb80> |
||
6993 | |||
6994 | 00002a04 <osd_ncmode_minimal>: |
||
6995 | #include "osd_helpers.h" |
||
6996 | #include "osd_ncmode_default.h" |
||
6997 | |||
6998 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
6999 | |||
7000 | int osd_ncmode_minimal() { |
||
7001 | 2a04: ff 92 push r15 |
||
7002 | 2a06: 0f 93 push r16 |
||
7003 | 2a08: 1f 93 push r17 |
||
7004 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
7005 | 2a0a: 80 91 1b 01 lds r24, 0x011B |
||
7006 | 2a0e: 80 ff sbrs r24, 0 |
||
7007 | 2a10: 15 c1 rjmp .+554 ; 0x2c3c <osd_ncmode_minimal+0x238> |
||
7008 | // write icons at init or after menu/mode-switch |
||
7009 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
7010 | 2a12: 80 91 1d 01 lds r24, 0x011D |
||
7011 | 2a16: 81 ff sbrs r24, 1 |
||
7012 | 2a18: e8 c1 rjmp .+976 ; 0x2dea <osd_ncmode_minimal+0x3e6> |
||
7013 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
||
7014 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
7015 | } |
||
7016 | |||
7017 | // first line |
||
7018 | write_ndigit_number_u(1, top_line, (uint16_t) (((uint32_t) naviData.GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
||
7019 | 2a1a: 20 91 d4 01 lds r18, 0x01D4 |
||
7020 | 2a1e: 30 91 d5 01 lds r19, 0x01D5 |
||
7021 | 2a22: 40 e0 ldi r20, 0x00 ; 0 |
||
7022 | 2a24: 50 e0 ldi r21, 0x00 ; 0 |
||
7023 | 2a26: ca 01 movw r24, r20 |
||
7024 | 2a28: b9 01 movw r22, r18 |
||
7025 | 2a2a: 66 0f add r22, r22 |
||
7026 | 2a2c: 77 1f adc r23, r23 |
||
7027 | 2a2e: 88 1f adc r24, r24 |
||
7028 | 2a30: 99 1f adc r25, r25 |
||
7029 | 2a32: 66 0f add r22, r22 |
||
7030 | 2a34: 77 1f adc r23, r23 |
||
7031 | 2a36: 88 1f adc r24, r24 |
||
7032 | 2a38: 99 1f adc r25, r25 |
||
7033 | 2a3a: 66 0f add r22, r22 |
||
7034 | 2a3c: 77 1f adc r23, r23 |
||
7035 | 2a3e: 88 1f adc r24, r24 |
||
7036 | 2a40: 99 1f adc r25, r25 |
||
7037 | 2a42: 62 0f add r22, r18 |
||
7038 | 2a44: 73 1f adc r23, r19 |
||
7039 | 2a46: 84 1f adc r24, r20 |
||
7040 | 2a48: 95 1f adc r25, r21 |
||
7041 | 2a4a: 2a ef ldi r18, 0xFA ; 250 |
||
7042 | 2a4c: 30 e0 ldi r19, 0x00 ; 0 |
||
7043 | 2a4e: 40 e0 ldi r20, 0x00 ; 0 |
||
7044 | 2a50: 50 e0 ldi r21, 0x00 ; 0 |
||
7045 | 2a52: 0e 94 8f 1c call 0x391e ; 0x391e <__udivmodsi4> |
||
7046 | 2a56: 81 e0 ldi r24, 0x01 ; 1 |
||
7047 | 2a58: 60 91 02 01 lds r22, 0x0102 |
||
7048 | 2a5c: a9 01 movw r20, r18 |
||
7049 | 2a5e: 23 e0 ldi r18, 0x03 ; 3 |
||
7050 | 2a60: 30 e0 ldi r19, 0x00 ; 0 |
||
7051 | 2a62: 00 e0 ldi r16, 0x00 ; 0 |
||
7052 | 2a64: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
7053 | |||
7054 | write_ndigit_number_u(12, top_line, naviData.HomePositionDeviation.Distance / 10, 3, 0); |
||
7055 | 2a68: 80 91 c6 01 lds r24, 0x01C6 |
||
7056 | 2a6c: 90 91 c7 01 lds r25, 0x01C7 |
||
7057 | 2a70: 6a e0 ldi r22, 0x0A ; 10 |
||
7058 | 2a72: 70 e0 ldi r23, 0x00 ; 0 |
||
7059 | 2a74: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
7060 | 2a78: ab 01 movw r20, r22 |
||
7061 | 2a7a: 8c e0 ldi r24, 0x0C ; 12 |
||
7062 | 2a7c: 60 91 02 01 lds r22, 0x0102 |
||
7063 | 2a80: 23 e0 ldi r18, 0x03 ; 3 |
||
7064 | 2a82: 30 e0 ldi r19, 0x00 ; 0 |
||
7065 | 2a84: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
7066 | |||
7067 | uint16_t heading_home = (naviData.HomePositionDeviation.Bearing + 360 - naviData.CompassHeading) % 360; |
||
7068 | 2a88: 80 91 c8 01 lds r24, 0x01C8 |
||
7069 | 2a8c: 90 91 c9 01 lds r25, 0x01C9 |
||
7070 | 2a90: 20 91 d8 01 lds r18, 0x01D8 |
||
7071 | 2a94: 30 91 d9 01 lds r19, 0x01D9 |
||
7072 | write_char_xy(17, top_line, 0xa0 + heading_fine_conv(heading_home)); |
||
7073 | 2a98: 10 91 02 01 lds r17, 0x0102 |
||
7074 | 2a9c: 88 59 subi r24, 0x98 ; 152 |
||
7075 | 2a9e: 9e 4f sbci r25, 0xFE ; 254 |
||
7076 | 2aa0: 82 1b sub r24, r18 |
||
7077 | 2aa2: 93 0b sbc r25, r19 |
||
7078 | 2aa4: 68 e6 ldi r22, 0x68 ; 104 |
||
7079 | 2aa6: 71 e0 ldi r23, 0x01 ; 1 |
||
7080 | 2aa8: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7081 | 2aac: 0e 94 cf 08 call 0x119e ; 0x119e <heading_fine_conv> |
||
7082 | 2ab0: 48 2f mov r20, r24 |
||
7083 | 2ab2: 40 56 subi r20, 0x60 ; 96 |
||
7084 | 2ab4: 81 e1 ldi r24, 0x11 ; 17 |
||
7085 | 2ab6: 61 2f mov r22, r17 |
||
7086 | 2ab8: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7087 | |||
7088 | if (naviData.Altimeter > 300 || naviData.Altimeter < -300) { |
||
7089 | 2abc: 80 91 cd 01 lds r24, 0x01CD |
||
7090 | 2ac0: 90 91 ce 01 lds r25, 0x01CE |
||
7091 | 2ac4: 8d 52 subi r24, 0x2D ; 45 |
||
7092 | 2ac6: 91 40 sbci r25, 0x01 ; 1 |
||
7093 | 2ac8: 44 f4 brge .+16 ; 0x2ada <osd_ncmode_minimal+0xd6> |
||
7094 | 2aca: 80 91 cd 01 lds r24, 0x01CD |
||
7095 | 2ace: 90 91 ce 01 lds r25, 0x01CE |
||
7096 | 2ad2: 84 5d subi r24, 0xD4 ; 212 |
||
7097 | 2ad4: 9e 4f sbci r25, 0xFE ; 254 |
||
7098 | 2ad6: 0c f0 brlt .+2 ; 0x2ada <osd_ncmode_minimal+0xd6> |
||
7099 | 2ad8: 0c c2 rjmp .+1048 ; 0x2ef2 <osd_ncmode_minimal+0x4ee> |
||
7100 | // above 10m only write full meters |
||
7101 | write_ndigit_number_s(22, top_line, naviData.Altimeter / 30, 4, 0); |
||
7102 | 2ada: 80 91 cd 01 lds r24, 0x01CD |
||
7103 | 2ade: 90 91 ce 01 lds r25, 0x01CE |
||
7104 | 2ae2: 6e e1 ldi r22, 0x1E ; 30 |
||
7105 | 2ae4: 70 e0 ldi r23, 0x00 ; 0 |
||
7106 | 2ae6: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7107 | 2aea: ab 01 movw r20, r22 |
||
7108 | 2aec: 86 e1 ldi r24, 0x16 ; 22 |
||
7109 | 2aee: 60 91 02 01 lds r22, 0x0102 |
||
7110 | 2af2: 24 e0 ldi r18, 0x04 ; 4 |
||
7111 | 2af4: 30 e0 ldi r19, 0x00 ; 0 |
||
7112 | 2af6: 00 e0 ldi r16, 0x00 ; 0 |
||
7113 | 2af8: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
7114 | } else { |
||
7115 | // up to 10m write meters.dm |
||
7116 | write_ndigit_number_s_10th(22, top_line, naviData.Altimeter / 3, 3, 0); |
||
7117 | } |
||
7118 | |||
7119 | draw_variometer(27, top_line, naviData.Variometer); |
||
7120 | 2afc: 40 91 cf 01 lds r20, 0x01CF |
||
7121 | 2b00: 50 91 d0 01 lds r21, 0x01D0 |
||
7122 | 2b04: 8b e1 ldi r24, 0x1B ; 27 |
||
7123 | 2b06: 60 91 02 01 lds r22, 0x0102 |
||
7124 | 2b0a: 0e 94 c1 09 call 0x1382 ; 0x1382 <draw_variometer> |
||
7125 | |||
7126 | |||
7127 | // center |
||
7128 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
||
7129 | 2b0e: 80 91 dd 01 lds r24, 0x01DD |
||
7130 | 2b12: 80 ff sbrs r24, 0 |
||
7131 | 2b14: 10 c1 rjmp .+544 ; 0x2d36 <osd_ncmode_minimal+0x332> |
||
7132 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
||
7133 | 2b16: 80 91 27 01 lds r24, 0x0127 |
||
7134 | 2b1a: 80 ff sbrs r24, 0 |
||
7135 | 2b1c: a5 c1 rjmp .+842 ; 0x2e68 <osd_ncmode_minimal+0x464> |
||
7136 | 2b1e: 80 91 1d 01 lds r24, 0x011D |
||
7137 | clear(); |
||
7138 | // update flags to paint display again if needed |
||
7139 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
7140 | } |
||
7141 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
7142 | 2b22: 90 91 1b 01 lds r25, 0x011B |
||
7143 | 2b26: 91 ff sbrs r25, 1 |
||
7144 | 2b28: 18 c0 rjmp .+48 ; 0x2b5a <osd_ncmode_minimal+0x156> |
||
7145 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7146 | 2b2a: 80 ff sbrs r24, 0 |
||
7147 | 2b2c: f4 c1 rjmp .+1000 ; 0x2f16 <osd_ncmode_minimal+0x512> |
||
7148 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
7149 | 2b2e: 40 91 da 01 lds r20, 0x01DA |
||
7150 | 2b32: 20 91 db 01 lds r18, 0x01DB |
||
7151 | 2b36: 80 91 02 01 lds r24, 0x0102 |
||
7152 | 2b3a: 60 91 03 01 lds r22, 0x0103 |
||
7153 | 2b3e: 62 50 subi r22, 0x02 ; 2 |
||
7154 | } else { |
||
7155 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
7156 | 2b40: 55 27 eor r21, r21 |
||
7157 | 2b42: 47 fd sbrc r20, 7 |
||
7158 | 2b44: 50 95 com r21 |
||
7159 | 2b46: 33 27 eor r19, r19 |
||
7160 | 2b48: 27 fd sbrc r18, 7 |
||
7161 | 2b4a: 30 95 com r19 |
||
7162 | 2b4c: 8e 5f subi r24, 0xFE ; 254 |
||
7163 | 2b4e: 0e 94 e6 08 call 0x11cc ; 0x11cc <draw_artificial_horizon> |
||
7164 | 2b52: 90 91 1b 01 lds r25, 0x011B |
||
7165 | 2b56: 80 91 1d 01 lds r24, 0x011D |
||
7166 | } |
||
7167 | } |
||
7168 | // motors are on, assume we were/are flying |
||
7169 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
||
7170 | 2b5a: 84 60 ori r24, 0x04 ; 4 |
||
7171 | 2b5c: 80 93 1d 01 sts 0x011D, r24 |
||
7172 | } else { |
||
7173 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
7174 | } |
||
7175 | } |
||
7176 | } |
||
7177 | if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) { |
||
7178 | 2b60: 92 fd sbrc r25, 2 |
||
7179 | 2b62: 0b c1 rjmp .+534 ; 0x2d7a <osd_ncmode_minimal+0x376> |
||
7180 | draw_big_variometer(27, 8, naviData.Variometer); |
||
7181 | } |
||
7182 | |||
7183 | // pre-bottom line |
||
7184 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7185 | 2b64: 80 91 1d 01 lds r24, 0x011D |
||
7186 | 2b68: 80 fd sbrc r24, 0 |
||
7187 | 2b6a: 13 c1 rjmp .+550 ; 0x2d92 <osd_ncmode_minimal+0x38e> |
||
7188 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
||
7189 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
7190 | } |
||
7191 | |||
7192 | // bottom line |
||
7193 | draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
||
7194 | 2b6c: 20 91 d3 01 lds r18, 0x01D3 |
||
7195 | 2b70: 82 e0 ldi r24, 0x02 ; 2 |
||
7196 | 2b72: 60 91 03 01 lds r22, 0x0103 |
||
7197 | 2b76: 40 91 19 01 lds r20, 0x0119 |
||
7198 | 2b7a: 00 91 1a 01 lds r16, 0x011A |
||
7199 | 2b7e: 0e 94 17 0a call 0x142e ; 0x142e <draw_battery> |
||
7200 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 3, 0); |
||
7201 | 2b82: 40 91 d3 01 lds r20, 0x01D3 |
||
7202 | 2b86: 83 e0 ldi r24, 0x03 ; 3 |
||
7203 | 2b88: 60 91 03 01 lds r22, 0x0103 |
||
7204 | 2b8c: 50 e0 ldi r21, 0x00 ; 0 |
||
7205 | 2b8e: 23 e0 ldi r18, 0x03 ; 3 |
||
7206 | 2b90: 30 e0 ldi r19, 0x00 ; 0 |
||
7207 | 2b92: 00 e0 ldi r16, 0x00 ; 0 |
||
7208 | 2b94: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
7209 | if (naviData.UBat <= min_voltage && last_UBat > min_voltage) { |
||
7210 | 2b98: 80 91 d3 01 lds r24, 0x01D3 |
||
7211 | 2b9c: 90 91 19 01 lds r25, 0x0119 |
||
7212 | 2ba0: 98 17 cp r25, r24 |
||
7213 | 2ba2: 08 f4 brcc .+2 ; 0x2ba6 <osd_ncmode_minimal+0x1a2> |
||
7214 | 2ba4: 69 c1 rjmp .+722 ; 0x2e78 <osd_ncmode_minimal+0x474> |
||
7215 | 2ba6: 80 91 00 01 lds r24, 0x0100 |
||
7216 | 2baa: 98 17 cp r25, r24 |
||
7217 | 2bac: 08 f0 brcs .+2 ; 0x2bb0 <osd_ncmode_minimal+0x1ac> |
||
7218 | 2bae: 64 c1 rjmp .+712 ; 0x2e78 <osd_ncmode_minimal+0x474> |
||
7219 | for (uint8_t x = 2; x < 8; x++) |
||
7220 | write_char_att_xy(x, bottom_line, BLINK); |
||
7221 | 2bb0: 82 e0 ldi r24, 0x02 ; 2 |
||
7222 | 2bb2: 60 91 03 01 lds r22, 0x0103 |
||
7223 | 2bb6: 4f e4 ldi r20, 0x4F ; 79 |
||
7224 | 2bb8: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7225 | 2bbc: 83 e0 ldi r24, 0x03 ; 3 |
||
7226 | 2bbe: 60 91 03 01 lds r22, 0x0103 |
||
7227 | 2bc2: 4f e4 ldi r20, 0x4F ; 79 |
||
7228 | 2bc4: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7229 | 2bc8: 84 e0 ldi r24, 0x04 ; 4 |
||
7230 | 2bca: 60 91 03 01 lds r22, 0x0103 |
||
7231 | 2bce: 4f e4 ldi r20, 0x4F ; 79 |
||
7232 | 2bd0: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7233 | 2bd4: 85 e0 ldi r24, 0x05 ; 5 |
||
7234 | 2bd6: 60 91 03 01 lds r22, 0x0103 |
||
7235 | 2bda: 4f e4 ldi r20, 0x4F ; 79 |
||
7236 | 2bdc: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7237 | 2be0: 86 e0 ldi r24, 0x06 ; 6 |
||
7238 | 2be2: 60 91 03 01 lds r22, 0x0103 |
||
7239 | 2be6: 4f e4 ldi r20, 0x4F ; 79 |
||
7240 | 2be8: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7241 | 2bec: 87 e0 ldi r24, 0x07 ; 7 |
||
7242 | 2bee: 60 91 03 01 lds r22, 0x0103 |
||
7243 | 2bf2: 4f e4 ldi r20, 0x4F ; 79 |
||
7244 | 2bf4: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7245 | } else if (naviData.UBat > min_voltage && last_UBat < min_voltage) { |
||
7246 | for (uint8_t x = 2; x < 8; x++) |
||
7247 | write_char_att_xy(x, bottom_line, 0); |
||
7248 | } |
||
7249 | |||
7250 | write_time(11, bottom_line, naviData.FlyingTime); |
||
7251 | 2bf8: 40 91 d1 01 lds r20, 0x01D1 |
||
7252 | 2bfc: 50 91 d2 01 lds r21, 0x01D2 |
||
7253 | 2c00: 8b e0 ldi r24, 0x0B ; 11 |
||
7254 | 2c02: 60 91 03 01 lds r22, 0x0103 |
||
7255 | 2c06: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
7256 | |||
7257 | write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 2, 0); |
||
7258 | 2c0a: 40 91 cc 01 lds r20, 0x01CC |
||
7259 | 2c0e: 88 e1 ldi r24, 0x18 ; 24 |
||
7260 | 2c10: 60 91 03 01 lds r22, 0x0103 |
||
7261 | 2c14: 50 e0 ldi r21, 0x00 ; 0 |
||
7262 | 2c16: 22 e0 ldi r18, 0x02 ; 2 |
||
7263 | 2c18: 30 e0 ldi r19, 0x00 ; 0 |
||
7264 | 2c1a: 00 e0 ldi r16, 0x00 ; 0 |
||
7265 | 2c1c: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
7266 | |||
7267 | if (naviData.NCFlags & NC_FLAG_CH) { |
||
7268 | 2c20: 80 91 de 01 lds r24, 0x01DE |
||
7269 | 2c24: 82 fd sbrc r24, 2 |
||
7270 | 2c26: 5e c1 rjmp .+700 ; 0x2ee4 <osd_ncmode_minimal+0x4e0> |
||
7271 | write_char_xy(27, bottom_line, 231); // gps ch |
||
7272 | } else if (naviData.NCFlags & NC_FLAG_PH) { |
||
7273 | 2c28: 80 91 de 01 lds r24, 0x01DE |
||
7274 | 2c2c: 81 ff sbrs r24, 1 |
||
7275 | 2c2e: 53 c1 rjmp .+678 ; 0x2ed6 <osd_ncmode_minimal+0x4d2> |
||
7276 | write_char_xy(27, bottom_line, 230); // gps ph |
||
7277 | 2c30: 8b e1 ldi r24, 0x1B ; 27 |
||
7278 | 2c32: 60 91 03 01 lds r22, 0x0103 |
||
7279 | 2c36: 46 ee ldi r20, 0xE6 ; 230 |
||
7280 | 2c38: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7281 | write_char_xy(27, bottom_line, 201); // sat2 (free) |
||
7282 | } |
||
7283 | } |
||
7284 | |||
7285 | // remember statistics (only when engines running) |
||
7286 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { |
||
7287 | 2c3c: 80 91 dd 01 lds r24, 0x01DD |
||
7288 | 2c40: 80 ff sbrs r24, 0 |
||
7289 | 2c42: 65 c0 rjmp .+202 ; 0x2d0e <osd_ncmode_minimal+0x30a> |
||
7290 | if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter; |
||
7291 | 2c44: 20 91 cd 01 lds r18, 0x01CD |
||
7292 | 2c48: 30 91 ce 01 lds r19, 0x01CE |
||
7293 | 2c4c: 80 91 1f 01 lds r24, 0x011F |
||
7294 | 2c50: 90 91 20 01 lds r25, 0x0120 |
||
7295 | 2c54: 82 17 cp r24, r18 |
||
7296 | 2c56: 93 07 cpc r25, r19 |
||
7297 | 2c58: 44 f4 brge .+16 ; 0x2c6a <osd_ncmode_minimal+0x266> |
||
7298 | 2c5a: 80 91 cd 01 lds r24, 0x01CD |
||
7299 | 2c5e: 90 91 ce 01 lds r25, 0x01CE |
||
7300 | 2c62: 90 93 20 01 sts 0x0120, r25 |
||
7301 | 2c66: 80 93 1f 01 sts 0x011F, r24 |
||
7302 | if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
||
7303 | 2c6a: 20 91 d4 01 lds r18, 0x01D4 |
||
7304 | 2c6e: 30 91 d5 01 lds r19, 0x01D5 |
||
7305 | 2c72: 80 91 21 01 lds r24, 0x0121 |
||
7306 | 2c76: 90 91 22 01 lds r25, 0x0122 |
||
7307 | 2c7a: 82 17 cp r24, r18 |
||
7308 | 2c7c: 93 07 cpc r25, r19 |
||
7309 | 2c7e: 40 f4 brcc .+16 ; 0x2c90 <osd_ncmode_minimal+0x28c> |
||
7310 | 2c80: 80 91 d4 01 lds r24, 0x01D4 |
||
7311 | 2c84: 90 91 d5 01 lds r25, 0x01D5 |
||
7312 | 2c88: 90 93 22 01 sts 0x0122, r25 |
||
7313 | 2c8c: 80 93 21 01 sts 0x0121, r24 |
||
7314 | if (naviData.HomePositionDeviation.Distance > max_Distance) { |
||
7315 | 2c90: 20 91 c6 01 lds r18, 0x01C6 |
||
7316 | 2c94: 30 91 c7 01 lds r19, 0x01C7 |
||
7317 | 2c98: 80 91 23 01 lds r24, 0x0123 |
||
7318 | 2c9c: 90 91 24 01 lds r25, 0x0124 |
||
7319 | 2ca0: 82 17 cp r24, r18 |
||
7320 | 2ca2: 93 07 cpc r25, r19 |
||
7321 | 2ca4: 40 f4 brcc .+16 ; 0x2cb6 <osd_ncmode_minimal+0x2b2> |
||
7322 | max_Distance = naviData.HomePositionDeviation.Distance; |
||
7323 | 2ca6: 80 91 c6 01 lds r24, 0x01C6 |
||
7324 | 2caa: 90 91 c7 01 lds r25, 0x01C7 |
||
7325 | 2cae: 90 93 24 01 sts 0x0124, r25 |
||
7326 | 2cb2: 80 93 23 01 sts 0x0123, r24 |
||
7327 | } |
||
7328 | if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
||
7329 | 2cb6: 90 91 d3 01 lds r25, 0x01D3 |
||
7330 | 2cba: 80 91 04 01 lds r24, 0x0104 |
||
7331 | 2cbe: 98 17 cp r25, r24 |
||
7332 | 2cc0: 20 f4 brcc .+8 ; 0x2cca <osd_ncmode_minimal+0x2c6> |
||
7333 | 2cc2: 80 91 d3 01 lds r24, 0x01D3 |
||
7334 | 2cc6: 80 93 04 01 sts 0x0104, r24 |
||
7335 | if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
||
7336 | 2cca: 20 91 d1 01 lds r18, 0x01D1 |
||
7337 | 2cce: 30 91 d2 01 lds r19, 0x01D2 |
||
7338 | 2cd2: 80 91 25 01 lds r24, 0x0125 |
||
7339 | 2cd6: 90 91 26 01 lds r25, 0x0126 |
||
7340 | 2cda: 82 17 cp r24, r18 |
||
7341 | 2cdc: 93 07 cpc r25, r19 |
||
7342 | 2cde: 40 f4 brcc .+16 ; 0x2cf0 <osd_ncmode_minimal+0x2ec> |
||
7343 | 2ce0: 80 91 d1 01 lds r24, 0x01D1 |
||
7344 | 2ce4: 90 91 d2 01 lds r25, 0x01D2 |
||
7345 | 2ce8: 90 93 26 01 sts 0x0126, r25 |
||
7346 | 2cec: 80 93 25 01 sts 0x0125, r24 |
||
7347 | if (ampere > max_ampere) max_ampere = ampere; |
||
7348 | 2cf0: 20 91 37 01 lds r18, 0x0137 |
||
7349 | 2cf4: 30 91 38 01 lds r19, 0x0138 |
||
7350 | 2cf8: 80 91 39 01 lds r24, 0x0139 |
||
7351 | 2cfc: 90 91 3a 01 lds r25, 0x013A |
||
7352 | 2d00: 82 17 cp r24, r18 |
||
7353 | 2d02: 93 07 cpc r25, r19 |
||
7354 | 2d04: 24 f4 brge .+8 ; 0x2d0e <osd_ncmode_minimal+0x30a> |
||
7355 | 2d06: 30 93 3a 01 sts 0x013A, r19 |
||
7356 | 2d0a: 20 93 39 01 sts 0x0139, r18 |
||
7357 | } |
||
7358 | |||
7359 | // remember last values |
||
7360 | last_RC_Quality = naviData.RC_Quality; |
||
7361 | 2d0e: 80 91 dc 01 lds r24, 0x01DC |
||
7362 | 2d12: 80 93 01 01 sts 0x0101, r24 |
||
7363 | last_UBat = naviData.UBat; |
||
7364 | 2d16: 80 91 d3 01 lds r24, 0x01D3 |
||
7365 | 2d1a: 80 93 00 01 sts 0x0100, r24 |
||
7366 | old_MKFlags = naviData.FCFlags; |
||
7367 | 2d1e: 80 91 dd 01 lds r24, 0x01DD |
||
7368 | 2d22: 80 93 27 01 sts 0x0127, r24 |
||
7369 | seconds_since_last_data = 0; |
||
7370 | 2d26: 10 92 18 01 sts 0x0118, r1 |
||
7371 | |||
7372 | return 0; |
||
7373 | } |
||
7374 | 2d2a: 80 e0 ldi r24, 0x00 ; 0 |
||
7375 | 2d2c: 90 e0 ldi r25, 0x00 ; 0 |
||
7376 | 2d2e: 1f 91 pop r17 |
||
7377 | 2d30: 0f 91 pop r16 |
||
7378 | 2d32: ff 90 pop r15 |
||
7379 | 2d34: 08 95 ret |
||
7380 | } |
||
7381 | // motors are on, assume we were/are flying |
||
7382 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
||
7383 | } else { |
||
7384 | // stats |
||
7385 | if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) { |
||
7386 | 2d36: 80 91 1d 01 lds r24, 0x011D |
||
7387 | 2d3a: 82 ff sbrs r24, 2 |
||
7388 | 2d3c: 92 c0 rjmp .+292 ; 0x2e62 <osd_ncmode_minimal+0x45e> |
||
7389 | 2d3e: 90 91 1b 01 lds r25, 0x011B |
||
7390 | 2d42: 93 fd sbrc r25, 3 |
||
7391 | 2d44: fc c0 rjmp .+504 ; 0x2f3e <osd_ncmode_minimal+0x53a> |
||
7392 | write_char_xy(22, line, 210); // fly clock |
||
7393 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[5])))); // longitude |
||
7394 | write_gps_pos(15, line, naviData.CurrentPosition.Longitude); |
||
7395 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
||
7396 | write_gps_pos(15, line, naviData.CurrentPosition.Latitude); |
||
7397 | } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
||
7398 | 2d46: 91 ff sbrs r25, 1 |
||
7399 | 2d48: 0b cf rjmp .-490 ; 0x2b60 <osd_ncmode_minimal+0x15c> |
||
7400 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7401 | 2d4a: 80 ff sbrs r24, 0 |
||
7402 | 2d4c: ee c0 rjmp .+476 ; 0x2f2a <osd_ncmode_minimal+0x526> |
||
7403 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
7404 | 2d4e: 40 91 da 01 lds r20, 0x01DA |
||
7405 | 2d52: 20 91 db 01 lds r18, 0x01DB |
||
7406 | 2d56: 80 91 02 01 lds r24, 0x0102 |
||
7407 | 2d5a: 60 91 03 01 lds r22, 0x0103 |
||
7408 | 2d5e: 62 50 subi r22, 0x02 ; 2 |
||
7409 | } else { |
||
7410 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
7411 | 2d60: 55 27 eor r21, r21 |
||
7412 | 2d62: 47 fd sbrc r20, 7 |
||
7413 | 2d64: 50 95 com r21 |
||
7414 | 2d66: 33 27 eor r19, r19 |
||
7415 | 2d68: 27 fd sbrc r18, 7 |
||
7416 | 2d6a: 30 95 com r19 |
||
7417 | 2d6c: 8e 5f subi r24, 0xFE ; 254 |
||
7418 | 2d6e: 0e 94 e6 08 call 0x11cc ; 0x11cc <draw_artificial_horizon> |
||
7419 | 2d72: 90 91 1b 01 lds r25, 0x011B |
||
7420 | } |
||
7421 | } |
||
7422 | } |
||
7423 | if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) { |
||
7424 | 2d76: 92 ff sbrs r25, 2 |
||
7425 | 2d78: f5 ce rjmp .-534 ; 0x2b64 <osd_ncmode_minimal+0x160> |
||
7426 | draw_big_variometer(27, 8, naviData.Variometer); |
||
7427 | 2d7a: 40 91 cf 01 lds r20, 0x01CF |
||
7428 | 2d7e: 50 91 d0 01 lds r21, 0x01D0 |
||
7429 | 2d82: 8b e1 ldi r24, 0x1B ; 27 |
||
7430 | 2d84: 68 e0 ldi r22, 0x08 ; 8 |
||
7431 | 2d86: 0e 94 84 0a call 0x1508 ; 0x1508 <draw_big_variometer> |
||
7432 | } |
||
7433 | |||
7434 | // pre-bottom line |
||
7435 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7436 | 2d8a: 80 91 1d 01 lds r24, 0x011D |
||
7437 | 2d8e: 80 ff sbrs r24, 0 |
||
7438 | 2d90: ed ce rjmp .-550 ; 0x2b6c <osd_ncmode_minimal+0x168> |
||
7439 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
||
7440 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
||
7441 | 2d92: 20 91 03 01 lds r18, 0x0103 |
||
7442 | 2d96: 21 50 subi r18, 0x01 ; 1 |
||
7443 | 2d98: 80 91 37 01 lds r24, 0x0137 |
||
7444 | 2d9c: 90 91 38 01 lds r25, 0x0138 |
||
7445 | 2da0: 6a e0 ldi r22, 0x0A ; 10 |
||
7446 | 2da2: 70 e0 ldi r23, 0x00 ; 0 |
||
7447 | 2da4: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7448 | 2da8: ab 01 movw r20, r22 |
||
7449 | 2daa: 83 e0 ldi r24, 0x03 ; 3 |
||
7450 | 2dac: 62 2f mov r22, r18 |
||
7451 | 2dae: 23 e0 ldi r18, 0x03 ; 3 |
||
7452 | 2db0: 30 e0 ldi r19, 0x00 ; 0 |
||
7453 | 2db2: 00 e0 ldi r16, 0x00 ; 0 |
||
7454 | 2db4: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
7455 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
7456 | 2db8: 10 91 03 01 lds r17, 0x0103 |
||
7457 | 2dbc: 11 50 subi r17, 0x01 ; 1 |
||
7458 | 2dbe: 60 91 3b 01 lds r22, 0x013B |
||
7459 | 2dc2: 70 91 3c 01 lds r23, 0x013C |
||
7460 | 2dc6: 80 91 3d 01 lds r24, 0x013D |
||
7461 | 2dca: 90 91 3e 01 lds r25, 0x013E |
||
7462 | 2dce: 2a e0 ldi r18, 0x0A ; 10 |
||
7463 | 2dd0: 30 e0 ldi r19, 0x00 ; 0 |
||
7464 | 2dd2: 40 e0 ldi r20, 0x00 ; 0 |
||
7465 | 2dd4: 50 e0 ldi r21, 0x00 ; 0 |
||
7466 | 2dd6: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
7467 | 2dda: 8a e0 ldi r24, 0x0A ; 10 |
||
7468 | 2ddc: 61 2f mov r22, r17 |
||
7469 | 2dde: a9 01 movw r20, r18 |
||
7470 | 2de0: 24 e0 ldi r18, 0x04 ; 4 |
||
7471 | 2de2: 30 e0 ldi r19, 0x00 ; 0 |
||
7472 | 2de4: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
7473 | 2de8: c1 ce rjmp .-638 ; 0x2b6c <osd_ncmode_minimal+0x168> |
||
7474 | |||
7475 | int osd_ncmode_minimal() { |
||
7476 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
7477 | // write icons at init or after menu/mode-switch |
||
7478 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
7479 | write_char_xy(4, top_line, 0xCB); // km/h |
||
7480 | 2dea: 84 e0 ldi r24, 0x04 ; 4 |
||
7481 | 2dec: 60 91 02 01 lds r22, 0x0102 |
||
7482 | 2df0: 4b ec ldi r20, 0xCB ; 203 |
||
7483 | 2df2: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7484 | write_char_xy(15, top_line, 0xCC); // small meters m height |
||
7485 | 2df6: 8f e0 ldi r24, 0x0F ; 15 |
||
7486 | 2df8: 60 91 02 01 lds r22, 0x0102 |
||
7487 | 2dfc: 4c ec ldi r20, 0xCC ; 204 |
||
7488 | 2dfe: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7489 | write_char_xy(26, top_line, 0xCC); // small meters m height |
||
7490 | 2e02: 8a e1 ldi r24, 0x1A ; 26 |
||
7491 | 2e04: 60 91 02 01 lds r22, 0x0102 |
||
7492 | 2e08: 4c ec ldi r20, 0xCC ; 204 |
||
7493 | 2e0a: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7494 | write_char_xy(16, top_line, 0xB0); // left circle |
||
7495 | 2e0e: 80 e1 ldi r24, 0x10 ; 16 |
||
7496 | 2e10: 60 91 02 01 lds r22, 0x0102 |
||
7497 | 2e14: 40 eb ldi r20, 0xB0 ; 176 |
||
7498 | 2e16: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7499 | write_char_xy(18, top_line, 0xB2); // right circle |
||
7500 | 2e1a: 82 e1 ldi r24, 0x12 ; 18 |
||
7501 | 2e1c: 60 91 02 01 lds r22, 0x0102 |
||
7502 | 2e20: 42 eb ldi r20, 0xB2 ; 178 |
||
7503 | 2e22: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7504 | write_char_xy(7, bottom_line, 0x9E); // small V |
||
7505 | 2e26: 87 e0 ldi r24, 0x07 ; 7 |
||
7506 | 2e28: 60 91 03 01 lds r22, 0x0103 |
||
7507 | 2e2c: 4e e9 ldi r20, 0x9E ; 158 |
||
7508 | 2e2e: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7509 | write_char_xy(17, bottom_line, 0xD2); // fly clock |
||
7510 | 2e32: 81 e1 ldi r24, 0x11 ; 17 |
||
7511 | 2e34: 60 91 03 01 lds r22, 0x0103 |
||
7512 | 2e38: 42 ed ldi r20, 0xD2 ; 210 |
||
7513 | 2e3a: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7514 | write_char_xy(26, bottom_line, 0xC8); // sat1 |
||
7515 | 2e3e: 8a e1 ldi r24, 0x1A ; 26 |
||
7516 | 2e40: 60 91 03 01 lds r22, 0x0103 |
||
7517 | 2e44: 48 ec ldi r20, 0xC8 ; 200 |
||
7518 | 2e46: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7519 | write_char_xy(27, bottom_line, 0xC9); // sat2 |
||
7520 | 2e4a: 8b e1 ldi r24, 0x1B ; 27 |
||
7521 | 2e4c: 60 91 03 01 lds r22, 0x0103 |
||
7522 | 2e50: 49 ec ldi r20, 0xC9 ; 201 |
||
7523 | 2e52: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7524 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
7525 | 2e56: 80 91 1d 01 lds r24, 0x011D |
||
7526 | 2e5a: 82 60 ori r24, 0x02 ; 2 |
||
7527 | 2e5c: 80 93 1d 01 sts 0x011D, r24 |
||
7528 | 2e60: dc cd rjmp .-1096 ; 0x2a1a <osd_ncmode_minimal+0x16> |
||
7529 | 2e62: 90 91 1b 01 lds r25, 0x011B |
||
7530 | 2e66: 6f cf rjmp .-290 ; 0x2d46 <osd_ncmode_minimal+0x342> |
||
7531 | |||
7532 | |||
7533 | // center |
||
7534 | if (naviData.FCFlags & FLAG_MOTOR_RUN) { // should be engines running |
||
7535 | if (!(old_MKFlags & FLAG_MOTOR_RUN)) { // motors just started, clear middle |
||
7536 | clear(); |
||
7537 | 2e68: 0e 94 75 08 call 0x10ea ; 0x10ea <clear> |
||
7538 | // update flags to paint display again if needed |
||
7539 | COSD_FLAGS_RUNTIME &= ~COSD_ICONS_WRITTEN; |
||
7540 | 2e6c: 80 91 1d 01 lds r24, 0x011D |
||
7541 | 2e70: 8d 7f andi r24, 0xFD ; 253 |
||
7542 | 2e72: 80 93 1d 01 sts 0x011D, r24 |
||
7543 | 2e76: 55 ce rjmp .-854 ; 0x2b22 <osd_ncmode_minimal+0x11e> |
||
7544 | draw_battery(2, bottom_line, min_voltage, naviData.UBat, max_voltage); |
||
7545 | write_ndigit_number_u_10th(3, bottom_line, naviData.UBat, 3, 0); |
||
7546 | if (naviData.UBat <= min_voltage && last_UBat > min_voltage) { |
||
7547 | for (uint8_t x = 2; x < 8; x++) |
||
7548 | write_char_att_xy(x, bottom_line, BLINK); |
||
7549 | } else if (naviData.UBat > min_voltage && last_UBat < min_voltage) { |
||
7550 | 2e78: 80 91 d3 01 lds r24, 0x01D3 |
||
7551 | 2e7c: 98 17 cp r25, r24 |
||
7552 | 2e7e: 08 f0 brcs .+2 ; 0x2e82 <osd_ncmode_minimal+0x47e> |
||
7553 | 2e80: bb ce rjmp .-650 ; 0x2bf8 <osd_ncmode_minimal+0x1f4> |
||
7554 | 2e82: 80 91 00 01 lds r24, 0x0100 |
||
7555 | 2e86: 89 17 cp r24, r25 |
||
7556 | 2e88: 08 f0 brcs .+2 ; 0x2e8c <osd_ncmode_minimal+0x488> |
||
7557 | 2e8a: b6 ce rjmp .-660 ; 0x2bf8 <osd_ncmode_minimal+0x1f4> |
||
7558 | for (uint8_t x = 2; x < 8; x++) |
||
7559 | write_char_att_xy(x, bottom_line, 0); |
||
7560 | 2e8c: 82 e0 ldi r24, 0x02 ; 2 |
||
7561 | 2e8e: 60 91 03 01 lds r22, 0x0103 |
||
7562 | 2e92: 40 e0 ldi r20, 0x00 ; 0 |
||
7563 | 2e94: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7564 | 2e98: 83 e0 ldi r24, 0x03 ; 3 |
||
7565 | 2e9a: 60 91 03 01 lds r22, 0x0103 |
||
7566 | 2e9e: 40 e0 ldi r20, 0x00 ; 0 |
||
7567 | 2ea0: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7568 | 2ea4: 84 e0 ldi r24, 0x04 ; 4 |
||
7569 | 2ea6: 60 91 03 01 lds r22, 0x0103 |
||
7570 | 2eaa: 40 e0 ldi r20, 0x00 ; 0 |
||
7571 | 2eac: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7572 | 2eb0: 85 e0 ldi r24, 0x05 ; 5 |
||
7573 | 2eb2: 60 91 03 01 lds r22, 0x0103 |
||
7574 | 2eb6: 40 e0 ldi r20, 0x00 ; 0 |
||
7575 | 2eb8: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7576 | 2ebc: 86 e0 ldi r24, 0x06 ; 6 |
||
7577 | 2ebe: 60 91 03 01 lds r22, 0x0103 |
||
7578 | 2ec2: 40 e0 ldi r20, 0x00 ; 0 |
||
7579 | 2ec4: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7580 | 2ec8: 87 e0 ldi r24, 0x07 ; 7 |
||
7581 | 2eca: 60 91 03 01 lds r22, 0x0103 |
||
7582 | 2ece: 40 e0 ldi r20, 0x00 ; 0 |
||
7583 | 2ed0: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
7584 | 2ed4: 91 ce rjmp .-734 ; 0x2bf8 <osd_ncmode_minimal+0x1f4> |
||
7585 | if (naviData.NCFlags & NC_FLAG_CH) { |
||
7586 | write_char_xy(27, bottom_line, 231); // gps ch |
||
7587 | } else if (naviData.NCFlags & NC_FLAG_PH) { |
||
7588 | write_char_xy(27, bottom_line, 230); // gps ph |
||
7589 | } else { // (naviData.NCFlags & NC_FLAG_FREE) |
||
7590 | write_char_xy(27, bottom_line, 201); // sat2 (free) |
||
7591 | 2ed6: 8b e1 ldi r24, 0x1B ; 27 |
||
7592 | 2ed8: 60 91 03 01 lds r22, 0x0103 |
||
7593 | 2edc: 49 ec ldi r20, 0xC9 ; 201 |
||
7594 | 2ede: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7595 | 2ee2: ac ce rjmp .-680 ; 0x2c3c <osd_ncmode_minimal+0x238> |
||
7596 | write_time(11, bottom_line, naviData.FlyingTime); |
||
7597 | |||
7598 | write_ndigit_number_u(24, bottom_line, naviData.SatsInUse, 2, 0); |
||
7599 | |||
7600 | if (naviData.NCFlags & NC_FLAG_CH) { |
||
7601 | write_char_xy(27, bottom_line, 231); // gps ch |
||
7602 | 2ee4: 8b e1 ldi r24, 0x1B ; 27 |
||
7603 | 2ee6: 60 91 03 01 lds r22, 0x0103 |
||
7604 | 2eea: 47 ee ldi r20, 0xE7 ; 231 |
||
7605 | 2eec: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7606 | 2ef0: a5 ce rjmp .-694 ; 0x2c3c <osd_ncmode_minimal+0x238> |
||
7607 | if (naviData.Altimeter > 300 || naviData.Altimeter < -300) { |
||
7608 | // above 10m only write full meters |
||
7609 | write_ndigit_number_s(22, top_line, naviData.Altimeter / 30, 4, 0); |
||
7610 | } else { |
||
7611 | // up to 10m write meters.dm |
||
7612 | write_ndigit_number_s_10th(22, top_line, naviData.Altimeter / 3, 3, 0); |
||
7613 | 2ef2: 80 91 cd 01 lds r24, 0x01CD |
||
7614 | 2ef6: 90 91 ce 01 lds r25, 0x01CE |
||
7615 | 2efa: 63 e0 ldi r22, 0x03 ; 3 |
||
7616 | 2efc: 70 e0 ldi r23, 0x00 ; 0 |
||
7617 | 2efe: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7618 | 2f02: ab 01 movw r20, r22 |
||
7619 | 2f04: 86 e1 ldi r24, 0x16 ; 22 |
||
7620 | 2f06: 60 91 02 01 lds r22, 0x0102 |
||
7621 | 2f0a: 23 e0 ldi r18, 0x03 ; 3 |
||
7622 | 2f0c: 30 e0 ldi r19, 0x00 ; 0 |
||
7623 | 2f0e: 00 e0 ldi r16, 0x00 ; 0 |
||
7624 | 2f10: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
7625 | 2f14: f3 cd rjmp .-1050 ; 0x2afc <osd_ncmode_minimal+0xf8> |
||
7626 | } |
||
7627 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
7628 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7629 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
7630 | } else { |
||
7631 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
7632 | 2f16: 40 91 da 01 lds r20, 0x01DA |
||
7633 | 2f1a: 20 91 db 01 lds r18, 0x01DB |
||
7634 | 2f1e: 80 91 02 01 lds r24, 0x0102 |
||
7635 | 2f22: 60 91 03 01 lds r22, 0x0103 |
||
7636 | 2f26: 61 50 subi r22, 0x01 ; 1 |
||
7637 | 2f28: 0b ce rjmp .-1002 ; 0x2b40 <osd_ncmode_minimal+0x13c> |
||
7638 | write_gps_pos(15, line, naviData.CurrentPosition.Latitude); |
||
7639 | } else if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { // if no stats there is space horizon |
||
7640 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7641 | draw_artificial_horizon(top_line + 2, bottom_line - 2, naviData.AngleNick, naviData.AngleRoll); |
||
7642 | } else { |
||
7643 | draw_artificial_horizon(top_line + 2, bottom_line - 1, naviData.AngleNick, naviData.AngleRoll); |
||
7644 | 2f2a: 40 91 da 01 lds r20, 0x01DA |
||
7645 | 2f2e: 20 91 db 01 lds r18, 0x01DB |
||
7646 | 2f32: 80 91 02 01 lds r24, 0x0102 |
||
7647 | 2f36: 60 91 03 01 lds r22, 0x0103 |
||
7648 | 2f3a: 61 50 subi r22, 0x01 ; 1 |
||
7649 | 2f3c: 11 cf rjmp .-478 ; 0x2d60 <osd_ncmode_minimal+0x35c> |
||
7650 | COSD_FLAGS_RUNTIME |= COSD_WASFLYING; |
||
7651 | } else { |
||
7652 | // stats |
||
7653 | if ((COSD_FLAGS_RUNTIME & COSD_WASFLYING) && (COSD_FLAGS_MODES & COSD_FLAG_STATS)) { |
||
7654 | uint8_t line = 3; |
||
7655 | write_ascii_string_pgm(2, line, (const char *) (pgm_read_word(&(stats_item_pointers[0])))); // max Altitude |
||
7656 | 2f3e: e0 ee ldi r30, 0xE0 ; 224 |
||
7657 | 2f40: f0 e0 ldi r31, 0x00 ; 0 |
||
7658 | 2f42: 45 91 lpm r20, Z+ |
||
7659 | 2f44: 54 91 lpm r21, Z+ |
||
7660 | 2f46: 82 e0 ldi r24, 0x02 ; 2 |
||
7661 | 2f48: 63 e0 ldi r22, 0x03 ; 3 |
||
7662 | 2f4a: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7663 | write_ndigit_number_s(18, line, max_Altimeter / 30, 4, 0); |
||
7664 | 2f4e: 80 91 1f 01 lds r24, 0x011F |
||
7665 | 2f52: 90 91 20 01 lds r25, 0x0120 |
||
7666 | 2f56: 6e e1 ldi r22, 0x1E ; 30 |
||
7667 | 2f58: 70 e0 ldi r23, 0x00 ; 0 |
||
7668 | 2f5a: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7669 | 2f5e: ab 01 movw r20, r22 |
||
7670 | 2f60: 82 e1 ldi r24, 0x12 ; 18 |
||
7671 | 2f62: 63 e0 ldi r22, 0x03 ; 3 |
||
7672 | 2f64: 24 e0 ldi r18, 0x04 ; 4 |
||
7673 | 2f66: 30 e0 ldi r19, 0x00 ; 0 |
||
7674 | 2f68: 00 e0 ldi r16, 0x00 ; 0 |
||
7675 | 2f6a: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
7676 | write_char_xy(22, line, 204); // small meters m |
||
7677 | 2f6e: 86 e1 ldi r24, 0x16 ; 22 |
||
7678 | 2f70: 63 e0 ldi r22, 0x03 ; 3 |
||
7679 | 2f72: 4c ec ldi r20, 0xCC ; 204 |
||
7680 | 2f74: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7681 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[1])))); // max Speed |
||
7682 | 2f78: e2 ee ldi r30, 0xE2 ; 226 |
||
7683 | 2f7a: f0 e0 ldi r31, 0x00 ; 0 |
||
7684 | 2f7c: 45 91 lpm r20, Z+ |
||
7685 | 2f7e: 54 91 lpm r21, Z+ |
||
7686 | 2f80: 82 e0 ldi r24, 0x02 ; 2 |
||
7687 | 2f82: 64 e0 ldi r22, 0x04 ; 4 |
||
7688 | 2f84: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7689 | write_ndigit_number_u(19, line, (uint16_t) (((uint32_t) max_GroundSpeed * (uint32_t) 9) / (uint32_t) 250), 3, 0); |
||
7690 | 2f88: 20 91 21 01 lds r18, 0x0121 |
||
7691 | 2f8c: 30 91 22 01 lds r19, 0x0122 |
||
7692 | 2f90: 40 e0 ldi r20, 0x00 ; 0 |
||
7693 | 2f92: 50 e0 ldi r21, 0x00 ; 0 |
||
7694 | 2f94: ca 01 movw r24, r20 |
||
7695 | 2f96: b9 01 movw r22, r18 |
||
7696 | 2f98: 66 0f add r22, r22 |
||
7697 | 2f9a: 77 1f adc r23, r23 |
||
7698 | 2f9c: 88 1f adc r24, r24 |
||
7699 | 2f9e: 99 1f adc r25, r25 |
||
7700 | 2fa0: 66 0f add r22, r22 |
||
7701 | 2fa2: 77 1f adc r23, r23 |
||
7702 | 2fa4: 88 1f adc r24, r24 |
||
7703 | 2fa6: 99 1f adc r25, r25 |
||
7704 | 2fa8: 66 0f add r22, r22 |
||
7705 | 2faa: 77 1f adc r23, r23 |
||
7706 | 2fac: 88 1f adc r24, r24 |
||
7707 | 2fae: 99 1f adc r25, r25 |
||
7708 | 2fb0: 62 0f add r22, r18 |
||
7709 | 2fb2: 73 1f adc r23, r19 |
||
7710 | 2fb4: 84 1f adc r24, r20 |
||
7711 | 2fb6: 95 1f adc r25, r21 |
||
7712 | 2fb8: 2a ef ldi r18, 0xFA ; 250 |
||
7713 | 2fba: 30 e0 ldi r19, 0x00 ; 0 |
||
7714 | 2fbc: 40 e0 ldi r20, 0x00 ; 0 |
||
7715 | 2fbe: 50 e0 ldi r21, 0x00 ; 0 |
||
7716 | 2fc0: 0e 94 8f 1c call 0x391e ; 0x391e <__udivmodsi4> |
||
7717 | 2fc4: 83 e1 ldi r24, 0x13 ; 19 |
||
7718 | 2fc6: 64 e0 ldi r22, 0x04 ; 4 |
||
7719 | 2fc8: a9 01 movw r20, r18 |
||
7720 | 2fca: 23 e0 ldi r18, 0x03 ; 3 |
||
7721 | 2fcc: 30 e0 ldi r19, 0x00 ; 0 |
||
7722 | 2fce: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
7723 | write_char_xy(22, line, 203); // km/h |
||
7724 | 2fd2: 86 e1 ldi r24, 0x16 ; 22 |
||
7725 | 2fd4: 64 e0 ldi r22, 0x04 ; 4 |
||
7726 | 2fd6: 4b ec ldi r20, 0xCB ; 203 |
||
7727 | 2fd8: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7728 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[2])))); // max Distance |
||
7729 | 2fdc: e4 ee ldi r30, 0xE4 ; 228 |
||
7730 | 2fde: f0 e0 ldi r31, 0x00 ; 0 |
||
7731 | 2fe0: 45 91 lpm r20, Z+ |
||
7732 | 2fe2: 54 91 lpm r21, Z+ |
||
7733 | 2fe4: 82 e0 ldi r24, 0x02 ; 2 |
||
7734 | 2fe6: 65 e0 ldi r22, 0x05 ; 5 |
||
7735 | 2fe8: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7736 | write_ndigit_number_u(19, line, max_Distance / 10, 3, 0); |
||
7737 | 2fec: 80 91 23 01 lds r24, 0x0123 |
||
7738 | 2ff0: 90 91 24 01 lds r25, 0x0124 |
||
7739 | 2ff4: 6a e0 ldi r22, 0x0A ; 10 |
||
7740 | 2ff6: 70 e0 ldi r23, 0x00 ; 0 |
||
7741 | 2ff8: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7742 | 2ffc: ab 01 movw r20, r22 |
||
7743 | 2ffe: 83 e1 ldi r24, 0x13 ; 19 |
||
7744 | 3000: 65 e0 ldi r22, 0x05 ; 5 |
||
7745 | 3002: 23 e0 ldi r18, 0x03 ; 3 |
||
7746 | 3004: 30 e0 ldi r19, 0x00 ; 0 |
||
7747 | 3006: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
7748 | write_char_xy(22, line, 204); // small meters m |
||
7749 | 300a: 86 e1 ldi r24, 0x16 ; 22 |
||
7750 | 300c: 65 e0 ldi r22, 0x05 ; 5 |
||
7751 | 300e: 4c ec ldi r20, 0xCC ; 204 |
||
7752 | 3010: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7753 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
||
7754 | 3014: e6 ee ldi r30, 0xE6 ; 230 |
||
7755 | 3016: f0 e0 ldi r31, 0x00 ; 0 |
||
7756 | 3018: 45 91 lpm r20, Z+ |
||
7757 | 301a: 54 91 lpm r21, Z+ |
||
7758 | 301c: 82 e0 ldi r24, 0x02 ; 2 |
||
7759 | 301e: 66 e0 ldi r22, 0x06 ; 6 |
||
7760 | 3020: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7761 | write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
||
7762 | 3024: 40 91 04 01 lds r20, 0x0104 |
||
7763 | 3028: 82 e1 ldi r24, 0x12 ; 18 |
||
7764 | 302a: 66 e0 ldi r22, 0x06 ; 6 |
||
7765 | 302c: 50 e0 ldi r21, 0x00 ; 0 |
||
7766 | 302e: 23 e0 ldi r18, 0x03 ; 3 |
||
7767 | 3030: 30 e0 ldi r19, 0x00 ; 0 |
||
7768 | 3032: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
7769 | write_char_xy(22, line, 0x9E); // small V |
||
7770 | 3036: 86 e1 ldi r24, 0x16 ; 22 |
||
7771 | 3038: 66 e0 ldi r22, 0x06 ; 6 |
||
7772 | 303a: 4e e9 ldi r20, 0x9E ; 158 |
||
7773 | 303c: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7774 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7775 | 3040: 80 91 1d 01 lds r24, 0x011D |
||
7776 | 3044: 80 fd sbrc r24, 0 |
||
7777 | 3046: 44 c0 rjmp .+136 ; 0x30d0 <osd_ncmode_minimal+0x6cc> |
||
7778 | 3048: 17 e0 ldi r17, 0x07 ; 7 |
||
7779 | 304a: 08 e0 ldi r16, 0x08 ; 8 |
||
7780 | 304c: 99 e0 ldi r25, 0x09 ; 9 |
||
7781 | 304e: f9 2e mov r15, r25 |
||
7782 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
||
7783 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
||
7784 | write_char_xy(22, line, 0x9F); // small A |
||
7785 | } |
||
7786 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[4])))); // max time |
||
7787 | 3050: e8 ee ldi r30, 0xE8 ; 232 |
||
7788 | 3052: f0 e0 ldi r31, 0x00 ; 0 |
||
7789 | 3054: 45 91 lpm r20, Z+ |
||
7790 | 3056: 54 91 lpm r21, Z+ |
||
7791 | 3058: 82 e0 ldi r24, 0x02 ; 2 |
||
7792 | 305a: 61 2f mov r22, r17 |
||
7793 | 305c: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7794 | write_time(16, line, max_FlyingTime); |
||
7795 | 3060: 40 91 25 01 lds r20, 0x0125 |
||
7796 | 3064: 50 91 26 01 lds r21, 0x0126 |
||
7797 | 3068: 80 e1 ldi r24, 0x10 ; 16 |
||
7798 | 306a: 61 2f mov r22, r17 |
||
7799 | 306c: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
7800 | write_char_xy(22, line, 210); // fly clock |
||
7801 | 3070: 86 e1 ldi r24, 0x16 ; 22 |
||
7802 | 3072: 61 2f mov r22, r17 |
||
7803 | 3074: 42 ed ldi r20, 0xD2 ; 210 |
||
7804 | 3076: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7805 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[5])))); // longitude |
||
7806 | 307a: ea ee ldi r30, 0xEA ; 234 |
||
7807 | 307c: f0 e0 ldi r31, 0x00 ; 0 |
||
7808 | 307e: 45 91 lpm r20, Z+ |
||
7809 | 3080: 54 91 lpm r21, Z+ |
||
7810 | 3082: 82 e0 ldi r24, 0x02 ; 2 |
||
7811 | 3084: 60 2f mov r22, r16 |
||
7812 | 3086: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7813 | write_gps_pos(15, line, naviData.CurrentPosition.Longitude); |
||
7814 | 308a: 20 91 9b 01 lds r18, 0x019B |
||
7815 | 308e: 30 91 9c 01 lds r19, 0x019C |
||
7816 | 3092: 40 91 9d 01 lds r20, 0x019D |
||
7817 | 3096: 50 91 9e 01 lds r21, 0x019E |
||
7818 | 309a: 8f e0 ldi r24, 0x0F ; 15 |
||
7819 | 309c: 60 2f mov r22, r16 |
||
7820 | 309e: 0e 94 bd 07 call 0xf7a ; 0xf7a <write_gps_pos> |
||
7821 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[6])))); // latitude |
||
7822 | 30a2: ec ee ldi r30, 0xEC ; 236 |
||
7823 | 30a4: f0 e0 ldi r31, 0x00 ; 0 |
||
7824 | 30a6: 45 91 lpm r20, Z+ |
||
7825 | 30a8: 54 91 lpm r21, Z+ |
||
7826 | 30aa: 82 e0 ldi r24, 0x02 ; 2 |
||
7827 | 30ac: 6f 2d mov r22, r15 |
||
7828 | 30ae: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7829 | write_gps_pos(15, line, naviData.CurrentPosition.Latitude); |
||
7830 | 30b2: 20 91 9f 01 lds r18, 0x019F |
||
7831 | 30b6: 30 91 a0 01 lds r19, 0x01A0 |
||
7832 | 30ba: 40 91 a1 01 lds r20, 0x01A1 |
||
7833 | 30be: 50 91 a2 01 lds r21, 0x01A2 |
||
7834 | 30c2: 8f e0 ldi r24, 0x0F ; 15 |
||
7835 | 30c4: 6f 2d mov r22, r15 |
||
7836 | 30c6: 0e 94 bd 07 call 0xf7a ; 0xf7a <write_gps_pos> |
||
7837 | 30ca: 90 91 1b 01 lds r25, 0x011B |
||
7838 | 30ce: 48 cd rjmp .-1392 ; 0x2b60 <osd_ncmode_minimal+0x15c> |
||
7839 | write_char_xy(22, line, 204); // small meters m |
||
7840 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[3])))); // min voltage |
||
7841 | write_ndigit_number_u_10th(18, line, min_UBat, 3, 0); |
||
7842 | write_char_xy(22, line, 0x9E); // small V |
||
7843 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7844 | write_ascii_string_pgm(2, ++line, (const char *) (pgm_read_word(&(stats_item_pointers[7])))); // ampere |
||
7845 | 30d0: ee ee ldi r30, 0xEE ; 238 |
||
7846 | 30d2: f0 e0 ldi r31, 0x00 ; 0 |
||
7847 | 30d4: 45 91 lpm r20, Z+ |
||
7848 | 30d6: 54 91 lpm r21, Z+ |
||
7849 | 30d8: 82 e0 ldi r24, 0x02 ; 2 |
||
7850 | 30da: 67 e0 ldi r22, 0x07 ; 7 |
||
7851 | 30dc: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
7852 | write_ndigit_number_u_10th(18, line, max_ampere / 10, 3, 0); |
||
7853 | 30e0: 80 91 39 01 lds r24, 0x0139 |
||
7854 | 30e4: 90 91 3a 01 lds r25, 0x013A |
||
7855 | 30e8: 6a e0 ldi r22, 0x0A ; 10 |
||
7856 | 30ea: 70 e0 ldi r23, 0x00 ; 0 |
||
7857 | 30ec: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
7858 | 30f0: ab 01 movw r20, r22 |
||
7859 | 30f2: 82 e1 ldi r24, 0x12 ; 18 |
||
7860 | 30f4: 67 e0 ldi r22, 0x07 ; 7 |
||
7861 | 30f6: 23 e0 ldi r18, 0x03 ; 3 |
||
7862 | 30f8: 30 e0 ldi r19, 0x00 ; 0 |
||
7863 | 30fa: 00 e0 ldi r16, 0x00 ; 0 |
||
7864 | 30fc: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
7865 | write_char_xy(22, line, 0x9F); // small A |
||
7866 | 3100: 86 e1 ldi r24, 0x16 ; 22 |
||
7867 | 3102: 67 e0 ldi r22, 0x07 ; 7 |
||
7868 | 3104: 4f e9 ldi r20, 0x9F ; 159 |
||
7869 | 3106: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
7870 | 310a: 18 e0 ldi r17, 0x08 ; 8 |
||
7871 | 310c: 09 e0 ldi r16, 0x09 ; 9 |
||
7872 | 310e: 8a e0 ldi r24, 0x0A ; 10 |
||
7873 | 3110: f8 2e mov r15, r24 |
||
7874 | 3112: 9e cf rjmp .-196 ; 0x3050 <osd_ncmode_minimal+0x64c> |
||
7875 | |||
7876 | 00003114 <osd_fcmode_default>: |
||
7877 | #include "osd_helpers.h" |
||
7878 | #include "osd_fcmode_default.h" |
||
7879 | |||
7880 | #if !(ALLCHARSDEBUG|(WRITECHARS != -1)) |
||
7881 | |||
7882 | int osd_fcmode_default() { |
||
7883 | 3114: 0f 93 push r16 |
||
7884 | 3116: 1f 93 push r17 |
||
7885 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
7886 | 3118: 80 91 1b 01 lds r24, 0x011B |
||
7887 | 311c: 80 ff sbrs r24, 0 |
||
7888 | 311e: b7 c0 rjmp .+366 ; 0x328e <osd_fcmode_default+0x17a> |
||
7889 | // write icons at init or after menu/mode-switch |
||
7890 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
7891 | 3120: 80 91 1d 01 lds r24, 0x011D |
||
7892 | 3124: 81 ff sbrs r24, 1 |
||
7893 | 3126: d6 c0 rjmp .+428 ; 0x32d4 <osd_fcmode_default+0x1c0> |
||
7894 | } |
||
7895 | } |
||
7896 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
7897 | } |
||
7898 | |||
7899 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
7900 | 3128: 40 91 5f 01 lds r20, 0x015F |
||
7901 | 312c: 50 91 60 01 lds r21, 0x0160 |
||
7902 | 3130: 87 e0 ldi r24, 0x07 ; 7 |
||
7903 | 3132: 60 91 02 01 lds r22, 0x0102 |
||
7904 | 3136: 23 e0 ldi r18, 0x03 ; 3 |
||
7905 | 3138: 30 e0 ldi r19, 0x00 ; 0 |
||
7906 | 313a: 00 e0 ldi r16, 0x00 ; 0 |
||
7907 | 313c: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
7908 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
7909 | 3140: 80 91 5f 01 lds r24, 0x015F |
||
7910 | 3144: 90 91 60 01 lds r25, 0x0160 |
||
7911 | 3148: 85 36 cpi r24, 0x65 ; 101 |
||
7912 | 314a: 91 05 cpc r25, r1 |
||
7913 | 314c: 08 f4 brcc .+2 ; 0x3150 <osd_fcmode_default+0x3c> |
||
7914 | 314e: b2 c0 rjmp .+356 ; 0x32b4 <osd_fcmode_default+0x1a0> |
||
7915 | for (uint8_t x = 0; x < 4; x++) |
||
7916 | write_char_att_xy(7 + x, top_line, BLINK); |
||
7917 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
7918 | 3150: 80 91 5f 01 lds r24, 0x015F |
||
7919 | 3154: 90 91 60 01 lds r25, 0x0160 |
||
7920 | 3158: 85 36 cpi r24, 0x65 ; 101 |
||
7921 | 315a: 91 05 cpc r25, r1 |
||
7922 | 315c: 28 f0 brcs .+10 ; 0x3168 <osd_fcmode_default+0x54> |
||
7923 | 315e: 80 91 01 01 lds r24, 0x0101 |
||
7924 | 3162: 85 36 cpi r24, 0x65 ; 101 |
||
7925 | 3164: 08 f4 brcc .+2 ; 0x3168 <osd_fcmode_default+0x54> |
||
7926 | 3166: f5 c0 rjmp .+490 ; 0x3352 <osd_fcmode_default+0x23e> |
||
7927 | for (uint8_t x = 0; x < 4; x++) |
||
7928 | write_char_att_xy(7 + x, top_line, 0); |
||
7929 | } |
||
7930 | |||
7931 | if (debugData.Analog[5] > 300 || debugData.Analog[5] < -300) { |
||
7932 | 3168: 80 91 55 01 lds r24, 0x0155 |
||
7933 | 316c: 90 91 56 01 lds r25, 0x0156 |
||
7934 | 3170: 8d 52 subi r24, 0x2D ; 45 |
||
7935 | 3172: 91 40 sbci r25, 0x01 ; 1 |
||
7936 | 3174: 40 f4 brcc .+16 ; 0x3186 <osd_fcmode_default+0x72> |
||
7937 | 3176: 80 91 55 01 lds r24, 0x0155 |
||
7938 | 317a: 90 91 56 01 lds r25, 0x0156 |
||
7939 | 317e: 84 5d subi r24, 0xD4 ; 212 |
||
7940 | 3180: 9e 4f sbci r25, 0xFE ; 254 |
||
7941 | 3182: 08 f0 brcs .+2 ; 0x3186 <osd_fcmode_default+0x72> |
||
7942 | 3184: 41 c1 rjmp .+642 ; 0x3408 <osd_fcmode_default+0x2f4> |
||
7943 | // above 10m only write full meters |
||
7944 | write_ndigit_number_s(23, top_line, debugData.Analog[5] / 30, 4, 0); |
||
7945 | 3186: 80 91 55 01 lds r24, 0x0155 |
||
7946 | 318a: 90 91 56 01 lds r25, 0x0156 |
||
7947 | 318e: 6e e1 ldi r22, 0x1E ; 30 |
||
7948 | 3190: 70 e0 ldi r23, 0x00 ; 0 |
||
7949 | 3192: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
7950 | 3196: ab 01 movw r20, r22 |
||
7951 | 3198: 87 e1 ldi r24, 0x17 ; 23 |
||
7952 | 319a: 60 91 02 01 lds r22, 0x0102 |
||
7953 | 319e: 24 e0 ldi r18, 0x04 ; 4 |
||
7954 | 31a0: 30 e0 ldi r19, 0x00 ; 0 |
||
7955 | 31a2: 00 e0 ldi r16, 0x00 ; 0 |
||
7956 | 31a4: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
7957 | } else { |
||
7958 | // up to 10m write meters.dm |
||
7959 | write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 3, 0); |
||
7960 | } |
||
7961 | if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5]; |
||
7962 | 31a8: 20 91 55 01 lds r18, 0x0155 |
||
7963 | 31ac: 30 91 56 01 lds r19, 0x0156 |
||
7964 | 31b0: 80 91 1f 01 lds r24, 0x011F |
||
7965 | 31b4: 90 91 20 01 lds r25, 0x0120 |
||
7966 | 31b8: 82 17 cp r24, r18 |
||
7967 | 31ba: 93 07 cpc r25, r19 |
||
7968 | 31bc: 40 f4 brcc .+16 ; 0x31ce <osd_fcmode_default+0xba> |
||
7969 | 31be: 80 91 55 01 lds r24, 0x0155 |
||
7970 | 31c2: 90 91 56 01 lds r25, 0x0156 |
||
7971 | 31c6: 90 93 20 01 sts 0x0120, r25 |
||
7972 | 31ca: 80 93 1f 01 sts 0x011F, r24 |
||
7973 | |||
7974 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
7975 | 31ce: 80 91 1b 01 lds r24, 0x011B |
||
7976 | 31d2: 81 fd sbrc r24, 1 |
||
7977 | 31d4: c9 c0 rjmp .+402 ; 0x3368 <osd_fcmode_default+0x254> |
||
7978 | draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]); |
||
7979 | } |
||
7980 | |||
7981 | // pre-bottom line |
||
7982 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
7983 | 31d6: 80 91 1d 01 lds r24, 0x011D |
||
7984 | 31da: 80 fd sbrc r24, 0 |
||
7985 | 31dc: d9 c0 rjmp .+434 ; 0x3390 <osd_fcmode_default+0x27c> |
||
7986 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
7987 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
7988 | } |
||
7989 | } |
||
7990 | |||
7991 | draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage); |
||
7992 | 31de: 20 91 5d 01 lds r18, 0x015D |
||
7993 | 31e2: 30 91 5e 01 lds r19, 0x015E |
||
7994 | 31e6: 82 e0 ldi r24, 0x02 ; 2 |
||
7995 | 31e8: 60 91 03 01 lds r22, 0x0103 |
||
7996 | 31ec: 40 91 19 01 lds r20, 0x0119 |
||
7997 | 31f0: 00 91 1a 01 lds r16, 0x011A |
||
7998 | 31f4: 0e 94 17 0a call 0x142e ; 0x142e <draw_battery> |
||
7999 | write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 3, 0); |
||
8000 | 31f8: 40 91 5d 01 lds r20, 0x015D |
||
8001 | 31fc: 50 91 5e 01 lds r21, 0x015E |
||
8002 | 3200: 83 e0 ldi r24, 0x03 ; 3 |
||
8003 | 3202: 60 91 03 01 lds r22, 0x0103 |
||
8004 | 3206: 23 e0 ldi r18, 0x03 ; 3 |
||
8005 | 3208: 30 e0 ldi r19, 0x00 ; 0 |
||
8006 | 320a: 00 e0 ldi r16, 0x00 ; 0 |
||
8007 | 320c: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
8008 | if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) { |
||
8009 | 3210: 80 91 5d 01 lds r24, 0x015D |
||
8010 | 3214: 90 91 5e 01 lds r25, 0x015E |
||
8011 | 3218: 40 91 19 01 lds r20, 0x0119 |
||
8012 | 321c: 24 2f mov r18, r20 |
||
8013 | 321e: 30 e0 ldi r19, 0x00 ; 0 |
||
8014 | 3220: 28 17 cp r18, r24 |
||
8015 | 3222: 39 07 cpc r19, r25 |
||
8016 | 3224: 28 f0 brcs .+10 ; 0x3230 <osd_fcmode_default+0x11c> |
||
8017 | 3226: 80 91 00 01 lds r24, 0x0100 |
||
8018 | 322a: 48 17 cp r20, r24 |
||
8019 | 322c: 08 f4 brcc .+2 ; 0x3230 <osd_fcmode_default+0x11c> |
||
8020 | 322e: 6c c0 rjmp .+216 ; 0x3308 <osd_fcmode_default+0x1f4> |
||
8021 | for (uint8_t x = 2; x < 8; x++) |
||
8022 | write_char_att_xy(x, bottom_line, BLINK); |
||
8023 | } else if (debugData.Analog[9] > min_voltage && last_UBat < min_voltage) { |
||
8024 | 3230: 80 91 5d 01 lds r24, 0x015D |
||
8025 | 3234: 90 91 5e 01 lds r25, 0x015E |
||
8026 | 3238: 28 17 cp r18, r24 |
||
8027 | 323a: 39 07 cpc r19, r25 |
||
8028 | 323c: 40 f5 brcc .+80 ; 0x328e <osd_fcmode_default+0x17a> |
||
8029 | 323e: 80 91 00 01 lds r24, 0x0100 |
||
8030 | 3242: 84 17 cp r24, r20 |
||
8031 | 3244: 20 f5 brcc .+72 ; 0x328e <osd_fcmode_default+0x17a> |
||
8032 | for (uint8_t x = 2; x < 8; x++) |
||
8033 | write_char_att_xy(x, bottom_line, 0); |
||
8034 | 3246: 82 e0 ldi r24, 0x02 ; 2 |
||
8035 | 3248: 60 91 03 01 lds r22, 0x0103 |
||
8036 | 324c: 40 e0 ldi r20, 0x00 ; 0 |
||
8037 | 324e: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8038 | 3252: 83 e0 ldi r24, 0x03 ; 3 |
||
8039 | 3254: 60 91 03 01 lds r22, 0x0103 |
||
8040 | 3258: 40 e0 ldi r20, 0x00 ; 0 |
||
8041 | 325a: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8042 | 325e: 84 e0 ldi r24, 0x04 ; 4 |
||
8043 | 3260: 60 91 03 01 lds r22, 0x0103 |
||
8044 | 3264: 40 e0 ldi r20, 0x00 ; 0 |
||
8045 | 3266: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8046 | 326a: 85 e0 ldi r24, 0x05 ; 5 |
||
8047 | 326c: 60 91 03 01 lds r22, 0x0103 |
||
8048 | 3270: 40 e0 ldi r20, 0x00 ; 0 |
||
8049 | 3272: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8050 | 3276: 86 e0 ldi r24, 0x06 ; 6 |
||
8051 | 3278: 60 91 03 01 lds r22, 0x0103 |
||
8052 | 327c: 40 e0 ldi r20, 0x00 ; 0 |
||
8053 | 327e: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8054 | 3282: 87 e0 ldi r24, 0x07 ; 7 |
||
8055 | 3284: 60 91 03 01 lds r22, 0x0103 |
||
8056 | 3288: 40 e0 ldi r20, 0x00 ; 0 |
||
8057 | 328a: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8058 | } |
||
8059 | } |
||
8060 | // remember last values |
||
8061 | last_UBat = debugData.Analog[9]; |
||
8062 | 328e: 80 91 5d 01 lds r24, 0x015D |
||
8063 | 3292: 90 91 5e 01 lds r25, 0x015E |
||
8064 | 3296: 80 93 00 01 sts 0x0100, r24 |
||
8065 | last_RC_Quality = debugData.Analog[10]; |
||
8066 | 329a: 80 91 5f 01 lds r24, 0x015F |
||
8067 | 329e: 90 91 60 01 lds r25, 0x0160 |
||
8068 | 32a2: 80 93 01 01 sts 0x0101, r24 |
||
8069 | debugData.Analog[5]); // Height |
||
8070 | debugData.Analog[9]); // Voltage |
||
8071 | debugData.Analog[10]);// RC Signal |
||
8072 | debugData.Analog[11]);// Gyro compass |
||
8073 | */ |
||
8074 | seconds_since_last_data = 0; |
||
8075 | 32a6: 10 92 18 01 sts 0x0118, r1 |
||
8076 | |||
8077 | return 0; |
||
8078 | } |
||
8079 | 32aa: 80 e0 ldi r24, 0x00 ; 0 |
||
8080 | 32ac: 90 e0 ldi r25, 0x00 ; 0 |
||
8081 | 32ae: 1f 91 pop r17 |
||
8082 | 32b0: 0f 91 pop r16 |
||
8083 | 32b2: 08 95 ret |
||
8084 | } |
||
8085 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8086 | } |
||
8087 | |||
8088 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8089 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8090 | 32b4: 80 91 01 01 lds r24, 0x0101 |
||
8091 | 32b8: 85 36 cpi r24, 0x65 ; 101 |
||
8092 | 32ba: 08 f4 brcc .+2 ; 0x32be <osd_fcmode_default+0x1aa> |
||
8093 | 32bc: 49 cf rjmp .-366 ; 0x3150 <osd_fcmode_default+0x3c> |
||
8094 | 32be: 17 e0 ldi r17, 0x07 ; 7 |
||
8095 | for (uint8_t x = 0; x < 4; x++) |
||
8096 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8097 | 32c0: 81 2f mov r24, r17 |
||
8098 | 32c2: 60 91 02 01 lds r22, 0x0102 |
||
8099 | 32c6: 4f e4 ldi r20, 0x4F ; 79 |
||
8100 | 32c8: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8101 | 32cc: 1f 5f subi r17, 0xFF ; 255 |
||
8102 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8103 | } |
||
8104 | |||
8105 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8106 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8107 | for (uint8_t x = 0; x < 4; x++) |
||
8108 | 32ce: 1b 30 cpi r17, 0x0B ; 11 |
||
8109 | 32d0: b9 f7 brne .-18 ; 0x32c0 <osd_fcmode_default+0x1ac> |
||
8110 | 32d2: 4a cf rjmp .-364 ; 0x3168 <osd_fcmode_default+0x54> |
||
8111 | |||
8112 | int osd_fcmode_default() { |
||
8113 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
8114 | // write icons at init or after menu/mode-switch |
||
8115 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
8116 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
||
8117 | 32d4: 8a e0 ldi r24, 0x0A ; 10 |
||
8118 | 32d6: 60 91 02 01 lds r22, 0x0102 |
||
8119 | 32da: 4a ec ldi r20, 0xCA ; 202 |
||
8120 | 32dc: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8121 | write_char_xy(27, top_line, 0xCC); // small meters m height |
||
8122 | 32e0: 8b e1 ldi r24, 0x1B ; 27 |
||
8123 | 32e2: 60 91 02 01 lds r22, 0x0102 |
||
8124 | 32e6: 4c ec ldi r20, 0xCC ; 204 |
||
8125 | 32e8: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8126 | write_char_xy(7, bottom_line, 0x9E); // small v |
||
8127 | 32ec: 87 e0 ldi r24, 0x07 ; 7 |
||
8128 | 32ee: 60 91 03 01 lds r22, 0x0103 |
||
8129 | 32f2: 4e e9 ldi r20, 0x9E ; 158 |
||
8130 | 32f4: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8131 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8132 | 32f8: 80 91 1d 01 lds r24, 0x011D |
||
8133 | 32fc: 80 fd sbrc r24, 0 |
||
8134 | 32fe: 96 c0 rjmp .+300 ; 0x342c <osd_fcmode_default+0x318> |
||
8135 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
||
8136 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
8137 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
||
8138 | } |
||
8139 | } |
||
8140 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8141 | 3300: 82 60 ori r24, 0x02 ; 2 |
||
8142 | 3302: 80 93 1d 01 sts 0x011D, r24 |
||
8143 | 3306: 10 cf rjmp .-480 ; 0x3128 <osd_fcmode_default+0x14> |
||
8144 | |||
8145 | draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage); |
||
8146 | write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 3, 0); |
||
8147 | if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) { |
||
8148 | for (uint8_t x = 2; x < 8; x++) |
||
8149 | write_char_att_xy(x, bottom_line, BLINK); |
||
8150 | 3308: 82 e0 ldi r24, 0x02 ; 2 |
||
8151 | 330a: 60 91 03 01 lds r22, 0x0103 |
||
8152 | 330e: 4f e4 ldi r20, 0x4F ; 79 |
||
8153 | 3310: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8154 | 3314: 83 e0 ldi r24, 0x03 ; 3 |
||
8155 | 3316: 60 91 03 01 lds r22, 0x0103 |
||
8156 | 331a: 4f e4 ldi r20, 0x4F ; 79 |
||
8157 | 331c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8158 | 3320: 84 e0 ldi r24, 0x04 ; 4 |
||
8159 | 3322: 60 91 03 01 lds r22, 0x0103 |
||
8160 | 3326: 4f e4 ldi r20, 0x4F ; 79 |
||
8161 | 3328: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8162 | 332c: 85 e0 ldi r24, 0x05 ; 5 |
||
8163 | 332e: 60 91 03 01 lds r22, 0x0103 |
||
8164 | 3332: 4f e4 ldi r20, 0x4F ; 79 |
||
8165 | 3334: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8166 | 3338: 86 e0 ldi r24, 0x06 ; 6 |
||
8167 | 333a: 60 91 03 01 lds r22, 0x0103 |
||
8168 | 333e: 4f e4 ldi r20, 0x4F ; 79 |
||
8169 | 3340: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8170 | 3344: 87 e0 ldi r24, 0x07 ; 7 |
||
8171 | 3346: 60 91 03 01 lds r22, 0x0103 |
||
8172 | 334a: 4f e4 ldi r20, 0x4F ; 79 |
||
8173 | 334c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8174 | 3350: 9e cf rjmp .-196 ; 0x328e <osd_fcmode_default+0x17a> |
||
8175 | |||
8176 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8177 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8178 | for (uint8_t x = 0; x < 4; x++) |
||
8179 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8180 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
8181 | 3352: 17 e0 ldi r17, 0x07 ; 7 |
||
8182 | for (uint8_t x = 0; x < 4; x++) |
||
8183 | write_char_att_xy(7 + x, top_line, 0); |
||
8184 | 3354: 81 2f mov r24, r17 |
||
8185 | 3356: 60 91 02 01 lds r22, 0x0102 |
||
8186 | 335a: 40 e0 ldi r20, 0x00 ; 0 |
||
8187 | 335c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8188 | 3360: 1f 5f subi r17, 0xFF ; 255 |
||
8189 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8190 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8191 | for (uint8_t x = 0; x < 4; x++) |
||
8192 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8193 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
8194 | for (uint8_t x = 0; x < 4; x++) |
||
8195 | 3362: 1b 30 cpi r17, 0x0B ; 11 |
||
8196 | 3364: b9 f7 brne .-18 ; 0x3354 <osd_fcmode_default+0x240> |
||
8197 | 3366: 00 cf rjmp .-512 ; 0x3168 <osd_fcmode_default+0x54> |
||
8198 | write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 3, 0); |
||
8199 | } |
||
8200 | if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5]; |
||
8201 | |||
8202 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
8203 | draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]); |
||
8204 | 3368: 40 91 4b 01 lds r20, 0x014B |
||
8205 | 336c: 50 91 4c 01 lds r21, 0x014C |
||
8206 | 3370: 20 91 4d 01 lds r18, 0x014D |
||
8207 | 3374: 30 91 4e 01 lds r19, 0x014E |
||
8208 | 3378: 80 91 02 01 lds r24, 0x0102 |
||
8209 | 337c: 60 91 03 01 lds r22, 0x0103 |
||
8210 | 3380: 61 50 subi r22, 0x01 ; 1 |
||
8211 | 3382: 8e 5f subi r24, 0xFE ; 254 |
||
8212 | 3384: 0e 94 e6 08 call 0x11cc ; 0x11cc <draw_artificial_horizon> |
||
8213 | } |
||
8214 | |||
8215 | // pre-bottom line |
||
8216 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8217 | 3388: 80 91 1d 01 lds r24, 0x011D |
||
8218 | 338c: 80 ff sbrs r24, 0 |
||
8219 | 338e: 27 cf rjmp .-434 ; 0x31de <osd_fcmode_default+0xca> |
||
8220 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
||
8221 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
||
8222 | 3390: 20 91 03 01 lds r18, 0x0103 |
||
8223 | 3394: 21 50 subi r18, 0x01 ; 1 |
||
8224 | 3396: 80 91 37 01 lds r24, 0x0137 |
||
8225 | 339a: 90 91 38 01 lds r25, 0x0138 |
||
8226 | 339e: 6a e0 ldi r22, 0x0A ; 10 |
||
8227 | 33a0: 70 e0 ldi r23, 0x00 ; 0 |
||
8228 | 33a2: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
8229 | 33a6: ab 01 movw r20, r22 |
||
8230 | 33a8: 83 e0 ldi r24, 0x03 ; 3 |
||
8231 | 33aa: 62 2f mov r22, r18 |
||
8232 | 33ac: 23 e0 ldi r18, 0x03 ; 3 |
||
8233 | 33ae: 30 e0 ldi r19, 0x00 ; 0 |
||
8234 | 33b0: 00 e0 ldi r16, 0x00 ; 0 |
||
8235 | 33b2: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
8236 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
8237 | 33b6: 10 91 03 01 lds r17, 0x0103 |
||
8238 | 33ba: 11 50 subi r17, 0x01 ; 1 |
||
8239 | 33bc: 60 91 3b 01 lds r22, 0x013B |
||
8240 | 33c0: 70 91 3c 01 lds r23, 0x013C |
||
8241 | 33c4: 80 91 3d 01 lds r24, 0x013D |
||
8242 | 33c8: 90 91 3e 01 lds r25, 0x013E |
||
8243 | 33cc: 2a e0 ldi r18, 0x0A ; 10 |
||
8244 | 33ce: 30 e0 ldi r19, 0x00 ; 0 |
||
8245 | 33d0: 40 e0 ldi r20, 0x00 ; 0 |
||
8246 | 33d2: 50 e0 ldi r21, 0x00 ; 0 |
||
8247 | 33d4: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
8248 | 33d8: 8a e0 ldi r24, 0x0A ; 10 |
||
8249 | 33da: 61 2f mov r22, r17 |
||
8250 | 33dc: a9 01 movw r20, r18 |
||
8251 | 33de: 24 e0 ldi r18, 0x04 ; 4 |
||
8252 | 33e0: 30 e0 ldi r19, 0x00 ; 0 |
||
8253 | 33e2: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
8254 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
8255 | 33e6: 80 91 1b 01 lds r24, 0x011B |
||
8256 | 33ea: 85 ff sbrs r24, 5 |
||
8257 | 33ec: f8 ce rjmp .-528 ; 0x31de <osd_fcmode_default+0xca> |
||
8258 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
8259 | 33ee: 60 91 03 01 lds r22, 0x0103 |
||
8260 | 33f2: 61 50 subi r22, 0x01 ; 1 |
||
8261 | 33f4: 40 91 9f 02 lds r20, 0x029F |
||
8262 | 33f8: 50 91 a0 02 lds r21, 0x02A0 |
||
8263 | 33fc: 81 e1 ldi r24, 0x11 ; 17 |
||
8264 | 33fe: 23 e0 ldi r18, 0x03 ; 3 |
||
8265 | 3400: 30 e0 ldi r19, 0x00 ; 0 |
||
8266 | 3402: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
8267 | 3406: eb ce rjmp .-554 ; 0x31de <osd_fcmode_default+0xca> |
||
8268 | if (debugData.Analog[5] > 300 || debugData.Analog[5] < -300) { |
||
8269 | // above 10m only write full meters |
||
8270 | write_ndigit_number_s(23, top_line, debugData.Analog[5] / 30, 4, 0); |
||
8271 | } else { |
||
8272 | // up to 10m write meters.dm |
||
8273 | write_ndigit_number_s_10th(23, top_line, debugData.Analog[5] / 3, 3, 0); |
||
8274 | 3408: 80 91 55 01 lds r24, 0x0155 |
||
8275 | 340c: 90 91 56 01 lds r25, 0x0156 |
||
8276 | 3410: 63 e0 ldi r22, 0x03 ; 3 |
||
8277 | 3412: 70 e0 ldi r23, 0x00 ; 0 |
||
8278 | 3414: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
8279 | 3418: ab 01 movw r20, r22 |
||
8280 | 341a: 87 e1 ldi r24, 0x17 ; 23 |
||
8281 | 341c: 60 91 02 01 lds r22, 0x0102 |
||
8282 | 3420: 23 e0 ldi r18, 0x03 ; 3 |
||
8283 | 3422: 30 e0 ldi r19, 0x00 ; 0 |
||
8284 | 3424: 00 e0 ldi r16, 0x00 ; 0 |
||
8285 | 3426: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
8286 | 342a: be ce rjmp .-644 ; 0x31a8 <osd_fcmode_default+0x94> |
||
8287 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
8288 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
||
8289 | write_char_xy(27, top_line, 0xCC); // small meters m height |
||
8290 | write_char_xy(7, bottom_line, 0x9E); // small v |
||
8291 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8292 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
||
8293 | 342c: 60 91 03 01 lds r22, 0x0103 |
||
8294 | 3430: 61 50 subi r22, 0x01 ; 1 |
||
8295 | 3432: 87 e0 ldi r24, 0x07 ; 7 |
||
8296 | 3434: 4f e9 ldi r20, 0x9F ; 159 |
||
8297 | 3436: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8298 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
||
8299 | 343a: 60 91 03 01 lds r22, 0x0103 |
||
8300 | 343e: 61 50 subi r22, 0x01 ; 1 |
||
8301 | 3440: 8e e0 ldi r24, 0x0E ; 14 |
||
8302 | 3442: 45 eb ldi r20, 0xB5 ; 181 |
||
8303 | 3444: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8304 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
8305 | 3448: 80 91 1b 01 lds r24, 0x011B |
||
8306 | 344c: 85 fd sbrc r24, 5 |
||
8307 | 344e: 03 c0 rjmp .+6 ; 0x3456 <osd_fcmode_default+0x342> |
||
8308 | 3450: 80 91 1d 01 lds r24, 0x011D |
||
8309 | 3454: 55 cf rjmp .-342 ; 0x3300 <osd_fcmode_default+0x1ec> |
||
8310 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
||
8311 | 3456: 60 91 03 01 lds r22, 0x0103 |
||
8312 | 345a: 61 50 subi r22, 0x01 ; 1 |
||
8313 | 345c: 85 e1 ldi r24, 0x15 ; 21 |
||
8314 | 345e: 4e e9 ldi r20, 0x9E ; 158 |
||
8315 | 3460: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8316 | 3464: f5 cf rjmp .-22 ; 0x3450 <osd_fcmode_default+0x33c> |
||
8317 | |||
8318 | 00003466 <osd_fcmode_jopl>: |
||
8319 | |||
8320 | // jopl Vario |
||
8321 | static int16_t last_Altimeter = 0; |
||
8322 | static int16_t Vario = 0; |
||
8323 | |||
8324 | int osd_fcmode_jopl() { |
||
8325 | 3466: 0f 93 push r16 |
||
8326 | 3468: 1f 93 push r17 |
||
8327 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
8328 | 346a: 80 91 1b 01 lds r24, 0x011B |
||
8329 | 346e: 80 ff sbrs r24, 0 |
||
8330 | 3470: 10 c1 rjmp .+544 ; 0x3692 <osd_fcmode_jopl+0x22c> |
||
8331 | // write icons at init or after menu/mode-switch |
||
8332 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
8333 | 3472: 80 91 1d 01 lds r24, 0x011D |
||
8334 | 3476: 81 ff sbrs r24, 1 |
||
8335 | 3478: 2f c1 rjmp .+606 ; 0x36d8 <osd_fcmode_jopl+0x272> |
||
8336 | // end jopl |
||
8337 | |||
8338 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8339 | } |
||
8340 | |||
8341 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8342 | 347a: 40 91 5f 01 lds r20, 0x015F |
||
8343 | 347e: 50 91 60 01 lds r21, 0x0160 |
||
8344 | 3482: 87 e0 ldi r24, 0x07 ; 7 |
||
8345 | 3484: 60 91 02 01 lds r22, 0x0102 |
||
8346 | 3488: 23 e0 ldi r18, 0x03 ; 3 |
||
8347 | 348a: 30 e0 ldi r19, 0x00 ; 0 |
||
8348 | 348c: 00 e0 ldi r16, 0x00 ; 0 |
||
8349 | 348e: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
8350 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8351 | 3492: 80 91 5f 01 lds r24, 0x015F |
||
8352 | 3496: 90 91 60 01 lds r25, 0x0160 |
||
8353 | 349a: 85 36 cpi r24, 0x65 ; 101 |
||
8354 | 349c: 91 05 cpc r25, r1 |
||
8355 | 349e: 08 f4 brcc .+2 ; 0x34a2 <osd_fcmode_jopl+0x3c> |
||
8356 | 34a0: 0b c1 rjmp .+534 ; 0x36b8 <osd_fcmode_jopl+0x252> |
||
8357 | for (uint8_t x = 0; x < 4; x++) |
||
8358 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8359 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
8360 | 34a2: 80 91 5f 01 lds r24, 0x015F |
||
8361 | 34a6: 90 91 60 01 lds r25, 0x0160 |
||
8362 | 34aa: 85 36 cpi r24, 0x65 ; 101 |
||
8363 | 34ac: 91 05 cpc r25, r1 |
||
8364 | 34ae: 28 f0 brcs .+10 ; 0x34ba <osd_fcmode_jopl+0x54> |
||
8365 | 34b0: 80 91 01 01 lds r24, 0x0101 |
||
8366 | 34b4: 85 36 cpi r24, 0x65 ; 101 |
||
8367 | 34b6: 08 f4 brcc .+2 ; 0x34ba <osd_fcmode_jopl+0x54> |
||
8368 | 34b8: 62 c1 rjmp .+708 ; 0x377e <osd_fcmode_jopl+0x318> |
||
8369 | for (uint8_t x = 0; x < 4; x++) |
||
8370 | write_char_att_xy(7 + x, top_line, 0); |
||
8371 | } |
||
8372 | |||
8373 | // jopl ... compass |
||
8374 | write_ndigit_number_u(13, top_line, debugData.Analog[8], 3, 0); |
||
8375 | 34ba: 40 91 5b 01 lds r20, 0x015B |
||
8376 | 34be: 50 91 5c 01 lds r21, 0x015C |
||
8377 | 34c2: 8d e0 ldi r24, 0x0D ; 13 |
||
8378 | 34c4: 60 91 02 01 lds r22, 0x0102 |
||
8379 | 34c8: 23 e0 ldi r18, 0x03 ; 3 |
||
8380 | 34ca: 30 e0 ldi r19, 0x00 ; 0 |
||
8381 | 34cc: 00 e0 ldi r16, 0x00 ; 0 |
||
8382 | 34ce: 0e 94 6b 07 call 0xed6 ; 0xed6 <write_ndigit_number_u> |
||
8383 | write_ascii_string_pgm(17, top_line, (const char *) (pgm_read_word(&(directions[heading_conv(debugData.Analog[8])])))); |
||
8384 | 34d2: 10 91 02 01 lds r17, 0x0102 |
||
8385 | 34d6: 80 91 5b 01 lds r24, 0x015B |
||
8386 | 34da: 90 91 5c 01 lds r25, 0x015C |
||
8387 | 34de: 0e 94 9d 08 call 0x113a ; 0x113a <heading_conv> |
||
8388 | 34e2: e8 2f mov r30, r24 |
||
8389 | 34e4: f0 e0 ldi r31, 0x00 ; 0 |
||
8390 | 34e6: ee 0f add r30, r30 |
||
8391 | 34e8: ff 1f adc r31, r31 |
||
8392 | 34ea: e8 5f subi r30, 0xF8 ; 248 |
||
8393 | 34ec: fe 4f sbci r31, 0xFE ; 254 |
||
8394 | 34ee: 45 91 lpm r20, Z+ |
||
8395 | 34f0: 54 91 lpm r21, Z+ |
||
8396 | 34f2: 81 e1 ldi r24, 0x11 ; 17 |
||
8397 | 34f4: 61 2f mov r22, r17 |
||
8398 | 34f6: 0e 94 7e 05 call 0xafc ; 0xafc <write_ascii_string_pgm> |
||
8399 | // end jopl |
||
8400 | |||
8401 | // jopl Altimeter modification |
||
8402 | if ((debugData.Analog[5] > 100) || (debugData.Analog[5] < -100)) { |
||
8403 | 34fa: 80 91 55 01 lds r24, 0x0155 |
||
8404 | 34fe: 90 91 56 01 lds r25, 0x0156 |
||
8405 | 3502: 85 36 cpi r24, 0x65 ; 101 |
||
8406 | 3504: 91 05 cpc r25, r1 |
||
8407 | 3506: 40 f4 brcc .+16 ; 0x3518 <osd_fcmode_jopl+0xb2> |
||
8408 | 3508: 80 91 55 01 lds r24, 0x0155 |
||
8409 | 350c: 90 91 56 01 lds r25, 0x0156 |
||
8410 | 3510: 8c 59 subi r24, 0x9C ; 156 |
||
8411 | 3512: 9f 4f sbci r25, 0xFF ; 255 |
||
8412 | 3514: 08 f0 brcs .+2 ; 0x3518 <osd_fcmode_jopl+0xb2> |
||
8413 | 3516: 96 c1 rjmp .+812 ; 0x3844 <osd_fcmode_jopl+0x3de> |
||
8414 | // above 10m only write full meters |
||
8415 | write_ndigit_number_s(22, top_line, debugData.Analog[5] / 10, 4, 0); |
||
8416 | 3518: 80 91 55 01 lds r24, 0x0155 |
||
8417 | 351c: 90 91 56 01 lds r25, 0x0156 |
||
8418 | 3520: 6a e0 ldi r22, 0x0A ; 10 |
||
8419 | 3522: 70 e0 ldi r23, 0x00 ; 0 |
||
8420 | 3524: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
8421 | 3528: ab 01 movw r20, r22 |
||
8422 | 352a: 86 e1 ldi r24, 0x16 ; 22 |
||
8423 | 352c: 60 91 02 01 lds r22, 0x0102 |
||
8424 | 3530: 24 e0 ldi r18, 0x04 ; 4 |
||
8425 | 3532: 30 e0 ldi r19, 0x00 ; 0 |
||
8426 | 3534: 00 e0 ldi r16, 0x00 ; 0 |
||
8427 | 3536: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
8428 | } else { |
||
8429 | // up to 10m write meters.dm |
||
8430 | write_ndigit_number_s_10th(22, top_line, debugData.Analog[5], 3, 0); |
||
8431 | } |
||
8432 | Vario = debugData.Analog[5] - last_Altimeter; |
||
8433 | 353a: 40 91 55 01 lds r20, 0x0155 |
||
8434 | 353e: 50 91 56 01 lds r21, 0x0156 |
||
8435 | 3542: 80 91 43 01 lds r24, 0x0143 |
||
8436 | 3546: 90 91 44 01 lds r25, 0x0144 |
||
8437 | 354a: 48 1b sub r20, r24 |
||
8438 | 354c: 59 0b sbc r21, r25 |
||
8439 | 354e: 50 93 46 01 sts 0x0146, r21 |
||
8440 | 3552: 40 93 45 01 sts 0x0145, r20 |
||
8441 | draw_variometer(27, top_line, Vario); |
||
8442 | 3556: 8b e1 ldi r24, 0x1B ; 27 |
||
8443 | 3558: 60 91 02 01 lds r22, 0x0102 |
||
8444 | 355c: 0e 94 c1 09 call 0x1382 ; 0x1382 <draw_variometer> |
||
8445 | if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) { |
||
8446 | 3560: 40 91 1b 01 lds r20, 0x011B |
||
8447 | 3564: 42 fd sbrc r20, 2 |
||
8448 | 3566: 63 c1 rjmp .+710 ; 0x382e <osd_fcmode_jopl+0x3c8> |
||
8449 | draw_big_variometer(27, 8, Vario); |
||
8450 | } |
||
8451 | last_Altimeter = debugData.Analog[5]; |
||
8452 | 3568: 80 91 55 01 lds r24, 0x0155 |
||
8453 | 356c: 90 91 56 01 lds r25, 0x0156 |
||
8454 | 3570: 90 93 44 01 sts 0x0144, r25 |
||
8455 | 3574: 80 93 43 01 sts 0x0143, r24 |
||
8456 | // end jopl |
||
8457 | |||
8458 | if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5]; |
||
8459 | 3578: 20 91 55 01 lds r18, 0x0155 |
||
8460 | 357c: 30 91 56 01 lds r19, 0x0156 |
||
8461 | 3580: 80 91 1f 01 lds r24, 0x011F |
||
8462 | 3584: 90 91 20 01 lds r25, 0x0120 |
||
8463 | 3588: 82 17 cp r24, r18 |
||
8464 | 358a: 93 07 cpc r25, r19 |
||
8465 | 358c: 40 f4 brcc .+16 ; 0x359e <osd_fcmode_jopl+0x138> |
||
8466 | 358e: 80 91 55 01 lds r24, 0x0155 |
||
8467 | 3592: 90 91 56 01 lds r25, 0x0156 |
||
8468 | 3596: 90 93 20 01 sts 0x0120, r25 |
||
8469 | 359a: 80 93 1f 01 sts 0x011F, r24 |
||
8470 | |||
8471 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
8472 | 359e: 41 fd sbrc r20, 1 |
||
8473 | 35a0: 35 c1 rjmp .+618 ; 0x380c <osd_fcmode_jopl+0x3a6> |
||
8474 | draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]); |
||
8475 | } |
||
8476 | |||
8477 | // jopl ... compass heading |
||
8478 | // seccond line |
||
8479 | draw_compass(11, top_line + 1, debugData.Analog[8]); |
||
8480 | 35a2: 40 91 5b 01 lds r20, 0x015B |
||
8481 | 35a6: 50 91 5c 01 lds r21, 0x015C |
||
8482 | 35aa: 60 91 02 01 lds r22, 0x0102 |
||
8483 | 35ae: 6f 5f subi r22, 0xFF ; 255 |
||
8484 | 35b0: 8b e0 ldi r24, 0x0B ; 11 |
||
8485 | 35b2: 0e 94 55 0a call 0x14aa ; 0x14aa <draw_compass> |
||
8486 | // end jopl |
||
8487 | |||
8488 | // pre-bottom line |
||
8489 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8490 | 35b6: 80 91 1d 01 lds r24, 0x011D |
||
8491 | 35ba: 80 fd sbrc r24, 0 |
||
8492 | 35bc: eb c0 rjmp .+470 ; 0x3794 <osd_fcmode_jopl+0x32e> |
||
8493 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
8494 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
8495 | } |
||
8496 | } |
||
8497 | |||
8498 | draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage); |
||
8499 | 35be: 20 91 5d 01 lds r18, 0x015D |
||
8500 | 35c2: 30 91 5e 01 lds r19, 0x015E |
||
8501 | 35c6: 82 e0 ldi r24, 0x02 ; 2 |
||
8502 | 35c8: 60 91 03 01 lds r22, 0x0103 |
||
8503 | 35cc: 40 91 19 01 lds r20, 0x0119 |
||
8504 | 35d0: 00 91 1a 01 lds r16, 0x011A |
||
8505 | 35d4: 0e 94 17 0a call 0x142e ; 0x142e <draw_battery> |
||
8506 | write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 3, 0); |
||
8507 | 35d8: 40 91 5d 01 lds r20, 0x015D |
||
8508 | 35dc: 50 91 5e 01 lds r21, 0x015E |
||
8509 | 35e0: 83 e0 ldi r24, 0x03 ; 3 |
||
8510 | 35e2: 60 91 03 01 lds r22, 0x0103 |
||
8511 | 35e6: 23 e0 ldi r18, 0x03 ; 3 |
||
8512 | 35e8: 30 e0 ldi r19, 0x00 ; 0 |
||
8513 | 35ea: 00 e0 ldi r16, 0x00 ; 0 |
||
8514 | 35ec: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
8515 | if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) { |
||
8516 | 35f0: 80 91 5d 01 lds r24, 0x015D |
||
8517 | 35f4: 90 91 5e 01 lds r25, 0x015E |
||
8518 | 35f8: 40 91 19 01 lds r20, 0x0119 |
||
8519 | 35fc: 24 2f mov r18, r20 |
||
8520 | 35fe: 30 e0 ldi r19, 0x00 ; 0 |
||
8521 | 3600: 28 17 cp r18, r24 |
||
8522 | 3602: 39 07 cpc r19, r25 |
||
8523 | 3604: 28 f0 brcs .+10 ; 0x3610 <osd_fcmode_jopl+0x1aa> |
||
8524 | 3606: 80 91 00 01 lds r24, 0x0100 |
||
8525 | 360a: 48 17 cp r20, r24 |
||
8526 | 360c: 08 f4 brcc .+2 ; 0x3610 <osd_fcmode_jopl+0x1aa> |
||
8527 | 360e: 92 c0 rjmp .+292 ; 0x3734 <osd_fcmode_jopl+0x2ce> |
||
8528 | for (uint8_t x = 2; x < 8; x++) |
||
8529 | write_char_att_xy(x, bottom_line, BLINK); |
||
8530 | } else if (debugData.Analog[9] > min_voltage && last_UBat < min_voltage) { |
||
8531 | 3610: 80 91 5d 01 lds r24, 0x015D |
||
8532 | 3614: 90 91 5e 01 lds r25, 0x015E |
||
8533 | 3618: 28 17 cp r18, r24 |
||
8534 | 361a: 39 07 cpc r19, r25 |
||
8535 | 361c: 40 f5 brcc .+80 ; 0x366e <osd_fcmode_jopl+0x208> |
||
8536 | 361e: 80 91 00 01 lds r24, 0x0100 |
||
8537 | 3622: 84 17 cp r24, r20 |
||
8538 | 3624: 20 f5 brcc .+72 ; 0x366e <osd_fcmode_jopl+0x208> |
||
8539 | for (uint8_t x = 2; x < 8; x++) |
||
8540 | write_char_att_xy(x, bottom_line, 0); |
||
8541 | 3626: 82 e0 ldi r24, 0x02 ; 2 |
||
8542 | 3628: 60 91 03 01 lds r22, 0x0103 |
||
8543 | 362c: 40 e0 ldi r20, 0x00 ; 0 |
||
8544 | 362e: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8545 | 3632: 83 e0 ldi r24, 0x03 ; 3 |
||
8546 | 3634: 60 91 03 01 lds r22, 0x0103 |
||
8547 | 3638: 40 e0 ldi r20, 0x00 ; 0 |
||
8548 | 363a: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8549 | 363e: 84 e0 ldi r24, 0x04 ; 4 |
||
8550 | 3640: 60 91 03 01 lds r22, 0x0103 |
||
8551 | 3644: 40 e0 ldi r20, 0x00 ; 0 |
||
8552 | 3646: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8553 | 364a: 85 e0 ldi r24, 0x05 ; 5 |
||
8554 | 364c: 60 91 03 01 lds r22, 0x0103 |
||
8555 | 3650: 40 e0 ldi r20, 0x00 ; 0 |
||
8556 | 3652: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8557 | 3656: 86 e0 ldi r24, 0x06 ; 6 |
||
8558 | 3658: 60 91 03 01 lds r22, 0x0103 |
||
8559 | 365c: 40 e0 ldi r20, 0x00 ; 0 |
||
8560 | 365e: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8561 | 3662: 87 e0 ldi r24, 0x07 ; 7 |
||
8562 | 3664: 60 91 03 01 lds r22, 0x0103 |
||
8563 | 3668: 40 e0 ldi r20, 0x00 ; 0 |
||
8564 | 366a: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8565 | } |
||
8566 | |||
8567 | // jopl ... Times |
||
8568 | write_time(8, bottom_line, uptime); |
||
8569 | 366e: 40 91 12 01 lds r20, 0x0112 |
||
8570 | 3672: 50 91 13 01 lds r21, 0x0113 |
||
8571 | 3676: 88 e0 ldi r24, 0x08 ; 8 |
||
8572 | 3678: 60 91 03 01 lds r22, 0x0103 |
||
8573 | 367c: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
8574 | write_time(15, bottom_line, flytime_fc); |
||
8575 | 3680: 40 91 16 01 lds r20, 0x0116 |
||
8576 | 3684: 50 91 17 01 lds r21, 0x0117 |
||
8577 | 3688: 8f e0 ldi r24, 0x0F ; 15 |
||
8578 | 368a: 60 91 03 01 lds r22, 0x0103 |
||
8579 | 368e: 0e 94 3a 08 call 0x1074 ; 0x1074 <write_time> |
||
8580 | // write_ndigit_number_s(22, bottom_line, debugData.Analog[5], 5, 0); |
||
8581 | // end jopl |
||
8582 | |||
8583 | } |
||
8584 | // remember last values |
||
8585 | last_UBat = debugData.Analog[9]; |
||
8586 | 3692: 80 91 5d 01 lds r24, 0x015D |
||
8587 | 3696: 90 91 5e 01 lds r25, 0x015E |
||
8588 | 369a: 80 93 00 01 sts 0x0100, r24 |
||
8589 | last_RC_Quality = debugData.Analog[10]; |
||
8590 | 369e: 80 91 5f 01 lds r24, 0x015F |
||
8591 | 36a2: 90 91 60 01 lds r25, 0x0160 |
||
8592 | 36a6: 80 93 01 01 sts 0x0101, r24 |
||
8593 | debugData.Analog[28]);// |
||
8594 | debugData.Analog[29]);// |
||
8595 | debugData.Analog[30]);// GPS_Nick |
||
8596 | debugData.Analog[31]);// GPS_Roll |
||
8597 | */ |
||
8598 | seconds_since_last_data = 0; |
||
8599 | 36aa: 10 92 18 01 sts 0x0118, r1 |
||
8600 | |||
8601 | return 0; |
||
8602 | } |
||
8603 | 36ae: 80 e0 ldi r24, 0x00 ; 0 |
||
8604 | 36b0: 90 e0 ldi r25, 0x00 ; 0 |
||
8605 | 36b2: 1f 91 pop r17 |
||
8606 | 36b4: 0f 91 pop r16 |
||
8607 | 36b6: 08 95 ret |
||
8608 | |||
8609 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8610 | } |
||
8611 | |||
8612 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8613 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8614 | 36b8: 80 91 01 01 lds r24, 0x0101 |
||
8615 | 36bc: 85 36 cpi r24, 0x65 ; 101 |
||
8616 | 36be: 08 f4 brcc .+2 ; 0x36c2 <osd_fcmode_jopl+0x25c> |
||
8617 | 36c0: f0 ce rjmp .-544 ; 0x34a2 <osd_fcmode_jopl+0x3c> |
||
8618 | 36c2: 17 e0 ldi r17, 0x07 ; 7 |
||
8619 | for (uint8_t x = 0; x < 4; x++) |
||
8620 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8621 | 36c4: 81 2f mov r24, r17 |
||
8622 | 36c6: 60 91 02 01 lds r22, 0x0102 |
||
8623 | 36ca: 4f e4 ldi r20, 0x4F ; 79 |
||
8624 | 36cc: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8625 | 36d0: 1f 5f subi r17, 0xFF ; 255 |
||
8626 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8627 | } |
||
8628 | |||
8629 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8630 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8631 | for (uint8_t x = 0; x < 4; x++) |
||
8632 | 36d2: 1b 30 cpi r17, 0x0B ; 11 |
||
8633 | 36d4: b9 f7 brne .-18 ; 0x36c4 <osd_fcmode_jopl+0x25e> |
||
8634 | 36d6: f1 ce rjmp .-542 ; 0x34ba <osd_fcmode_jopl+0x54> |
||
8635 | |||
8636 | int osd_fcmode_jopl() { |
||
8637 | if (COSD_FLAGS_MODES & COSD_FLAG_HUD) { |
||
8638 | // write icons at init or after menu/mode-switch |
||
8639 | if (!(COSD_FLAGS_RUNTIME & COSD_ICONS_WRITTEN)) { |
||
8640 | write_char_xy(10, top_line, 0xCA); // RC-transmitter |
||
8641 | 36d8: 8a e0 ldi r24, 0x0A ; 10 |
||
8642 | 36da: 60 91 02 01 lds r22, 0x0102 |
||
8643 | 36de: 4a ec ldi r20, 0xCA ; 202 |
||
8644 | 36e0: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8645 | |||
8646 | // jopl ... compass |
||
8647 | write_char_xy(16, top_line, 0xD0); // degree symbol |
||
8648 | 36e4: 80 e1 ldi r24, 0x10 ; 16 |
||
8649 | 36e6: 60 91 02 01 lds r22, 0x0102 |
||
8650 | 36ea: 40 ed ldi r20, 0xD0 ; 208 |
||
8651 | 36ec: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8652 | // end jopl |
||
8653 | |||
8654 | write_char_xy(26, top_line, 0xCC); // small meters m height |
||
8655 | 36f0: 8a e1 ldi r24, 0x1A ; 26 |
||
8656 | 36f2: 60 91 02 01 lds r22, 0x0102 |
||
8657 | 36f6: 4c ec ldi r20, 0xCC ; 204 |
||
8658 | 36f8: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8659 | write_char_xy(7, bottom_line, 0x9E); // small v |
||
8660 | 36fc: 87 e0 ldi r24, 0x07 ; 7 |
||
8661 | 36fe: 60 91 03 01 lds r22, 0x0103 |
||
8662 | 3702: 4e e9 ldi r20, 0x9E ; 158 |
||
8663 | 3704: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8664 | |||
8665 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8666 | 3708: 80 91 1d 01 lds r24, 0x011D |
||
8667 | 370c: 80 fd sbrc r24, 0 |
||
8668 | 370e: a7 c0 rjmp .+334 ; 0x385e <osd_fcmode_jopl+0x3f8> |
||
8669 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
||
8670 | } |
||
8671 | } |
||
8672 | |||
8673 | // jopl ... Times |
||
8674 | write_char_xy(14, bottom_line, 0xD1); // on clock |
||
8675 | 3710: 8e e0 ldi r24, 0x0E ; 14 |
||
8676 | 3712: 60 91 03 01 lds r22, 0x0103 |
||
8677 | 3716: 41 ed ldi r20, 0xD1 ; 209 |
||
8678 | 3718: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8679 | write_char_xy(21, bottom_line, 0xD2); // fly clock |
||
8680 | 371c: 85 e1 ldi r24, 0x15 ; 21 |
||
8681 | 371e: 60 91 03 01 lds r22, 0x0103 |
||
8682 | 3722: 42 ed ldi r20, 0xD2 ; 210 |
||
8683 | 3724: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8684 | // end jopl |
||
8685 | |||
8686 | COSD_FLAGS_RUNTIME |= COSD_ICONS_WRITTEN; |
||
8687 | 3728: 80 91 1d 01 lds r24, 0x011D |
||
8688 | 372c: 82 60 ori r24, 0x02 ; 2 |
||
8689 | 372e: 80 93 1d 01 sts 0x011D, r24 |
||
8690 | 3732: a3 ce rjmp .-698 ; 0x347a <osd_fcmode_jopl+0x14> |
||
8691 | |||
8692 | draw_battery(2, bottom_line, min_voltage, debugData.Analog[9], max_voltage); |
||
8693 | write_ndigit_number_u_10th(3, bottom_line, debugData.Analog[9], 3, 0); |
||
8694 | if (debugData.Analog[9] <= min_voltage && last_UBat > min_voltage) { |
||
8695 | for (uint8_t x = 2; x < 8; x++) |
||
8696 | write_char_att_xy(x, bottom_line, BLINK); |
||
8697 | 3734: 82 e0 ldi r24, 0x02 ; 2 |
||
8698 | 3736: 60 91 03 01 lds r22, 0x0103 |
||
8699 | 373a: 4f e4 ldi r20, 0x4F ; 79 |
||
8700 | 373c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8701 | 3740: 83 e0 ldi r24, 0x03 ; 3 |
||
8702 | 3742: 60 91 03 01 lds r22, 0x0103 |
||
8703 | 3746: 4f e4 ldi r20, 0x4F ; 79 |
||
8704 | 3748: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8705 | 374c: 84 e0 ldi r24, 0x04 ; 4 |
||
8706 | 374e: 60 91 03 01 lds r22, 0x0103 |
||
8707 | 3752: 4f e4 ldi r20, 0x4F ; 79 |
||
8708 | 3754: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8709 | 3758: 85 e0 ldi r24, 0x05 ; 5 |
||
8710 | 375a: 60 91 03 01 lds r22, 0x0103 |
||
8711 | 375e: 4f e4 ldi r20, 0x4F ; 79 |
||
8712 | 3760: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8713 | 3764: 86 e0 ldi r24, 0x06 ; 6 |
||
8714 | 3766: 60 91 03 01 lds r22, 0x0103 |
||
8715 | 376a: 4f e4 ldi r20, 0x4F ; 79 |
||
8716 | 376c: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8717 | 3770: 87 e0 ldi r24, 0x07 ; 7 |
||
8718 | 3772: 60 91 03 01 lds r22, 0x0103 |
||
8719 | 3776: 4f e4 ldi r20, 0x4F ; 79 |
||
8720 | 3778: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8721 | 377c: 78 cf rjmp .-272 ; 0x366e <osd_fcmode_jopl+0x208> |
||
8722 | |||
8723 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8724 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8725 | for (uint8_t x = 0; x < 4; x++) |
||
8726 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8727 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
8728 | 377e: 17 e0 ldi r17, 0x07 ; 7 |
||
8729 | for (uint8_t x = 0; x < 4; x++) |
||
8730 | write_char_att_xy(7 + x, top_line, 0); |
||
8731 | 3780: 81 2f mov r24, r17 |
||
8732 | 3782: 60 91 02 01 lds r22, 0x0102 |
||
8733 | 3786: 40 e0 ldi r20, 0x00 ; 0 |
||
8734 | 3788: 0e 94 91 08 call 0x1122 ; 0x1122 <write_char_att_xy> |
||
8735 | 378c: 1f 5f subi r17, 0xFF ; 255 |
||
8736 | write_ndigit_number_u(7, top_line, debugData.Analog[10], 3, 0); |
||
8737 | if (debugData.Analog[10] <= RCLVL_WRN && last_RC_Quality > RCLVL_WRN) { |
||
8738 | for (uint8_t x = 0; x < 4; x++) |
||
8739 | write_char_att_xy(7 + x, top_line, BLINK); |
||
8740 | } else if (debugData.Analog[10] > RCLVL_WRN && last_RC_Quality <= RCLVL_WRN) { |
||
8741 | for (uint8_t x = 0; x < 4; x++) |
||
8742 | 378e: 1b 30 cpi r17, 0x0B ; 11 |
||
8743 | 3790: b9 f7 brne .-18 ; 0x3780 <osd_fcmode_jopl+0x31a> |
||
8744 | 3792: 93 ce rjmp .-730 ; 0x34ba <osd_fcmode_jopl+0x54> |
||
8745 | // end jopl |
||
8746 | |||
8747 | // pre-bottom line |
||
8748 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8749 | //write_ndigit_number_s(3, bottom_line - 1, ampere, 4, 0); |
||
8750 | write_ndigit_number_u_10th(3, bottom_line - 1, ampere / 10, 3, 0); |
||
8751 | 3794: 20 91 03 01 lds r18, 0x0103 |
||
8752 | 3798: 21 50 subi r18, 0x01 ; 1 |
||
8753 | 379a: 80 91 37 01 lds r24, 0x0137 |
||
8754 | 379e: 90 91 38 01 lds r25, 0x0138 |
||
8755 | 37a2: 6a e0 ldi r22, 0x0A ; 10 |
||
8756 | 37a4: 70 e0 ldi r23, 0x00 ; 0 |
||
8757 | 37a6: 0e 94 7c 1c call 0x38f8 ; 0x38f8 <__divmodhi4> |
||
8758 | 37aa: ab 01 movw r20, r22 |
||
8759 | 37ac: 83 e0 ldi r24, 0x03 ; 3 |
||
8760 | 37ae: 62 2f mov r22, r18 |
||
8761 | 37b0: 23 e0 ldi r18, 0x03 ; 3 |
||
8762 | 37b2: 30 e0 ldi r19, 0x00 ; 0 |
||
8763 | 37b4: 00 e0 ldi r16, 0x00 ; 0 |
||
8764 | 37b6: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
8765 | write_ndigit_number_s(10, bottom_line - 1, ampere_wasted / 10, 4, 0); |
||
8766 | 37ba: 10 91 03 01 lds r17, 0x0103 |
||
8767 | 37be: 11 50 subi r17, 0x01 ; 1 |
||
8768 | 37c0: 60 91 3b 01 lds r22, 0x013B |
||
8769 | 37c4: 70 91 3c 01 lds r23, 0x013C |
||
8770 | 37c8: 80 91 3d 01 lds r24, 0x013D |
||
8771 | 37cc: 90 91 3e 01 lds r25, 0x013E |
||
8772 | 37d0: 2a e0 ldi r18, 0x0A ; 10 |
||
8773 | 37d2: 30 e0 ldi r19, 0x00 ; 0 |
||
8774 | 37d4: 40 e0 ldi r20, 0x00 ; 0 |
||
8775 | 37d6: 50 e0 ldi r21, 0x00 ; 0 |
||
8776 | 37d8: 0e 94 b1 1c call 0x3962 ; 0x3962 <__divmodsi4> |
||
8777 | 37dc: 8a e0 ldi r24, 0x0A ; 10 |
||
8778 | 37de: 61 2f mov r22, r17 |
||
8779 | 37e0: a9 01 movw r20, r18 |
||
8780 | 37e2: 24 e0 ldi r18, 0x04 ; 4 |
||
8781 | 37e4: 30 e0 ldi r19, 0x00 ; 0 |
||
8782 | 37e6: 0e 94 19 07 call 0xe32 ; 0xe32 <write_ndigit_number_s> |
||
8783 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
8784 | 37ea: 80 91 1b 01 lds r24, 0x011B |
||
8785 | 37ee: 85 ff sbrs r24, 5 |
||
8786 | 37f0: e6 ce rjmp .-564 ; 0x35be <osd_fcmode_jopl+0x158> |
||
8787 | write_ndigit_number_u_10th(17, bottom_line - 1, s_volt, 3, 0); |
||
8788 | 37f2: 60 91 03 01 lds r22, 0x0103 |
||
8789 | 37f6: 61 50 subi r22, 0x01 ; 1 |
||
8790 | 37f8: 40 91 9f 02 lds r20, 0x029F |
||
8791 | 37fc: 50 91 a0 02 lds r21, 0x02A0 |
||
8792 | 3800: 81 e1 ldi r24, 0x11 ; 17 |
||
8793 | 3802: 23 e0 ldi r18, 0x03 ; 3 |
||
8794 | 3804: 30 e0 ldi r19, 0x00 ; 0 |
||
8795 | 3806: 0e 94 76 06 call 0xcec ; 0xcec <write_ndigit_number_u_10th> |
||
8796 | 380a: d9 ce rjmp .-590 ; 0x35be <osd_fcmode_jopl+0x158> |
||
8797 | // end jopl |
||
8798 | |||
8799 | if (debugData.Analog[5] > max_Altimeter) max_Altimeter = debugData.Analog[5]; |
||
8800 | |||
8801 | if (COSD_FLAGS_MODES & COSD_FLAG_ARTHORIZON) { |
||
8802 | draw_artificial_horizon(top_line + 2, bottom_line - 1, debugData.Analog[0], debugData.Analog[1]); |
||
8803 | 380c: 40 91 4b 01 lds r20, 0x014B |
||
8804 | 3810: 50 91 4c 01 lds r21, 0x014C |
||
8805 | 3814: 20 91 4d 01 lds r18, 0x014D |
||
8806 | 3818: 30 91 4e 01 lds r19, 0x014E |
||
8807 | 381c: 80 91 02 01 lds r24, 0x0102 |
||
8808 | 3820: 60 91 03 01 lds r22, 0x0103 |
||
8809 | 3824: 61 50 subi r22, 0x01 ; 1 |
||
8810 | 3826: 8e 5f subi r24, 0xFE ; 254 |
||
8811 | 3828: 0e 94 e6 08 call 0x11cc ; 0x11cc <draw_artificial_horizon> |
||
8812 | 382c: ba ce rjmp .-652 ; 0x35a2 <osd_fcmode_jopl+0x13c> |
||
8813 | write_ndigit_number_s_10th(22, top_line, debugData.Analog[5], 3, 0); |
||
8814 | } |
||
8815 | Vario = debugData.Analog[5] - last_Altimeter; |
||
8816 | draw_variometer(27, top_line, Vario); |
||
8817 | if (COSD_FLAGS_MODES & COSD_FLAG_BIGVARIO) { |
||
8818 | draw_big_variometer(27, 8, Vario); |
||
8819 | 382e: 40 91 45 01 lds r20, 0x0145 |
||
8820 | 3832: 50 91 46 01 lds r21, 0x0146 |
||
8821 | 3836: 8b e1 ldi r24, 0x1B ; 27 |
||
8822 | 3838: 68 e0 ldi r22, 0x08 ; 8 |
||
8823 | 383a: 0e 94 84 0a call 0x1508 ; 0x1508 <draw_big_variometer> |
||
8824 | 383e: 40 91 1b 01 lds r20, 0x011B |
||
8825 | 3842: 92 ce rjmp .-732 ; 0x3568 <osd_fcmode_jopl+0x102> |
||
8826 | if ((debugData.Analog[5] > 100) || (debugData.Analog[5] < -100)) { |
||
8827 | // above 10m only write full meters |
||
8828 | write_ndigit_number_s(22, top_line, debugData.Analog[5] / 10, 4, 0); |
||
8829 | } else { |
||
8830 | // up to 10m write meters.dm |
||
8831 | write_ndigit_number_s_10th(22, top_line, debugData.Analog[5], 3, 0); |
||
8832 | 3844: 40 91 55 01 lds r20, 0x0155 |
||
8833 | 3848: 50 91 56 01 lds r21, 0x0156 |
||
8834 | 384c: 86 e1 ldi r24, 0x16 ; 22 |
||
8835 | 384e: 60 91 02 01 lds r22, 0x0102 |
||
8836 | 3852: 23 e0 ldi r18, 0x03 ; 3 |
||
8837 | 3854: 30 e0 ldi r19, 0x00 ; 0 |
||
8838 | 3856: 00 e0 ldi r16, 0x00 ; 0 |
||
8839 | 3858: 0e 94 d3 05 call 0xba6 ; 0xba6 <write_ndigit_number_s_10th> |
||
8840 | 385c: 6e ce rjmp .-804 ; 0x353a <osd_fcmode_jopl+0xd4> |
||
8841 | |||
8842 | write_char_xy(26, top_line, 0xCC); // small meters m height |
||
8843 | write_char_xy(7, bottom_line, 0x9E); // small v |
||
8844 | |||
8845 | if (COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) { |
||
8846 | write_char_xy(7, bottom_line - 1, 0x9F); // small A |
||
8847 | 385e: 60 91 03 01 lds r22, 0x0103 |
||
8848 | 3862: 61 50 subi r22, 0x01 ; 1 |
||
8849 | 3864: 87 e0 ldi r24, 0x07 ; 7 |
||
8850 | 3866: 4f e9 ldi r20, 0x9F ; 159 |
||
8851 | 3868: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8852 | write_char_xy(14, bottom_line - 1, 0xB5); // mah |
||
8853 | 386c: 60 91 03 01 lds r22, 0x0103 |
||
8854 | 3870: 61 50 subi r22, 0x01 ; 1 |
||
8855 | 3872: 8e e0 ldi r24, 0x0E ; 14 |
||
8856 | 3874: 45 eb ldi r20, 0xB5 ; 181 |
||
8857 | 3876: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8858 | if (COSD_FLAGS_MODES & COSD_FLAG_STROMVOLT) { |
||
8859 | 387a: 80 91 1b 01 lds r24, 0x011B |
||
8860 | 387e: 85 ff sbrs r24, 5 |
||
8861 | 3880: 47 cf rjmp .-370 ; 0x3710 <osd_fcmode_jopl+0x2aa> |
||
8862 | write_char_xy(21, bottom_line - 1, 0x9E); // small V |
||
8863 | 3882: 60 91 03 01 lds r22, 0x0103 |
||
8864 | 3886: 61 50 subi r22, 0x01 ; 1 |
||
8865 | 3888: 85 e1 ldi r24, 0x15 ; 21 |
||
8866 | 388a: 4e e9 ldi r20, 0x9E ; 158 |
||
8867 | 388c: 0e 94 04 05 call 0xa08 ; 0xa08 <write_char_xy> |
||
8868 | 3890: 3f cf rjmp .-386 ; 0x3710 <osd_fcmode_jopl+0x2aa> |
||
8869 | |||
8870 | 00003892 <__mulsi3>: |
||
8871 | 3892: 62 9f mul r22, r18 |
||
8872 | 3894: d0 01 movw r26, r0 |
||
8873 | 3896: 73 9f mul r23, r19 |
||
8874 | 3898: f0 01 movw r30, r0 |
||
8875 | 389a: 82 9f mul r24, r18 |
||
8876 | 389c: e0 0d add r30, r0 |
||
8877 | 389e: f1 1d adc r31, r1 |
||
8878 | 38a0: 64 9f mul r22, r20 |
||
8879 | 38a2: e0 0d add r30, r0 |
||
8880 | 38a4: f1 1d adc r31, r1 |
||
8881 | 38a6: 92 9f mul r25, r18 |
||
8882 | 38a8: f0 0d add r31, r0 |
||
8883 | 38aa: 83 9f mul r24, r19 |
||
8884 | 38ac: f0 0d add r31, r0 |
||
8885 | 38ae: 74 9f mul r23, r20 |
||
8886 | 38b0: f0 0d add r31, r0 |
||
8887 | 38b2: 65 9f mul r22, r21 |
||
8888 | 38b4: f0 0d add r31, r0 |
||
8889 | 38b6: 99 27 eor r25, r25 |
||
8890 | 38b8: 72 9f mul r23, r18 |
||
8891 | 38ba: b0 0d add r27, r0 |
||
8892 | 38bc: e1 1d adc r30, r1 |
||
8893 | 38be: f9 1f adc r31, r25 |
||
8894 | 38c0: 63 9f mul r22, r19 |
||
8895 | 38c2: b0 0d add r27, r0 |
||
8896 | 38c4: e1 1d adc r30, r1 |
||
8897 | 38c6: f9 1f adc r31, r25 |
||
8898 | 38c8: bd 01 movw r22, r26 |
||
8899 | 38ca: cf 01 movw r24, r30 |
||
8900 | 38cc: 11 24 eor r1, r1 |
||
8901 | 38ce: 08 95 ret |
||
8902 | |||
8903 | 000038d0 <__udivmodhi4>: |
||
8904 | 38d0: aa 1b sub r26, r26 |
||
8905 | 38d2: bb 1b sub r27, r27 |
||
8906 | 38d4: 51 e1 ldi r21, 0x11 ; 17 |
||
8907 | 38d6: 07 c0 rjmp .+14 ; 0x38e6 <__udivmodhi4_ep> |
||
8908 | |||
8909 | 000038d8 <__udivmodhi4_loop>: |
||
8910 | 38d8: aa 1f adc r26, r26 |
||
8911 | 38da: bb 1f adc r27, r27 |
||
8912 | 38dc: a6 17 cp r26, r22 |
||
8913 | 38de: b7 07 cpc r27, r23 |
||
8914 | 38e0: 10 f0 brcs .+4 ; 0x38e6 <__udivmodhi4_ep> |
||
8915 | 38e2: a6 1b sub r26, r22 |
||
8916 | 38e4: b7 0b sbc r27, r23 |
||
8917 | |||
8918 | 000038e6 <__udivmodhi4_ep>: |
||
8919 | 38e6: 88 1f adc r24, r24 |
||
8920 | 38e8: 99 1f adc r25, r25 |
||
8921 | 38ea: 5a 95 dec r21 |
||
8922 | 38ec: a9 f7 brne .-22 ; 0x38d8 <__udivmodhi4_loop> |
||
8923 | 38ee: 80 95 com r24 |
||
8924 | 38f0: 90 95 com r25 |
||
8925 | 38f2: bc 01 movw r22, r24 |
||
8926 | 38f4: cd 01 movw r24, r26 |
||
8927 | 38f6: 08 95 ret |
||
8928 | |||
8929 | 000038f8 <__divmodhi4>: |
||
8930 | 38f8: 97 fb bst r25, 7 |
||
8931 | 38fa: 09 2e mov r0, r25 |
||
8932 | 38fc: 07 26 eor r0, r23 |
||
8933 | 38fe: 0a d0 rcall .+20 ; 0x3914 <__divmodhi4_neg1> |
||
8934 | 3900: 77 fd sbrc r23, 7 |
||
8935 | 3902: 04 d0 rcall .+8 ; 0x390c <__divmodhi4_neg2> |
||
8936 | 3904: e5 df rcall .-54 ; 0x38d0 <__udivmodhi4> |
||
8937 | 3906: 06 d0 rcall .+12 ; 0x3914 <__divmodhi4_neg1> |
||
8938 | 3908: 00 20 and r0, r0 |
||
8939 | 390a: 1a f4 brpl .+6 ; 0x3912 <__divmodhi4_exit> |
||
8940 | |||
8941 | 0000390c <__divmodhi4_neg2>: |
||
8942 | 390c: 70 95 com r23 |
||
8943 | 390e: 61 95 neg r22 |
||
8944 | 3910: 7f 4f sbci r23, 0xFF ; 255 |
||
8945 | |||
8946 | 00003912 <__divmodhi4_exit>: |
||
8947 | 3912: 08 95 ret |
||
8948 | |||
8949 | 00003914 <__divmodhi4_neg1>: |
||
8950 | 3914: f6 f7 brtc .-4 ; 0x3912 <__divmodhi4_exit> |
||
8951 | 3916: 90 95 com r25 |
||
8952 | 3918: 81 95 neg r24 |
||
8953 | 391a: 9f 4f sbci r25, 0xFF ; 255 |
||
8954 | 391c: 08 95 ret |
||
8955 | |||
8956 | 0000391e <__udivmodsi4>: |
||
8957 | 391e: a1 e2 ldi r26, 0x21 ; 33 |
||
8958 | 3920: 1a 2e mov r1, r26 |
||
8959 | 3922: aa 1b sub r26, r26 |
||
8960 | 3924: bb 1b sub r27, r27 |
||
8961 | 3926: fd 01 movw r30, r26 |
||
8962 | 3928: 0d c0 rjmp .+26 ; 0x3944 <__udivmodsi4_ep> |
||
8963 | |||
8964 | 0000392a <__udivmodsi4_loop>: |
||
8965 | 392a: aa 1f adc r26, r26 |
||
8966 | 392c: bb 1f adc r27, r27 |
||
8967 | 392e: ee 1f adc r30, r30 |
||
8968 | 3930: ff 1f adc r31, r31 |
||
8969 | 3932: a2 17 cp r26, r18 |
||
8970 | 3934: b3 07 cpc r27, r19 |
||
8971 | 3936: e4 07 cpc r30, r20 |
||
8972 | 3938: f5 07 cpc r31, r21 |
||
8973 | 393a: 20 f0 brcs .+8 ; 0x3944 <__udivmodsi4_ep> |
||
8974 | 393c: a2 1b sub r26, r18 |
||
8975 | 393e: b3 0b sbc r27, r19 |
||
8976 | 3940: e4 0b sbc r30, r20 |
||
8977 | 3942: f5 0b sbc r31, r21 |
||
8978 | |||
8979 | 00003944 <__udivmodsi4_ep>: |
||
8980 | 3944: 66 1f adc r22, r22 |
||
8981 | 3946: 77 1f adc r23, r23 |
||
8982 | 3948: 88 1f adc r24, r24 |
||
8983 | 394a: 99 1f adc r25, r25 |
||
8984 | 394c: 1a 94 dec r1 |
||
8985 | 394e: 69 f7 brne .-38 ; 0x392a <__udivmodsi4_loop> |
||
8986 | 3950: 60 95 com r22 |
||
8987 | 3952: 70 95 com r23 |
||
8988 | 3954: 80 95 com r24 |
||
8989 | 3956: 90 95 com r25 |
||
8990 | 3958: 9b 01 movw r18, r22 |
||
8991 | 395a: ac 01 movw r20, r24 |
||
8992 | 395c: bd 01 movw r22, r26 |
||
8993 | 395e: cf 01 movw r24, r30 |
||
8994 | 3960: 08 95 ret |
||
8995 | |||
8996 | 00003962 <__divmodsi4>: |
||
8997 | 3962: 97 fb bst r25, 7 |
||
8998 | 3964: 09 2e mov r0, r25 |
||
8999 | 3966: 05 26 eor r0, r21 |
||
9000 | 3968: 0e d0 rcall .+28 ; 0x3986 <__divmodsi4_neg1> |
||
9001 | 396a: 57 fd sbrc r21, 7 |
||
9002 | 396c: 04 d0 rcall .+8 ; 0x3976 <__divmodsi4_neg2> |
||
9003 | 396e: d7 df rcall .-82 ; 0x391e <__udivmodsi4> |
||
9004 | 3970: 0a d0 rcall .+20 ; 0x3986 <__divmodsi4_neg1> |
||
9005 | 3972: 00 1c adc r0, r0 |
||
9006 | 3974: 38 f4 brcc .+14 ; 0x3984 <__divmodsi4_exit> |
||
9007 | |||
9008 | 00003976 <__divmodsi4_neg2>: |
||
9009 | 3976: 50 95 com r21 |
||
9010 | 3978: 40 95 com r20 |
||
9011 | 397a: 30 95 com r19 |
||
9012 | 397c: 21 95 neg r18 |
||
9013 | 397e: 3f 4f sbci r19, 0xFF ; 255 |
||
9014 | 3980: 4f 4f sbci r20, 0xFF ; 255 |
||
9015 | 3982: 5f 4f sbci r21, 0xFF ; 255 |
||
9016 | |||
9017 | 00003984 <__divmodsi4_exit>: |
||
9018 | 3984: 08 95 ret |
||
9019 | |||
9020 | 00003986 <__divmodsi4_neg1>: |
||
9021 | 3986: f6 f7 brtc .-4 ; 0x3984 <__divmodsi4_exit> |
||
9022 | 3988: 90 95 com r25 |
||
9023 | 398a: 80 95 com r24 |
||
9024 | 398c: 70 95 com r23 |
||
9025 | 398e: 61 95 neg r22 |
||
9026 | 3990: 7f 4f sbci r23, 0xFF ; 255 |
||
9027 | 3992: 8f 4f sbci r24, 0xFF ; 255 |
||
9028 | 3994: 9f 4f sbci r25, 0xFF ; 255 |
||
9029 | 3996: 08 95 ret |
||
9030 | |||
9031 | 00003998 <itoa>: |
||
9032 | 3998: fb 01 movw r30, r22 |
||
9033 | 399a: 9f 01 movw r18, r30 |
||
9034 | 399c: e8 94 clt |
||
9035 | 399e: 42 30 cpi r20, 0x02 ; 2 |
||
9036 | 39a0: c4 f0 brlt .+48 ; 0x39d2 <itoa+0x3a> |
||
9037 | 39a2: 45 32 cpi r20, 0x25 ; 37 |
||
9038 | 39a4: b4 f4 brge .+44 ; 0x39d2 <itoa+0x3a> |
||
9039 | 39a6: 4a 30 cpi r20, 0x0A ; 10 |
||
9040 | 39a8: 29 f4 brne .+10 ; 0x39b4 <itoa+0x1c> |
||
9041 | 39aa: 97 fb bst r25, 7 |
||
9042 | 39ac: 1e f4 brtc .+6 ; 0x39b4 <itoa+0x1c> |
||
9043 | 39ae: 90 95 com r25 |
||
9044 | 39b0: 81 95 neg r24 |
||
9045 | 39b2: 9f 4f sbci r25, 0xFF ; 255 |
||
9046 | 39b4: 64 2f mov r22, r20 |
||
9047 | 39b6: 77 27 eor r23, r23 |
||
9048 | 39b8: 0e 94 68 1c call 0x38d0 ; 0x38d0 <__udivmodhi4> |
||
9049 | 39bc: 80 5d subi r24, 0xD0 ; 208 |
||
9050 | 39be: 8a 33 cpi r24, 0x3A ; 58 |
||
9051 | 39c0: 0c f0 brlt .+2 ; 0x39c4 <itoa+0x2c> |
||
9052 | 39c2: 89 5d subi r24, 0xD9 ; 217 |
||
9053 | 39c4: 81 93 st Z+, r24 |
||
9054 | 39c6: cb 01 movw r24, r22 |
||
9055 | 39c8: 00 97 sbiw r24, 0x00 ; 0 |
||
9056 | 39ca: a1 f7 brne .-24 ; 0x39b4 <itoa+0x1c> |
||
9057 | 39cc: 16 f4 brtc .+4 ; 0x39d2 <itoa+0x3a> |
||
9058 | 39ce: 5d e2 ldi r21, 0x2D ; 45 |
||
9059 | 39d0: 51 93 st Z+, r21 |
||
9060 | 39d2: 10 82 st Z, r1 |
||
9061 | 39d4: c9 01 movw r24, r18 |
||
9062 | 39d6: 0c 94 02 1d jmp 0x3a04 ; 0x3a04 <strrev> |
||
9063 | |||
9064 | 000039da <__eerd_byte_m162>: |
||
9065 | 39da: e1 99 sbic 0x1c, 1 ; 28 |
||
9066 | 39dc: fe cf rjmp .-4 ; 0x39da <__eerd_byte_m162> |
||
9067 | 39de: 9f bb out 0x1f, r25 ; 31 |
||
9068 | 39e0: 8e bb out 0x1e, r24 ; 30 |
||
9069 | 39e2: e0 9a sbi 0x1c, 0 ; 28 |
||
9070 | 39e4: 99 27 eor r25, r25 |
||
9071 | 39e6: 8d b3 in r24, 0x1d ; 29 |
||
9072 | 39e8: 08 95 ret |
||
9073 | |||
9074 | 000039ea <__eewr_byte_m162>: |
||
9075 | 39ea: 26 2f mov r18, r22 |
||
9076 | |||
9077 | 000039ec <__eewr_r18_m162>: |
||
9078 | 39ec: e1 99 sbic 0x1c, 1 ; 28 |
||
9079 | 39ee: fe cf rjmp .-4 ; 0x39ec <__eewr_r18_m162> |
||
9080 | 39f0: 9f bb out 0x1f, r25 ; 31 |
||
9081 | 39f2: 8e bb out 0x1e, r24 ; 30 |
||
9082 | 39f4: 2d bb out 0x1d, r18 ; 29 |
||
9083 | 39f6: 0f b6 in r0, 0x3f ; 63 |
||
9084 | 39f8: f8 94 cli |
||
9085 | 39fa: e2 9a sbi 0x1c, 2 ; 28 |
||
9086 | 39fc: e1 9a sbi 0x1c, 1 ; 28 |
||
9087 | 39fe: 0f be out 0x3f, r0 ; 63 |
||
9088 | 3a00: 01 96 adiw r24, 0x01 ; 1 |
||
9089 | 3a02: 08 95 ret |
||
9090 | |||
9091 | 00003a04 <strrev>: |
||
9092 | 3a04: dc 01 movw r26, r24 |
||
9093 | 3a06: fc 01 movw r30, r24 |
||
9094 | 3a08: 67 2f mov r22, r23 |
||
9095 | 3a0a: 71 91 ld r23, Z+ |
||
9096 | 3a0c: 77 23 and r23, r23 |
||
9097 | 3a0e: e1 f7 brne .-8 ; 0x3a08 <strrev+0x4> |
||
9098 | 3a10: 32 97 sbiw r30, 0x02 ; 2 |
||
9099 | 3a12: 04 c0 rjmp .+8 ; 0x3a1c <strrev+0x18> |
||
9100 | 3a14: 7c 91 ld r23, X |
||
9101 | 3a16: 6d 93 st X+, r22 |
||
9102 | 3a18: 70 83 st Z, r23 |
||
9103 | 3a1a: 62 91 ld r22, -Z |
||
9104 | 3a1c: ae 17 cp r26, r30 |
||
9105 | 3a1e: bf 07 cpc r27, r31 |
||
9106 | 3a20: c8 f3 brcs .-14 ; 0x3a14 <strrev+0x10> |
||
9107 | 3a22: 08 95 ret |
||
9108 | |||
9109 | 00003a24 <_exit>: |
||
9110 | 3a24: f8 94 cli |
||
9111 | |||
9112 | 00003a26 <__stop_program>: |
||
9113 | 3a26: ff cf rjmp .-2 ; 0x3a26 <__stop_program> |