Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

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