Statistics
| Revision:

root / demos / hunter_prey_john / projects / libwireless / lib / wl_token_ring.lst @ 1694

History | View | Annotate | Download (43.8 KB)

1
   1               		.file	"wl_token_ring.c"
2
   2               		.arch atmega128
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               		.text
11
  11               	.global	wl_token_ring_leave
12
  13               	wl_token_ring_leave:
13
  14               	/* prologue: frame size=0 */
14
  15               	/* prologue end (size=0) */
15
  16 0000 84E0      		ldi r24,lo8(4)
16
  17 0002 90E0      		ldi r25,hi8(4)
17
  18 0004 9093 0000 		sts (ringState)+1,r25
18
  19 0008 8093 0000 		sts ringState,r24
19
  20               	/* epilogue: frame size=0 */
20
  21 000c 0895      		ret
21
  22               	/* epilogue end (size=1) */
22
  23               	/* function wl_token_ring_leave size 7 (6) */
23
  25               	.global	wl_token_ring_set_bom_functions
24
  27               	wl_token_ring_set_bom_functions:
25
  28               	/* prologue: frame size=0 */
26
  29               	/* prologue end (size=0) */
27
  30 000e 9093 0000 		sts (bom_on_function)+1,r25
28
  31 0012 8093 0000 		sts bom_on_function,r24
29
  32 0016 7093 0000 		sts (bom_off_function)+1,r23
30
  33 001a 6093 0000 		sts bom_off_function,r22
31
  34 001e 5093 0000 		sts (get_max_bom_function)+1,r21
32
  35 0022 4093 0000 		sts get_max_bom_function,r20
33
  36               	/* epilogue: frame size=0 */
34
  37 0026 0895      		ret
35
  38               	/* epilogue end (size=1) */
36
  39               	/* function wl_token_ring_set_bom_functions size 13 (12) */
37
  42               	wl_token_ring_cleanup:
38
  43               	/* prologue: frame size=0 */
39
  44               	/* prologue end (size=0) */
40
  45               	/* epilogue: frame size=0 */
41
  46 0028 0895      		ret
42
  47               	/* epilogue end (size=1) */
43
  48               	/* function wl_token_ring_cleanup size 1 (0) */
44
  51               	wl_token_ring_response_handler:
45
  52               	/* prologue: frame size=0 */
46
  53               	/* prologue end (size=0) */
47
  54               	/* epilogue: frame size=0 */
48
  55 002a 0895      		ret
49
  56               	/* epilogue end (size=1) */
50
  57               	/* function wl_token_ring_response_handler size 1 (0) */
51
  59               	.global	wl_token_iterator_has_next
52
  61               	wl_token_iterator_has_next:
53
  62               	/* prologue: frame size=0 */
54
  63               	/* prologue end (size=0) */
55
  64 002c 20E0      		ldi r18,lo8(0)
56
  65 002e 30E0      		ldi r19,hi8(0)
57
  66 0030 8091 0000 		lds r24,iteratorCount
58
  67 0034 9091 0000 		lds r25,(iteratorCount)+1
59
  68 0038 8F5F      		subi r24,lo8(-1)
60
  69 003a 9F4F      		sbci r25,hi8(-1)
61
  70 003c 01F0      		breq .L10
62
  71 003e 21E0      		ldi r18,lo8(1)
63
  72 0040 30E0      		ldi r19,hi8(1)
64
  73               	.L10:
65
  74 0042 C901      		movw r24,r18
66
  75               	/* epilogue: frame size=0 */
67
  76 0044 0895      		ret
68
  77               	/* epilogue end (size=1) */
69
  78               	/* function wl_token_iterator_has_next size 14 (13) */
70
  80               	.global	wl_token_get_matrix_size
71
  82               	wl_token_get_matrix_size:
72
  83               	/* prologue: frame size=0 */
73
  84               	/* prologue end (size=0) */
74
  85 0046 0E94 0000 		call sensor_matrix_get_size
75
  86               	/* epilogue: frame size=0 */
76
  87 004a 0895      		ret
77
  88               	/* epilogue end (size=1) */
78
  89               	/* function wl_token_get_matrix_size size 3 (2) */
79
  91               	.global	wl_token_get_num_robots
80
  93               	wl_token_get_num_robots:
81
  94               	/* prologue: frame size=0 */
82
  95               	/* prologue end (size=0) */
83
  96 004c 0E94 0000 		call sensor_matrix_get_joined
84
  97               	/* epilogue: frame size=0 */
85
  98 0050 0895      		ret
86
  99               	/* epilogue end (size=1) */
87
 100               	/* function wl_token_get_num_robots size 3 (2) */
88
 102               	.global	wl_token_get_robots_in_ring
89
 104               	wl_token_get_robots_in_ring:
90
 105               	/* prologue: frame size=0 */
91
 106               	/* prologue end (size=0) */
92
 107 0052 0E94 0000 		call sensor_matrix_get_joined
93
 108               	/* epilogue: frame size=0 */
94
 109 0056 0895      		ret
95
 110               	/* epilogue end (size=1) */
96
 111               	/* function wl_token_get_robots_in_ring size 3 (2) */
97
 113               	.global	wl_token_iterator_next
98
 115               	wl_token_iterator_next:
99
 116               	/* prologue: frame size=0 */
100
 117 0058 0F93      		push r16
101
 118 005a 1F93      		push r17
102
 119 005c CF93      		push r28
103
 120 005e DF93      		push r29
104
 121               	/* prologue end (size=4) */
105
 122 0060 C091 0000 		lds r28,iteratorCount
106
 123 0064 D091 0000 		lds r29,(iteratorCount)+1
107
 124 0068 D7FD      		sbrc r29,7
108
 125 006a 00C0      		rjmp .L19
109
 126 006c 2196      		adiw r28,1
110
 127 006e D093 0000 		sts (iteratorCount)+1,r29
111
 128 0072 C093 0000 		sts iteratorCount,r28
112
 129 0076 2197      		sbiw r28,1
113
 130 0078 00C0      		rjmp .L21
114
 131               	.L22:
115
 132 007a 8091 0000 		lds r24,iteratorCount
116
 133 007e 9091 0000 		lds r25,(iteratorCount)+1
117
 134 0082 0196      		adiw r24,1
118
 135 0084 9093 0000 		sts (iteratorCount)+1,r25
119
 136 0088 8093 0000 		sts iteratorCount,r24
120
 137               	.L21:
121
 138 008c 8091 0000 		lds r24,iteratorCount
122
 139 0090 9091 0000 		lds r25,(iteratorCount)+1
123
 140 0094 0E94 0000 		call sensor_matrix_get_in_ring
124
 141 0098 892B      		or r24,r25
125
 142 009a 01F4      		brne .L23
126
 143 009c 0091 0000 		lds r16,iteratorCount
127
 144 00a0 1091 0000 		lds r17,(iteratorCount)+1
128
 145 00a4 0E94 0000 		call sensor_matrix_get_size
129
 146 00a8 0817      		cp r16,r24
130
 147 00aa 1907      		cpc r17,r25
131
 148 00ac 04F0      		brlt .L22
132
 149               	.L23:
133
 150 00ae 0091 0000 		lds r16,iteratorCount
134
 151 00b2 1091 0000 		lds r17,(iteratorCount)+1
135
 152 00b6 0E94 0000 		call sensor_matrix_get_size
136
 153 00ba 0817      		cp r16,r24
137
 154 00bc 1907      		cpc r17,r25
138
 155 00be 01F4      		brne .L19
139
 156 00c0 8FEF      		ldi r24,lo8(-1)
140
 157 00c2 9FEF      		ldi r25,hi8(-1)
141
 158 00c4 9093 0000 		sts (iteratorCount)+1,r25
142
 159 00c8 8093 0000 		sts iteratorCount,r24
143
 160               	.L19:
144
 161 00cc CE01      		movw r24,r28
145
 162               	/* epilogue: frame size=0 */
146
 163 00ce DF91      		pop r29
147
 164 00d0 CF91      		pop r28
148
 165 00d2 1F91      		pop r17
149
 166 00d4 0F91      		pop r16
150
 167 00d6 0895      		ret
151
 168               	/* epilogue end (size=5) */
152
 169               	/* function wl_token_iterator_next size 64 (55) */
153
 171               	.global	wl_token_iterator_begin
154
 173               	wl_token_iterator_begin:
155
 174               	/* prologue: frame size=0 */
156
 175 00d8 CF93      		push r28
157
 176 00da DF93      		push r29
158
 177               	/* prologue end (size=2) */
159
 178 00dc C0E0      		ldi r28,lo8(0)
160
 179 00de D0E0      		ldi r29,hi8(0)
161
 180 00e0 00C0      		rjmp .L28
162
 181               	.L29:
163
 182 00e2 2196      		adiw r28,1
164
 183               	.L28:
165
 184 00e4 CE01      		movw r24,r28
166
 185 00e6 0E94 0000 		call sensor_matrix_get_in_ring
167
 186 00ea 892B      		or r24,r25
168
 187 00ec 01F4      		brne .L30
169
 188 00ee 0E94 0000 		call sensor_matrix_get_size
170
 189 00f2 C817      		cp r28,r24
171
 190 00f4 D907      		cpc r29,r25
172
 191 00f6 04F0      		brlt .L29
173
 192               	.L30:
174
 193 00f8 0E94 0000 		call sensor_matrix_get_size
175
 194 00fc C817      		cp r28,r24
176
 195 00fe D907      		cpc r29,r25
177
 196 0100 01F4      		brne .L32
178
 197 0102 CFEF      		ldi r28,lo8(-1)
179
 198 0104 DFEF      		ldi r29,hi8(-1)
180
 199               	.L32:
181
 200 0106 D093 0000 		sts (iteratorCount)+1,r29
182
 201 010a C093 0000 		sts iteratorCount,r28
183
 202               	/* epilogue: frame size=0 */
184
 203 010e DF91      		pop r29
185
 204 0110 CF91      		pop r28
186
 205 0112 0895      		ret
187
 206               	/* epilogue end (size=3) */
188
 207               	/* function wl_token_iterator_begin size 30 (25) */
189
 209               	.global	wl_token_is_robot_in_ring
190
 211               	wl_token_is_robot_in_ring:
191
 212               	/* prologue: frame size=0 */
192
 213               	/* prologue end (size=0) */
193
 214 0114 0E94 0000 		call sensor_matrix_get_in_ring
194
 215               	/* epilogue: frame size=0 */
195
 216 0118 0895      		ret
196
 217               	/* epilogue end (size=1) */
197
 218               	/* function wl_token_is_robot_in_ring size 3 (2) */
198
 220               	.global	wl_token_get_sensor_reading
199
 222               	wl_token_get_sensor_reading:
200
 223               	/* prologue: frame size=0 */
201
 224 011a 0F93      		push r16
202
 225 011c 1F93      		push r17
203
 226 011e CF93      		push r28
204
 227 0120 DF93      		push r29
205
 228               	/* prologue end (size=4) */
206
 229 0122 EC01      		movw r28,r24
207
 230 0124 8B01      		movw r16,r22
208
 231 0126 CB01      		movw r24,r22
209
 232 0128 0E94 0000 		call wl_token_is_robot_in_ring
210
 233 012c 892B      		or r24,r25
211
 234 012e 01F0      		breq .L38
212
 235 0130 0E94 0000 		call wl_get_xbee_id
213
 236 0134 C817      		cp r28,r24
214
 237 0136 D907      		cpc r29,r25
215
 238 0138 01F0      		breq .L40
216
 239 013a CE01      		movw r24,r28
217
 240 013c 0E94 0000 		call wl_token_is_robot_in_ring
218
 241 0140 892B      		or r24,r25
219
 242 0142 01F0      		breq .L38
220
 243               	.L40:
221
 244 0144 B801      		movw r22,r16
222
 245 0146 CE01      		movw r24,r28
223
 246 0148 0E94 0000 		call sensor_matrix_get_reading
224
 247 014c 00C0      		rjmp .L42
225
 248               	.L38:
226
 249 014e 8FEF      		ldi r24,lo8(-1)
227
 250 0150 9FEF      		ldi r25,hi8(-1)
228
 251               	.L42:
229
 252               	/* epilogue: frame size=0 */
230
 253 0152 DF91      		pop r29
231
 254 0154 CF91      		pop r28
232
 255 0156 1F91      		pop r17
233
 256 0158 0F91      		pop r16
234
 257 015a 0895      		ret
235
 258               	/* epilogue end (size=5) */
236
 259               	/* function wl_token_get_sensor_reading size 33 (24) */
237
 261               	.global	wl_token_get_my_sensor_reading
238
 263               	wl_token_get_my_sensor_reading:
239
 264               	/* prologue: frame size=0 */
240
 265 015c 0F93      		push r16
241
 266 015e 1F93      		push r17
242
 267               	/* prologue end (size=2) */
243
 268 0160 8C01      		movw r16,r24
244
 269 0162 0E94 0000 		call wl_get_xbee_id
245
 270 0166 B801      		movw r22,r16
246
 271 0168 0E94 0000 		call wl_token_get_sensor_reading
247
 272               	/* epilogue: frame size=0 */
248
 273 016c 1F91      		pop r17
249
 274 016e 0F91      		pop r16
250
 275 0170 0895      		ret
251
 276               	/* epilogue end (size=3) */
252
 277               	/* function wl_token_get_my_sensor_reading size 11 (6) */
253
 279               	.global	wl_token_ring_unregister
254
 281               	wl_token_ring_unregister:
255
 282               	/* prologue: frame size=0 */
256
 283               	/* prologue end (size=0) */
257
 284 0172 80E0      		ldi r24,lo8(wl_token_ring_handler)
258
 285 0174 90E0      		ldi r25,hi8(wl_token_ring_handler)
259
 286 0176 0E94 0000 		call wl_unregister_packet_group
260
 287               	/* epilogue: frame size=0 */
261
 288 017a 0895      		ret
262
 289               	/* epilogue end (size=1) */
263
 290               	/* function wl_token_ring_unregister size 5 (4) */
264
 292               	.global	wl_token_ring_join
265
 294               	wl_token_ring_join:
266
 295               	/* prologue: frame size=0 */
267
 296 017c 0F93      		push r16
268
 297               	/* prologue end (size=1) */
269
 298 017e 82E0      		ldi r24,lo8(2)
270
 299 0180 90E0      		ldi r25,hi8(2)
271
 300 0182 9093 0000 		sts (ringState)+1,r25
272
 301 0186 8093 0000 		sts ringState,r24
273
 302 018a 88E0      		ldi r24,lo8(8)
274
 303 018c 90E0      		ldi r25,hi8(8)
275
 304 018e 9093 0000 		sts (joinDelay)+1,r25
276
 305 0192 8093 0000 		sts joinDelay,r24
277
 306 0196 00E0      		ldi r16,lo8(0)
278
 307 0198 20E0      		ldi r18,lo8(0)
279
 308 019a 30E0      		ldi r19,hi8(0)
280
 309 019c 40E0      		ldi r20,lo8(0)
281
 310 019e 50E0      		ldi r21,hi8(0)
282
 311 01a0 64E0      		ldi r22,lo8(4)
283
 312 01a2 82E0      		ldi r24,lo8(2)
284
 313 01a4 0E94 0000 		call wl_send_global_packet
285
 314 01a8 892B      		or r24,r25
286
 315 01aa 01F0      		breq .L49
287
 316 01ac 8FEF      		ldi r24,lo8(-1)
288
 317 01ae 9FEF      		ldi r25,hi8(-1)
289
 318 01b0 00C0      		rjmp .L51
290
 319               	.L49:
291
 320 01b2 80E0      		ldi r24,lo8(0)
292
 321 01b4 90E0      		ldi r25,hi8(0)
293
 322               	.L51:
294
 323               	/* epilogue: frame size=0 */
295
 324 01b6 0F91      		pop r16
296
 325 01b8 0895      		ret
297
 326               	/* epilogue end (size=2) */
298
 327               	/* function wl_token_ring_join size 31 (28) */
299
 330               	wl_token_pass_token:
300
 331               	/* prologue: frame size=0 */
301
 332 01ba 6F92      		push r6
302
 333 01bc 7F92      		push r7
303
 334 01be 9F92      		push r9
304
 335 01c0 AF92      		push r10
305
 336 01c2 BF92      		push r11
306
 337 01c4 CF92      		push r12
307
 338 01c6 DF92      		push r13
308
 339 01c8 EF92      		push r14
309
 340 01ca FF92      		push r15
310
 341 01cc 0F93      		push r16
311
 342 01ce 1F93      		push r17
312
 343 01d0 CF93      		push r28
313
 344 01d2 DF93      		push r29
314
 345 01d4 CDB7      		in r28,__SP_L__
315
 346 01d6 DEB7      		in r29,__SP_H__
316
 347               	/* prologue end (size=15) */
317
 348 01d8 6DB6      		in r6,__SP_L__
318
 349 01da 7EB6      		in r7,__SP_H__
319
 350 01dc 0E94 0000 		call wl_get_xbee_id
320
 351 01e0 8C01      		movw r16,r24
321
 352 01e2 0E94 0000 		call sensor_matrix_get_size
322
 353 01e6 880F      		lsl r24
323
 354 01e8 991F      		rol r25
324
 355 01ea 2DB7      		in r18,__SP_L__
325
 356 01ec 3EB7      		in r19,__SP_H__
326
 357 01ee 281B      		sub r18,r24
327
 358 01f0 390B      		sbc r19,r25
328
 359 01f2 0FB6      		in __tmp_reg__,__SREG__
329
 360 01f4 F894      		cli
330
 361 01f6 3EBF      		out __SP_H__,r19
331
 362 01f8 0FBE      		out __SREG__,__tmp_reg__
332
 363 01fa 2DBF      		out __SP_L__,r18
333
 364 01fc ADB6      		in r10,__SP_L__
334
 365 01fe BEB6      		in r11,__SP_H__
335
 366 0200 0894      		sec
336
 367 0202 A11C      		adc r10,__zero_reg__
337
 368 0204 B11C      		adc r11,__zero_reg__
338
 369 0206 8091 0000 		lds r24,accepted
339
 370 020a 9091 0000 		lds r25,(accepted)+1
340
 371 020e 3FEF      		ldi r19,hi8(-1)
341
 372 0210 8F3F      		cpi r24,lo8(-1)
342
 373 0212 9307      		cpc r25,r19
343
 374 0214 01F4      		brne .L54
344
 375               	.L74:
345
 376 0216 0F5F      		subi r16,lo8(-(1))
346
 377 0218 1F4F      		sbci r17,hi8(-(1))
347
 378 021a 0E94 0000 		call sensor_matrix_get_size
348
 379 021e 0817      		cp r16,r24
349
 380 0220 1907      		cpc r17,r25
350
 381 0222 01F4      		brne .L57
351
 382 0224 00E0      		ldi r16,lo8(0)
352
 383 0226 10E0      		ldi r17,hi8(0)
353
 384               	.L57:
354
 385 0228 C801      		movw r24,r16
355
 386 022a 0E94 0000 		call sensor_matrix_get_in_ring
356
 387 022e 892B      		or r24,r25
357
 388 0230 01F0      		breq .+2
358
 389 0232 00C0      		rjmp .L73
359
 390 0234 00C0      		rjmp .L74
360
 391               	.L54:
361
 392 0236 61E0      		ldi r22,lo8(1)
362
 393 0238 70E0      		ldi r23,hi8(1)
363
 394 023a 0E94 0000 		call sensor_matrix_set_in_ring
364
 395 023e 9090 0000 		lds r9,accepted
365
 396 0242 8FEF      		ldi r24,lo8(-1)
366
 397 0244 9FEF      		ldi r25,hi8(-1)
367
 398 0246 9093 0000 		sts (accepted)+1,r25
368
 399 024a 8093 0000 		sts accepted,r24
369
 400               	.L61:
370
 401 024e 00E0      		ldi r16,lo8(0)
371
 402 0250 10E0      		ldi r17,hi8(0)
372
 403 0252 CC24      		clr r12
373
 404 0254 DD24      		clr r13
374
 405 0256 7501      		movw r14,r10
375
 406 0258 00C0      		rjmp .L62
376
 407               	.L63:
377
 408 025a C801      		movw r24,r16
378
 409 025c 0E94 0000 		call sensor_matrix_get_in_ring
379
 410 0260 892B      		or r24,r25
380
 411 0262 01F0      		breq .L64
381
 412 0264 0E94 0000 		call wl_get_xbee_id
382
 413 0268 0817      		cp r16,r24
383
 414 026a 1907      		cpc r17,r25
384
 415 026c 01F0      		breq .L64
385
 416 026e F701      		movw r30,r14
386
 417 0270 0083      		st Z,r16
387
 418 0272 0E94 0000 		call wl_get_xbee_id
388
 419 0276 B801      		movw r22,r16
389
 420 0278 0E94 0000 		call sensor_matrix_get_reading
390
 421 027c F701      		movw r30,r14
391
 422 027e 8183      		std Z+1,r24
392
 423 0280 0894      		sec
393
 424 0282 C11C      		adc r12,__zero_reg__
394
 425 0284 D11C      		adc r13,__zero_reg__
395
 426 0286 22E0      		ldi r18,lo8(2)
396
 427 0288 30E0      		ldi r19,hi8(2)
397
 428 028a E20E      		add r14,r18
398
 429 028c F31E      		adc r15,r19
399
 430               	.L64:
400
 431 028e 0F5F      		subi r16,lo8(-(1))
401
 432 0290 1F4F      		sbci r17,hi8(-(1))
402
 433               	.L62:
403
 434 0292 0E94 0000 		call sensor_matrix_get_size
404
 435 0296 0817      		cp r16,r24
405
 436 0298 1907      		cpc r17,r25
406
 437 029a 04F0      		brlt .L63
407
 438 029c CC0C      		lsl r12
408
 439 029e DD1C      		rol r13
409
 440 02a0 00E0      		ldi r16,lo8(0)
410
 441 02a2 9601      		movw r18,r12
411
 442 02a4 A501      		movw r20,r10
412
 443 02a6 62E0      		ldi r22,lo8(2)
413
 444 02a8 82E0      		ldi r24,lo8(2)
414
 445 02aa 0E94 0000 		call wl_send_global_packet
415
 446 02ae 892B      		or r24,r25
416
 447 02b0 01F4      		brne .L68
417
 448 02b2 C92C      		mov r12,r9
418
 449 02b4 DD24      		clr r13
419
 450 02b6 82E0      		ldi r24,lo8(2)
420
 451 02b8 E82E      		mov r14,r24
421
 452 02ba 8601      		movw r16,r12
422
 453 02bc 20E0      		ldi r18,lo8(0)
423
 454 02be 30E0      		ldi r19,hi8(0)
424
 455 02c0 40E0      		ldi r20,lo8(0)
425
 456 02c2 50E0      		ldi r21,hi8(0)
426
 457 02c4 61E0      		ldi r22,lo8(1)
427
 458 02c6 82E0      		ldi r24,lo8(2)
428
 459 02c8 0E94 0000 		call wl_send_robot_to_robot_global_packet
429
 460 02cc 892B      		or r24,r25
430
 461 02ce 01F4      		brne .L68
431
 462 02d0 D092 0000 		sts (wl_token_next_robot)+1,r13
432
 463 02d4 C092 0000 		sts wl_token_next_robot,r12
433
 464 02d8 84E0      		ldi r24,lo8(4)
434
 465 02da 90E0      		ldi r25,hi8(4)
435
 466 02dc 9093 0000 		sts (deathDelay)+1,r25
436
 467 02e0 8093 0000 		sts deathDelay,r24
437
 468 02e4 80E0      		ldi r24,lo8(0)
438
 469 02e6 90E0      		ldi r25,hi8(0)
439
 470 02e8 00C0      		rjmp .L71
440
 471               	.L73:
441
 472 02ea 902E      		mov r9,r16
442
 473 02ec 00C0      		rjmp .L61
443
 474               	.L68:
444
 475 02ee 8FEF      		ldi r24,lo8(-1)
445
 476 02f0 9FEF      		ldi r25,hi8(-1)
446
 477               	.L71:
447
 478 02f2 0FB6      		in __tmp_reg__,__SREG__
448
 479 02f4 F894      		cli
449
 480 02f6 7EBE      		out __SP_H__,r7
450
 481 02f8 0FBE      		out __SREG__,__tmp_reg__
451
 482 02fa 6DBE      		out __SP_L__,r6
452
 483               	/* epilogue: frame size=0 */
453
 484 02fc DF91      		pop r29
454
 485 02fe CF91      		pop r28
455
 486 0300 1F91      		pop r17
456
 487 0302 0F91      		pop r16
457
 488 0304 FF90      		pop r15
458
 489 0306 EF90      		pop r14
459
 490 0308 DF90      		pop r13
460
 491 030a CF90      		pop r12
461
 492 030c BF90      		pop r11
462
 493 030e AF90      		pop r10
463
 494 0310 9F90      		pop r9
464
 495 0312 7F90      		pop r7
465
 496 0314 6F90      		pop r6
466
 497 0316 0895      		ret
467
 498               	/* epilogue end (size=14) */
468
 499               	/* function wl_token_pass_token size 175 (146) */
469
 502               	wl_token_ring_receive_handler:
470
 503               	/* prologue: frame size=0 */
471
 504 0318 AF92      		push r10
472
 505 031a BF92      		push r11
473
 506 031c CF92      		push r12
474
 507 031e DF92      		push r13
475
 508 0320 EF92      		push r14
476
 509 0322 FF92      		push r15
477
 510 0324 0F93      		push r16
478
 511 0326 1F93      		push r17
479
 512 0328 CF93      		push r28
480
 513 032a DF93      		push r29
481
 514               	/* prologue end (size=10) */
482
 515 032c 6B01      		movw r12,r22
483
 516 032e 8A01      		movw r16,r20
484
 517 0330 E901      		movw r28,r18
485
 518 0332 8330      		cpi r24,lo8(3)
486
 519 0334 01F4      		brne .+2
487
 520 0336 00C0      		rjmp .L79
488
 521 0338 8430      		cpi r24,lo8(4)
489
 522 033a 00F4      		brsh .L82
490
 523 033c 8130      		cpi r24,lo8(1)
491
 524 033e 01F0      		breq .L77
492
 525 0340 8230      		cpi r24,lo8(2)
493
 526 0342 01F0      		breq .+2
494
 527 0344 00C0      		rjmp .L137
495
 528 0346 00C0      		rjmp .L78
496
 529               	.L82:
497
 530 0348 8430      		cpi r24,lo8(4)
498
 531 034a 01F4      		brne .+2
499
 532 034c 00C0      		rjmp .L80
500
 533 034e 8530      		cpi r24,lo8(5)
501
 534 0350 01F0      		breq .+2
502
 535 0352 00C0      		rjmp .L137
503
 536 0354 00C0      		rjmp .L81
504
 537               	.L77:
505
 538 0356 8091 0000 		lds r24,wl_token_next_robot
506
 539 035a 9091 0000 		lds r25,(wl_token_next_robot)+1
507
 540 035e 6817      		cp r22,r24
508
 541 0360 7907      		cpc r23,r25
509
 542 0362 01F0      		breq .L83
510
 543 0364 0E94 0000 		call wl_get_xbee_id
511
 544 0368 2091 0000 		lds r18,wl_token_next_robot
512
 545 036c 3091 0000 		lds r19,(wl_token_next_robot)+1
513
 546 0370 8217      		cp r24,r18
514
 547 0372 9307      		cpc r25,r19
515
 548 0374 01F0      		breq .L83
516
 549 0376 8091 0000 		lds r24,bom_on_count
517
 550 037a 9091 0000 		lds r25,(bom_on_count)+1
518
 551 037e 0397      		sbiw r24,3
519
 552 0380 04F4      		brge .L83
520
 553 0382 8091 0000 		lds r24,ringState
521
 554 0386 9091 0000 		lds r25,(ringState)+1
522
 555 038a 0397      		sbiw r24,3
523
 556 038c 01F0      		breq .+2
524
 557 038e 00C0      		rjmp .L137
525
 558               	.L83:
526
 559 0390 CFEF      		ldi r28,lo8(-1)
527
 560 0392 DFEF      		ldi r29,hi8(-1)
528
 561 0394 D093 0000 		sts (bom_on_count)+1,r29
529
 562 0398 C093 0000 		sts bom_on_count,r28
530
 563 039c D093 0000 		sts (deathDelay)+1,r29
531
 564 03a0 C093 0000 		sts deathDelay,r28
532
 565 03a4 61E0      		ldi r22,lo8(1)
533
 566 03a6 70E0      		ldi r23,hi8(1)
534
 567 03a8 C601      		movw r24,r12
535
 568 03aa 0E94 0000 		call sensor_matrix_set_in_ring
536
 569 03ae 8091 0000 		lds r24,ringState
537
 570 03b2 9091 0000 		lds r25,(ringState)+1
538
 571 03b6 8330      		cpi r24,3
539
 572 03b8 9105      		cpc r25,__zero_reg__
540
 573 03ba 01F4      		brne .L87
541
 574 03bc 0E94 0000 		call wl_get_xbee_id
542
 575 03c0 61E0      		ldi r22,lo8(1)
543
 576 03c2 70E0      		ldi r23,hi8(1)
544
 577 03c4 0E94 0000 		call sensor_matrix_set_in_ring
545
 578 03c8 81E0      		ldi r24,lo8(1)
546
 579 03ca 90E0      		ldi r25,hi8(1)
547
 580 03cc 9093 0000 		sts (ringState)+1,r25
548
 581 03d0 8093 0000 		sts ringState,r24
549
 582 03d4 D093 0000 		sts (joinDelay)+1,r29
550
 583 03d8 C093 0000 		sts joinDelay,r28
551
 584 03dc 00C0      		rjmp .L89
552
 585               	.L87:
553
 586 03de 8430      		cpi r24,4
554
 587 03e0 9105      		cpc r25,__zero_reg__
555
 588 03e2 01F0      		breq .L90
556
 589 03e4 892B      		or r24,r25
557
 590 03e6 01F4      		brne .L89
558
 591               	.L90:
559
 592 03e8 0E94 0000 		call wl_get_xbee_id
560
 593 03ec 60E0      		ldi r22,lo8(0)
561
 594 03ee 70E0      		ldi r23,hi8(0)
562
 595 03f0 00C0      		rjmp .L140
563
 596               	.L89:
564
 597 03f2 00E0      		ldi r16,lo8(0)
565
 598 03f4 20E0      		ldi r18,lo8(0)
566
 599 03f6 30E0      		ldi r19,hi8(0)
567
 600 03f8 40E0      		ldi r20,lo8(0)
568
 601 03fa 50E0      		ldi r21,hi8(0)
569
 602 03fc 63E0      		ldi r22,lo8(3)
570
 603 03fe 82E0      		ldi r24,lo8(2)
571
 604 0400 0E94 0000 		call wl_send_global_packet
572
 605 0404 E091 0000 		lds r30,bom_on_function
573
 606 0408 F091 0000 		lds r31,(bom_on_function)+1
574
 607 040c 0995      		icall
575
 608 040e 84E6      		ldi r24,lo8(100)
576
 609 0410 90E0      		ldi r25,hi8(100)
577
 610 0412 0E94 0000 		call delay_ms
578
 611 0416 E091 0000 		lds r30,bom_off_function
579
 612 041a F091 0000 		lds r31,(bom_off_function)+1
580
 613 041e 0995      		icall
581
 614 0420 0E94 0000 		call wl_get_xbee_id
582
 615 0424 0E94 0000 		call sensor_matrix_get_in_ring
583
 616 0428 892B      		or r24,r25
584
 617 042a 01F4      		brne .+2
585
 618 042c 00C0      		rjmp .L137
586
 619 042e 00C0      		rjmp .L141
587
 620               	.L78:
588
 621 0430 8FEF      		ldi r24,lo8(-1)
589
 622 0432 9FEF      		ldi r25,hi8(-1)
590
 623 0434 9093 0000 		sts (bom_on_count)+1,r25
591
 624 0438 8093 0000 		sts bom_on_count,r24
592
 625 043c 9093 0000 		sts (deathDelay)+1,r25
593
 626 0440 8093 0000 		sts deathDelay,r24
594
 627 0444 61E0      		ldi r22,lo8(1)
595
 628 0446 70E0      		ldi r23,hi8(1)
596
 629 0448 C601      		movw r24,r12
597
 630 044a 0E94 0000 		call sensor_matrix_set_in_ring
598
 631 044e CE01      		movw r24,r28
599
 632 0450 62E0      		ldi r22,lo8(2)
600
 633 0452 70E0      		ldi r23,hi8(2)
601
 634 0454 0E94 0000 		call __divmodhi4
602
 635 0458 5B01      		movw r10,r22
603
 636 045a C0E0      		ldi r28,lo8(0)
604
 637 045c D0E0      		ldi r29,hi8(0)
605
 638 045e EE24      		clr r14
606
 639 0460 FF24      		clr r15
607
 640 0462 00C0      		rjmp .L93
608
 641               	.L94:
609
 642 0464 CC15      		cp r28,r12
610
 643 0466 DD05      		cpc r29,r13
611
 644 0468 01F4      		brne .+2
612
 645 046a 00C0      		rjmp .L95
613
 646 046c EA14      		cp r14,r10
614
 647 046e FB04      		cpc r15,r11
615
 648 0470 04F4      		brge .L97
616
 649 0472 F801      		movw r30,r16
617
 650 0474 8081      		ld r24,Z
618
 651 0476 9927      		clr r25
619
 652 0478 8C17      		cp r24,r28
620
 653 047a 9D07      		cpc r25,r29
621
 654 047c 01F4      		brne .L97
622
 655 047e 8091 0000 		lds r24,accepted
623
 656 0482 9091 0000 		lds r25,(accepted)+1
624
 657 0486 8C17      		cp r24,r28
625
 658 0488 9D07      		cpc r25,r29
626
 659 048a 01F4      		brne .L100
627
 660 048c 8FEF      		ldi r24,lo8(-1)
628
 661 048e 9FEF      		ldi r25,hi8(-1)
629
 662 0490 9093 0000 		sts (accepted)+1,r25
630
 663 0494 8093 0000 		sts accepted,r24
631
 664               	.L100:
632
 665 0498 F801      		movw r30,r16
633
 666 049a 4181      		ldd r20,Z+1
634
 667 049c 5527      		clr r21
635
 668 049e BE01      		movw r22,r28
636
 669 04a0 C601      		movw r24,r12
637
 670 04a2 0E94 0000 		call sensor_matrix_set_reading
638
 671 04a6 CE01      		movw r24,r28
639
 672 04a8 0E94 0000 		call sensor_matrix_get_in_ring
640
 673 04ac 61E0      		ldi r22,lo8(1)
641
 674 04ae 70E0      		ldi r23,hi8(1)
642
 675 04b0 CE01      		movw r24,r28
643
 676 04b2 0E94 0000 		call sensor_matrix_set_in_ring
644
 677 04b6 0894      		sec
645
 678 04b8 E11C      		adc r14,__zero_reg__
646
 679 04ba F11C      		adc r15,__zero_reg__
647
 680 04bc 0E5F      		subi r16,lo8(-(2))
648
 681 04be 1F4F      		sbci r17,hi8(-(2))
649
 682 04c0 00C0      		rjmp .L95
650
 683               	.L97:
651
 684 04c2 CE01      		movw r24,r28
652
 685 04c4 0E94 0000 		call sensor_matrix_get_in_ring
653
 686 04c8 892B      		or r24,r25
654
 687 04ca 01F0      		breq .L102
655
 688 04cc 60E0      		ldi r22,lo8(0)
656
 689 04ce 70E0      		ldi r23,hi8(0)
657
 690 04d0 CE01      		movw r24,r28
658
 691 04d2 0E94 0000 		call sensor_matrix_set_in_ring
659
 692               	.L102:
660
 693 04d6 0E94 0000 		call wl_get_xbee_id
661
 694 04da C817      		cp r28,r24
662
 695 04dc D907      		cpc r29,r25
663
 696 04de 01F4      		brne .L104
664
 697 04e0 8091 0000 		lds r24,ringState
665
 698 04e4 9091 0000 		lds r25,(ringState)+1
666
 699 04e8 0197      		sbiw r24,1
667
 700 04ea 01F4      		brne .L104
668
 701 04ec 1092 0000 		sts (ringState)+1,__zero_reg__
669
 702 04f0 1092 0000 		sts ringState,__zero_reg__
670
 703 04f4 0E94 0000 		call wl_token_ring_join
671
 704               	.L104:
672
 705 04f8 8091 0000 		lds r24,acceptor
673
 706 04fc 9091 0000 		lds r25,(acceptor)+1
674
 707 0500 C817      		cp r28,r24
675
 708 0502 D907      		cpc r29,r25
676
 709 0504 01F4      		brne .L95
677
 710 0506 0E94 0000 		call wl_get_xbee_id
678
 711 050a 60E0      		ldi r22,lo8(0)
679
 712 050c 70E0      		ldi r23,hi8(0)
680
 713 050e 0E94 0000 		call sensor_matrix_set_in_ring
681
 714 0512 1092 0000 		sts (ringState)+1,__zero_reg__
682
 715 0516 1092 0000 		sts ringState,__zero_reg__
683
 716 051a 8FEF      		ldi r24,lo8(-1)
684
 717 051c 9FEF      		ldi r25,hi8(-1)
685
 718 051e 9093 0000 		sts (acceptor)+1,r25
686
 719 0522 8093 0000 		sts acceptor,r24
687
 720 0526 0E94 0000 		call wl_token_ring_join
688
 721               	.L95:
689
 722 052a 2196      		adiw r28,1
690
 723               	.L93:
691
 724 052c 0E94 0000 		call sensor_matrix_get_size
692
 725 0530 C817      		cp r28,r24
693
 726 0532 D907      		cpc r29,r25
694
 727 0534 04F4      		brge .+2
695
 728 0536 00C0      		rjmp .L94
696
 729 0538 8601      		movw r16,r12
697
 730               	.L138:
698
 731 053a 0F5F      		subi r16,lo8(-(1))
699
 732 053c 1F4F      		sbci r17,hi8(-(1))
700
 733 053e 0E94 0000 		call sensor_matrix_get_size
701
 734 0542 0817      		cp r16,r24
702
 735 0544 1907      		cpc r17,r25
703
 736 0546 01F4      		brne .L110
704
 737 0548 00E0      		ldi r16,lo8(0)
705
 738 054a 10E0      		ldi r17,hi8(0)
706
 739               	.L110:
707
 740 054c C801      		movw r24,r16
708
 741 054e 0E94 0000 		call sensor_matrix_get_in_ring
709
 742 0552 892B      		or r24,r25
710
 743 0554 01F4      		brne .L112
711
 744 0556 0C15      		cp r16,r12
712
 745 0558 1D05      		cpc r17,r13
713
 746 055a 01F4      		brne .L138
714
 747               	.L112:
715
 748 055c C02E      		mov r12,r16
716
 749 055e DD24      		clr r13
717
 750 0560 0E94 0000 		call wl_get_xbee_id
718
 751 0564 C816      		cp r12,r24
719
 752 0566 D906      		cpc r13,r25
720
 753 0568 01F0      		breq .L116
721
 754 056a D092 0000 		sts (wl_token_next_robot)+1,r13
722
 755 056e C092 0000 		sts wl_token_next_robot,r12
723
 756               	.L116:
724
 757 0572 0E94 0000 		call wl_get_xbee_id
725
 758 0576 EC01      		movw r28,r24
726
 759 0578 2196      		adiw r28,1
727
 760 057a 01E0      		ldi r16,lo8(1)
728
 761 057c 10E0      		ldi r17,hi8(1)
729
 762               	.L117:
730
 763 057e 0E94 0000 		call sensor_matrix_get_size
731
 764 0582 C817      		cp r28,r24
732
 765 0584 D907      		cpc r29,r25
733
 766 0586 01F4      		brne .L118
734
 767 0588 C0E0      		ldi r28,lo8(0)
735
 768 058a D0E0      		ldi r29,hi8(0)
736
 769               	.L118:
737
 770 058c CC15      		cp r28,r12
738
 771 058e DD05      		cpc r29,r13
739
 772 0590 01F0      		breq .L120
740
 773 0592 CE01      		movw r24,r28
741
 774 0594 0E94 0000 		call sensor_matrix_get_in_ring
742
 775 0598 892B      		or r24,r25
743
 776 059a 01F0      		breq .L122
744
 777 059c 0F5F      		subi r16,lo8(-(1))
745
 778 059e 1F4F      		sbci r17,hi8(-(1))
746
 779               	.L122:
747
 780 05a0 2196      		adiw r28,1
748
 781 05a2 00C0      		rjmp .L117
749
 782               	.L120:
750
 783 05a4 000F      		lsl r16
751
 784 05a6 111F      		rol r17
752
 785 05a8 000F      		lsl r16
753
 786 05aa 111F      		rol r17
754
 787 05ac 1093 0000 		sts (deathDelay)+1,r17
755
 788 05b0 0093 0000 		sts deathDelay,r16
756
 789 05b4 0E94 0000 		call sensor_matrix_get_joined
757
 790 05b8 892B      		or r24,r25
758
 791 05ba 01F0      		breq .+2
759
 792 05bc 00C0      		rjmp .L137
760
 793 05be 8091 0000 		lds r24,ringState
761
 794 05c2 9091 0000 		lds r25,(ringState)+1
762
 795 05c6 0297      		sbiw r24,2
763
 796 05c8 01F0      		breq .+2
764
 797 05ca 00C0      		rjmp .L137
765
 798 05cc 42E0      		ldi r20,lo8(2)
766
 799 05ce E42E      		mov r14,r20
767
 800 05d0 8601      		movw r16,r12
768
 801 05d2 20E0      		ldi r18,lo8(0)
769
 802 05d4 30E0      		ldi r19,hi8(0)
770
 803 05d6 40E0      		ldi r20,lo8(0)
771
 804 05d8 50E0      		ldi r21,hi8(0)
772
 805 05da 61E0      		ldi r22,lo8(1)
773
 806 05dc 82E0      		ldi r24,lo8(2)
774
 807 05de 0E94 0000 		call wl_send_robot_to_robot_global_packet
775
 808 05e2 00C0      		rjmp .L137
776
 809               	.L79:
777
 810 05e4 1092 0000 		sts (bom_on_count)+1,__zero_reg__
778
 811 05e8 1092 0000 		sts bom_on_count,__zero_reg__
779
 812 05ec E091 0000 		lds r30,get_max_bom_function
780
 813 05f0 F091 0000 		lds r31,(get_max_bom_function)+1
781
 814 05f4 0995      		icall
782
 815 05f6 8C01      		movw r16,r24
783
 816 05f8 0E94 0000 		call wl_get_xbee_id
784
 817 05fc A801      		movw r20,r16
785
 818 05fe B601      		movw r22,r12
786
 819 0600 0E94 0000 		call sensor_matrix_set_reading
787
 820 0604 00C0      		rjmp .L137
788
 821               	.L80:
789
 822 0606 8091 0000 		lds r24,ringState
790
 823 060a 9091 0000 		lds r25,(ringState)+1
791
 824 060e 0197      		sbiw r24,1
792
 825 0610 01F0      		breq .+2
793
 826 0612 00C0      		rjmp .L137
794
 827 0614 8091 0000 		lds r24,accepted
795
 828 0618 9091 0000 		lds r25,(accepted)+1
796
 829 061c 8617      		cp r24,r22
797
 830 061e 9707      		cpc r25,r23
798
 831 0620 01F4      		brne .L127
799
 832 0622 8FEF      		ldi r24,lo8(-1)
800
 833 0624 9FEF      		ldi r25,hi8(-1)
801
 834 0626 9093 0000 		sts (accepted)+1,r25
802
 835 062a 8093 0000 		sts accepted,r24
803
 836 062e 00C0      		rjmp .L129
804
 837               	.L127:
805
 838 0630 8F5F      		subi r24,lo8(-1)
806
 839 0632 9F4F      		sbci r25,hi8(-1)
807
 840 0634 01F0      		breq .+2
808
 841 0636 00C0      		rjmp .L137
809
 842               	.L129:
810
 843 0638 8601      		movw r16,r12
811
 844               	.L139:
812
 845 063a 0150      		subi r16,lo8(-(-1))
813
 846 063c 1040      		sbci r17,hi8(-(-1))
814
 847 063e 17FF      		sbrs r17,7
815
 848 0640 00C0      		rjmp .L131
816
 849 0642 0E94 0000 		call sensor_matrix_get_size
817
 850 0646 8C01      		movw r16,r24
818
 851 0648 0150      		subi r16,lo8(-(-1))
819
 852 064a 1040      		sbci r17,hi8(-(-1))
820
 853               	.L131:
821
 854 064c 0E94 0000 		call wl_get_xbee_id
822
 855 0650 0817      		cp r16,r24
823
 856 0652 1907      		cpc r17,r25
824
 857 0654 01F0      		breq .L133
825
 858 0656 C801      		movw r24,r16
826
 859 0658 0E94 0000 		call sensor_matrix_get_in_ring
827
 860 065c 892B      		or r24,r25
828
 861 065e 01F4      		brne .L137
829
 862 0660 00C0      		rjmp .L139
830
 863               	.L133:
831
 864 0662 D092 0000 		sts (accepted)+1,r13
832
 865 0666 C092 0000 		sts accepted,r12
833
 866 066a 31E0      		ldi r19,lo8(1)
834
 867 066c E32E      		mov r14,r19
835
 868 066e 8601      		movw r16,r12
836
 869 0670 20E0      		ldi r18,lo8(0)
837
 870 0672 30E0      		ldi r19,hi8(0)
838
 871 0674 40E0      		ldi r20,lo8(0)
839
 872 0676 50E0      		ldi r21,hi8(0)
840
 873 0678 65E0      		ldi r22,lo8(5)
841
 874 067a 82E0      		ldi r24,lo8(2)
842
 875 067c 0E94 0000 		call wl_send_robot_to_robot_global_packet
843
 876 0680 0E94 0000 		call sensor_matrix_get_joined
844
 877 0684 0197      		sbiw r24,1
845
 878 0686 01F4      		brne .L137
846
 879               	.L141:
847
 880 0688 0E94 0000 		call wl_token_pass_token
848
 881 068c 00C0      		rjmp .L137
849
 882               	.L81:
850
 883 068e 88E0      		ldi r24,lo8(8)
851
 884 0690 90E0      		ldi r25,hi8(8)
852
 885 0692 9093 0000 		sts (joinDelay)+1,r25
853
 886 0696 8093 0000 		sts joinDelay,r24
854
 887 069a 83E0      		ldi r24,lo8(3)
855
 888 069c 90E0      		ldi r25,hi8(3)
856
 889 069e 9093 0000 		sts (ringState)+1,r25
857
 890 06a2 8093 0000 		sts ringState,r24
858
 891 06a6 7093 0000 		sts (acceptor)+1,r23
859
 892 06aa 6093 0000 		sts acceptor,r22
860
 893 06ae 0E94 0000 		call wl_get_xbee_id
861
 894 06b2 61E0      		ldi r22,lo8(1)
862
 895 06b4 70E0      		ldi r23,hi8(1)
863
 896               	.L140:
864
 897 06b6 0E94 0000 		call sensor_matrix_set_in_ring
865
 898               	.L137:
866
 899               	/* epilogue: frame size=0 */
867
 900 06ba DF91      		pop r29
868
 901 06bc CF91      		pop r28
869
 902 06be 1F91      		pop r17
870
 903 06c0 0F91      		pop r16
871
 904 06c2 FF90      		pop r15
872
 905 06c4 EF90      		pop r14
873
 906 06c6 DF90      		pop r13
874
 907 06c8 CF90      		pop r12
875
 908 06ca BF90      		pop r11
876
 909 06cc AF90      		pop r10
877
 910 06ce 0895      		ret
878
 911               	/* epilogue end (size=11) */
879
 912               	/* function wl_token_ring_receive_handler size 483 (462) */
880
 915               	wl_token_ring_timeout_handler:
881
 916               	/* prologue: frame size=0 */
882
 917 06d0 0F93      		push r16
883
 918 06d2 1F93      		push r17
884
 919               	/* prologue end (size=2) */
885
 920 06d4 8091 0000 		lds r24,deathDelay
886
 921 06d8 9091 0000 		lds r25,(deathDelay)+1
887
 922 06dc 892B      		or r24,r25
888
 923 06de 01F4      		brne .L143
889
 924 06e0 0091 0000 		lds r16,wl_token_next_robot
890
 925 06e4 1091 0000 		lds r17,(wl_token_next_robot)+1
891
 926 06e8 0E94 0000 		call wl_get_xbee_id
892
 927 06ec 0817      		cp r16,r24
893
 928 06ee 1907      		cpc r17,r25
894
 929 06f0 01F0      		breq .L145
895
 930 06f2 60E0      		ldi r22,lo8(0)
896
 931 06f4 70E0      		ldi r23,hi8(0)
897
 932 06f6 8091 0000 		lds r24,wl_token_next_robot
898
 933 06fa 9091 0000 		lds r25,(wl_token_next_robot)+1
899
 934 06fe 0E94 0000 		call sensor_matrix_set_in_ring
900
 935 0702 8FEF      		ldi r24,lo8(-1)
901
 936 0704 9FEF      		ldi r25,hi8(-1)
902
 937 0706 9093 0000 		sts (wl_token_next_robot)+1,r25
903
 938 070a 8093 0000 		sts wl_token_next_robot,r24
904
 939 070e 84E0      		ldi r24,lo8(4)
905
 940 0710 90E0      		ldi r25,hi8(4)
906
 941 0712 9093 0000 		sts (deathDelay)+1,r25
907
 942 0716 8093 0000 		sts deathDelay,r24
908
 943               	.L145:
909
 944 071a 8091 0000 		lds r24,ringState
910
 945 071e 9091 0000 		lds r25,(ringState)+1
911
 946 0722 0197      		sbiw r24,1
912
 947 0724 01F4      		brne .L143
913
 948 0726 0E94 0000 		call wl_token_pass_token
914
 949               	.L143:
915
 950 072a 8091 0000 		lds r24,joinDelay
916
 951 072e 9091 0000 		lds r25,(joinDelay)+1
917
 952 0732 892B      		or r24,r25
918
 953 0734 01F4      		brne .L148
919
 954 0736 0E94 0000 		call sensor_matrix_get_joined
920
 955 073a 892B      		or r24,r25
921
 956 073c 01F4      		brne .L150
922
 957 073e 0E94 0000 		call wl_get_xbee_id
923
 958 0742 61E0      		ldi r22,lo8(1)
924
 959 0744 70E0      		ldi r23,hi8(1)
925
 960 0746 0E94 0000 		call sensor_matrix_set_in_ring
926
 961 074a 81E0      		ldi r24,lo8(1)
927
 962 074c 90E0      		ldi r25,hi8(1)
928
 963 074e 9093 0000 		sts (ringState)+1,r25
929
 964 0752 8093 0000 		sts ringState,r24
930
 965 0756 84E0      		ldi r24,lo8(4)
931
 966 0758 90E0      		ldi r25,hi8(4)
932
 967 075a 9093 0000 		sts (deathDelay)+1,r25
933
 968 075e 8093 0000 		sts deathDelay,r24
934
 969 0762 0E94 0000 		call wl_get_xbee_id
935
 970 0766 9093 0000 		sts (wl_token_next_robot)+1,r25
936
 971 076a 8093 0000 		sts wl_token_next_robot,r24
937
 972 076e 00C0      		rjmp .L148
938
 973               	.L150:
939
 974 0770 0E94 0000 		call wl_token_ring_join
940
 975 0774 0E94 0000 		call rand
941
 976 0778 6FEF      		ldi r22,lo8(4095)
942
 977 077a 7FE0      		ldi r23,hi8(4095)
943
 978 077c 0E94 0000 		call __divmodhi4
944
 979 0780 6F5F      		subi r22,lo8(-(1))
945
 980 0782 7F4F      		sbci r23,hi8(-(1))
946
 981 0784 7093 0000 		sts (joinDelay)+1,r23
947
 982 0788 6093 0000 		sts joinDelay,r22
948
 983               	.L148:
949
 984 078c 8091 0000 		lds r24,deathDelay
950
 985 0790 9091 0000 		lds r25,(deathDelay)+1
951
 986 0794 97FD      		sbrc r25,7
952
 987 0796 00C0      		rjmp .L152
953
 988 0798 0197      		sbiw r24,1
954
 989 079a 9093 0000 		sts (deathDelay)+1,r25
955
 990 079e 8093 0000 		sts deathDelay,r24
956
 991               	.L152:
957
 992 07a2 8091 0000 		lds r24,joinDelay
958
 993 07a6 9091 0000 		lds r25,(joinDelay)+1
959
 994 07aa 97FD      		sbrc r25,7
960
 995 07ac 00C0      		rjmp .L154
961
 996 07ae 0197      		sbiw r24,1
962
 997 07b0 9093 0000 		sts (joinDelay)+1,r25
963
 998 07b4 8093 0000 		sts joinDelay,r24
964
 999               	.L154:
965
 1000 07b8 8091 0000 		lds r24,bom_on_count
966
 1001 07bc 9091 0000 		lds r25,(bom_on_count)+1
967
 1002 07c0 97FD      		sbrc r25,7
968
 1003 07c2 00C0      		rjmp .L158
969
 1004 07c4 0196      		adiw r24,1
970
 1005 07c6 9093 0000 		sts (bom_on_count)+1,r25
971
 1006 07ca 8093 0000 		sts bom_on_count,r24
972
 1007               	.L158:
973
 1008               	/* epilogue: frame size=0 */
974
 1009 07ce 1F91      		pop r17
975
 1010 07d0 0F91      		pop r16
976
 1011 07d2 0895      		ret
977
 1012               	/* epilogue end (size=3) */
978
 1013               	/* function wl_token_ring_timeout_handler size 131 (126) */
979
 1015               	.global	wl_token_ring_register
980
 1017               	wl_token_ring_register:
981
 1018               	/* prologue: frame size=0 */
982
 1019               	/* prologue end (size=0) */
983
 1020 07d4 0E94 0000 		call wl_get_xbee_id
984
 1021 07d8 8F3F      		cpi r24,255
985
 1022 07da 9105      		cpc r25,__zero_reg__
986
 1023 07dc 01F0      		breq .L160
987
 1024 07de 04F0      		brlt .L160
988
 1025 07e0 8FEF      		ldi r24,lo8(-1)
989
 1026 07e2 9FEF      		ldi r25,hi8(-1)
990
 1027 07e4 0895      		ret
991
 1028               	.L160:
992
 1029 07e6 0E94 0000 		call sensor_matrix_create
993
 1030 07ea 0E94 0000 		call wl_get_xbee_id
994
 1031 07ee 60E0      		ldi r22,lo8(0)
995
 1032 07f0 70E0      		ldi r23,hi8(0)
996
 1033 07f2 0E94 0000 		call sensor_matrix_set_in_ring
997
 1034 07f6 80E0      		ldi r24,lo8(wl_token_ring_handler)
998
 1035 07f8 90E0      		ldi r25,hi8(wl_token_ring_handler)
999
 1036 07fa 0E94 0000 		call wl_register_packet_group
1000
 1037 07fe 80E0      		ldi r24,lo8(0)
1001
 1038 0800 90E0      		ldi r25,hi8(0)
1002
 1039 0802 0895      		ret
1003
 1040               	/* epilogue: frame size=0 */
1004
 1041               	/* epilogue: noreturn */
1005
 1042               	/* epilogue end (size=0) */
1006
 1043               	/* function wl_token_ring_register size 24 (24) */
1007
 1045               		.lcomm iteratorCount,2
1008
 1046               		.data
1009
 1049               	bom_on_function:
1010
 1050 0000 0000      		.word	gs(bom_on)
1011
 1053               	bom_off_function:
1012
 1054 0002 0000      		.word	gs(bom_off)
1013
 1057               	get_max_bom_function:
1014
 1058 0004 0000      		.word	gs(get_max_bom)
1015
 1061               	wl_token_ring_handler:
1016
 1062 0006 0200      		.word	2
1017
 1063 0008 0000      		.word	gs(wl_token_ring_timeout_handler)
1018
 1064 000a 0000      		.word	gs(wl_token_ring_response_handler)
1019
 1065 000c 0000      		.word	gs(wl_token_ring_receive_handler)
1020
 1066 000e 0000      		.word	gs(wl_token_ring_cleanup)
1021
 1069               	wl_token_next_robot:
1022
 1070 0010 FFFF      		.word	-1
1023
 1071               		.lcomm bom_on_count,2
1024
 1072               		.lcomm ringState,2
1025
 1075               	deathDelay:
1026
 1076 0012 FFFF      		.word	-1
1027
 1079               	joinDelay:
1028
 1080 0014 FFFF      		.word	-1
1029
 1083               	accepted:
1030
 1084 0016 FFFF      		.word	-1
1031
 1087               	acceptor:
1032
 1088 0018 FFFF      		.word	-1
1033
 1089               	/* File "wl_token_ring.c": code 1035 = 0x040b ( 939), prologues  40, epilogues  56 */
1034
DEFINED SYMBOLS
1035
                            *ABS*:00000000 wl_token_ring.c
1036
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:3      *ABS*:0000003f __SREG__
1037
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:4      *ABS*:0000003e __SP_H__
1038
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:5      *ABS*:0000003d __SP_L__
1039
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:6      *ABS*:00000000 __tmp_reg__
1040
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:7      *ABS*:00000001 __zero_reg__
1041
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:13     .text:00000000 wl_token_ring_leave
1042
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1071   .bss:00000004 ringState
1043
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:27     .text:0000000e wl_token_ring_set_bom_functions
1044
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1049   .data:00000000 bom_on_function
1045
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1053   .data:00000002 bom_off_function
1046
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1057   .data:00000004 get_max_bom_function
1047
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:42     .text:00000028 wl_token_ring_cleanup
1048
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:51     .text:0000002a wl_token_ring_response_handler
1049
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:61     .text:0000002c wl_token_iterator_has_next
1050
                             .bss:00000000 iteratorCount
1051
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:82     .text:00000046 wl_token_get_matrix_size
1052
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:93     .text:0000004c wl_token_get_num_robots
1053
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:104    .text:00000052 wl_token_get_robots_in_ring
1054
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:115    .text:00000058 wl_token_iterator_next
1055
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:173    .text:000000d8 wl_token_iterator_begin
1056
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:211    .text:00000114 wl_token_is_robot_in_ring
1057
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:222    .text:0000011a wl_token_get_sensor_reading
1058
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:263    .text:0000015c wl_token_get_my_sensor_reading
1059
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:281    .text:00000172 wl_token_ring_unregister
1060
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1061   .data:00000006 wl_token_ring_handler
1061
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:294    .text:0000017c wl_token_ring_join
1062
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1079   .data:00000014 joinDelay
1063
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:330    .text:000001ba wl_token_pass_token
1064
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1083   .data:00000016 accepted
1065
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1069   .data:00000010 wl_token_next_robot
1066
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1075   .data:00000012 deathDelay
1067
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:502    .text:00000318 wl_token_ring_receive_handler
1068
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1045   .bss:00000002 bom_on_count
1069
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1087   .data:00000018 acceptor
1070
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:915    .text:000006d0 wl_token_ring_timeout_handler
1071
F:\DOCUME~1\Evan\LOCALS~1\Temp/ccyQFxcu.s:1017   .text:000007d4 wl_token_ring_register
1072

    
1073
UNDEFINED SYMBOLS
1074
__do_copy_data
1075
__do_clear_bss
1076
sensor_matrix_get_size
1077
sensor_matrix_get_joined
1078
sensor_matrix_get_in_ring
1079
wl_get_xbee_id
1080
sensor_matrix_get_reading
1081
wl_unregister_packet_group
1082
wl_send_global_packet
1083
sensor_matrix_set_in_ring
1084
wl_send_robot_to_robot_global_packet
1085
delay_ms
1086
__divmodhi4
1087
sensor_matrix_set_reading
1088
rand
1089
sensor_matrix_create
1090
wl_register_packet_group
1091
bom_on
1092
bom_off
1093
get_max_bom