Subversion Repositories FlightCtrl

Rev

Rev 1755 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1755 - 1
   1               		.file	"twimaster.c"
1789 - 2
   2               	__SREG__ = 0x3f
3
   3               	__SP_H__ = 0x3e
4
   4               	__SP_L__ = 0x3d
5
   5               	__CCP__  = 0x34
1755 - 6
   6               	__tmp_reg__ = 0
7
   7               	__zero_reg__ = 1
1789 - 8
   8               		.text
9
   9               	.global	I2C_Init
10
  11               	I2C_Init:
11
  12               	/* prologue: function */
12
  13               	/* frame size = 0 */
13
  14 0000 9FB7      		in r25,__SREG__
14
  15               	/* #APP */
15
  16               	 ;  100 "twimaster.c" 1
16
  17 0002 F894      		cli
17
  18               	 ;  0 "" 2
18
  19               	/* #NOAPP */
19
  20 0004 3998      		cbi 39-32,1
20
  21 0006 389A      		sbi 39-32,0
21
  22 0008 88B1      		in r24,40-32
22
  23 000a 8360      		ori r24,lo8(3)
23
  24 000c 88B9      		out 40-32,r24
24
  25 000e 8091 B900 		lds r24,185
25
  26 0012 8C7F      		andi r24,lo8(-4)
26
  27 0014 8093 B900 		sts 185,r24
27
  28 0018 8AE2      		ldi r24,lo8(42)
28
  29 001a 8093 B800 		sts 184,r24
29
  30 001e 1092 0000 		sts twi_state,__zero_reg__
30
  31 0022 1092 0000 		sts motor_write,__zero_reg__
31
  32 0026 1092 0000 		sts motor_read,__zero_reg__
32
  33 002a E0E0      		ldi r30,lo8(Motor)
33
  34 002c F0E0      		ldi r31,hi8(Motor)
34
  35               	.L2:
35
  36 002e 1082      		st Z,__zero_reg__
36
  37 0030 1182      		std Z+1,__zero_reg__
37
  38 0032 1282      		std Z+2,__zero_reg__
38
  39 0034 1382      		std Z+3,__zero_reg__
39
  40 0036 1482      		std Z+4,__zero_reg__
40
  41 0038 1582      		std Z+5,__zero_reg__
41
  42 003a 1682      		std Z+6,__zero_reg__
42
  43 003c 1782      		std Z+7,__zero_reg__
43
  44 003e 3896      		adiw r30,8
44
  45 0040 80E0      		ldi r24,hi8(Motor+96)
45
  46 0042 E030      		cpi r30,lo8(Motor+96)
46
  47 0044 F807      		cpc r31,r24
47
  48 0046 01F4      		brne .L2
48
  49 0048 9FBF      		out __SREG__,r25
49
  50               	/* epilogue start */
50
  51 004a 0895      		ret
51
  53               	.global	I2C_Reset
52
  55               	I2C_Reset:
53
  56 004c EF92      		push r14
54
  57 004e FF92      		push r15
55
  58 0050 0F93      		push r16
56
  59 0052 1F93      		push r17
57
  60               	/* prologue: function */
58
  61               	/* frame size = 0 */
59
  62 0054 1092 0000 		sts twi_state,__zero_reg__
60
  63 0058 8CEB      		ldi r24,lo8(188)
61
  64 005a E82E      		mov r14,r24
62
  65 005c F12C      		mov r15,__zero_reg__
63
  66 005e 84E9      		ldi r24,lo8(-108)
64
  67 0060 F701      		movw r30,r14
65
  68 0062 8083      		st Z,r24
66
  69 0064 1092 0000 		sts motor_write,__zero_reg__
67
  70 0068 1092 0000 		sts motor_read,__zero_reg__
68
  71 006c 80E8      		ldi r24,lo8(-128)
69
  72 006e 8083      		st Z,r24
70
  73 0070 1092 BD00 		sts 189,__zero_reg__
71
  74 0074 1092 BA00 		sts 186,__zero_reg__
72
  75 0078 0BEB      		ldi r16,lo8(187)
73
  76 007a 10E0      		ldi r17,hi8(187)
74
  77 007c F801      		movw r30,r16
75
  78 007e 1082      		st Z,__zero_reg__
76
  79 0080 1092 B900 		sts 185,__zero_reg__
77
  80 0084 1092 B800 		sts 184,__zero_reg__
78
  81 0088 0E94 0000 		call I2C_Init
79
  82 008c F801      		movw r30,r16
80
  83 008e 1082      		st Z,__zero_reg__
81
  84 0090 85E8      		ldi r24,lo8(-123)
82
  85 0092 F701      		movw r30,r14
83
  86 0094 8083      		st Z,r24
84
  87 0096 8091 0000 		lds r24,BLFlags
85
  88 009a 8260      		ori r24,lo8(2)
86
  89 009c 8093 0000 		sts BLFlags,r24
87
  90               	/* epilogue start */
88
  91 00a0 1F91      		pop r17
89
  92 00a2 0F91      		pop r16
90
  93 00a4 FF90      		pop r15
91
  94 00a6 EF90      		pop r14
92
  95 00a8 0895      		ret
93
  97               	.global	__vector_26
94
  99               	__vector_26:
95
 100 00aa 1F92      		push __zero_reg__
96
 101 00ac 0F92      		push r0
97
 102 00ae 0FB6      		in r0,__SREG__
98
 103 00b0 0F92      		push r0
99
 104 00b2 1124      		clr __zero_reg__
100
 105 00b4 2F93      		push r18
101
 106 00b6 3F93      		push r19
102
 107 00b8 4F93      		push r20
103
 108 00ba 8F93      		push r24
104
 109 00bc 9F93      		push r25
105
 110 00be AF93      		push r26
106
 111 00c0 BF93      		push r27
107
 112 00c2 EF93      		push r30
108
 113 00c4 FF93      		push r31
109
 114               	/* prologue: Signal */
110
 115               	/* frame size = 0 */
111
 116 00c6 8091 0000 		lds r24,twi_state
112
 117 00ca 8F5F      		subi r24,lo8(-(1))
113
 118 00cc 8093 0000 		sts twi_state,r24
114
 119 00d0 8150      		subi r24,lo8(-(-1))
115
 120 00d2 E82F      		mov r30,r24
116
 121 00d4 F0E0      		ldi r31,lo8(0)
117
 122 00d6 E731      		cpi r30,23
118
 123 00d8 F105      		cpc r31,__zero_reg__
119
 124 00da 00F0      		brlo .+2
120
 125 00dc 00C0      		rjmp .L8
121
 126 00de E050      		subi r30,lo8(-(gs(.L21)))
122
 127 00e0 F040      		sbci r31,hi8(-(gs(.L21)))
123
 128 00e2 0C94 0000 		jmp __tablejump2__
124
 129               		.data
125
 130               		.section .progmem.gcc_sw_table, "a", @progbits
126
 131               		.p2align 1
127
 132               	.L21:
128
 133               		.data
129
 134               		.section .progmem.gcc_sw_table, "a", @progbits
130
 135               		.p2align 1
131
 136 0000 0000      		.word gs(.L55)
132
 137 0002 0000      		.word gs(.L10)
133
 138 0004 0000      		.word gs(.L11)
134
 139 0006 0000      		.word gs(.L12)
135
 140 0008 0000      		.word gs(.L13)
136
 141 000a 0000      		.word gs(.L14)
137
 142 000c 0000      		.word gs(.L15)
138
 143 000e 0000      		.word gs(.L8)
139
 144 0010 0000      		.word gs(.L8)
140
 145 0012 0000      		.word gs(.L8)
141
 146 0014 0000      		.word gs(.L8)
142
 147 0016 0000      		.word gs(.L8)
143
 148 0018 0000      		.word gs(.L8)
144
 149 001a 0000      		.word gs(.L8)
145
 150 001c 0000      		.word gs(.L8)
146
 151 001e 0000      		.word gs(.L8)
147
 152 0020 0000      		.word gs(.L8)
148
 153 0022 0000      		.word gs(.L8)
149
 154 0024 0000      		.word gs(.L16)
150
 155 0026 0000      		.word gs(.L17)
151
 156 0028 0000      		.word gs(.L18)
152
 157 002a 0000      		.word gs(.L19)
153
 158 002c 0000      		.word gs(.L20)
154
 159               		.text
155
 160               	.L23:
156
 161 00e6 8091 0000 		lds r24,motor_write
157
 162 00ea 8F5F      		subi r24,lo8(-(1))
158
 163 00ec 8093 0000 		sts motor_write,r24
159
 164               	.L55:
160
 165 00f0 E091 0000 		lds r30,motor_write
161
 166 00f4 F0E0      		ldi r31,lo8(0)
162
 167 00f6 EE0F      		lsl r30
163
 168 00f8 FF1F      		rol r31
164
 169 00fa EE0F      		lsl r30
165
 170 00fc FF1F      		rol r31
166
 171 00fe E050      		subi r30,lo8(-(Mixer))
167
 172 0100 F040      		sbci r31,hi8(-(Mixer))
168
 173 0102 8585      		ldd r24,Z+13
169
 174 0104 1816      		cp __zero_reg__,r24
170
 175 0106 04F0      		brlt .L22
171
 176 0108 8091 0000 		lds r24,motor_write
172
 177 010c 8C30      		cpi r24,lo8(12)
173
 178 010e 00F0      		brlo .L23
174
 179               	.L22:
175
 180 0110 8091 0000 		lds r24,motor_write
176
 181 0114 8C30      		cpi r24,lo8(12)
177
 182 0116 00F0      		brlo .L24
178
 183 0118 1092 0000 		sts (BLConfig_WriteMask)+1,__zero_reg__
179
 184 011c 1092 0000 		sts BLConfig_WriteMask,__zero_reg__
180
 185 0120 1092 0000 		sts motor_write,__zero_reg__
181
 186 0124 85E0      		ldi r24,lo8(5)
182
 187 0126 8093 0000 		sts twi_state,r24
183
 188 012a 8091 0000 		lds r24,motor_read
184
 189 012e 880F      		lsl r24
185
 190 0130 8D5A      		subi r24,lo8(-(83))
186
 191 0132 00C0      		rjmp .L63
187
 192               	.L24:
188
 193 0134 8091 0000 		lds r24,motor_write
189
 194 0138 880F      		lsl r24
190
 195 013a 8E5A      		subi r24,lo8(-(82))
191
 196               	.L63:
192
 197 013c 8093 BB00 		sts 187,r24
193
 198 0140 85E8      		ldi r24,lo8(-123)
194
 199 0142 00C0      		rjmp .L59
195
 200               	.L10:
196
 201 0144 E091 0000 		lds r30,motor_write
197
 202 0148 F0E0      		ldi r31,lo8(0)
198
 203 014a 93E0      		ldi r25,3
199
 204 014c EE0F      	1:	lsl r30
200
 205 014e FF1F      		rol r31
201
 206 0150 9A95      		dec r25
202
 207 0152 01F4      		brne 1b
203
 208 0154 E050      		subi r30,lo8(-(Motor))
204
 209 0156 F040      		sbci r31,hi8(-(Motor))
205
 210 0158 8181      		ldd r24,Z+1
206
 211 015a 8093 BB00 		sts 187,r24
207
 212 015e 85E8      		ldi r24,lo8(-123)
208
 213 0160 8093 BC00 		sts 188,r24
209
 214 0164 E091 0000 		lds r30,motor_write
210
 215 0168 F0E0      		ldi r31,lo8(0)
211
 216 016a 83E0      		ldi r24,3
212
 217 016c EE0F      	1:	lsl r30
213
 218 016e FF1F      		rol r31
214
 219 0170 8A95      		dec r24
215
 220 0172 01F4      		brne 1b
216
 221 0174 E050      		subi r30,lo8(-(Motor))
217
 222 0176 F040      		sbci r31,hi8(-(Motor))
218
 223 0178 8081      		ld r24,Z
219
 224 017a 80FF      		sbrs r24,0
220
 225 017c 00C0      		rjmp .L30
221
 226               	.L26:
222
 227 017e E091 0000 		lds r30,motor_write
223
 228 0182 F0E0      		ldi r31,lo8(0)
224
 229 0184 B3E0      		ldi r27,3
225
 230 0186 EE0F      	1:	lsl r30
226
 231 0188 FF1F      		rol r31
227
 232 018a BA95      		dec r27
228
 233 018c 01F4      		brne 1b
229
 234 018e E050      		subi r30,lo8(-(Motor))
230
 235 0190 F040      		sbci r31,hi8(-(Motor))
231
 236 0192 8281      		ldd r24,Z+2
232
 237 0194 8823      		tst r24
233
 238 0196 01F0      		breq .L27
234
 239 0198 8091 0000 		lds r24,RequiredMotors
235
 240 019c 8730      		cpi r24,lo8(7)
236
 241 019e 00F4      		brsh .+2
237
 242 01a0 00C0      		rjmp .L54
238
 243               	.L27:
239
 244 01a2 8091 0000 		lds r24,BLConfig_WriteMask
240
 245 01a6 9091 0000 		lds r25,(BLConfig_WriteMask)+1
241
 246 01aa 892B      		or r24,r25
242
 247 01ac 01F0      		breq .+2
243
 248 01ae 00C0      		rjmp .L54
244
 249 01b0 8091 0000 		lds r24,BLConfig_ReadMask
245
 250 01b4 9091 0000 		lds r25,(BLConfig_ReadMask)+1
246
 251 01b8 892B      		or r24,r25
247
 252 01ba 01F0      		breq .+2
248
 253 01bc 00C0      		rjmp .L54
249
 254 01be 00C0      		rjmp .L30
250
 255               	.L11:
251
 256 01c0 4091 0000 		lds r20,motor_write
252
 257 01c4 2091 0000 		lds r18,BLConfig_ReadMask
253
 258 01c8 3091 0000 		lds r19,(BLConfig_ReadMask)+1
254
 259 01cc 81E0      		ldi r24,lo8(1)
255
 260 01ce 90E0      		ldi r25,hi8(1)
256
 261 01d0 00C0      		rjmp 2f
257
 262 01d2 880F      	1:	lsl r24
258
 263 01d4 991F      		rol r25
259
 264 01d6 4A95      	2:	dec r20
260
 265 01d8 02F4      		brpl 1b
261
 266 01da 8223      		and r24,r18
262
 267 01dc 9323      		and r25,r19
263
 268 01de 892B      		or r24,r25
264
 269 01e0 01F0      		breq .L28
265
 270 01e2 E091 0000 		lds r30,motor_write
266
 271 01e6 F0E0      		ldi r31,lo8(0)
267
 272 01e8 A3E0      		ldi r26,3
268
 273 01ea EE0F      	1:	lsl r30
269
 274 01ec FF1F      		rol r31
270
 275 01ee AA95      		dec r26
271
 276 01f0 01F4      		brne 1b
272
 277 01f2 E050      		subi r30,lo8(-(Motor))
273
 278 01f4 F040      		sbci r31,hi8(-(Motor))
274
 279 01f6 80E1      		ldi r24,lo8(16)
275
 280 01f8 8483      		std Z+4,r24
276
 281 01fa 00C0      		rjmp .L29
277
 282               	.L28:
278
 283 01fc E091 0000 		lds r30,motor_write
279
 284 0200 F0E0      		ldi r31,lo8(0)
280
 285 0202 43E0      		ldi r20,3
281
 286 0204 EE0F      	1:	lsl r30
282
 287 0206 FF1F      		rol r31
283
 288 0208 4A95      		dec r20
284
 289 020a 01F4      		brne 1b
285
 290 020c E050      		subi r30,lo8(-(Motor))
286
 291 020e F040      		sbci r31,hi8(-(Motor))
287
 292 0210 1482      		std Z+4,__zero_reg__
288
 293               	.L29:
289
 294 0212 E091 0000 		lds r30,motor_write
290
 295 0216 A091 0000 		lds r26,motor_write
291
 296 021a F0E0      		ldi r31,lo8(0)
292
 297 021c 33E0      		ldi r19,3
293
 298 021e EE0F      	1:	lsl r30
294
 299 0220 FF1F      		rol r31
295
 300 0222 3A95      		dec r19
296
 301 0224 01F4      		brne 1b
297
 302 0226 E050      		subi r30,lo8(-(Motor))
298
 303 0228 F040      		sbci r31,hi8(-(Motor))
299
 304 022a 9481      		ldd r25,Z+4
300
 305 022c 990F      		lsl r25
301
 306 022e 990F      		lsl r25
302
 307 0230 990F      		lsl r25
303
 308 0232 B0E0      		ldi r27,lo8(0)
304
 309 0234 23E0      		ldi r18,3
305
 310 0236 AA0F      	1:	lsl r26
306
 311 0238 BB1F      		rol r27
307
 312 023a 2A95      		dec r18
308
 313 023c 01F4      		brne 1b
309
 314 023e A050      		subi r26,lo8(-(Motor))
310
 315 0240 B040      		sbci r27,hi8(-(Motor))
311
 316 0242 1296      		adiw r26,2
312
 317 0244 8C91      		ld r24,X
313
 318 0246 8770      		andi r24,lo8(7)
314
 319 0248 982B      		or r25,r24
315
 320 024a 9093 BB00 		sts 187,r25
316
 321 024e 85E8      		ldi r24,lo8(-123)
317
 322 0250 8093 BC00 		sts 188,r24
318
 323 0254 4091 0000 		lds r20,motor_write
319
 324 0258 2091 0000 		lds r18,BLConfig_WriteMask
320
 325 025c 3091 0000 		lds r19,(BLConfig_WriteMask)+1
321
 326 0260 81E0      		ldi r24,lo8(1)
322
 327 0262 90E0      		ldi r25,hi8(1)
323
 328 0264 00C0      		rjmp 2f
324
 329 0266 880F      	1:	lsl r24
325
 330 0268 991F      		rol r25
326
 331 026a 4A95      	2:	dec r20
327
 332 026c 02F4      		brpl 1b
328
 333 026e 8223      		and r24,r18
329
 334 0270 9323      		and r25,r19
330
 335 0272 892B      		or r24,r25
331
 336 0274 01F0      		breq .L30
332
 337 0276 80E0      		ldi r24,lo8(BLConfig)
333
 338 0278 90E0      		ldi r25,hi8(BLConfig)
334
 339 027a 9093 0000 		sts (pBuff.1659)+1,r25
335
 340 027e 8093 0000 		sts pBuff.1659,r24
336
 341 0282 88E0      		ldi r24,lo8(8)
337
 342 0284 8093 0000 		sts BuffLen.1660,r24
338
 343 0288 00C0      		rjmp .L54
339
 344               	.L30:
340
 345 028a 84E0      		ldi r24,lo8(4)
341
 346 028c 00C0      		rjmp .L61
342
 347               	.L12:
343
 348 028e E091 0000 		lds r30,pBuff.1659
344
 349 0292 F091 0000 		lds r31,(pBuff.1659)+1
345
 350 0296 8191      		ld r24,Z+
346
 351 0298 8093 BB00 		sts 187,r24
347
 352 029c 85E8      		ldi r24,lo8(-123)
348
 353 029e 8093 BC00 		sts 188,r24
349
 354 02a2 F093 0000 		sts (pBuff.1659)+1,r31
350
 355 02a6 E093 0000 		sts pBuff.1659,r30
351
 356 02aa 8091 0000 		lds r24,BuffLen.1660
352
 357 02ae 8150      		subi r24,lo8(-(-1))
353
 358 02b0 8093 0000 		sts BuffLen.1660,r24
354
 359 02b4 8823      		tst r24
355
 360 02b6 01F4      		brne .+2
356
 361 02b8 00C0      		rjmp .L54
357
 362 02ba 83E0      		ldi r24,lo8(3)
358
 363 02bc 00C0      		rjmp .L61
359
 364               	.L13:
360
 365 02be 8091 B900 		lds r24,185
361
 366 02c2 8033      		cpi r24,lo8(48)
362
 367 02c4 01F4      		brne .L31
363
 368 02c6 8091 0000 		lds r24,missing_motor.1657
364
 369 02ca 8823      		tst r24
365
 370 02cc 01F4      		brne .L32
366
 371 02ce 8091 0000 		lds r24,motor_write
367
 372 02d2 8F5F      		subi r24,lo8(-(1))
368
 373 02d4 8093 0000 		sts missing_motor.1657,r24
369
 374               	.L32:
370
 375 02d8 E091 0000 		lds r30,motor_write
371
 376 02dc F0E0      		ldi r31,lo8(0)
372
 377 02de 93E0      		ldi r25,3
373
 378 02e0 EE0F      	1:	lsl r30
374
 379 02e2 FF1F      		rol r31
375
 380 02e4 9A95      		dec r25
376
 381 02e6 01F4      		brne 1b
377
 382 02e8 E050      		subi r30,lo8(-(Motor))
378
 383 02ea F040      		sbci r31,hi8(-(Motor))
379
 384 02ec 8381      		ldd r24,Z+3
380
 385 02ee 8F77      		andi r24,lo8(127)
381
 386 02f0 8F37      		cpi r24,lo8(127)
382
 387 02f2 01F0      		breq .L31
383
 388 02f4 E091 0000 		lds r30,motor_write
384
 389 02f8 F0E0      		ldi r31,lo8(0)
385
 390 02fa 83E0      		ldi r24,3
386
 391 02fc EE0F      	1:	lsl r30
387
 392 02fe FF1F      		rol r31
388
 393 0300 8A95      		dec r24
389
 394 0302 01F4      		brne 1b
390
 395 0304 E050      		subi r30,lo8(-(Motor))
391
 396 0306 F040      		sbci r31,hi8(-(Motor))
392
 397 0308 8381      		ldd r24,Z+3
393
 398 030a 8F5F      		subi r24,lo8(-(1))
394
 399 030c 8383      		std Z+3,r24
395
 400               	.L31:
396
 401 030e 1092 0000 		sts twi_state,__zero_reg__
397
 402 0312 84E9      		ldi r24,lo8(-108)
398
 403 0314 8093 BC00 		sts 188,r24
399
 404 0318 8AE0      		ldi r24,lo8(10)
400
 405 031a 90E0      		ldi r25,hi8(10)
401
 406 031c 9093 0000 		sts (I2CTimeout)+1,r25
402
 407 0320 8093 0000 		sts I2CTimeout,r24
403
 408 0324 8091 0000 		lds r24,motor_write
404
 409 0328 8F5F      		subi r24,lo8(-(1))
405
 410 032a 8093 0000 		sts motor_write,r24
406
 411 032e 1092 0000 		sts twi_state,__zero_reg__
407
 412 0332 00C0      		rjmp .L64
408
 413               	.L14:
409
 414 0334 8091 B900 		lds r24,185
410
 415 0338 8034      		cpi r24,lo8(64)
411
 416 033a 01F0      		breq .L33
412
 417 033c E091 0000 		lds r30,motor_read
413
 418 0340 F0E0      		ldi r31,lo8(0)
414
 419 0342 B3E0      		ldi r27,3
415
 420 0344 EE0F      	1:	lsl r30
416
 421 0346 FF1F      		rol r31
417
 422 0348 BA95      		dec r27
418
 423 034a 01F4      		brne 1b
419
 424 034c E050      		subi r30,lo8(-(Motor))
420
 425 034e F040      		sbci r31,hi8(-(Motor))
421
 426 0350 8381      		ldd r24,Z+3
422
 427 0352 8F77      		andi r24,lo8(127)
423
 428 0354 8383      		std Z+3,r24
424
 429 0356 8091 0000 		lds r24,motor_read
425
 430 035a 8F5F      		subi r24,lo8(-(1))
426
 431 035c 8093 0000 		sts motor_read,r24
427
 432 0360 8091 0000 		lds r24,motor_read
428
 433 0364 8C30      		cpi r24,lo8(12)
429
 434 0366 00F0      		brlo .L34
430
 435 0368 1092 0000 		sts motor_read,__zero_reg__
431
 436 036c 1092 0000 		sts (BLConfig_ReadMask)+1,__zero_reg__
432
 437 0370 1092 0000 		sts BLConfig_ReadMask,__zero_reg__
433
 438 0374 8091 0000 		lds r24,motor_read_temperature.1658
434
 439 0378 8F5F      		subi r24,lo8(-(1))
435
 440 037a 8093 0000 		sts motor_read_temperature.1658,r24
436
 441 037e 8C30      		cpi r24,lo8(12)
437
 442 0380 00F0      		brlo .L34
438
 443 0382 1092 0000 		sts motor_read_temperature.1658,__zero_reg__
439
 444 0386 8091 0000 		lds r24,BLFlags
440
 445 038a 8D7F      		andi r24,lo8(-3)
441
 446 038c 8093 0000 		sts BLFlags,r24
442
 447               	.L34:
443
 448 0390 8091 0000 		lds r24,BLFlags
444
 449 0394 8160      		ori r24,lo8(1)
445
 450 0396 8093 0000 		sts BLFlags,r24
446
 451 039a 1092 0000 		sts twi_state,__zero_reg__
447
 452 039e 84E9      		ldi r24,lo8(-108)
448
 453 03a0 00C0      		rjmp .L57
449
 454               	.L33:
450
 455 03a2 E091 0000 		lds r30,motor_read
451
 456 03a6 F0E0      		ldi r31,lo8(0)
452
 457 03a8 A3E0      		ldi r26,3
453
 458 03aa EE0F      	1:	lsl r30
454
 459 03ac FF1F      		rol r31
455
 460 03ae AA95      		dec r26
456
 461 03b0 01F4      		brne 1b
457
 462 03b2 E050      		subi r30,lo8(-(Motor))
458
 463 03b4 F040      		sbci r31,hi8(-(Motor))
459
 464 03b6 8381      		ldd r24,Z+3
460
 465 03b8 8068      		ori r24,lo8(-128)
461
 466 03ba 8383      		std Z+3,r24
462
 467 03bc E091 0000 		lds r30,motor_read
463
 468 03c0 F0E0      		ldi r31,lo8(0)
464
 469 03c2 43E0      		ldi r20,3
465
 470 03c4 EE0F      	1:	lsl r30
466
 471 03c6 FF1F      		rol r31
467
 472 03c8 4A95      		dec r20
468
 473 03ca 01F4      		brne 1b
469
 474 03cc E050      		subi r30,lo8(-(Motor))
470
 475 03ce F040      		sbci r31,hi8(-(Motor))
471
 476 03d0 8081      		ld r24,Z
472
 477 03d2 80FF      		sbrs r24,0
473
 478 03d4 00C0      		rjmp .L36
474
 479 03d6 E091 0000 		lds r30,motor_read
475
 480 03da F0E0      		ldi r31,lo8(0)
476
 481 03dc 33E0      		ldi r19,3
477
 482 03de EE0F      	1:	lsl r30
478
 483 03e0 FF1F      		rol r31
479
 484 03e2 3A95      		dec r19
480
 485 03e4 01F4      		brne 1b
481
 486 03e6 E050      		subi r30,lo8(-(Motor))
482
 487 03e8 F040      		sbci r31,hi8(-(Motor))
483
 488 03ea 8481      		ldd r24,Z+4
484
 489 03ec 8823      		tst r24
485
 490 03ee 01F0      		breq .L38
486
 491 03f0 8031      		cpi r24,lo8(16)
487
 492 03f2 01F4      		brne .L37
488
 493 03f4 80E0      		ldi r24,lo8(BLConfig)
489
 494 03f6 90E0      		ldi r25,hi8(BLConfig)
490
 495 03f8 9093 0000 		sts (pBuff.1659)+1,r25
491
 496 03fc 8093 0000 		sts pBuff.1659,r24
492
 497 0400 88E0      		ldi r24,lo8(8)
493
 498 0402 00C0      		rjmp .L56
494
 499               	.L38:
495
 500 0404 8091 0000 		lds r24,motor_read
496
 501 0408 90E0      		ldi r25,lo8(0)
497
 502 040a 23E0      		ldi r18,3
498
 503 040c 880F      	1:	lsl r24
499
 504 040e 991F      		rol r25
500
 505 0410 2A95      		dec r18
501
 506 0412 01F4      		brne 1b
502
 507 0414 8050      		subi r24,lo8(-(Motor+5))
503
 508 0416 9040      		sbci r25,hi8(-(Motor+5))
504
 509 0418 9093 0000 		sts (pBuff.1659)+1,r25
505
 510 041c 8093 0000 		sts pBuff.1659,r24
506
 511 0420 9091 0000 		lds r25,motor_read
507
 512 0424 8091 0000 		lds r24,motor_read_temperature.1658
508
 513 0428 9817      		cp r25,r24
509
 514 042a 01F4      		brne .L42
510
 515 042c 83E0      		ldi r24,lo8(3)
511
 516 042e 00C0      		rjmp .L56
512
 517               	.L36:
513
 518 0430 8091 0000 		lds r24,motor_read
514
 519 0434 90E0      		ldi r25,lo8(0)
515
 520 0436 B3E0      		ldi r27,3
516
 521 0438 880F      	1:	lsl r24
517
 522 043a 991F      		rol r25
518
 523 043c BA95      		dec r27
519
 524 043e 01F4      		brne 1b
520
 525 0440 8050      		subi r24,lo8(-(Motor+5))
521
 526 0442 9040      		sbci r25,hi8(-(Motor+5))
522
 527 0444 9093 0000 		sts (pBuff.1659)+1,r25
523
 528 0448 8093 0000 		sts pBuff.1659,r24
524
 529 044c 8091 0000 		lds r24,BLFlags
525
 530 0450 81FD      		sbrc r24,1
526
 531 0452 00C0      		rjmp .L41
527
 532 0454 9091 0000 		lds r25,motor_read
528
 533 0458 8091 0000 		lds r24,motor_read_temperature.1658
529
 534 045c 9817      		cp r25,r24
530
 535 045e 01F4      		brne .L42
531
 536               	.L41:
532
 537 0460 82E0      		ldi r24,lo8(2)
533
 538 0462 00C0      		rjmp .L56
534
 539               	.L42:
535
 540 0464 81E0      		ldi r24,lo8(1)
536
 541               	.L56:
537
 542 0466 8093 0000 		sts BuffLen.1660,r24
538
 543               	.L37:
539
 544 046a 8091 0000 		lds r24,BuffLen.1660
540
 545 046e 8130      		cpi r24,lo8(1)
541
 546 0470 01F4      		brne .L43
542
 547 0472 85E8      		ldi r24,lo8(-123)
543
 548 0474 00C0      		rjmp .L57
544
 549               	.L43:
545
 550 0476 85EC      		ldi r24,lo8(-59)
546
 551               	.L57:
547
 552 0478 8093 BC00 		sts 188,r24
548
 553 047c 8091 0000 		lds r24,missing_motor.1657
549
 554 0480 8093 0000 		sts MissingMotor,r24
550
 555 0484 1092 0000 		sts missing_motor.1657,__zero_reg__
551
 556 0488 00C0      		rjmp .L54
552
 557               	.L15:
553
 558 048a 8091 BB00 		lds r24,187
554
 559 048e E091 0000 		lds r30,pBuff.1659
555
 560 0492 F091 0000 		lds r31,(pBuff.1659)+1
556
 561 0496 8193      		st Z+,r24
557
 562 0498 F093 0000 		sts (pBuff.1659)+1,r31
558
 563 049c E093 0000 		sts pBuff.1659,r30
559
 564 04a0 8091 0000 		lds r24,BuffLen.1660
560
 565 04a4 8150      		subi r24,lo8(-(-1))
561
 566 04a6 8093 0000 		sts BuffLen.1660,r24
562
 567 04aa 8230      		cpi r24,lo8(2)
563
 568 04ac 00F0      		brlo .L44
564
 569 04ae 85EC      		ldi r24,lo8(-59)
565
 570 04b0 00C0      		rjmp .L58
566
 571               	.L44:
567
 572 04b2 8130      		cpi r24,lo8(1)
568
 573 04b4 01F4      		brne .L46
569
 574 04b6 85E8      		ldi r24,lo8(-123)
570
 575               	.L58:
571
 576 04b8 8093 BC00 		sts 188,r24
572
 577 04bc 86E0      		ldi r24,lo8(6)
573
 578 04be 00C0      		rjmp .L61
574
 579               	.L46:
575
 580 04c0 8091 0000 		lds r24,BLFlags
576
 581 04c4 81FF      		sbrs r24,1
577
 582 04c6 00C0      		rjmp .L47
578
 583 04c8 8091 0000 		lds r24,FCFlags
579
 584 04cc 80FD      		sbrc r24,0
580
 585 04ce 00C0      		rjmp .L48
581
 586 04d0 E091 0000 		lds r30,motor_read
582
 587 04d4 F0E0      		ldi r31,lo8(0)
583
 588 04d6 A3E0      		ldi r26,3
584
 589 04d8 EE0F      	1:	lsl r30
585
 590 04da FF1F      		rol r31
586
 591 04dc AA95      		dec r26
587
 592 04de 01F4      		brne 1b
588
 593 04e0 E050      		subi r30,lo8(-(Motor))
589
 594 04e2 F040      		sbci r31,hi8(-(Motor))
590
 595 04e4 8681      		ldd r24,Z+6
591
 596 04e6 8A3F      		cpi r24,lo8(-6)
592
 597 04e8 01F4      		brne .L48
593
 598 04ea E091 0000 		lds r30,motor_read
594
 599 04ee F0E0      		ldi r31,lo8(0)
595
 600 04f0 43E0      		ldi r20,3
596
 601 04f2 EE0F      	1:	lsl r30
597
 602 04f4 FF1F      		rol r31
598
 603 04f6 4A95      		dec r20
599
 604 04f8 01F4      		brne 1b
600
 605 04fa E050      		subi r30,lo8(-(Motor))
601
 606 04fc F040      		sbci r31,hi8(-(Motor))
602
 607 04fe 8081      		ld r24,Z
603
 608 0500 8160      		ori r24,lo8(1)
604
 609 0502 8083      		st Z,r24
605
 610 0504 00C0      		rjmp .L47
606
 611               	.L48:
607
 612 0506 E091 0000 		lds r30,motor_read
608
 613 050a F0E0      		ldi r31,lo8(0)
609
 614 050c 33E0      		ldi r19,3
610
 615 050e EE0F      	1:	lsl r30
611
 616 0510 FF1F      		rol r31
612
 617 0512 3A95      		dec r19
613
 618 0514 01F4      		brne 1b
614
 619 0516 E050      		subi r30,lo8(-(Motor))
615
 620 0518 F040      		sbci r31,hi8(-(Motor))
616
 621 051a 1082      		st Z,__zero_reg__
617
 622               	.L47:
618
 623 051c 8091 0000 		lds r24,motor_read
619
 624 0520 8F5F      		subi r24,lo8(-(1))
620
 625 0522 8093 0000 		sts motor_read,r24
621
 626 0526 8091 0000 		lds r24,motor_read
622
 627 052a 8C30      		cpi r24,lo8(12)
623
 628 052c 00F0      		brlo .L49
624
 629 052e 1092 0000 		sts motor_read,__zero_reg__
625
 630 0532 1092 0000 		sts (BLConfig_ReadMask)+1,__zero_reg__
626
 631 0536 1092 0000 		sts BLConfig_ReadMask,__zero_reg__
627
 632 053a 8091 0000 		lds r24,motor_read_temperature.1658
628
 633 053e 8F5F      		subi r24,lo8(-(1))
629
 634 0540 8093 0000 		sts motor_read_temperature.1658,r24
630
 635 0544 8C30      		cpi r24,lo8(12)
631
 636 0546 00F0      		brlo .L49
632
 637 0548 1092 0000 		sts motor_read_temperature.1658,__zero_reg__
633
 638 054c 8091 0000 		lds r24,BLFlags
634
 639 0550 8D7F      		andi r24,lo8(-3)
635
 640 0552 8093 0000 		sts BLFlags,r24
636
 641               	.L49:
637
 642 0556 1092 0000 		sts twi_state,__zero_reg__
638
 643 055a 84E9      		ldi r24,lo8(-108)
639
 644 055c 8093 BC00 		sts 188,r24
640
 645 0560 00C0      		rjmp .L62
641
 646               	.L61:
642
 647 0562 8093 0000 		sts twi_state,r24
643
 648 0566 00C0      		rjmp .L54
644
 649               	.L16:
645
 650 0568 88E9      		ldi r24,lo8(-104)
646
 651 056a 00C0      		rjmp .L63
647
 652               	.L17:
648
 653 056c 8091 0000 		lds r24,dac_channel
649
 654 0570 90E0      		ldi r25,lo8(0)
650
 655 0572 0896      		adiw r24,8
651
 656 0574 880F      		lsl r24
652
 657 0576 991F      		rol r25
653
 658 0578 00C0      		rjmp .L63
654
 659               	.L18:
655
 660 057a 8091 0000 		lds r24,dac_channel
656
 661 057e 8130      		cpi r24,lo8(1)
657
 662 0580 01F0      		breq .L51
658
 663 0582 8130      		cpi r24,lo8(1)
659
 664 0584 00F0      		brlo .L50
660
 665 0586 8230      		cpi r24,lo8(2)
661
 666 0588 01F0      		breq .+2
662
 667 058a 00C0      		rjmp .L54
663
 668 058c 00C0      		rjmp .L65
664
 669               	.L50:
665
 670 058e 8091 0000 		lds r24,AnalogOffsetNick
666
 671 0592 00C0      		rjmp .L63
667
 672               	.L51:
668
 673 0594 8091 0000 		lds r24,AnalogOffsetRoll
669
 674 0598 00C0      		rjmp .L63
670
 675               	.L65:
671
 676 059a 8091 0000 		lds r24,AnalogOffsetGier
672
 677 059e 00C0      		rjmp .L63
673
 678               	.L19:
674
 679 05a0 80E8      		ldi r24,lo8(-128)
675
 680 05a2 00C0      		rjmp .L63
676
 681               	.L20:
677
 682 05a4 1092 0000 		sts twi_state,__zero_reg__
678
 683 05a8 84E9      		ldi r24,lo8(-108)
679
 684 05aa 8093 BC00 		sts 188,r24
680
 685 05ae 8AE0      		ldi r24,lo8(10)
681
 686 05b0 90E0      		ldi r25,hi8(10)
682
 687 05b2 9093 0000 		sts (I2CTimeout)+1,r25
683
 688 05b6 8093 0000 		sts I2CTimeout,r24
684
 689 05ba 8091 0000 		lds r24,dac_channel
685
 690 05be 8230      		cpi r24,lo8(2)
686
 691 05c0 00F4      		brsh .L53
687
 692 05c2 8091 0000 		lds r24,dac_channel
688
 693 05c6 8F5F      		subi r24,lo8(-(1))
689
 694 05c8 8093 0000 		sts dac_channel,r24
690
 695 05cc 82E1      		ldi r24,lo8(18)
691
 696 05ce 8093 0000 		sts twi_state,r24
692
 697               	.L64:
693
 698 05d2 8091 0000 		lds r24,BLFlags
694
 699 05d6 8E7F      		andi r24,lo8(-2)
695
 700 05d8 8093 0000 		sts BLFlags,r24
696
 701 05dc 85EA      		ldi r24,lo8(-91)
697
 702               	.L59:
698
 703 05de 8093 BC00 		sts 188,r24
699
 704 05e2 00C0      		rjmp .L54
700
 705               	.L53:
701
 706 05e4 1092 0000 		sts dac_channel,__zero_reg__
702
 707               	.L62:
703
 708 05e8 8091 0000 		lds r24,BLFlags
704
 709 05ec 8160      		ori r24,lo8(1)
705
 710 05ee 8093 0000 		sts BLFlags,r24
706
 711 05f2 00C0      		rjmp .L54
707
 712               	.L8:
708
 713 05f4 1092 0000 		sts twi_state,__zero_reg__
709
 714 05f8 84E9      		ldi r24,lo8(-108)
710
 715 05fa 8093 BC00 		sts 188,r24
711
 716 05fe 8091 0000 		lds r24,BLFlags
712
 717 0602 8160      		ori r24,lo8(1)
713
 718 0604 8093 0000 		sts BLFlags,r24
714
 719 0608 8AE0      		ldi r24,lo8(10)
715
 720 060a 90E0      		ldi r25,hi8(10)
716
 721 060c 9093 0000 		sts (I2CTimeout)+1,r25
717
 722 0610 8093 0000 		sts I2CTimeout,r24
718
 723 0614 1092 0000 		sts motor_write,__zero_reg__
719
 724 0618 1092 0000 		sts motor_read,__zero_reg__
720
 725               	.L54:
721
 726               	/* epilogue start */
722
 727 061c FF91      		pop r31
723
 728 061e EF91      		pop r30
724
 729 0620 BF91      		pop r27
725
 730 0622 AF91      		pop r26
726
 731 0624 9F91      		pop r25
727
 732 0626 8F91      		pop r24
728
 733 0628 4F91      		pop r20
729
 734 062a 3F91      		pop r19
730
 735 062c 2F91      		pop r18
731
 736 062e 0F90      		pop r0
732
 737 0630 0FBE      		out __SREG__,r0
733
 738 0632 0F90      		pop r0
734
 739 0634 1F90      		pop __zero_reg__
735
 740 0636 1895      		reti
736
 742               	.global	I2C_ReadBLConfig
737
 744               	I2C_ReadBLConfig:
738
 745 0638 FF92      		push r15
739
 746 063a 0F93      		push r16
740
 747 063c 1F93      		push r17
741
 748 063e CF93      		push r28
742
 749 0640 DF93      		push r29
743
 750               	/* prologue: function */
744
 751               	/* frame size = 0 */
745
 752 0642 982F      		mov r25,r24
746
 753 0644 8091 0000 		lds r24,MotorenEin
747
 754 0648 8823      		tst r24
748
 755 064a 01F0      		breq .+2
749
 756 064c 00C0      		rjmp .L67
750
 757 064e 8091 0000 		lds r24,PC_MotortestActive
751
 758 0652 8823      		tst r24
752
 759 0654 01F0      		breq .+2
753
 760 0656 00C0      		rjmp .L67
754
 761 0658 9D30      		cpi r25,lo8(13)
755
 762 065a 00F0      		brlo .+2
756
 763 065c 00C0      		rjmp .L68
757
 764 065e 9923      		tst r25
758
 765 0660 01F4      		brne .L69
759
 766 0662 86E0      		ldi r24,lo8(6)
760
 767 0664 00C0      		rjmp .L70
761
 768               	.L69:
762
 769 0666 C92F      		mov r28,r25
763
 770 0668 D0E0      		ldi r29,lo8(0)
764
 771 066a 2197      		sbiw r28,1
765
 772 066c FE01      		movw r30,r28
766
 773 066e 43E0      		ldi r20,3
767
 774 0670 EE0F      	1:	lsl r30
768
 775 0672 FF1F      		rol r31
769
 776 0674 4A95      		dec r20
770
 777 0676 01F4      		brne 1b
771
 778 0678 E050      		subi r30,lo8(-(Motor))
772
 779 067a F040      		sbci r31,hi8(-(Motor))
773
 780 067c 8381      		ldd r24,Z+3
774
 781 067e 87FF      		sbrs r24,7
775
 782 0680 00C0      		rjmp .L68
776
 783 0682 8081      		ld r24,Z
777
 784 0684 80FD      		sbrc r24,0
778
 785 0686 00C0      		rjmp .L71
779
 786 0688 83E0      		ldi r24,lo8(3)
780
 787 068a 00C0      		rjmp .L70
781
 788               	.L71:
782
 789 068c 80ED      		ldi r24,lo8(2000)
783
 790 068e 97E0      		ldi r25,hi8(2000)
784
 791 0690 0E94 0000 		call SetDelay
785
 792 0694 8C01      		movw r16,r24
786
 793               	.L73:
787
 794 0696 8091 0000 		lds r24,BLFlags
788
 795 069a 80FD      		sbrc r24,0
789
 796 069c 00C0      		rjmp .L72
790
 797 069e C801      		movw r24,r16
791
 798 06a0 0E94 0000 		call CheckDelay
792
 799 06a4 8823      		tst r24
793
 800 06a6 01F0      		breq .L73
794
 801               	.L72:
795
 802 06a8 81E0      		ldi r24,lo8(1)
796
 803 06aa 90E0      		ldi r25,hi8(1)
797
 804 06ac 00C0      		rjmp 2f
798
 805 06ae 880F      	1:	lsl r24
799
 806 06b0 991F      		rol r25
800
 807 06b2 CA95      	2:	dec r28
801
 808 06b4 02F4      		brpl 1b
802
 809 06b6 9093 0000 		sts (BLConfig_ReadMask)+1,r25
803
 810 06ba 8093 0000 		sts BLConfig_ReadMask,r24
804
 811 06be E0E0      		ldi r30,lo8(Motor+1)
805
 812 06c0 F0E0      		ldi r31,hi8(Motor+1)
806
 813 06c2 40E0      		ldi r20,lo8(0)
807
 814 06c4 50E0      		ldi r21,hi8(0)
808
 815 06c6 61E0      		ldi r22,lo8(1)
809
 816 06c8 70E0      		ldi r23,hi8(1)
810
 817               	.L75:
811
 818 06ca 2091 0000 		lds r18,BLConfig_ReadMask
812
 819 06ce 3091 0000 		lds r19,(BLConfig_ReadMask)+1
813
 820 06d2 CB01      		movw r24,r22
814
 821 06d4 042E      		mov r0,r20
815
 822 06d6 00C0      		rjmp 2f
816
 823 06d8 880F      	1:	lsl r24
817
 824 06da 991F      		rol r25
818
 825 06dc 0A94      	2:	dec r0
819
 826 06de 02F4      		brpl 1b
820
 827 06e0 8223      		and r24,r18
821
 828 06e2 9323      		and r25,r19
822
 829 06e4 892B      		or r24,r25
823
 830 06e6 01F0      		breq .L74
824
 831 06e8 1082      		st Z,__zero_reg__
825
 832 06ea 1182      		std Z+1,__zero_reg__
826
 833               	.L74:
827
 834 06ec 4F5F      		subi r20,lo8(-(1))
828
 835 06ee 5F4F      		sbci r21,hi8(-(1))
829
 836 06f0 3896      		adiw r30,8
830
 837 06f2 4C30      		cpi r20,12
831
 838 06f4 5105      		cpc r21,__zero_reg__
832
 839 06f6 01F4      		brne .L75
833
 840 06f8 1092 0000 		sts motor_read,__zero_reg__
834
 841 06fc 1092 0000 		sts BLConfig,__zero_reg__
835
 842 0700 1092 0000 		sts BLConfig+7,__zero_reg__
836
 843 0704 35EA      		ldi r19,lo8(-91)
837
 844 0706 F32E      		mov r15,r19
838
 845               	.L79:
839
 846 0708 1092 0000 		sts twi_state,__zero_reg__
840
 847 070c 8091 0000 		lds r24,BLFlags
841
 848 0710 8E7F      		andi r24,lo8(-2)
842
 849 0712 8093 0000 		sts BLFlags,r24
843
 850 0716 F092 BC00 		sts 188,r15
844
 851               	.L77:
845
 852 071a 8091 0000 		lds r24,BLFlags
846
 853 071e 80FD      		sbrc r24,0
847
 854 0720 00C0      		rjmp .L76
848
 855 0722 C801      		movw r24,r16
849
 856 0724 0E94 0000 		call CheckDelay
850
 857 0728 8823      		tst r24
851
 858 072a 01F0      		breq .L77
852
 859               	.L76:
853
 860 072c 8091 0000 		lds r24,BLConfig_ReadMask
854
 861 0730 9091 0000 		lds r25,(BLConfig_ReadMask)+1
855
 862 0734 892B      		or r24,r25
856
 863 0736 01F0      		breq .L78
857
 864 0738 C801      		movw r24,r16
858
 865 073a 0E94 0000 		call CheckDelay
859
 866 073e 8823      		tst r24
860
 867 0740 01F0      		breq .L79
861
 868               	.L78:
862
 869 0742 8091 0000 		lds r24,BLConfig
863
 870 0746 8230      		cpi r24,lo8(2)
864
 871 0748 01F0      		breq .L80
865
 872 074a 84E0      		ldi r24,lo8(4)
866
 873 074c 00C0      		rjmp .L70
867
 874               	.L80:
868
 875 074e 80E0      		ldi r24,lo8(BLConfig)
869
 876 0750 90E0      		ldi r25,hi8(BLConfig)
870
 877 0752 67E0      		ldi r22,lo8(7)
871
 878 0754 70E0      		ldi r23,hi8(7)
872
 879 0756 0E94 0000 		call RAM_Checksum
873
 880 075a 9091 0000 		lds r25,BLConfig+7
874
 881 075e 8917      		cp r24,r25
875
 882 0760 01F4      		brne .L81
876
 883 0762 80E0      		ldi r24,lo8(0)
877
 884 0764 00C0      		rjmp .L70
878
 885               	.L81:
879
 886 0766 85E0      		ldi r24,lo8(5)
880
 887 0768 00C0      		rjmp .L70
881
 888               	.L67:
882
 889 076a 81E0      		ldi r24,lo8(1)
883
 890 076c 00C0      		rjmp .L70
884
 891               	.L68:
885
 892 076e 82E0      		ldi r24,lo8(2)
886
 893               	.L70:
887
 894               	/* epilogue start */
888
 895 0770 CDB7      		in r28,__SP_L__
889
 896 0772 DEB7      		in r29,__SP_H__
890
 897 0774 E5E0      		ldi r30, lo8(5)
891
 898 0776 0C94 0000 		jmp __epilogue_restores__ + ((18 - 5) * 2)
892
 900               	.global	I2C_WriteBLConfig
893
 902               	I2C_WriteBLConfig:
894
 903 077a 1F93      		push r17
895
 904 077c CF93      		push r28
896
 905 077e DF93      		push r29
897
 906               	/* prologue: function */
898
 907               	/* frame size = 0 */
899
 908 0780 182F      		mov r17,r24
900
 909 0782 8091 0000 		lds r24,MotorenEin
901
 910 0786 8823      		tst r24
902
 911 0788 01F0      		breq .+2
903
 912 078a 00C0      		rjmp .L88
904
 913 078c 8091 0000 		lds r24,PC_MotortestActive
905
 914 0790 8823      		tst r24
906
 915 0792 01F0      		breq .+2
907
 916 0794 00C0      		rjmp .L88
908
 917 0796 1D30      		cpi r17,lo8(13)
909
 918 0798 00F0      		brlo .+2
910
 919 079a 00C0      		rjmp .L89
911
 920 079c 1123      		tst r17
912
 921 079e 01F0      		breq .L90
913
 922 07a0 E12F      		mov r30,r17
914
 923 07a2 F0E0      		ldi r31,lo8(0)
915
 924 07a4 53E0      		ldi r21,3
916
 925 07a6 EE0F      	1:	lsl r30
917
 926 07a8 FF1F      		rol r31
918
 927 07aa 5A95      		dec r21
919
 928 07ac 01F4      		brne 1b
920
 929 07ae E050      		subi r30,lo8(-(Motor-8))
921
 930 07b0 F040      		sbci r31,hi8(-(Motor-8))
922
 931 07b2 8381      		ldd r24,Z+3
923
 932 07b4 87FF      		sbrs r24,7
924
 933 07b6 00C0      		rjmp .L89
925
 934 07b8 8081      		ld r24,Z
926
 935 07ba 80FD      		sbrc r24,0
927
 936 07bc 00C0      		rjmp .L90
928
 937 07be 83E0      		ldi r24,lo8(3)
929
 938 07c0 00C0      		rjmp .L91
930
 939               	.L90:
931
 940 07c2 8091 0000 		lds r24,BLConfig
932
 941 07c6 8230      		cpi r24,lo8(2)
933
 942 07c8 01F0      		breq .L92
934
 943 07ca 84E0      		ldi r24,lo8(4)
935
 944 07cc 00C0      		rjmp .L91
936
 945               	.L92:
937
 946 07ce 80E0      		ldi r24,lo8(BLConfig)
938
 947 07d0 90E0      		ldi r25,hi8(BLConfig)
939
 948 07d2 67E0      		ldi r22,lo8(7)
940
 949 07d4 70E0      		ldi r23,hi8(7)
941
 950 07d6 0E94 0000 		call RAM_Checksum
942
 951 07da 9091 0000 		lds r25,BLConfig+7
943
 952 07de 8917      		cp r24,r25
944
 953 07e0 01F0      		breq .L93
945
 954 07e2 85E0      		ldi r24,lo8(5)
946
 955 07e4 00C0      		rjmp .L91
947
 956               	.L93:
948
 957 07e6 80ED      		ldi r24,lo8(2000)
949
 958 07e8 97E0      		ldi r25,hi8(2000)
950
 959 07ea 0E94 0000 		call SetDelay
951
 960 07ee EC01      		movw r28,r24
952
 961               	.L95:
953
 962 07f0 8091 0000 		lds r24,BLFlags
954
 963 07f4 80FD      		sbrc r24,0
955
 964 07f6 00C0      		rjmp .L94
956
 965 07f8 CE01      		movw r24,r28
957
 966 07fa 0E94 0000 		call CheckDelay
958
 967 07fe 8823      		tst r24
959
 968 0800 01F0      		breq .L95
960
 969               	.L94:
961
 970 0802 1123      		tst r17
962
 971 0804 01F4      		brne .L96
963
 972 0806 8FEF      		ldi r24,lo8(255)
964
 973 0808 90E0      		ldi r25,hi8(255)
965
 974               	.L109:
966
 975 080a 9093 0000 		sts (BLConfig_WriteMask)+1,r25
967
 976 080e 8093 0000 		sts BLConfig_WriteMask,r24
968
 977 0812 E0E0      		ldi r30,lo8(Motor+1)
969
 978 0814 F0E0      		ldi r31,hi8(Motor+1)
970
 979 0816 40E0      		ldi r20,lo8(0)
971
 980 0818 50E0      		ldi r21,hi8(0)
972
 981 081a 61E0      		ldi r22,lo8(1)
973
 982 081c 70E0      		ldi r23,hi8(1)
974
 983 081e 00C0      		rjmp .L97
975
 984               	.L96:
976
 985 0820 212F      		mov r18,r17
977
 986 0822 30E0      		ldi r19,lo8(0)
978
 987 0824 2150      		subi r18,lo8(-(-1))
979
 988 0826 3040      		sbci r19,hi8(-(-1))
980
 989 0828 81E0      		ldi r24,lo8(1)
981
 990 082a 90E0      		ldi r25,hi8(1)
982
 991 082c 00C0      		rjmp 2f
983
 992 082e 880F      	1:	lsl r24
984
 993 0830 991F      		rol r25
985
 994 0832 2A95      	2:	dec r18
986
 995 0834 02F4      		brpl 1b
987
 996 0836 00C0      		rjmp .L109
988
 997               	.L97:
989
 998 0838 2091 0000 		lds r18,BLConfig_WriteMask
990
 999 083c 3091 0000 		lds r19,(BLConfig_WriteMask)+1
991
 1000 0840 CB01      		movw r24,r22
992
 1001 0842 042E      		mov r0,r20
993
 1002 0844 00C0      		rjmp 2f
994
 1003 0846 880F      	1:	lsl r24
995
 1004 0848 991F      		rol r25
996
 1005 084a 0A94      	2:	dec r0
997
 1006 084c 02F4      		brpl 1b
998
 1007 084e 8223      		and r24,r18
999
 1008 0850 9323      		and r25,r19
1000
 1009 0852 892B      		or r24,r25
1001
 1010 0854 01F0      		breq .L99
1002
 1011 0856 1082      		st Z,__zero_reg__
1003
 1012 0858 1182      		std Z+1,__zero_reg__
1004
 1013               	.L99:
1005
 1014 085a 4F5F      		subi r20,lo8(-(1))
1006
 1015 085c 5F4F      		sbci r21,hi8(-(1))
1007
 1016 085e 3896      		adiw r30,8
1008
 1017 0860 4C30      		cpi r20,12
1009
 1018 0862 5105      		cpc r21,__zero_reg__
1010
 1019 0864 01F4      		brne .L97
1011
 1020 0866 1092 0000 		sts motor_write,__zero_reg__
1012
 1021 086a 15EA      		ldi r17,lo8(-91)
1013
 1022               	.L103:
1014
 1023 086c 1092 0000 		sts twi_state,__zero_reg__
1015
 1024 0870 8091 0000 		lds r24,BLFlags
1016
 1025 0874 8E7F      		andi r24,lo8(-2)
1017
 1026 0876 8093 0000 		sts BLFlags,r24
1018
 1027 087a 1093 BC00 		sts 188,r17
1019
 1028               	.L101:
1020
 1029 087e 8091 0000 		lds r24,BLFlags
1021
 1030 0882 80FD      		sbrc r24,0
1022
 1031 0884 00C0      		rjmp .L100
1023
 1032 0886 CE01      		movw r24,r28
1024
 1033 0888 0E94 0000 		call CheckDelay
1025
 1034 088c 8823      		tst r24
1026
 1035 088e 01F0      		breq .L101
1027
 1036               	.L100:
1028
 1037 0890 8091 0000 		lds r24,BLConfig_WriteMask
1029
 1038 0894 9091 0000 		lds r25,(BLConfig_WriteMask)+1
1030
 1039 0898 892B      		or r24,r25
1031
 1040 089a 01F0      		breq .L102
1032
 1041 089c CE01      		movw r24,r28
1033
 1042 089e 0E94 0000 		call CheckDelay
1034
 1043 08a2 8823      		tst r24
1035
 1044 08a4 01F0      		breq .L103
1036
 1045               	.L102:
1037
 1046 08a6 8091 0000 		lds r24,BLConfig_WriteMask
1038
 1047 08aa 9091 0000 		lds r25,(BLConfig_WriteMask)+1
1039
 1048 08ae 892B      		or r24,r25
1040
 1049 08b0 01F4      		brne .L89
1041
 1050 08b2 80E0      		ldi r24,lo8(0)
1042
 1051 08b4 00C0      		rjmp .L91
1043
 1052               	.L88:
1044
 1053 08b6 81E0      		ldi r24,lo8(1)
1045
 1054 08b8 00C0      		rjmp .L91
1046
 1055               	.L89:
1047
 1056 08ba 82E0      		ldi r24,lo8(2)
1048
 1057               	.L91:
1049
 1058               	/* epilogue start */
1050
 1059 08bc DF91      		pop r29
1051
 1060 08be CF91      		pop r28
1052
 1061 08c0 1F91      		pop r17
1053
 1062 08c2 0895      		ret
1054
 1064               	.global	twi_state
1055
 1065               	.global	twi_state
1056
 1066               		.section .bss
1057
 1069               	twi_state:
1058
 1070 0000 00        		.skip 1,0
1059
 1071               	.global	dac_channel
1060
 1072               	.global	dac_channel
1061
 1075               	dac_channel:
1062
 1076 0001 00        		.skip 1,0
1063
 1077               	.global	motor_write
1064
 1078               	.global	motor_write
1065
 1081               	motor_write:
1066
 1082 0002 00        		.skip 1,0
1067
 1083               	.global	motor_read
1068
 1084               	.global	motor_read
1069
 1087               	motor_read:
1070
 1088 0003 00        		.skip 1,0
1071
 1089               	.global	I2CTimeout
1072
 1090               		.data
1073
 1093               	I2CTimeout:
1074
 1094 0000 6400      		.word	100
1075
 1095               	.global	MissingMotor
1076
 1096               	.global	MissingMotor
1077
 1097               		.section .bss
1078
 1100               	MissingMotor:
1079
 1101 0004 00        		.skip 1,0
1080
 1102               	.global	BLFlags
1081
 1103               	.global	BLFlags
1082
 1106               	BLFlags:
1083
 1107 0005 00        		.skip 1,0
1084
 1108               	.global	BLConfig_WriteMask
1085
 1109               	.global	BLConfig_WriteMask
1086
 1112               	BLConfig_WriteMask:
1087
 1113 0006 0000      		.skip 2,0
1088
 1114               	.global	BLConfig_ReadMask
1089
 1115               	.global	BLConfig_ReadMask
1090
 1118               	BLConfig_ReadMask:
1091
 1119 0008 0000      		.skip 2,0
1092
 1120               		.lcomm BuffLen.1660,1
1093
 1121               		.lcomm pBuff.1659,2
1094
 1122               		.lcomm motor_read_temperature.1658,1
1095
 1123               		.lcomm missing_motor.1657,1
1096
 1124               		.comm Motor,96,1
1097
 1125               		.comm BLConfig,8,1
1098
 1126               	.global __do_copy_data
1099
 1127               	.global __do_clear_bss
1755 - 1100
DEFINED SYMBOLS
1101
                            *ABS*:00000000 twimaster.c
1789 - 1102
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:2      *ABS*:0000003f __SREG__
1103
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:3      *ABS*:0000003e __SP_H__
1104
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:4      *ABS*:0000003d __SP_L__
1105
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:5      *ABS*:00000034 __CCP__
1106
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:6      *ABS*:00000000 __tmp_reg__
1107
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:7      *ABS*:00000001 __zero_reg__
1108
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:11     .text:00000000 I2C_Init
1109
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1069   .bss:00000000 twi_state
1110
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1081   .bss:00000002 motor_write
1111
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1087   .bss:00000003 motor_read
1755 - 1112
                            *COM*:00000060 Motor
1789 - 1113
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:55     .text:0000004c I2C_Reset
1114
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1106   .bss:00000005 BLFlags
1115
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:99     .text:000000aa __vector_26
1116
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1112   .bss:00000006 BLConfig_WriteMask
1117
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1118   .bss:00000008 BLConfig_ReadMask
1755 - 1118
                            *COM*:00000008 BLConfig
1789 - 1119
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1120   .bss:0000000b pBuff.1659
1120
                             .bss:0000000a BuffLen.1660
1121
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1122   .bss:0000000e missing_motor.1657
1122
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1093   .data:00000000 I2CTimeout
1123
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1121   .bss:0000000d motor_read_temperature.1658
1124
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1100   .bss:00000004 MissingMotor
1125
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:1075   .bss:00000001 dac_channel
1126
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:744    .text:00000638 I2C_ReadBLConfig
1127
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccHkTAFJ.s:902    .text:0000077a I2C_WriteBLConfig
1755 - 1128
 
1129
UNDEFINED SYMBOLS
1130
__tablejump2__
1131
Mixer
1132
RequiredMotors
1133
FCFlags
1134
AnalogOffsetNick
1135
AnalogOffsetRoll
1136
AnalogOffsetGier
1137
MotorenEin
1138
PC_MotortestActive
1139
SetDelay
1140
CheckDelay
1789 - 1141
RAM_Checksum
1142
__epilogue_restores__
1143
__do_copy_data
1144
__do_clear_bss