2313 lines
81 KiB
Plaintext
2313 lines
81 KiB
Plaintext
|
|
Mainboard.elf: file format elf32-avr
|
|
|
|
Sections:
|
|
Idx Name Size VMA LMA File off Algn
|
|
0 .data 0000003e 00800100 00000dc4 00000e58 2**0
|
|
CONTENTS, ALLOC, LOAD, DATA
|
|
1 .text 00000dc4 00000000 00000000 00000094 2**1
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
2 .bss 00000006 0080013e 0080013e 00000e96 2**0
|
|
ALLOC
|
|
3 .stab 00000d2c 00000000 00000000 00000e98 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
4 .stabstr 00000209 00000000 00000000 00001bc4 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
5 .comment 0000002f 00000000 00000000 00001dcd 2**0
|
|
CONTENTS, READONLY
|
|
6 .debug_aranges 00000208 00000000 00000000 00001dfc 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
7 .debug_info 0000226a 00000000 00000000 00002004 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
8 .debug_abbrev 00000e59 00000000 00000000 0000426e 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
9 .debug_line 000011b9 00000000 00000000 000050c7 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
10 .debug_frame 00000540 00000000 00000000 00006280 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
11 .debug_str 000007d4 00000000 00000000 000067c0 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
12 .debug_loc 000019f5 00000000 00000000 00006f94 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
13 .debug_ranges 000001a8 00000000 00000000 00008989 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
|
Disassembly of section .text:
|
|
|
|
00000000 <__vectors>:
|
|
void init_led()
|
|
{
|
|
DDRB |= (1<<PINB7) | (1<<PINB6) | (1<<PINB5);
|
|
}
|
|
|
|
void fade(int from, int to, int dur) {
|
|
0: 0c 94 69 00 jmp 0xd2 ; 0xd2 <__ctors_end>
|
|
4: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
8: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
c: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
10: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
14: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
18: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
1c: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
20: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
24: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
28: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
for (int i=0;i<0xFF;i++) {
|
|
2c: 0c 94 8f 02 jmp 0x51e ; 0x51e <__vector_11>
|
|
for(int k=0;k<dur;k++) {
|
|
30: 0c 94 b7 02 jmp 0x56e ; 0x56e <__vector_12>
|
|
for (int j=i;j<0xFF;j++) {
|
|
led(from);
|
|
}
|
|
for (int j=0;j<i;j++) {
|
|
34: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
}
|
|
|
|
void fade(int from, int to, int dur) {
|
|
for (int i=0;i<0xFF;i++) {
|
|
for(int k=0;k<dur;k++) {
|
|
for (int j=i;j<0xFF;j++) {
|
|
38: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
led(from);
|
|
3c: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
40: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
}
|
|
|
|
void fade(int from, int to, int dur) {
|
|
for (int i=0;i<0xFF;i++) {
|
|
for(int k=0;k<dur;k++) {
|
|
for (int j=i;j<0xFF;j++) {
|
|
44: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
48: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
4c: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
led(from);
|
|
}
|
|
for (int j=0;j<i;j++) {
|
|
50: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
54: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
58: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
led(to);
|
|
5c: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
for (int i=0;i<0xFF;i++) {
|
|
for(int k=0;k<dur;k++) {
|
|
for (int j=i;j<0xFF;j++) {
|
|
led(from);
|
|
}
|
|
for (int j=0;j<i;j++) {
|
|
60: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
64: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
68: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
DDRB |= (1<<PINB7) | (1<<PINB6) | (1<<PINB5);
|
|
}
|
|
|
|
void fade(int from, int to, int dur) {
|
|
for (int i=0;i<0xFF;i++) {
|
|
for(int k=0;k<dur;k++) {
|
|
6c: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
70: 0c 94 86 00 jmp 0x10c ; 0x10c <__bad_interrupt>
|
|
|
|
00000074 <device_descriptor>:
|
|
74: 12 01 00 02 ff 00 00 10 ad de ee be 00 01 01 02 ................
|
|
for (int j=i;j<0xFF;j++) {
|
|
84: 03 01 ..
|
|
|
|
00000086 <string0>:
|
|
86: 04 03 09 04 ....
|
|
|
|
0000008a <string1>:
|
|
{
|
|
DDRB |= (1<<PINB7) | (1<<PINB6) | (1<<PINB5);
|
|
}
|
|
|
|
void fade(int from, int to, int dur) {
|
|
for (int i=0;i<0xFF;i++) {
|
|
8a: 14 03 42 00 6c 00 75 00 62 00 62 00 46 00 69 00 ..B.l.u.b.b.F.i.
|
|
for (int j=0;j<i;j++) {
|
|
led(to);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
9a: 73 00 68 00 00 00 s.h...
|
|
|
|
000000a0 <string2>:
|
|
a0: 20 03 48 00 61 00 63 00 6b 00 65 00 72 00 2d 00 .H.a.c.k.e.r.-.
|
|
b0: 4a 00 65 00 6f 00 70 00 61 00 72 00 64 00 79 00 J.e.o.p.a.r.d.y.
|
|
...
|
|
|
|
000000c2 <string3>:
|
|
c2: 0e 03 30 00 30 00 30 00 30 00 30 00 31 00 00 00 ..0.0.0.0.0.1...
|
|
|
|
000000d2 <__ctors_end>:
|
|
d2: 11 24 eor r1, r1
|
|
d4: 1f be out 0x3f, r1 ; 63
|
|
d6: cf ef ldi r28, 0xFF ; 255
|
|
d8: d4 e0 ldi r29, 0x04 ; 4
|
|
da: de bf out 0x3e, r29 ; 62
|
|
dc: cd bf out 0x3d, r28 ; 61
|
|
|
|
000000de <__do_copy_data>:
|
|
de: 11 e0 ldi r17, 0x01 ; 1
|
|
e0: a0 e0 ldi r26, 0x00 ; 0
|
|
e2: b1 e0 ldi r27, 0x01 ; 1
|
|
e4: e4 ec ldi r30, 0xC4 ; 196
|
|
e6: fd e0 ldi r31, 0x0D ; 13
|
|
e8: 02 c0 rjmp .+4 ; 0xee <__do_copy_data+0x10>
|
|
ea: 05 90 lpm r0, Z+
|
|
ec: 0d 92 st X+, r0
|
|
ee: ae 33 cpi r26, 0x3E ; 62
|
|
f0: b1 07 cpc r27, r17
|
|
f2: d9 f7 brne .-10 ; 0xea <__do_copy_data+0xc>
|
|
|
|
000000f4 <__do_clear_bss>:
|
|
f4: 21 e0 ldi r18, 0x01 ; 1
|
|
f6: ae e3 ldi r26, 0x3E ; 62
|
|
f8: b1 e0 ldi r27, 0x01 ; 1
|
|
fa: 01 c0 rjmp .+2 ; 0xfe <.do_clear_bss_start>
|
|
|
|
000000fc <.do_clear_bss_loop>:
|
|
fc: 1d 92 st X+, r1
|
|
|
|
000000fe <.do_clear_bss_start>:
|
|
fe: a4 34 cpi r26, 0x44 ; 68
|
|
100: b2 07 cpc r27, r18
|
|
102: e1 f7 brne .-8 ; 0xfc <.do_clear_bss_loop>
|
|
104: 0e 94 9e 00 call 0x13c ; 0x13c <main>
|
|
108: 0c 94 e0 06 jmp 0xdc0 ; 0xdc0 <_exit>
|
|
|
|
0000010c <__bad_interrupt>:
|
|
10c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
|
|
|
00000110 <spi_putc>:
|
|
110: 8e bd out 0x2e, r24 ; 46
|
|
112: 0d b4 in r0, 0x2d ; 45
|
|
114: 07 fc sbrc r0, 7
|
|
116: 10 c0 rjmp .+32 ; 0x138 <spi_putc+0x28>
|
|
118: 90 e4 ldi r25, 0x40 ; 64
|
|
11a: 85 b1 in r24, 0x05 ; 5
|
|
11c: 89 27 eor r24, r25
|
|
11e: 85 b9 out 0x05, r24 ; 5
|
|
120: 2f ef ldi r18, 0xFF ; 255
|
|
122: 31 ee ldi r19, 0xE1 ; 225
|
|
124: 84 e0 ldi r24, 0x04 ; 4
|
|
126: 21 50 subi r18, 0x01 ; 1
|
|
128: 30 40 sbci r19, 0x00 ; 0
|
|
12a: 80 40 sbci r24, 0x00 ; 0
|
|
12c: e1 f7 brne .-8 ; 0x126 <spi_putc+0x16>
|
|
12e: 00 c0 rjmp .+0 ; 0x130 <spi_putc+0x20>
|
|
130: 00 00 nop
|
|
132: 0d b4 in r0, 0x2d ; 45
|
|
134: 07 fe sbrs r0, 7
|
|
136: f1 cf rjmp .-30 ; 0x11a <spi_putc+0xa>
|
|
138: 8e b5 in r24, 0x2e ; 46
|
|
13a: 08 95 ret
|
|
|
|
0000013c <main>:
|
|
13c: 86 ed ldi r24, 0xD6 ; 214
|
|
13e: 84 b9 out 0x04, r24 ; 4
|
|
140: 80 e1 ldi r24, 0x10 ; 16
|
|
142: 85 b9 out 0x05, r24 ; 5
|
|
144: 1d bc out 0x2d, r1 ; 45
|
|
146: 83 e5 ldi r24, 0x53 ; 83
|
|
148: 8c bd out 0x2c, r24 ; 44
|
|
14a: 8f e3 ldi r24, 0x3F ; 63
|
|
14c: 9c e9 ldi r25, 0x9C ; 156
|
|
14e: 01 97 sbiw r24, 0x01 ; 1
|
|
150: f1 f7 brne .-4 ; 0x14e <main+0x12>
|
|
152: 00 c0 rjmp .+0 ; 0x154 <main+0x18>
|
|
154: 00 00 nop
|
|
156: 2c 98 cbi 0x05, 4 ; 5
|
|
158: 80 ec ldi r24, 0xC0 ; 192
|
|
15a: 0e 94 88 00 call 0x110 ; 0x110 <spi_putc>
|
|
15e: 8f e9 ldi r24, 0x9F ; 159
|
|
160: 9f e0 ldi r25, 0x0F ; 15
|
|
162: 01 97 sbiw r24, 0x01 ; 1
|
|
164: f1 f7 brne .-4 ; 0x162 <main+0x26>
|
|
166: 00 c0 rjmp .+0 ; 0x168 <main+0x2c>
|
|
168: 00 00 nop
|
|
16a: 2c 9a sbi 0x05, 4 ; 5
|
|
16c: 2c 98 cbi 0x05, 4 ; 5
|
|
16e: 80 ec ldi r24, 0xC0 ; 192
|
|
170: 0e 94 88 00 call 0x110 ; 0x110 <spi_putc>
|
|
174: 8f e9 ldi r24, 0x9F ; 159
|
|
176: 9f e0 ldi r25, 0x0F ; 15
|
|
178: 01 97 sbiw r24, 0x01 ; 1
|
|
17a: f1 f7 brne .-4 ; 0x178 <main+0x3c>
|
|
17c: 00 c0 rjmp .+0 ; 0x17e <main+0x42>
|
|
17e: 00 00 nop
|
|
180: 2c 9a sbi 0x05, 4 ; 5
|
|
182: 2f 9a sbi 0x05, 7 ; 5
|
|
184: ff cf rjmp .-2 ; 0x184 <main+0x48>
|
|
|
|
00000186 <uart_putchar>:
|
|
186: cf 93 push r28
|
|
188: c8 2f mov r28, r24
|
|
18a: 8a 30 cpi r24, 0x0A ; 10
|
|
18c: 19 f4 brne .+6 ; 0x194 <uart_putchar+0xe>
|
|
18e: 8d e0 ldi r24, 0x0D ; 13
|
|
190: 0e 94 c3 00 call 0x186 ; 0x186 <uart_putchar>
|
|
194: e8 ec ldi r30, 0xC8 ; 200
|
|
196: f0 e0 ldi r31, 0x00 ; 0
|
|
198: 90 81 ld r25, Z
|
|
19a: 95 ff sbrs r25, 5
|
|
19c: fd cf rjmp .-6 ; 0x198 <uart_putchar+0x12>
|
|
19e: c0 93 ce 00 sts 0x00CE, r28
|
|
1a2: 80 e0 ldi r24, 0x00 ; 0
|
|
1a4: 90 e0 ldi r25, 0x00 ; 0
|
|
1a6: cf 91 pop r28
|
|
1a8: 08 95 ret
|
|
|
|
000001aa <usb_controlrequest>:
|
|
1aa: cf 93 push r28
|
|
1ac: df 93 push r29
|
|
1ae: cd b7 in r28, 0x3d ; 61
|
|
1b0: de b7 in r29, 0x3e ; 62
|
|
1b2: 60 97 sbiw r28, 0x10 ; 16
|
|
1b4: 0f b6 in r0, 0x3f ; 63
|
|
1b6: f8 94 cli
|
|
1b8: de bf out 0x3e, r29 ; 62
|
|
1ba: 0f be out 0x3f, r0 ; 63
|
|
1bc: cd bf out 0x3d, r28 ; 61
|
|
1be: 2c e0 ldi r18, 0x0C ; 12
|
|
1c0: e5 e1 ldi r30, 0x15 ; 21
|
|
1c2: f1 e0 ldi r31, 0x01 ; 1
|
|
1c4: de 01 movw r26, r28
|
|
1c6: 11 96 adiw r26, 0x01 ; 1
|
|
1c8: 01 90 ld r0, Z+
|
|
1ca: 0d 92 st X+, r0
|
|
1cc: 2a 95 dec r18
|
|
1ce: e1 f7 brne .-8 ; 0x1c8 <usb_controlrequest+0x1e>
|
|
1d0: 1d 86 std Y+13, r1 ; 0x0d
|
|
1d2: 1e 86 std Y+14, r1 ; 0x0e
|
|
1d4: 1f 86 std Y+15, r1 ; 0x0f
|
|
1d6: 18 8a std Y+16, r1 ; 0x10
|
|
1d8: fc 01 movw r30, r24
|
|
1da: 20 81 ld r18, Z
|
|
1dc: 23 3c cpi r18, 0xC3 ; 195
|
|
1de: 51 f4 brne .+20 ; 0x1f4 <usb_controlrequest+0x4a>
|
|
1e0: 81 81 ldd r24, Z+1 ; 0x01
|
|
1e2: 81 30 cpi r24, 0x01 ; 1
|
|
1e4: 49 f4 brne .+18 ; 0x1f8 <usb_controlrequest+0x4e>
|
|
1e6: 60 e1 ldi r22, 0x10 ; 16
|
|
1e8: ce 01 movw r24, r28
|
|
1ea: 01 96 adiw r24, 0x01 ; 1
|
|
1ec: 0e 94 3d 02 call 0x47a ; 0x47a <usb_txdata_control>
|
|
1f0: 81 e0 ldi r24, 0x01 ; 1
|
|
1f2: 03 c0 rjmp .+6 ; 0x1fa <usb_controlrequest+0x50>
|
|
1f4: 80 e0 ldi r24, 0x00 ; 0
|
|
1f6: 01 c0 rjmp .+2 ; 0x1fa <usb_controlrequest+0x50>
|
|
1f8: 80 e0 ldi r24, 0x00 ; 0
|
|
1fa: 60 96 adiw r28, 0x10 ; 16
|
|
1fc: 0f b6 in r0, 0x3f ; 63
|
|
1fe: f8 94 cli
|
|
200: de bf out 0x3e, r29 ; 62
|
|
202: 0f be out 0x3f, r0 ; 63
|
|
204: cd bf out 0x3d, r28 ; 61
|
|
206: df 91 pop r29
|
|
208: cf 91 pop r28
|
|
20a: 08 95 ret
|
|
|
|
0000020c <usb_ep>:
|
|
20c: cf 93 push r28
|
|
20e: df 93 push r29
|
|
210: cd b7 in r28, 0x3d ; 61
|
|
212: de b7 in r29, 0x3e ; 62
|
|
214: a0 97 sbiw r28, 0x20 ; 32
|
|
216: 0f b6 in r0, 0x3f ; 63
|
|
218: f8 94 cli
|
|
21a: de bf out 0x3e, r29 ; 62
|
|
21c: 0f be out 0x3f, r0 ; 63
|
|
21e: cd bf out 0x3d, r28 ; 61
|
|
220: 81 30 cpi r24, 0x01 ; 1
|
|
222: a1 f4 brne .+40 ; 0x24c <usb_ep+0x40>
|
|
224: 40 e2 ldi r20, 0x20 ; 32
|
|
226: be 01 movw r22, r28
|
|
228: 6f 5f subi r22, 0xFF ; 255
|
|
22a: 7f 4f sbci r23, 0xFF ; 255
|
|
22c: 0e 94 18 02 call 0x430 ; 0x430 <usb_rxdata>
|
|
230: 88 23 and r24, r24
|
|
232: 61 f0 breq .+24 ; 0x24c <usb_ep+0x40>
|
|
234: 18 a2 std Y+32, r1 ; 0x20
|
|
236: ce 01 movw r24, r28
|
|
238: 01 96 adiw r24, 0x01 ; 1
|
|
23a: 0e 94 bb 06 call 0xd76 ; 0xd76 <strupr>
|
|
23e: 40 e2 ldi r20, 0x20 ; 32
|
|
240: be 01 movw r22, r28
|
|
242: 6f 5f subi r22, 0xFF ; 255
|
|
244: 7f 4f sbci r23, 0xFF ; 255
|
|
246: 82 e8 ldi r24, 0x82 ; 130
|
|
248: 0e 94 60 02 call 0x4c0 ; 0x4c0 <usb_txdata>
|
|
24c: a0 96 adiw r28, 0x20 ; 32
|
|
24e: 0f b6 in r0, 0x3f ; 63
|
|
250: f8 94 cli
|
|
252: de bf out 0x3e, r29 ; 62
|
|
254: 0f be out 0x3f, r0 ; 63
|
|
256: cd bf out 0x3d, r28 ; 61
|
|
258: df 91 pop r29
|
|
25a: cf 91 pop r28
|
|
25c: 08 95 ret
|
|
|
|
0000025e <usb_endpoints>:
|
|
25e: 2f 92 push r2
|
|
260: 3f 92 push r3
|
|
262: 4f 92 push r4
|
|
264: 5f 92 push r5
|
|
266: 7f 92 push r7
|
|
268: 8f 92 push r8
|
|
26a: 9f 92 push r9
|
|
26c: af 92 push r10
|
|
26e: cf 92 push r12
|
|
270: df 92 push r13
|
|
272: ef 92 push r14
|
|
274: ff 92 push r15
|
|
276: 0f 93 push r16
|
|
278: 1f 93 push r17
|
|
27a: cf 93 push r28
|
|
27c: df 93 push r29
|
|
27e: 28 2f mov r18, r24
|
|
280: 90 e0 ldi r25, 0x00 ; 0
|
|
282: 6c e0 ldi r22, 0x0C ; 12
|
|
284: 70 e0 ldi r23, 0x00 ; 0
|
|
286: 0e 94 71 05 call 0xae2 ; 0xae2 <__mulhi3>
|
|
28a: fc 01 movw r30, r24
|
|
28c: eb 5d subi r30, 0xDB ; 219
|
|
28e: fe 4f sbci r31, 0xFE ; 254
|
|
290: 82 2f mov r24, r18
|
|
292: 90 e0 ldi r25, 0x00 ; 0
|
|
294: 6c e0 ldi r22, 0x0C ; 12
|
|
296: 70 e0 ldi r23, 0x00 ; 0
|
|
298: 0e 94 71 05 call 0xae2 ; 0xae2 <__mulhi3>
|
|
29c: 89 5d subi r24, 0xD9 ; 217
|
|
29e: 9e 4f sbci r25, 0xFE ; 254
|
|
2a0: 41 e0 ldi r20, 0x01 ; 1
|
|
2a2: 0f 2e mov r0, r31
|
|
2a4: f9 ee ldi r31, 0xE9 ; 233
|
|
2a6: cf 2e mov r12, r31
|
|
2a8: d1 2c mov r13, r1
|
|
2aa: f0 2d mov r31, r0
|
|
2ac: 0f 2e mov r0, r31
|
|
2ae: fb ee ldi r31, 0xEB ; 235
|
|
2b0: ef 2e mov r14, r31
|
|
2b2: f1 2c mov r15, r1
|
|
2b4: f0 2d mov r31, r0
|
|
2b6: aa 24 eor r10, r10
|
|
2b8: a3 94 inc r10
|
|
2ba: 0c ee ldi r16, 0xEC ; 236
|
|
2bc: 10 e0 ldi r17, 0x00 ; 0
|
|
2be: 6d ee ldi r22, 0xED ; 237
|
|
2c0: 70 e0 ldi r23, 0x00 ; 0
|
|
2c2: 0f 2e mov r0, r31
|
|
2c4: f0 ef ldi r31, 0xF0 ; 240
|
|
2c6: 4f 2e mov r4, r31
|
|
2c8: 51 2c mov r5, r1
|
|
2ca: f0 2d mov r31, r0
|
|
2cc: 68 94 set
|
|
2ce: 99 24 eor r9, r9
|
|
2d0: 92 f8 bld r9, 2
|
|
2d2: 81 2c mov r8, r1
|
|
2d4: 68 94 set
|
|
2d6: 77 24 eor r7, r7
|
|
2d8: 74 f8 bld r7, 4
|
|
2da: df 01 movw r26, r30
|
|
2dc: 20 81 ld r18, Z
|
|
2de: 2f 3f cpi r18, 0xFF ; 255
|
|
2e0: 59 f1 breq .+86 ; 0x338 <usb_endpoints+0xda>
|
|
2e2: e6 01 movw r28, r12
|
|
2e4: 48 83 st Y, r20
|
|
2e6: e7 01 movw r28, r14
|
|
2e8: a8 82 st Y, r10
|
|
2ea: 20 81 ld r18, Z
|
|
2ec: e8 01 movw r28, r16
|
|
2ee: 28 83 st Y, r18
|
|
2f0: 1c 01 movw r2, r24
|
|
2f2: 9c 01 movw r18, r24
|
|
2f4: 21 50 subi r18, 0x01 ; 1
|
|
2f6: 31 09 sbc r19, r1
|
|
2f8: e9 01 movw r28, r18
|
|
2fa: 28 81 ld r18, Y
|
|
2fc: 20 38 cpi r18, 0x80 ; 128
|
|
2fe: 41 f0 breq .+16 ; 0x310 <usb_endpoints+0xb2>
|
|
300: 20 34 cpi r18, 0x40 ; 64
|
|
302: 41 f0 breq .+16 ; 0x314 <usb_endpoints+0xb6>
|
|
304: 20 32 cpi r18, 0x20 ; 32
|
|
306: 41 f0 breq .+16 ; 0x318 <usb_endpoints+0xba>
|
|
308: 20 31 cpi r18, 0x10 ; 16
|
|
30a: 41 f4 brne .+16 ; 0x31c <usb_endpoints+0xbe>
|
|
30c: 37 2d mov r19, r7
|
|
30e: 07 c0 rjmp .+14 ; 0x31e <usb_endpoints+0xc0>
|
|
310: 30 e4 ldi r19, 0x40 ; 64
|
|
312: 05 c0 rjmp .+10 ; 0x31e <usb_endpoints+0xc0>
|
|
314: 30 e3 ldi r19, 0x30 ; 48
|
|
316: 03 c0 rjmp .+6 ; 0x31e <usb_endpoints+0xc0>
|
|
318: 30 e2 ldi r19, 0x20 ; 32
|
|
31a: 01 c0 rjmp .+2 ; 0x31e <usb_endpoints+0xc0>
|
|
31c: 38 2d mov r19, r8
|
|
31e: e1 01 movw r28, r2
|
|
320: 28 81 ld r18, Y
|
|
322: 23 2b or r18, r19
|
|
324: eb 01 movw r28, r22
|
|
326: 28 83 st Y, r18
|
|
328: 2c 91 ld r18, X
|
|
32a: 20 ff sbrs r18, 0
|
|
32c: 03 c0 rjmp .+6 ; 0x334 <usb_endpoints+0xd6>
|
|
32e: d2 01 movw r26, r4
|
|
330: 1c 92 st X, r1
|
|
332: 02 c0 rjmp .+4 ; 0x338 <usb_endpoints+0xda>
|
|
334: e2 01 movw r28, r4
|
|
336: 98 82 st Y, r9
|
|
338: 4f 5f subi r20, 0xFF ; 255
|
|
33a: 33 96 adiw r30, 0x03 ; 3
|
|
33c: 03 96 adiw r24, 0x03 ; 3
|
|
33e: 45 30 cpi r20, 0x05 ; 5
|
|
340: 61 f6 brne .-104 ; 0x2da <usb_endpoints+0x7c>
|
|
342: ea ee ldi r30, 0xEA ; 234
|
|
344: f0 e0 ldi r31, 0x00 ; 0
|
|
346: 8e e1 ldi r24, 0x1E ; 30
|
|
348: 80 83 st Z, r24
|
|
34a: 10 82 st Z, r1
|
|
34c: df 91 pop r29
|
|
34e: cf 91 pop r28
|
|
350: 1f 91 pop r17
|
|
352: 0f 91 pop r16
|
|
354: ff 90 pop r15
|
|
356: ef 90 pop r14
|
|
358: df 90 pop r13
|
|
35a: cf 90 pop r12
|
|
35c: af 90 pop r10
|
|
35e: 9f 90 pop r9
|
|
360: 8f 90 pop r8
|
|
362: 7f 90 pop r7
|
|
364: 5f 90 pop r5
|
|
366: 4f 90 pop r4
|
|
368: 3f 90 pop r3
|
|
36a: 2f 90 pop r2
|
|
36c: 08 95 ret
|
|
|
|
0000036e <usb_wait_in>:
|
|
36e: e8 ee ldi r30, 0xE8 ; 232
|
|
370: f0 e0 ldi r31, 0x00 ; 0
|
|
372: 80 81 ld r24, Z
|
|
374: 85 70 andi r24, 0x05 ; 5
|
|
376: e9 f3 breq .-6 ; 0x372 <usb_wait_in+0x4>
|
|
378: 08 95 ret
|
|
|
|
0000037a <usb_desc_out>:
|
|
37a: af 92 push r10
|
|
37c: bf 92 push r11
|
|
37e: cf 92 push r12
|
|
380: df 92 push r13
|
|
382: ef 92 push r14
|
|
384: ff 92 push r15
|
|
386: 0f 93 push r16
|
|
388: 1f 93 push r17
|
|
38a: cf 93 push r28
|
|
38c: df 93 push r29
|
|
38e: d8 2e mov r13, r24
|
|
390: d6 2f mov r29, r22
|
|
392: c7 2f mov r28, r23
|
|
394: e4 2f mov r30, r20
|
|
396: f0 e0 ldi r31, 0x00 ; 0
|
|
398: 2e 17 cp r18, r30
|
|
39a: 3f 07 cpc r19, r31
|
|
39c: 10 f4 brcc .+4 ; 0x3a2 <usb_desc_out+0x28>
|
|
39e: c2 2e mov r12, r18
|
|
3a0: 01 c0 rjmp .+2 ; 0x3a4 <usb_desc_out+0x2a>
|
|
3a2: c4 2e mov r12, r20
|
|
3a4: 0e 94 b7 01 call 0x36e ; 0x36e <usb_wait_in>
|
|
3a8: 0d 2f mov r16, r29
|
|
3aa: 1c 2f mov r17, r28
|
|
3ac: 68 94 set
|
|
3ae: aa 24 eor r10, r10
|
|
3b0: a4 f8 bld r10, 4
|
|
3b2: 0f 2e mov r0, r31
|
|
3b4: f8 ee ldi r31, 0xE8 ; 232
|
|
3b6: ef 2e mov r14, r31
|
|
3b8: f1 2c mov r15, r1
|
|
3ba: f0 2d mov r31, r0
|
|
// send IN package
|
|
n = (len < ENDPOINT0_SIZE) ? len : ENDPOINT0_SIZE;
|
|
for (i = n; i; i--)
|
|
UEDATX = isRAM ? *addr++ : pgm_read_byte(addr++);
|
|
len -= n;
|
|
USB_SEND_IN;
|
|
3bc: 0f 2e mov r0, r31
|
|
3be: fe ef ldi r31, 0xFE ; 254
|
|
3c0: bf 2e mov r11, r31
|
|
3c2: f0 2d mov r31, r0
|
|
usb_wait_in();
|
|
if (i & _BV(RXOUTI)) return; // cancel
|
|
// send IN package
|
|
n = (len < ENDPOINT0_SIZE) ? len : ENDPOINT0_SIZE;
|
|
for (i = n; i; i--)
|
|
UEDATX = isRAM ? *addr++ : pgm_read_byte(addr++);
|
|
3c4: c1 ef ldi r28, 0xF1 ; 241
|
|
3c6: d0 e0 ldi r29, 0x00 ; 0
|
|
if (len>maxsize) len=maxsize;
|
|
do {
|
|
usb_wait_in();
|
|
if (i & _BV(RXOUTI)) return; // cancel
|
|
// send IN package
|
|
n = (len < ENDPOINT0_SIZE) ? len : ENDPOINT0_SIZE;
|
|
3c8: 2c 2d mov r18, r12
|
|
3ca: 80 e1 ldi r24, 0x10 ; 16
|
|
3cc: 8c 15 cp r24, r12
|
|
3ce: 08 f4 brcc .+2 ; 0x3d2 <usb_desc_out+0x58>
|
|
3d0: 2a 2d mov r18, r10
|
|
for (i = n; i; i--)
|
|
3d2: 22 23 and r18, r18
|
|
3d4: d9 f0 breq .+54 ; 0x40c <usb_desc_out+0x92>
|
|
3d6: f8 01 movw r30, r16
|
|
3d8: 92 2f mov r25, r18
|
|
UEDATX = isRAM ? *addr++ : pgm_read_byte(addr++);
|
|
3da: dd 20 and r13, r13
|
|
3dc: 11 f0 breq .+4 ; 0x3e2 <usb_desc_out+0x68>
|
|
3de: 80 81 ld r24, Z
|
|
3e0: 01 c0 rjmp .+2 ; 0x3e4 <usb_desc_out+0x6a>
|
|
3e2: 84 91 lpm r24, Z
|
|
3e4: 88 83 st Y, r24
|
|
do {
|
|
usb_wait_in();
|
|
if (i & _BV(RXOUTI)) return; // cancel
|
|
// send IN package
|
|
n = (len < ENDPOINT0_SIZE) ? len : ENDPOINT0_SIZE;
|
|
for (i = n; i; i--)
|
|
3e6: 91 50 subi r25, 0x01 ; 1
|
|
3e8: 31 96 adiw r30, 0x01 ; 1
|
|
3ea: 91 11 cpse r25, r1
|
|
3ec: f6 cf rjmp .-20 ; 0x3da <usb_desc_out+0x60>
|
|
do {
|
|
i = UEINTX;
|
|
} while (!(i & (_BV(TXINI)|_BV(RXOUTI))));
|
|
}
|
|
|
|
void usb_desc_out(bool isRAM, const uint8_t *pgmaddr, uint8_t size, uint16_t maxsize)
|
|
3ee: 62 2f mov r22, r18
|
|
3f0: 61 50 subi r22, 0x01 ; 1
|
|
3f2: 70 e0 ldi r23, 0x00 ; 0
|
|
3f4: 6f 5f subi r22, 0xFF ; 255
|
|
3f6: 7f 4f sbci r23, 0xFF ; 255
|
|
3f8: 06 0f add r16, r22
|
|
3fa: 17 1f adc r17, r23
|
|
if (i & _BV(RXOUTI)) return; // cancel
|
|
// send IN package
|
|
n = (len < ENDPOINT0_SIZE) ? len : ENDPOINT0_SIZE;
|
|
for (i = n; i; i--)
|
|
UEDATX = isRAM ? *addr++ : pgm_read_byte(addr++);
|
|
len -= n;
|
|
3fc: c2 1a sub r12, r18
|
|
USB_SEND_IN;
|
|
3fe: f7 01 movw r30, r14
|
|
400: b0 82 st Z, r11
|
|
} while (len || n == ENDPOINT0_SIZE);
|
|
402: c1 10 cpse r12, r1
|
|
404: 07 c0 rjmp .+14 ; 0x414 <usb_desc_out+0x9a>
|
|
406: 20 31 cpi r18, 0x10 ; 16
|
|
408: 29 f0 breq .+10 ; 0x414 <usb_desc_out+0x9a>
|
|
40a: 07 c0 rjmp .+14 ; 0x41a <usb_desc_out+0xa0>
|
|
// send IN package
|
|
n = (len < ENDPOINT0_SIZE) ? len : ENDPOINT0_SIZE;
|
|
for (i = n; i; i--)
|
|
UEDATX = isRAM ? *addr++ : pgm_read_byte(addr++);
|
|
len -= n;
|
|
USB_SEND_IN;
|
|
40c: f7 01 movw r30, r14
|
|
40e: b0 82 st Z, r11
|
|
} while (len || n == ENDPOINT0_SIZE);
|
|
410: cc 20 and r12, r12
|
|
412: 19 f0 breq .+6 ; 0x41a <usb_desc_out+0xa0>
|
|
|
|
addr=pgmaddr;
|
|
len=size;
|
|
if (len>maxsize) len=maxsize;
|
|
do {
|
|
usb_wait_in();
|
|
414: 0e 94 b7 01 call 0x36e ; 0x36e <usb_wait_in>
|
|
418: d7 cf rjmp .-82 ; 0x3c8 <usb_desc_out+0x4e>
|
|
for (i = n; i; i--)
|
|
UEDATX = isRAM ? *addr++ : pgm_read_byte(addr++);
|
|
len -= n;
|
|
USB_SEND_IN;
|
|
} while (len || n == ENDPOINT0_SIZE);
|
|
}
|
|
41a: df 91 pop r29
|
|
41c: cf 91 pop r28
|
|
41e: 1f 91 pop r17
|
|
420: 0f 91 pop r16
|
|
422: ff 90 pop r15
|
|
424: ef 90 pop r14
|
|
426: df 90 pop r13
|
|
428: cf 90 pop r12
|
|
42a: bf 90 pop r11
|
|
42c: af 90 pop r10
|
|
42e: 08 95 ret
|
|
|
|
00000430 <usb_rxdata>:
|
|
uint16_t r, i;
|
|
#else
|
|
uint8_t r, i;
|
|
#endif
|
|
|
|
UENUM = endpoint; // select endpoint
|
|
430: 80 93 e9 00 sts 0x00E9, r24
|
|
#ifdef MEGA4_6
|
|
r = ((uint16_t)(UEBCHX)<<8)+UEBCLX;
|
|
#else
|
|
r = UEBCLX;
|
|
434: 90 91 f2 00 lds r25, 0x00F2
|
|
438: 94 17 cp r25, r20
|
|
43a: 08 f4 brcc .+2 ; 0x43e <usb_rxdata+0xe>
|
|
43c: 49 2f mov r20, r25
|
|
#endif
|
|
if (r>maxdatasize) r = maxdatasize;
|
|
if (r) { // data available in input endpoint
|
|
43e: 44 23 and r20, r20
|
|
440: d1 f0 breq .+52 ; 0x476 <usb_rxdata+0x46>
|
|
442: 36 2f mov r19, r22
|
|
444: e6 2f mov r30, r22
|
|
446: f7 2f mov r31, r23
|
|
for (i=0; i<r; i++) buffer[i]=UEDATX;
|
|
448: a1 ef ldi r26, 0xF1 ; 241
|
|
44a: b0 e0 ldi r27, 0x00 ; 0
|
|
44c: 9c 91 ld r25, X
|
|
44e: 91 93 st Z+, r25
|
|
450: 9e 2f mov r25, r30
|
|
452: 93 1b sub r25, r19
|
|
454: 94 17 cp r25, r20
|
|
456: d0 f3 brcs .-12 ; 0x44c <usb_rxdata+0x1c>
|
|
#ifdef MEGA4_6
|
|
if ((((uint16_t)(UEBCHX)<<8)+UEBCLX)==0) { // buffer is empty
|
|
#else
|
|
if (UEBCLX==0) { // buffer is empty
|
|
458: 90 91 f2 00 lds r25, 0x00F2
|
|
45c: 91 11 cpse r25, r1
|
|
45e: 0b c0 rjmp .+22 ; 0x476 <usb_rxdata+0x46>
|
|
#endif
|
|
UERST = _BV(endpoint); // endpoint FIFO reset
|
|
460: 21 e0 ldi r18, 0x01 ; 1
|
|
462: 30 e0 ldi r19, 0x00 ; 0
|
|
464: 02 c0 rjmp .+4 ; 0x46a <usb_rxdata+0x3a>
|
|
466: 22 0f add r18, r18
|
|
468: 33 1f adc r19, r19
|
|
46a: 8a 95 dec r24
|
|
46c: e2 f7 brpl .-8 ; 0x466 <usb_rxdata+0x36>
|
|
46e: ea ee ldi r30, 0xEA ; 234
|
|
470: f0 e0 ldi r31, 0x00 ; 0
|
|
472: 20 83 st Z, r18
|
|
UERST = 0;
|
|
474: 10 82 st Z, r1
|
|
}
|
|
}
|
|
return r;
|
|
}
|
|
476: 84 2f mov r24, r20
|
|
478: 08 95 ret
|
|
|
|
0000047a <usb_txdata_control>:
|
|
|
|
bool usb_txdata_control(uint8_t *buffer, uint8_t datasize)
|
|
{
|
|
uint8_t i;
|
|
|
|
if (datasize) {
|
|
47a: 66 23 and r22, r22
|
|
47c: e9 f0 breq .+58 ; 0x4b8 <usb_txdata_control+0x3e>
|
|
UENUM = 0;
|
|
47e: 10 92 e9 00 sts 0x00E9, r1
|
|
|
|
#define STALL UECONX = _BV(STALLRQ) | _BV(EPEN)
|
|
|
|
static inline void usb_wait_in_ready(void)
|
|
{
|
|
while (!(UEINTX & _BV(TXINI)));
|
|
482: e8 ee ldi r30, 0xE8 ; 232
|
|
484: f0 e0 ldi r31, 0x00 ; 0
|
|
486: 20 81 ld r18, Z
|
|
488: 20 ff sbrs r18, 0
|
|
48a: fd cf rjmp .-6 ; 0x486 <usb_txdata_control+0xc>
|
|
UENUM = 0;
|
|
usb_wait_in_ready();
|
|
#ifdef MEGA4_6
|
|
if ((((uint16_t)(UEBCHX)<<8)+UEBCLX)==0) { // buffer is empty
|
|
#else
|
|
if (UEBCLX==0) { // buffer is empty
|
|
48c: 20 91 f2 00 lds r18, 0x00F2
|
|
490: 21 11 cpse r18, r1
|
|
492: 14 c0 rjmp .+40 ; 0x4bc <usb_txdata_control+0x42>
|
|
494: 28 2f mov r18, r24
|
|
496: e8 2f mov r30, r24
|
|
498: f9 2f mov r31, r25
|
|
#endif
|
|
for (i=0; i<datasize; i++) UEDATX = buffer[i];
|
|
49a: a1 ef ldi r26, 0xF1 ; 241
|
|
49c: b0 e0 ldi r27, 0x00 ; 0
|
|
49e: 81 91 ld r24, Z+
|
|
4a0: 8c 93 st X, r24
|
|
4a2: 8e 2f mov r24, r30
|
|
4a4: 82 1b sub r24, r18
|
|
4a6: 86 17 cp r24, r22
|
|
4a8: d0 f3 brcs .-12 ; 0x49e <usb_txdata_control+0x24>
|
|
UEINTX&=~_BV(TXINI); // necessary (in this order) (changed V1.1.1)
|
|
4aa: e8 ee ldi r30, 0xE8 ; 232
|
|
4ac: f0 e0 ldi r31, 0x00 ; 0
|
|
4ae: 80 81 ld r24, Z
|
|
4b0: 8e 7f andi r24, 0xFE ; 254
|
|
4b2: 80 83 st Z, r24
|
|
return true;
|
|
4b4: 81 e0 ldi r24, 0x01 ; 1
|
|
4b6: 08 95 ret
|
|
}
|
|
}
|
|
return false;
|
|
4b8: 80 e0 ldi r24, 0x00 ; 0
|
|
4ba: 08 95 ret
|
|
4bc: 80 e0 ldi r24, 0x00 ; 0
|
|
}
|
|
4be: 08 95 ret
|
|
|
|
000004c0 <usb_txdata>:
|
|
#ifdef MEGA4_6
|
|
bool usb_txdata(uint8_t endpoint, uint8_t *buffer, uint16_t datasize)
|
|
#else
|
|
bool usb_txdata(uint8_t endpoint, uint8_t *buffer, uint8_t datasize)
|
|
#endif
|
|
{
|
|
4c0: cf 93 push r28
|
|
4c2: df 93 push r29
|
|
uint16_t i;
|
|
#else
|
|
uint8_t i;
|
|
#endif
|
|
|
|
if (datasize) {
|
|
4c4: 44 23 and r20, r20
|
|
4c6: 29 f1 breq .+74 ; 0x512 <__stack+0x13>
|
|
UENUM = endpoint;
|
|
4c8: 80 93 e9 00 sts 0x00E9, r24
|
|
|
|
#define STALL UECONX = _BV(STALLRQ) | _BV(EPEN)
|
|
|
|
static inline void usb_wait_in_ready(void)
|
|
{
|
|
while (!(UEINTX & _BV(TXINI)));
|
|
4cc: e8 ee ldi r30, 0xE8 ; 232
|
|
4ce: f0 e0 ldi r31, 0x00 ; 0
|
|
4d0: 80 81 ld r24, Z
|
|
4d2: 80 ff sbrs r24, 0
|
|
4d4: fd cf rjmp .-6 ; 0x4d0 <usb_txdata+0x10>
|
|
UENUM = endpoint;
|
|
usb_wait_in_ready();
|
|
#ifdef MEGA4_6
|
|
if ((((uint16_t)(UEBCHX)<<8)+UEBCLX)==0) { // buffer is empty
|
|
#else
|
|
if (UEBCLX==0) { // buffer is empty
|
|
4d6: 80 91 f2 00 lds r24, 0x00F2
|
|
4da: 81 11 cpse r24, r1
|
|
4dc: 1c c0 rjmp .+56 ; 0x516 <__stack+0x17>
|
|
4de: 96 2f mov r25, r22
|
|
4e0: e6 2f mov r30, r22
|
|
4e2: f7 2f mov r31, r23
|
|
#endif
|
|
for (i=0; i<datasize; i++)
|
|
if (UEINTX & _BV(RWAL)) UEDATX = buffer[i];
|
|
4e4: a8 ee ldi r26, 0xE8 ; 232
|
|
4e6: b0 e0 ldi r27, 0x00 ; 0
|
|
4e8: c1 ef ldi r28, 0xF1 ; 241
|
|
4ea: d0 e0 ldi r29, 0x00 ; 0
|
|
4ec: 8c 91 ld r24, X
|
|
4ee: 85 ff sbrs r24, 5
|
|
4f0: 02 c0 rjmp .+4 ; 0x4f6 <usb_txdata+0x36>
|
|
4f2: 80 81 ld r24, Z
|
|
4f4: 88 83 st Y, r24
|
|
4f6: 31 96 adiw r30, 0x01 ; 1
|
|
#ifdef MEGA4_6
|
|
if ((((uint16_t)(UEBCHX)<<8)+UEBCLX)==0) { // buffer is empty
|
|
#else
|
|
if (UEBCLX==0) { // buffer is empty
|
|
#endif
|
|
for (i=0; i<datasize; i++)
|
|
4f8: 8e 2f mov r24, r30
|
|
4fa: 89 1b sub r24, r25
|
|
4fc: 84 17 cp r24, r20
|
|
4fe: b0 f3 brcs .-20 ; 0x4ec <usb_txdata+0x2c>
|
|
if (UEINTX & _BV(RWAL)) UEDATX = buffer[i];
|
|
UEINTX&=~_BV(TXINI); // necessary (in this order) (changed V1.1.1)
|
|
500: e8 ee ldi r30, 0xE8 ; 232
|
|
502: f0 e0 ldi r31, 0x00 ; 0
|
|
504: 80 81 ld r24, Z
|
|
506: 8e 7f andi r24, 0xFE ; 254
|
|
508: 80 83 st Z, r24
|
|
UEINTX=0x7F; // (uint8_t)~_BV(FIFOCON);
|
|
50a: 8f e7 ldi r24, 0x7F ; 127
|
|
50c: 80 83 st Z, r24
|
|
return true;
|
|
50e: 81 e0 ldi r24, 0x01 ; 1
|
|
510: 03 c0 rjmp .+6 ; 0x518 <__stack+0x19>
|
|
}
|
|
}
|
|
return false;
|
|
512: 80 e0 ldi r24, 0x00 ; 0
|
|
514: 01 c0 rjmp .+2 ; 0x518 <__stack+0x19>
|
|
516: 80 e0 ldi r24, 0x00 ; 0
|
|
}
|
|
518: df 91 pop r29
|
|
51a: cf 91 pop r28
|
|
51c: 08 95 ret
|
|
|
|
0000051e <__vector_11>:
|
|
// USB Device Interrupt
|
|
//-----------------------------------------------------------------------------
|
|
// Hardware interrupts of the USB controller
|
|
|
|
ISR(USB_GEN_vect)
|
|
{
|
|
51e: 1f 92 push r1
|
|
520: 0f 92 push r0
|
|
522: 0f b6 in r0, 0x3f ; 63
|
|
524: 0f 92 push r0
|
|
526: 11 24 eor r1, r1
|
|
528: 8f 93 push r24
|
|
52a: ef 93 push r30
|
|
52c: ff 93 push r31
|
|
uint8_t intbits;
|
|
|
|
intbits = UDINT; // save flags
|
|
52e: e1 ee ldi r30, 0xE1 ; 225
|
|
530: f0 e0 ldi r31, 0x00 ; 0
|
|
532: 80 81 ld r24, Z
|
|
UDINT = 0; // reset flags
|
|
534: 10 82 st Z, r1
|
|
if (intbits & _BV(EORSTI)) { // End Of Reset Interrupt Flag
|
|
536: 83 ff sbrs r24, 3
|
|
538: 12 c0 rjmp .+36 ; 0x55e <__vector_11+0x40>
|
|
// initialize endpoint 0 for control transfers
|
|
UENUM = 0;
|
|
53a: 10 92 e9 00 sts 0x00E9, r1
|
|
UECONX = _BV(EPEN);
|
|
53e: 81 e0 ldi r24, 0x01 ; 1
|
|
540: 80 93 eb 00 sts 0x00EB, r24
|
|
UECFG0X = EP_TYPE_CONTROL;
|
|
544: 10 92 ec 00 sts 0x00EC, r1
|
|
UECFG1X = EP_SIZE(ENDPOINT0_SIZE) | EP_SINGLE_BUFFER;
|
|
548: 82 e1 ldi r24, 0x12 ; 18
|
|
54a: 80 93 ed 00 sts 0x00ED, r24
|
|
UEIENX = _BV(RXSTPE); // enable interrupt for incoming data
|
|
54e: 88 e0 ldi r24, 0x08 ; 8
|
|
550: 80 93 f0 00 sts 0x00F0, r24
|
|
usb_conf = 0;
|
|
554: 10 92 3e 01 sts 0x013E, r1
|
|
#if (NUMINTERFACES>1)
|
|
usb_if = 0xFF;
|
|
558: 8f ef ldi r24, 0xFF ; 255
|
|
55a: 80 93 0e 01 sts 0x010E, r24
|
|
#endif
|
|
}
|
|
}
|
|
55e: ff 91 pop r31
|
|
560: ef 91 pop r30
|
|
562: 8f 91 pop r24
|
|
564: 0f 90 pop r0
|
|
566: 0f be out 0x3f, r0 ; 63
|
|
568: 0f 90 pop r0
|
|
56a: 1f 90 pop r1
|
|
56c: 18 95 reti
|
|
|
|
0000056e <__vector_12>:
|
|
// Endpoint Interrupts
|
|
//-----------------------------------------------------------------------------
|
|
// Interrupts, triggered by incoming data in an endpoint, are handled here.
|
|
|
|
ISR(USB_COM_vect)
|
|
{
|
|
56e: 1f 92 push r1
|
|
570: 0f 92 push r0
|
|
572: 0f b6 in r0, 0x3f ; 63
|
|
574: 0f 92 push r0
|
|
576: 11 24 eor r1, r1
|
|
578: 3f 92 push r3
|
|
57a: 4f 92 push r4
|
|
57c: 5f 92 push r5
|
|
57e: 6f 92 push r6
|
|
580: 7f 92 push r7
|
|
582: 8f 92 push r8
|
|
584: 9f 92 push r9
|
|
586: af 92 push r10
|
|
588: bf 92 push r11
|
|
58a: cf 92 push r12
|
|
58c: df 92 push r13
|
|
58e: ef 92 push r14
|
|
590: ff 92 push r15
|
|
592: 0f 93 push r16
|
|
594: 1f 93 push r17
|
|
596: 2f 93 push r18
|
|
598: 3f 93 push r19
|
|
59a: 4f 93 push r20
|
|
59c: 5f 93 push r21
|
|
59e: 6f 93 push r22
|
|
5a0: 7f 93 push r23
|
|
5a2: 8f 93 push r24
|
|
5a4: 9f 93 push r25
|
|
5a6: af 93 push r26
|
|
5a8: bf 93 push r27
|
|
5aa: ef 93 push r30
|
|
5ac: ff 93 push r31
|
|
5ae: cf 93 push r28
|
|
5b0: df 93 push r29
|
|
5b2: cd b7 in r28, 0x3d ; 61
|
|
5b4: de b7 in r29, 0x3e ; 62
|
|
5b6: 2a 97 sbiw r28, 0x0a ; 10
|
|
5b8: de bf out 0x3e, r29 ; 62
|
|
5ba: cd bf out 0x3d, r28 ; 61
|
|
#if (USESN==2) // serial number in RAM
|
|
struct usb_string_descriptor_ram buf;
|
|
#endif
|
|
struct usb_control_request ucr;
|
|
|
|
if (UEINT & 0x01) {
|
|
5bc: 80 91 f4 00 lds r24, 0x00F4
|
|
5c0: 80 ff sbrs r24, 0
|
|
5c2: 58 c2 rjmp .+1200 ; 0xa74 <__vector_12+0x506>
|
|
// handle interrupts of endpoint 0 (control transfers)
|
|
UENUM = 0;
|
|
5c4: 10 92 e9 00 sts 0x00E9, r1
|
|
intbits = UEINTX; // save interrupt flags of the endpoint
|
|
5c8: 80 91 e8 00 lds r24, 0x00E8
|
|
if (intbits & _BV(RXSTPI)) { // control transfer, setup
|
|
5cc: 83 ff sbrs r24, 3
|
|
5ce: 1f c2 rjmp .+1086 ; 0xa0e <__vector_12+0x4a0>
|
|
ucr.bmRequestType = UEDATX;
|
|
5d0: e1 ef ldi r30, 0xF1 ; 241
|
|
5d2: f0 e0 ldi r31, 0x00 ; 0
|
|
5d4: 80 81 ld r24, Z
|
|
5d6: 89 83 std Y+1, r24 ; 0x01
|
|
ucr.bRequest = UEDATX;
|
|
5d8: 80 81 ld r24, Z
|
|
5da: 8a 83 std Y+2, r24 ; 0x02
|
|
ucr.wValue = UEDATX;
|
|
5dc: 20 81 ld r18, Z
|
|
5de: 30 e0 ldi r19, 0x00 ; 0
|
|
5e0: 3c 83 std Y+4, r19 ; 0x04
|
|
5e2: 2b 83 std Y+3, r18 ; 0x03
|
|
ucr.wValue |= (UEDATX << 8);
|
|
5e4: 40 81 ld r20, Z
|
|
5e6: 94 2f mov r25, r20
|
|
5e8: 80 e0 ldi r24, 0x00 ; 0
|
|
5ea: 82 2b or r24, r18
|
|
5ec: 93 2b or r25, r19
|
|
5ee: 9c 83 std Y+4, r25 ; 0x04
|
|
5f0: 8b 83 std Y+3, r24 ; 0x03
|
|
ucr.wIndex = UEDATX;
|
|
5f2: 20 81 ld r18, Z
|
|
5f4: 30 e0 ldi r19, 0x00 ; 0
|
|
5f6: 3e 83 std Y+6, r19 ; 0x06
|
|
5f8: 2d 83 std Y+5, r18 ; 0x05
|
|
ucr.wIndex |= (UEDATX << 8);
|
|
5fa: 40 81 ld r20, Z
|
|
5fc: 94 2f mov r25, r20
|
|
5fe: 80 e0 ldi r24, 0x00 ; 0
|
|
600: 82 2b or r24, r18
|
|
602: 93 2b or r25, r19
|
|
604: 9e 83 std Y+6, r25 ; 0x06
|
|
606: 8d 83 std Y+5, r24 ; 0x05
|
|
ucr.wLength = UEDATX;
|
|
608: 20 81 ld r18, Z
|
|
60a: 30 e0 ldi r19, 0x00 ; 0
|
|
60c: 38 87 std Y+8, r19 ; 0x08
|
|
60e: 2f 83 std Y+7, r18 ; 0x07
|
|
ucr.wLength |= (UEDATX << 8);
|
|
610: 40 81 ld r20, Z
|
|
612: 94 2f mov r25, r20
|
|
614: 80 e0 ldi r24, 0x00 ; 0
|
|
616: 82 2b or r24, r18
|
|
618: 93 2b or r25, r19
|
|
61a: 98 87 std Y+8, r25 ; 0x08
|
|
61c: 8f 83 std Y+7, r24 ; 0x07
|
|
UEINTX = ~(_BV(RXSTPI) | _BV(RXOUTI) | _BV(TXINI));
|
|
61e: 82 ef ldi r24, 0xF2 ; 242
|
|
620: 80 93 e8 00 sts 0x00E8, r24
|
|
if (ucr.bRequest == GET_DESCRIPTOR) {
|
|
624: 8a 81 ldd r24, Y+2 ; 0x02
|
|
626: 86 30 cpi r24, 0x06 ; 6
|
|
628: 09 f0 breq .+2 ; 0x62c <__vector_12+0xbe>
|
|
62a: 30 c1 rjmp .+608 ; 0x88c <__vector_12+0x31e>
|
|
switch (ucr.wValue) {
|
|
62c: 8b 81 ldd r24, Y+3 ; 0x03
|
|
62e: 9c 81 ldd r25, Y+4 ; 0x04
|
|
630: 81 15 cp r24, r1
|
|
632: 23 e0 ldi r18, 0x03 ; 3
|
|
634: 92 07 cpc r25, r18
|
|
636: 09 f4 brne .+2 ; 0x63a <__vector_12+0xcc>
|
|
638: fd c0 rjmp .+506 ; 0x834 <__vector_12+0x2c6>
|
|
63a: 48 f4 brcc .+18 ; 0x64e <__vector_12+0xe0>
|
|
63c: 81 15 cp r24, r1
|
|
63e: 51 e0 ldi r21, 0x01 ; 1
|
|
640: 95 07 cpc r25, r21
|
|
642: 89 f0 breq .+34 ; 0x666 <__vector_12+0xf8>
|
|
644: 81 15 cp r24, r1
|
|
646: 92 40 sbci r25, 0x02 ; 2
|
|
648: 09 f0 breq .+2 ; 0x64c <__vector_12+0xde>
|
|
64a: 1c c1 rjmp .+568 ; 0x884 <__vector_12+0x316>
|
|
64c: 26 c0 rjmp .+76 ; 0x69a <__vector_12+0x12c>
|
|
64e: 82 30 cpi r24, 0x02 ; 2
|
|
650: b3 e0 ldi r27, 0x03 ; 3
|
|
652: 9b 07 cpc r25, r27
|
|
654: 09 f4 brne .+2 ; 0x658 <__vector_12+0xea>
|
|
656: 02 c1 rjmp .+516 ; 0x85c <__vector_12+0x2ee>
|
|
658: 08 f4 brcc .+2 ; 0x65c <__vector_12+0xee>
|
|
65a: f6 c0 rjmp .+492 ; 0x848 <__vector_12+0x2da>
|
|
65c: 83 30 cpi r24, 0x03 ; 3
|
|
65e: 93 40 sbci r25, 0x03 ; 3
|
|
660: 09 f0 breq .+2 ; 0x664 <__vector_12+0xf6>
|
|
662: 10 c1 rjmp .+544 ; 0x884 <__vector_12+0x316>
|
|
664: 05 c1 rjmp .+522 ; 0x870 <__vector_12+0x302>
|
|
case 0x0100: // device descriptor
|
|
usb_desc_out(false,&device_descriptor[0],pgm_read_byte(&device_descriptor[0]),ucr.wLength);
|
|
666: e4 e7 ldi r30, 0x74 ; 116
|
|
668: f0 e0 ldi r31, 0x00 ; 0
|
|
66a: 44 91 lpm r20, Z
|
|
66c: 2f 81 ldd r18, Y+7 ; 0x07
|
|
66e: 38 85 ldd r19, Y+8 ; 0x08
|
|
670: bf 01 movw r22, r30
|
|
672: 80 e0 ldi r24, 0x00 ; 0
|
|
674: 0e 94 bd 01 call 0x37a ; 0x37a <usb_desc_out>
|
|
break;
|
|
678: 0c c2 rjmp .+1048 ; 0xa92 <__vector_12+0x524>
|
|
case 0x0200: // configuration descriptor
|
|
// get number of activated endpoints
|
|
n=0;
|
|
#if (NUMINTERFACES>1)
|
|
for (j=0; j<NUMINTERFACES; j++)
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[j][i].ep_type!=EP_TYPE_DISABLED);
|
|
67a: 9a 2f mov r25, r26
|
|
67c: 50 81 ld r21, Z
|
|
67e: 5f 3f cpi r21, 0xFF ; 255
|
|
680: 09 f4 brne .+2 ; 0x684 <__vector_12+0x116>
|
|
682: 9b 2f mov r25, r27
|
|
684: 49 0f add r20, r25
|
|
686: 81 50 subi r24, 0x01 ; 1
|
|
688: 33 96 adiw r30, 0x03 ; 3
|
|
68a: 81 11 cpse r24, r1
|
|
68c: f6 cf rjmp .-20 ; 0x67a <__vector_12+0x10c>
|
|
68e: 2f 5f subi r18, 0xFF ; 255
|
|
690: 3f 4f sbci r19, 0xFF ; 255
|
|
break;
|
|
case 0x0200: // configuration descriptor
|
|
// get number of activated endpoints
|
|
n=0;
|
|
#if (NUMINTERFACES>1)
|
|
for (j=0; j<NUMINTERFACES; j++)
|
|
692: 22 30 cpi r18, 0x02 ; 2
|
|
694: 31 05 cpc r19, r1
|
|
696: 39 f4 brne .+14 ; 0x6a6 <__vector_12+0x138>
|
|
698: 10 c0 rjmp .+32 ; 0x6ba <__vector_12+0x14c>
|
|
ucr.wIndex |= (UEDATX << 8);
|
|
ucr.wLength = UEDATX;
|
|
ucr.wLength |= (UEDATX << 8);
|
|
UEINTX = ~(_BV(RXSTPI) | _BV(RXOUTI) | _BV(TXINI));
|
|
if (ucr.bRequest == GET_DESCRIPTOR) {
|
|
switch (ucr.wValue) {
|
|
69a: 20 e0 ldi r18, 0x00 ; 0
|
|
69c: 30 e0 ldi r19, 0x00 ; 0
|
|
69e: 40 e0 ldi r20, 0x00 ; 0
|
|
//-----------------------------------------------------------------------------
|
|
// Endpoint Interrupts
|
|
//-----------------------------------------------------------------------------
|
|
// Interrupts, triggered by incoming data in an endpoint, are handled here.
|
|
|
|
ISR(USB_COM_vect)
|
|
6a0: 14 e0 ldi r17, 0x04 ; 4
|
|
case 0x0200: // configuration descriptor
|
|
// get number of activated endpoints
|
|
n=0;
|
|
#if (NUMINTERFACES>1)
|
|
for (j=0; j<NUMINTERFACES; j++)
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[j][i].ep_type!=EP_TYPE_DISABLED);
|
|
6a2: a1 e0 ldi r26, 0x01 ; 1
|
|
6a4: b0 e0 ldi r27, 0x00 ; 0
|
|
//-----------------------------------------------------------------------------
|
|
// Endpoint Interrupts
|
|
//-----------------------------------------------------------------------------
|
|
// Interrupts, triggered by incoming data in an endpoint, are handled here.
|
|
|
|
ISR(USB_COM_vect)
|
|
6a6: c9 01 movw r24, r18
|
|
6a8: 6c e0 ldi r22, 0x0C ; 12
|
|
6aa: 70 e0 ldi r23, 0x00 ; 0
|
|
6ac: 0e 94 71 05 call 0xae2 ; 0xae2 <__mulhi3>
|
|
6b0: fc 01 movw r30, r24
|
|
6b2: eb 5d subi r30, 0xDB ; 219
|
|
6b4: fe 4f sbci r31, 0xFE ; 254
|
|
6b6: 81 2f mov r24, r17
|
|
6b8: e0 cf rjmp .-64 ; 0x67a <__vector_12+0x10c>
|
|
for (j=0; j<NUMINTERFACES; j++)
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[j][i].ep_type!=EP_TYPE_DISABLED);
|
|
#else
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[i].ep_type!=EP_TYPE_DISABLED);
|
|
#endif
|
|
s = sizeof(cfg_desc)+NUMINTERFACES*sizeof(if_desc)+n*sizeof(ep_desc);
|
|
6ba: 84 2f mov r24, r20
|
|
6bc: 88 0f add r24, r24
|
|
6be: 88 0f add r24, r24
|
|
6c0: 88 0f add r24, r24
|
|
6c2: 84 1b sub r24, r20
|
|
6c4: 0f 2e mov r0, r31
|
|
6c6: fb e1 ldi r31, 0x1B ; 27
|
|
6c8: ef 2e mov r14, r31
|
|
6ca: f0 2d mov r31, r0
|
|
6cc: e8 0e add r14, r24
|
|
cfg = malloc(s); // allocate memory
|
|
6ce: 8e 2d mov r24, r14
|
|
6d0: 90 e0 ldi r25, 0x00 ; 0
|
|
6d2: 0e 94 83 05 call 0xb06 ; 0xb06 <malloc>
|
|
6d6: 08 2f mov r16, r24
|
|
6d8: 19 2f mov r17, r25
|
|
// initialize configuration descriptor
|
|
cfg->bLength = sizeof(cfg_desc);
|
|
6da: 89 e0 ldi r24, 0x09 ; 9
|
|
6dc: d8 01 movw r26, r16
|
|
6de: 8c 93 st X, r24
|
|
cfg->bDescriptorType = 2;
|
|
6e0: 82 e0 ldi r24, 0x02 ; 2
|
|
6e2: 11 96 adiw r26, 0x01 ; 1
|
|
6e4: 8c 93 st X, r24
|
|
6e6: 11 97 sbiw r26, 0x01 ; 1
|
|
cfg->wTotalLength = s;
|
|
6e8: 12 96 adiw r26, 0x02 ; 2
|
|
6ea: ec 92 st X, r14
|
|
6ec: 12 97 sbiw r26, 0x02 ; 2
|
|
6ee: 13 96 adiw r26, 0x03 ; 3
|
|
6f0: 1c 92 st X, r1
|
|
6f2: 13 97 sbiw r26, 0x03 ; 3
|
|
cfg->bNumInterfaces = NUMINTERFACES;
|
|
6f4: 14 96 adiw r26, 0x04 ; 4
|
|
6f6: 8c 93 st X, r24
|
|
6f8: 14 97 sbiw r26, 0x04 ; 4
|
|
cfg->bConfigurationValue = 1;
|
|
6fa: 81 e0 ldi r24, 0x01 ; 1
|
|
6fc: 15 96 adiw r26, 0x05 ; 5
|
|
6fe: 8c 93 st X, r24
|
|
700: 15 97 sbiw r26, 0x05 ; 5
|
|
cfg->iConfiguration = 0;
|
|
702: 16 96 adiw r26, 0x06 ; 6
|
|
704: 1c 92 st X, r1
|
|
706: 16 97 sbiw r26, 0x06 ; 6
|
|
cfg->bmAttributes = POWERING;
|
|
708: 80 ec ldi r24, 0xC0 ; 192
|
|
70a: 17 96 adiw r26, 0x07 ; 7
|
|
70c: 8c 93 st X, r24
|
|
70e: 17 97 sbiw r26, 0x07 ; 7
|
|
cfg->bMaxPower = MAXPOWER>>1;
|
|
710: 8a ef ldi r24, 0xFA ; 250
|
|
712: 18 96 adiw r26, 0x08 ; 8
|
|
714: 8c 93 st X, r24
|
|
// initialize interface descriptor
|
|
ifp = (if_desc *)((uint16_t)(cfg)+sizeof(cfg_desc));
|
|
716: f8 01 movw r30, r16
|
|
718: 39 96 adiw r30, 0x09 ; 9
|
|
71a: 1a 86 std Y+10, r1 ; 0x0a
|
|
71c: 19 86 std Y+9, r1 ; 0x09
|
|
//-----------------------------------------------------------------------------
|
|
// Endpoint Interrupts
|
|
//-----------------------------------------------------------------------------
|
|
// Interrupts, triggered by incoming data in an endpoint, are handled here.
|
|
|
|
ISR(USB_COM_vect)
|
|
71e: 44 e0 ldi r20, 0x04 ; 4
|
|
720: a1 2c mov r10, r1
|
|
// initialize interface descriptor
|
|
ifp = (if_desc *)((uint16_t)(cfg)+sizeof(cfg_desc));
|
|
#if (NUMINTERFACES>1)
|
|
for (j=0; j<NUMINTERFACES; j++) {
|
|
n = 0;
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[j][i].ep_type!=EP_TYPE_DISABLED); // number of endpoints for one interface
|
|
722: 88 24 eor r8, r8
|
|
724: 83 94 inc r8
|
|
726: f8 2c mov r15, r8
|
|
728: 9a 2c mov r9, r10
|
|
#else
|
|
j = 0;
|
|
#endif
|
|
ifp->bLength = sizeof(if_desc);
|
|
72a: 0f 2e mov r0, r31
|
|
72c: f9 e0 ldi r31, 0x09 ; 9
|
|
72e: 7f 2e mov r7, r31
|
|
730: f0 2d mov r31, r0
|
|
ifp->bDescriptorType = 4;
|
|
ifp->bInterfaceNumber = j;
|
|
ifp->bAlternateSetting = 0;
|
|
ifp->bNumEndpoints = n;
|
|
ifp->bInterfaceClass = 0xFF;
|
|
732: bb 24 eor r11, r11
|
|
734: ba 94 dec r11
|
|
ifp->iInterface = 0;
|
|
epp = (ep_desc *)((uint16_t)(ifp)+sizeof(if_desc));
|
|
if (n) { // endpoints
|
|
for (i=0; i<MAX_ENDPOINT; i++) {
|
|
if (EPCO.ep_type!=EP_TYPE_DISABLED) {
|
|
epp->bLength = sizeof(ep_desc);
|
|
736: 0f 2e mov r0, r31
|
|
738: f7 e0 ldi r31, 0x07 ; 7
|
|
73a: cf 2e mov r12, r31
|
|
73c: f0 2d mov r31, r0
|
|
epp->bDescriptorType = 5;
|
|
73e: 0f 2e mov r0, r31
|
|
740: f5 e0 ldi r31, 0x05 ; 5
|
|
742: df 2e mov r13, r31
|
|
744: f0 2d mov r31, r0
|
|
epp->bEndpointAddress = (i+1)|(EPCO.ep_type<<7);
|
|
epp->bmAttributes = EP_TRANSFER(EPCO.ep_type);
|
|
746: 68 94 set
|
|
748: 66 24 eor r6, r6
|
|
74a: 61 f8 bld r6, 1
|
|
74c: 0f 2e mov r0, r31
|
|
74e: f3 e0 ldi r31, 0x03 ; 3
|
|
750: 5f 2e mov r5, r31
|
|
752: f0 2d mov r31, r0
|
|
754: 56 c0 rjmp .+172 ; 0x802 <__vector_12+0x294>
|
|
// initialize interface descriptor
|
|
ifp = (if_desc *)((uint16_t)(cfg)+sizeof(cfg_desc));
|
|
#if (NUMINTERFACES>1)
|
|
for (j=0; j<NUMINTERFACES; j++) {
|
|
n = 0;
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[j][i].ep_type!=EP_TYPE_DISABLED); // number of endpoints for one interface
|
|
756: 7f 2d mov r23, r15
|
|
758: dc 01 movw r26, r24
|
|
75a: 2c 91 ld r18, X
|
|
75c: 2f 3f cpi r18, 0xFF ; 255
|
|
75e: 09 f4 brne .+2 ; 0x762 <__vector_12+0x1f4>
|
|
760: 79 2d mov r23, r9
|
|
762: 67 0f add r22, r23
|
|
764: 51 50 subi r21, 0x01 ; 1
|
|
766: 03 96 adiw r24, 0x03 ; 3
|
|
768: 51 11 cpse r21, r1
|
|
76a: f5 cf rjmp .-22 ; 0x756 <__vector_12+0x1e8>
|
|
#else
|
|
j = 0;
|
|
#endif
|
|
ifp->bLength = sizeof(if_desc);
|
|
76c: 70 82 st Z, r7
|
|
ifp->bDescriptorType = 4;
|
|
76e: 41 83 std Z+1, r20 ; 0x01
|
|
ifp->bInterfaceNumber = j;
|
|
770: 42 82 std Z+2, r4 ; 0x02
|
|
ifp->bAlternateSetting = 0;
|
|
772: 13 82 std Z+3, r1 ; 0x03
|
|
ifp->bNumEndpoints = n;
|
|
774: 64 83 std Z+4, r22 ; 0x04
|
|
ifp->bInterfaceClass = 0xFF;
|
|
776: b5 82 std Z+5, r11 ; 0x05
|
|
ifp->bInterfaceSubClass = 0x00;
|
|
778: 16 82 std Z+6, r1 ; 0x06
|
|
ifp->bInterfaceProtocol = 0xFF;
|
|
77a: b7 82 std Z+7, r11 ; 0x07
|
|
ifp->iInterface = 0;
|
|
77c: 10 86 std Z+8, r1 ; 0x08
|
|
epp = (ep_desc *)((uint16_t)(ifp)+sizeof(if_desc));
|
|
77e: 39 96 adiw r30, 0x09 ; 9
|
|
if (n) { // endpoints
|
|
780: 66 23 and r22, r22
|
|
782: c1 f1 breq .+112 ; 0x7f4 <__vector_12+0x286>
|
|
//-----------------------------------------------------------------------------
|
|
// Endpoint Interrupts
|
|
//-----------------------------------------------------------------------------
|
|
// Interrupts, triggered by incoming data in an endpoint, are handled here.
|
|
|
|
ISR(USB_COM_vect)
|
|
784: 83 2f mov r24, r19
|
|
786: 93 2d mov r25, r3
|
|
788: 6c e0 ldi r22, 0x0C ; 12
|
|
78a: 70 e0 ldi r23, 0x00 ; 0
|
|
78c: 0e 94 71 05 call 0xae2 ; 0xae2 <__mulhi3>
|
|
790: 9c 01 movw r18, r24
|
|
792: 2a 5d subi r18, 0xDA ; 218
|
|
794: 3e 4f sbci r19, 0xFE ; 254
|
|
796: 48 2c mov r4, r8
|
|
798: c9 01 movw r24, r18
|
|
79a: b9 01 movw r22, r18
|
|
79c: 61 50 subi r22, 0x01 ; 1
|
|
79e: 71 09 sbc r23, r1
|
|
ifp->bInterfaceProtocol = 0xFF;
|
|
ifp->iInterface = 0;
|
|
epp = (ep_desc *)((uint16_t)(ifp)+sizeof(if_desc));
|
|
if (n) { // endpoints
|
|
for (i=0; i<MAX_ENDPOINT; i++) {
|
|
if (EPCO.ep_type!=EP_TYPE_DISABLED) {
|
|
7a0: db 01 movw r26, r22
|
|
7a2: 5c 91 ld r21, X
|
|
7a4: 5f 3f cpi r21, 0xFF ; 255
|
|
7a6: 01 f1 breq .+64 ; 0x7e8 <__vector_12+0x27a>
|
|
epp->bLength = sizeof(ep_desc);
|
|
7a8: c0 82 st Z, r12
|
|
epp->bDescriptorType = 5;
|
|
7aa: d1 82 std Z+1, r13 ; 0x01
|
|
epp->bEndpointAddress = (i+1)|(EPCO.ep_type<<7);
|
|
7ac: 65 2f mov r22, r21
|
|
7ae: 67 95 ror r22
|
|
7b0: 66 27 eor r22, r22
|
|
7b2: 67 95 ror r22
|
|
7b4: 64 29 or r22, r4
|
|
7b6: 62 83 std Z+2, r22 ; 0x02
|
|
epp->bmAttributes = EP_TRANSFER(EPCO.ep_type);
|
|
7b8: 51 34 cpi r21, 0x41 ; 65
|
|
7ba: 41 f0 breq .+16 ; 0x7cc <__vector_12+0x25e>
|
|
7bc: 50 34 cpi r21, 0x40 ; 64
|
|
7be: 41 f0 breq .+16 ; 0x7d0 <__vector_12+0x262>
|
|
7c0: 51 38 cpi r21, 0x81 ; 129
|
|
7c2: 41 f0 breq .+16 ; 0x7d4 <__vector_12+0x266>
|
|
7c4: 50 38 cpi r21, 0x80 ; 128
|
|
7c6: 41 f4 brne .+16 ; 0x7d8 <__vector_12+0x26a>
|
|
7c8: 56 2d mov r21, r6
|
|
7ca: 07 c0 rjmp .+14 ; 0x7da <__vector_12+0x26c>
|
|
7cc: 5f 2d mov r21, r15
|
|
7ce: 05 c0 rjmp .+10 ; 0x7da <__vector_12+0x26c>
|
|
7d0: 5f 2d mov r21, r15
|
|
7d2: 03 c0 rjmp .+6 ; 0x7da <__vector_12+0x26c>
|
|
7d4: 56 2d mov r21, r6
|
|
7d6: 01 c0 rjmp .+2 ; 0x7da <__vector_12+0x26c>
|
|
7d8: 55 2d mov r21, r5
|
|
7da: 53 83 std Z+3, r21 ; 0x03
|
|
epp->wMaxPacketSize = EPCO.ep_size;
|
|
7dc: dc 01 movw r26, r24
|
|
7de: 8c 91 ld r24, X
|
|
7e0: 84 83 std Z+4, r24 ; 0x04
|
|
7e2: 15 82 std Z+5, r1 ; 0x05
|
|
epp->bInterval = 0;
|
|
7e4: 16 82 std Z+6, r1 ; 0x06
|
|
epp = (ep_desc *)((uint16_t)(epp)+sizeof(ep_desc));
|
|
7e6: 37 96 adiw r30, 0x07 ; 7
|
|
7e8: 43 94 inc r4
|
|
7ea: 2d 5f subi r18, 0xFD ; 253
|
|
7ec: 3f 4f sbci r19, 0xFF ; 255
|
|
ifp->bInterfaceSubClass = 0x00;
|
|
ifp->bInterfaceProtocol = 0xFF;
|
|
ifp->iInterface = 0;
|
|
epp = (ep_desc *)((uint16_t)(ifp)+sizeof(if_desc));
|
|
if (n) { // endpoints
|
|
for (i=0; i<MAX_ENDPOINT; i++) {
|
|
7ee: b5 e0 ldi r27, 0x05 ; 5
|
|
7f0: 4b 12 cpse r4, r27
|
|
7f2: d2 cf rjmp .-92 ; 0x798 <__vector_12+0x22a>
|
|
7f4: a9 85 ldd r26, Y+9 ; 0x09
|
|
7f6: ba 85 ldd r27, Y+10 ; 0x0a
|
|
7f8: 11 96 adiw r26, 0x01 ; 1
|
|
7fa: ba 87 std Y+10, r27 ; 0x0a
|
|
7fc: a9 87 std Y+9, r26 ; 0x09
|
|
cfg->bmAttributes = POWERING;
|
|
cfg->bMaxPower = MAXPOWER>>1;
|
|
// initialize interface descriptor
|
|
ifp = (if_desc *)((uint16_t)(cfg)+sizeof(cfg_desc));
|
|
#if (NUMINTERFACES>1)
|
|
for (j=0; j<NUMINTERFACES; j++) {
|
|
7fe: 12 97 sbiw r26, 0x02 ; 2
|
|
800: 71 f0 breq .+28 ; 0x81e <__vector_12+0x2b0>
|
|
802: 49 84 ldd r4, Y+9 ; 0x09
|
|
n = 0;
|
|
for (i=0; i<MAX_ENDPOINT; i++) n+=(EP_CONFIG[j][i].ep_type!=EP_TYPE_DISABLED); // number of endpoints for one interface
|
|
804: 34 2d mov r19, r4
|
|
806: 3a 84 ldd r3, Y+10 ; 0x0a
|
|
//-----------------------------------------------------------------------------
|
|
// Endpoint Interrupts
|
|
//-----------------------------------------------------------------------------
|
|
// Interrupts, triggered by incoming data in an endpoint, are handled here.
|
|
|
|
ISR(USB_COM_vect)
|
|
808: 84 2d mov r24, r4
|
|
80a: 93 2d mov r25, r3
|
|
80c: 6c e0 ldi r22, 0x0C ; 12
|
|
80e: 70 e0 ldi r23, 0x00 ; 0
|
|
810: 0e 94 71 05 call 0xae2 ; 0xae2 <__mulhi3>
|
|
814: 8b 5d subi r24, 0xDB ; 219
|
|
816: 9e 4f sbci r25, 0xFE ; 254
|
|
818: 54 2f mov r21, r20
|
|
81a: 6a 2d mov r22, r10
|
|
81c: 9c cf rjmp .-200 ; 0x756 <__vector_12+0x1e8>
|
|
#if (NUMINTERFACES>1)
|
|
ifp = (if_desc *)epp;
|
|
}
|
|
#endif
|
|
// finally
|
|
usb_desc_out(true,(uint8_t *)cfg,s,ucr.wLength);
|
|
81e: 2f 81 ldd r18, Y+7 ; 0x07
|
|
820: 38 85 ldd r19, Y+8 ; 0x08
|
|
822: 4e 2d mov r20, r14
|
|
824: b8 01 movw r22, r16
|
|
826: 81 e0 ldi r24, 0x01 ; 1
|
|
828: 0e 94 bd 01 call 0x37a ; 0x37a <usb_desc_out>
|
|
free(cfg);
|
|
82c: c8 01 movw r24, r16
|
|
82e: 0e 94 1e 06 call 0xc3c ; 0xc3c <free>
|
|
break;
|
|
832: 2f c1 rjmp .+606 ; 0xa92 <__vector_12+0x524>
|
|
case 0x0300: // String 0
|
|
usb_desc_out(false,(uint8_t *)&string0.bLength,pgm_read_byte(&string0.bLength),ucr.wLength);
|
|
834: e6 e8 ldi r30, 0x86 ; 134
|
|
836: f0 e0 ldi r31, 0x00 ; 0
|
|
838: 44 91 lpm r20, Z
|
|
83a: 2f 81 ldd r18, Y+7 ; 0x07
|
|
83c: 38 85 ldd r19, Y+8 ; 0x08
|
|
83e: bf 01 movw r22, r30
|
|
840: 80 e0 ldi r24, 0x00 ; 0
|
|
842: 0e 94 bd 01 call 0x37a ; 0x37a <usb_desc_out>
|
|
break;
|
|
846: 25 c1 rjmp .+586 ; 0xa92 <__vector_12+0x524>
|
|
case 0x0301: // String 1
|
|
usb_desc_out(false,(uint8_t *)&string1.bLength,pgm_read_byte(&string1.bLength),ucr.wLength);
|
|
848: ea e8 ldi r30, 0x8A ; 138
|
|
84a: f0 e0 ldi r31, 0x00 ; 0
|
|
84c: 44 91 lpm r20, Z
|
|
84e: 2f 81 ldd r18, Y+7 ; 0x07
|
|
850: 38 85 ldd r19, Y+8 ; 0x08
|
|
852: bf 01 movw r22, r30
|
|
854: 80 e0 ldi r24, 0x00 ; 0
|
|
856: 0e 94 bd 01 call 0x37a ; 0x37a <usb_desc_out>
|
|
break;
|
|
85a: 1b c1 rjmp .+566 ; 0xa92 <__vector_12+0x524>
|
|
case 0x0302: // String 2
|
|
usb_desc_out(false,(uint8_t *)&string2.bLength,pgm_read_byte(&string2.bLength),ucr.wLength);
|
|
85c: e0 ea ldi r30, 0xA0 ; 160
|
|
85e: f0 e0 ldi r31, 0x00 ; 0
|
|
860: 44 91 lpm r20, Z
|
|
862: 2f 81 ldd r18, Y+7 ; 0x07
|
|
864: 38 85 ldd r19, Y+8 ; 0x08
|
|
866: bf 01 movw r22, r30
|
|
868: 80 e0 ldi r24, 0x00 ; 0
|
|
86a: 0e 94 bd 01 call 0x37a ; 0x37a <usb_desc_out>
|
|
break;
|
|
86e: 11 c1 rjmp .+546 ; 0xa92 <__vector_12+0x524>
|
|
#if (USESN>0)
|
|
case 0x0303: // String 3, serial number
|
|
#if (USESN==1) // Seriennummer im Flash
|
|
usb_desc_out(false,(uint8_t *)&string3.bLength,pgm_read_byte(&string3.bLength),ucr.wLength);
|
|
870: e2 ec ldi r30, 0xC2 ; 194
|
|
872: f0 e0 ldi r31, 0x00 ; 0
|
|
874: 44 91 lpm r20, Z
|
|
876: 2f 81 ldd r18, Y+7 ; 0x07
|
|
878: 38 85 ldd r19, Y+8 ; 0x08
|
|
87a: bf 01 movw r22, r30
|
|
87c: 80 e0 ldi r24, 0x00 ; 0
|
|
87e: 0e 94 bd 01 call 0x37a ; 0x37a <usb_desc_out>
|
|
i++;
|
|
}
|
|
buf.bLength=2*i+2; // total length of the data set
|
|
usb_desc_out(true,(uint8_t *)&buf,buf.bLength,ucr.wLength);
|
|
#endif
|
|
break;
|
|
882: 07 c1 rjmp .+526 ; 0xa92 <__vector_12+0x524>
|
|
#endif
|
|
default:
|
|
STALL; // stall
|
|
884: 81 e2 ldi r24, 0x21 ; 33
|
|
886: 80 93 eb 00 sts 0x00EB, r24
|
|
88a: 03 c1 rjmp .+518 ; 0xa92 <__vector_12+0x524>
|
|
}
|
|
return;
|
|
}
|
|
if (ucr.bRequest == SET_ADDRESS) {
|
|
88c: 85 30 cpi r24, 0x05 ; 5
|
|
88e: 71 f4 brne .+28 ; 0x8ac <__vector_12+0x33e>
|
|
USB_SEND_IN;
|
|
890: 8e ef ldi r24, 0xFE ; 254
|
|
892: 80 93 e8 00 sts 0x00E8, r24
|
|
|
|
#define STALL UECONX = _BV(STALLRQ) | _BV(EPEN)
|
|
|
|
static inline void usb_wait_in_ready(void)
|
|
{
|
|
while (!(UEINTX & _BV(TXINI)));
|
|
896: e8 ee ldi r30, 0xE8 ; 232
|
|
898: f0 e0 ldi r31, 0x00 ; 0
|
|
89a: 80 81 ld r24, Z
|
|
89c: 80 ff sbrs r24, 0
|
|
89e: fd cf rjmp .-6 ; 0x89a <__vector_12+0x32c>
|
|
return;
|
|
}
|
|
if (ucr.bRequest == SET_ADDRESS) {
|
|
USB_SEND_IN;
|
|
usb_wait_in_ready();
|
|
UDADDR = ucr.wValue | _BV(ADDEN);
|
|
8a0: 8b 81 ldd r24, Y+3 ; 0x03
|
|
8a2: 9c 81 ldd r25, Y+4 ; 0x04
|
|
8a4: 80 68 ori r24, 0x80 ; 128
|
|
8a6: 80 93 e3 00 sts 0x00E3, r24
|
|
8aa: f3 c0 rjmp .+486 ; 0xa92 <__vector_12+0x524>
|
|
return;
|
|
}
|
|
if (ucr.bRequest == SET_CONFIGURATION && ucr.bmRequestType == 0) { // another configuration will be chosen
|
|
8ac: 89 30 cpi r24, 0x09 ; 9
|
|
8ae: c1 f4 brne .+48 ; 0x8e0 <__vector_12+0x372>
|
|
8b0: 99 81 ldd r25, Y+1 ; 0x01
|
|
8b2: 91 11 cpse r25, r1
|
|
8b4: 60 c0 rjmp .+192 ; 0x976 <__vector_12+0x408>
|
|
if (ucr.wValue==1) { // configuration 1 will be chosen
|
|
8b6: 8b 81 ldd r24, Y+3 ; 0x03
|
|
8b8: 9c 81 ldd r25, Y+4 ; 0x04
|
|
8ba: 01 97 sbiw r24, 0x01 ; 1
|
|
8bc: 69 f4 brne .+26 ; 0x8d8 <__vector_12+0x36a>
|
|
usb_conf = ucr.wValue;
|
|
8be: 81 e0 ldi r24, 0x01 ; 1
|
|
8c0: 80 93 3e 01 sts 0x013E, r24
|
|
USB_SEND_IN;
|
|
8c4: 8e ef ldi r24, 0xFE ; 254
|
|
8c6: 80 93 e8 00 sts 0x00E8, r24
|
|
#if (NUMINTERFACES==1)
|
|
usb_endpoints(); // initialize endpoints
|
|
#else
|
|
usb_if = 0; // select interface 0
|
|
8ca: 10 92 0e 01 sts 0x010E, r1
|
|
usb_endpoints(usb_if); // initialize endpoints
|
|
8ce: 80 91 0e 01 lds r24, 0x010E
|
|
8d2: 0e 94 2f 01 call 0x25e ; 0x25e <usb_endpoints>
|
|
8d6: dd c0 rjmp .+442 ; 0xa92 <__vector_12+0x524>
|
|
#endif
|
|
} else { // other configurations are not supported in this version
|
|
STALL; // stall
|
|
8d8: 81 e2 ldi r24, 0x21 ; 33
|
|
8da: 80 93 eb 00 sts 0x00EB, r24
|
|
8de: d9 c0 rjmp .+434 ; 0xa92 <__vector_12+0x524>
|
|
}
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_CONFIGURATION && ucr.bmRequestType == 0x80) {
|
|
8e0: 88 30 cpi r24, 0x08 ; 8
|
|
8e2: 89 f4 brne .+34 ; 0x906 <__vector_12+0x398>
|
|
8e4: 99 81 ldd r25, Y+1 ; 0x01
|
|
8e6: 90 38 cpi r25, 0x80 ; 128
|
|
8e8: 09 f0 breq .+2 ; 0x8ec <__vector_12+0x37e>
|
|
8ea: 57 c0 rjmp .+174 ; 0x99a <__vector_12+0x42c>
|
|
|
|
#define STALL UECONX = _BV(STALLRQ) | _BV(EPEN)
|
|
|
|
static inline void usb_wait_in_ready(void)
|
|
{
|
|
while (!(UEINTX & _BV(TXINI)));
|
|
8ec: e8 ee ldi r30, 0xE8 ; 232
|
|
8ee: f0 e0 ldi r31, 0x00 ; 0
|
|
8f0: 80 81 ld r24, Z
|
|
8f2: 80 ff sbrs r24, 0
|
|
8f4: fd cf rjmp .-6 ; 0x8f0 <__vector_12+0x382>
|
|
}
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_CONFIGURATION && ucr.bmRequestType == 0x80) {
|
|
usb_wait_in_ready();
|
|
UEDATX = usb_conf;
|
|
8f6: 80 91 3e 01 lds r24, 0x013E
|
|
8fa: 80 93 f1 00 sts 0x00F1, r24
|
|
USB_SEND_IN;
|
|
8fe: 8e ef ldi r24, 0xFE ; 254
|
|
900: 80 93 e8 00 sts 0x00E8, r24
|
|
904: c6 c0 rjmp .+396 ; 0xa92 <__vector_12+0x524>
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_STATUS) {
|
|
906: 81 11 cpse r24, r1
|
|
908: 1c c0 rjmp .+56 ; 0x942 <__vector_12+0x3d4>
|
|
|
|
#define STALL UECONX = _BV(STALLRQ) | _BV(EPEN)
|
|
|
|
static inline void usb_wait_in_ready(void)
|
|
{
|
|
while (!(UEINTX & _BV(TXINI)));
|
|
90a: e8 ee ldi r30, 0xE8 ; 232
|
|
90c: f0 e0 ldi r31, 0x00 ; 0
|
|
90e: 80 81 ld r24, Z
|
|
910: 80 ff sbrs r24, 0
|
|
912: fd cf rjmp .-6 ; 0x90e <__vector_12+0x3a0>
|
|
}
|
|
if (ucr.bRequest == GET_STATUS) {
|
|
usb_wait_in_ready();
|
|
i = 0;
|
|
#ifdef SUPPORT_ENDPOINT_HALT
|
|
if (ucr.bmRequestType == 0x82) {
|
|
914: 89 81 ldd r24, Y+1 ; 0x01
|
|
916: 82 38 cpi r24, 0x82 ; 130
|
|
918: 59 f4 brne .+22 ; 0x930 <__vector_12+0x3c2>
|
|
UENUM = ucr.wIndex;
|
|
91a: 8d 81 ldd r24, Y+5 ; 0x05
|
|
91c: e9 ee ldi r30, 0xE9 ; 233
|
|
91e: f0 e0 ldi r31, 0x00 ; 0
|
|
920: 80 83 st Z, r24
|
|
if (UECONX & _BV(STALLRQ)) i = 1;
|
|
922: 80 91 eb 00 lds r24, 0x00EB
|
|
926: 85 fb bst r24, 5
|
|
928: 88 27 eor r24, r24
|
|
92a: 80 f9 bld r24, 0
|
|
UENUM = 0;
|
|
92c: 10 82 st Z, r1
|
|
92e: 01 c0 rjmp .+2 ; 0x932 <__vector_12+0x3c4>
|
|
USB_SEND_IN;
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_STATUS) {
|
|
usb_wait_in_ready();
|
|
i = 0;
|
|
930: 80 e0 ldi r24, 0x00 ; 0
|
|
UENUM = ucr.wIndex;
|
|
if (UECONX & _BV(STALLRQ)) i = 1;
|
|
UENUM = 0;
|
|
}
|
|
#endif
|
|
UEDATX = i;
|
|
932: e1 ef ldi r30, 0xF1 ; 241
|
|
934: f0 e0 ldi r31, 0x00 ; 0
|
|
936: 80 83 st Z, r24
|
|
UEDATX = 0;
|
|
938: 10 82 st Z, r1
|
|
USB_SEND_IN;
|
|
93a: 8e ef ldi r24, 0xFE ; 254
|
|
93c: 80 93 e8 00 sts 0x00E8, r24
|
|
940: a8 c0 rjmp .+336 ; 0xa92 <__vector_12+0x524>
|
|
return;
|
|
}
|
|
#if (NUMINTERFACES>1)
|
|
if (ucr.bRequest == SET_INTERFACE && (ucr.bmRequestType == 0x20 || ucr.bmRequestType == 0)) { // another interface will be chosen
|
|
942: 8b 30 cpi r24, 0x0B ; 11
|
|
944: c1 f4 brne .+48 ; 0x976 <__vector_12+0x408>
|
|
946: 89 81 ldd r24, Y+1 ; 0x01
|
|
948: 80 32 cpi r24, 0x20 ; 32
|
|
94a: 11 f0 breq .+4 ; 0x950 <__vector_12+0x3e2>
|
|
94c: 81 11 cpse r24, r1
|
|
94e: 55 c0 rjmp .+170 ; 0x9fa <__vector_12+0x48c>
|
|
if (ucr.wIndex<NUMINTERFACES) { // defined interface will be chosen
|
|
950: 8d 81 ldd r24, Y+5 ; 0x05
|
|
952: 9e 81 ldd r25, Y+6 ; 0x06
|
|
954: 82 30 cpi r24, 0x02 ; 2
|
|
956: 91 05 cpc r25, r1
|
|
958: 50 f4 brcc .+20 ; 0x96e <__vector_12+0x400>
|
|
usb_if = ucr.wIndex;
|
|
95a: 80 93 0e 01 sts 0x010E, r24
|
|
USB_SEND_IN;
|
|
95e: 8e ef ldi r24, 0xFE ; 254
|
|
960: 80 93 e8 00 sts 0x00E8, r24
|
|
usb_endpoints(usb_if); // initialize endpoints
|
|
964: 80 91 0e 01 lds r24, 0x010E
|
|
968: 0e 94 2f 01 call 0x25e ; 0x25e <usb_endpoints>
|
|
96c: 92 c0 rjmp .+292 ; 0xa92 <__vector_12+0x524>
|
|
} else { // other configurations are not supported in this version
|
|
STALL; // stall
|
|
96e: 81 e2 ldi r24, 0x21 ; 33
|
|
970: 80 93 eb 00 sts 0x00EB, r24
|
|
974: 8e c0 rjmp .+284 ; 0xa92 <__vector_12+0x524>
|
|
}
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_INTERFACE && ucr.bmRequestType == 0x80) {
|
|
976: 8a 30 cpi r24, 0x0A ; 10
|
|
978: 81 f4 brne .+32 ; 0x99a <__vector_12+0x42c>
|
|
97a: 89 81 ldd r24, Y+1 ; 0x01
|
|
97c: 80 38 cpi r24, 0x80 ; 128
|
|
97e: e9 f5 brne .+122 ; 0x9fa <__vector_12+0x48c>
|
|
|
|
#define STALL UECONX = _BV(STALLRQ) | _BV(EPEN)
|
|
|
|
static inline void usb_wait_in_ready(void)
|
|
{
|
|
while (!(UEINTX & _BV(TXINI)));
|
|
980: e8 ee ldi r30, 0xE8 ; 232
|
|
982: f0 e0 ldi r31, 0x00 ; 0
|
|
984: 80 81 ld r24, Z
|
|
986: 80 ff sbrs r24, 0
|
|
988: fd cf rjmp .-6 ; 0x984 <__vector_12+0x416>
|
|
}
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_INTERFACE && ucr.bmRequestType == 0x80) {
|
|
usb_wait_in_ready();
|
|
UEDATX = usb_if;
|
|
98a: 80 91 0e 01 lds r24, 0x010E
|
|
98e: 80 93 f1 00 sts 0x00F1, r24
|
|
USB_SEND_IN;
|
|
992: 8e ef ldi r24, 0xFE ; 254
|
|
994: 80 93 e8 00 sts 0x00E8, r24
|
|
998: 7c c0 rjmp .+248 ; 0xa92 <__vector_12+0x524>
|
|
return;
|
|
}
|
|
#endif
|
|
#ifdef SUPPORT_ENDPOINT_HALT
|
|
if ((ucr.bRequest == CLEAR_FEATURE || ucr.bRequest == SET_FEATURE)
|
|
99a: 81 30 cpi r24, 0x01 ; 1
|
|
99c: 11 f0 breq .+4 ; 0x9a2 <__vector_12+0x434>
|
|
99e: 83 30 cpi r24, 0x03 ; 3
|
|
9a0: 61 f5 brne .+88 ; 0x9fa <__vector_12+0x48c>
|
|
&& ucr.bmRequestType == 0x02 && ucr.wValue == 0) {
|
|
9a2: 89 81 ldd r24, Y+1 ; 0x01
|
|
9a4: 82 30 cpi r24, 0x02 ; 2
|
|
9a6: 49 f5 brne .+82 ; 0x9fa <__vector_12+0x48c>
|
|
9a8: 8b 81 ldd r24, Y+3 ; 0x03
|
|
9aa: 9c 81 ldd r25, Y+4 ; 0x04
|
|
9ac: 89 2b or r24, r25
|
|
9ae: 29 f5 brne .+74 ; 0x9fa <__vector_12+0x48c>
|
|
i = ucr.wIndex & 0x7F;
|
|
9b0: 8d 81 ldd r24, Y+5 ; 0x05
|
|
9b2: 9e 81 ldd r25, Y+6 ; 0x06
|
|
9b4: 8f 77 andi r24, 0x7F ; 127
|
|
9b6: 99 27 eor r25, r25
|
|
if (i >= 1 && i <= MAX_ENDPOINT) {
|
|
9b8: 38 2f mov r19, r24
|
|
9ba: 31 50 subi r19, 0x01 ; 1
|
|
9bc: 34 30 cpi r19, 0x04 ; 4
|
|
9be: e8 f4 brcc .+58 ; 0x9fa <__vector_12+0x48c>
|
|
USB_SEND_IN;
|
|
9c0: 3e ef ldi r19, 0xFE ; 254
|
|
9c2: 30 93 e8 00 sts 0x00E8, r19
|
|
UENUM = i;
|
|
9c6: 80 93 e9 00 sts 0x00E9, r24
|
|
if (ucr.bRequest == SET_FEATURE) {
|
|
9ca: 2a 81 ldd r18, Y+2 ; 0x02
|
|
9cc: 23 30 cpi r18, 0x03 ; 3
|
|
9ce: 21 f4 brne .+8 ; 0x9d8 <__vector_12+0x46a>
|
|
UECONX = _BV(STALLRQ)|_BV(EPEN);
|
|
9d0: 81 e2 ldi r24, 0x21 ; 33
|
|
9d2: 80 93 eb 00 sts 0x00EB, r24
|
|
9d6: 5d c0 rjmp .+186 ; 0xa92 <__vector_12+0x524>
|
|
} else {
|
|
UECONX = _BV(STALLRQC)|_BV(RSTDT)|_BV(EPEN);
|
|
9d8: 99 e1 ldi r25, 0x19 ; 25
|
|
9da: 90 93 eb 00 sts 0x00EB, r25
|
|
UERST = _BV(i);
|
|
9de: 21 e0 ldi r18, 0x01 ; 1
|
|
9e0: 30 e0 ldi r19, 0x00 ; 0
|
|
9e2: f9 01 movw r30, r18
|
|
9e4: 02 c0 rjmp .+4 ; 0x9ea <__vector_12+0x47c>
|
|
9e6: ee 0f add r30, r30
|
|
9e8: ff 1f adc r31, r31
|
|
9ea: 8a 95 dec r24
|
|
9ec: e2 f7 brpl .-8 ; 0x9e6 <__vector_12+0x478>
|
|
9ee: cf 01 movw r24, r30
|
|
9f0: ea ee ldi r30, 0xEA ; 234
|
|
9f2: f0 e0 ldi r31, 0x00 ; 0
|
|
9f4: 80 83 st Z, r24
|
|
UERST = 0;
|
|
9f6: 10 82 st Z, r1
|
|
9f8: 4c c0 rjmp .+152 ; 0xa92 <__vector_12+0x524>
|
|
}
|
|
}
|
|
#endif
|
|
#ifdef USERDEFCONTROLS
|
|
// handle user defined control requests
|
|
if (!usb_controlrequest(&ucr))
|
|
9fa: ce 01 movw r24, r28
|
|
9fc: 01 96 adiw r24, 0x01 ; 1
|
|
9fe: 0e 94 d5 00 call 0x1aa ; 0x1aa <usb_controlrequest>
|
|
a02: 81 11 cpse r24, r1
|
|
a04: 46 c0 rjmp .+140 ; 0xa92 <__vector_12+0x524>
|
|
UECONX = _BV(STALLRQ) | _BV(EPEN); // stall
|
|
a06: 81 e2 ldi r24, 0x21 ; 33
|
|
a08: 80 93 eb 00 sts 0x00EB, r24
|
|
a0c: 42 c0 rjmp .+132 ; 0xa92 <__vector_12+0x524>
|
|
return;
|
|
#endif
|
|
}
|
|
UECONX = _BV(STALLRQ) | _BV(EPEN); // stall
|
|
a0e: 81 e2 ldi r24, 0x21 ; 33
|
|
a10: 80 93 eb 00 sts 0x00EB, r24
|
|
a14: 2f c0 rjmp .+94 ; 0xa74 <__vector_12+0x506>
|
|
a16: f2 2e mov r15, r18
|
|
}
|
|
|
|
// handle interrupts for further endpoints
|
|
for (i=1; i<=MAX_ENDPOINT; i++) {
|
|
if (UEINT & _BV(i)) {
|
|
a18: 40 81 ld r20, Z
|
|
a1a: 50 e0 ldi r21, 0x00 ; 0
|
|
a1c: 02 2e mov r0, r18
|
|
a1e: 02 c0 rjmp .+4 ; 0xa24 <__vector_12+0x4b6>
|
|
a20: 55 95 asr r21
|
|
a22: 47 95 ror r20
|
|
a24: 0a 94 dec r0
|
|
a26: e2 f7 brpl .-8 ; 0xa20 <__vector_12+0x4b2>
|
|
a28: 40 ff sbrs r20, 0
|
|
a2a: 1b c0 rjmp .+54 ; 0xa62 <__vector_12+0x4f4>
|
|
UENUM=i; // select endpoint
|
|
a2c: db 01 movw r26, r22
|
|
a2e: 2c 93 st X, r18
|
|
intbits = UEINTX; // save interrupt bits of the endpoint
|
|
a30: d6 01 movw r26, r12
|
|
a32: 8c 91 ld r24, X
|
|
if (intbits & _BV(RXOUTI)) { // interrupt occured by incoming data
|
|
a34: 82 ff sbrs r24, 2
|
|
a36: 13 c0 rjmp .+38 ; 0xa5e <__vector_12+0x4f0>
|
|
#ifdef MEGA4_6
|
|
if (((uint16_t)(UEBCHX)<<8)+UEBCLX) { // data available in input endpoint
|
|
usb_ep(i,((uint16_t)(UEBCHX)<<8)+UEBCLX);
|
|
#else
|
|
if (UEBCLX) { // data available in input endpoint
|
|
a38: 80 91 f2 00 lds r24, 0x00F2
|
|
a3c: 88 23 and r24, r24
|
|
a3e: 41 f0 breq .+16 ; 0xa50 <__vector_12+0x4e2>
|
|
usb_ep(i,UEBCLX);
|
|
a40: 60 91 f2 00 lds r22, 0x00F2
|
|
a44: 70 e0 ldi r23, 0x00 ; 0
|
|
a46: 82 2f mov r24, r18
|
|
a48: 0e 94 06 01 call 0x20c ; 0x20c <usb_ep>
|
|
#endif
|
|
UENUM=i; // reselect endpoint (if changed by handling routine)
|
|
a4c: f0 92 e9 00 sts 0x00E9, r15
|
|
}
|
|
UEINTX = ~(_BV(RXOUTI)|_BV(STALLEDI)); // clear interrupt flags
|
|
a50: e8 ee ldi r30, 0xE8 ; 232
|
|
a52: f0 e0 ldi r31, 0x00 ; 0
|
|
a54: 89 ef ldi r24, 0xF9 ; 249
|
|
a56: 80 83 st Z, r24
|
|
UEINTX = 0x7F; // free bank (FIFOCON), has to be executed after RXOUTI!
|
|
a58: 8f e7 ldi r24, 0x7F ; 127
|
|
a5a: 80 83 st Z, r24
|
|
a5c: 1a c0 rjmp .+52 ; 0xa92 <__vector_12+0x524>
|
|
return;
|
|
}
|
|
STALL; // stall
|
|
a5e: d8 01 movw r26, r16
|
|
a60: 9c 93 st X, r25
|
|
a62: 2f 5f subi r18, 0xFF ; 255
|
|
a64: 3f 4f sbci r19, 0xFF ; 255
|
|
}
|
|
UECONX = _BV(STALLRQ) | _BV(EPEN); // stall
|
|
}
|
|
|
|
// handle interrupts for further endpoints
|
|
for (i=1; i<=MAX_ENDPOINT; i++) {
|
|
a66: 25 30 cpi r18, 0x05 ; 5
|
|
a68: 31 05 cpc r19, r1
|
|
a6a: a9 f6 brne .-86 ; 0xa16 <__vector_12+0x4a8>
|
|
return;
|
|
}
|
|
STALL; // stall
|
|
}
|
|
}
|
|
STALL; // stall
|
|
a6c: 81 e2 ldi r24, 0x21 ; 33
|
|
a6e: 80 93 eb 00 sts 0x00EB, r24
|
|
a72: 0f c0 rjmp .+30 ; 0xa92 <__vector_12+0x524>
|
|
USB_SEND_IN;
|
|
return;
|
|
}
|
|
if (ucr.bRequest == GET_STATUS) {
|
|
usb_wait_in_ready();
|
|
i = 0;
|
|
a74: 21 e0 ldi r18, 0x01 ; 1
|
|
a76: 30 e0 ldi r19, 0x00 ; 0
|
|
UECONX = _BV(STALLRQ) | _BV(EPEN); // stall
|
|
}
|
|
|
|
// handle interrupts for further endpoints
|
|
for (i=1; i<=MAX_ENDPOINT; i++) {
|
|
if (UEINT & _BV(i)) {
|
|
a78: e4 ef ldi r30, 0xF4 ; 244
|
|
a7a: f0 e0 ldi r31, 0x00 ; 0
|
|
UENUM=i; // select endpoint
|
|
a7c: 69 ee ldi r22, 0xE9 ; 233
|
|
a7e: 70 e0 ldi r23, 0x00 ; 0
|
|
intbits = UEINTX; // save interrupt bits of the endpoint
|
|
a80: 0f 2e mov r0, r31
|
|
a82: f8 ee ldi r31, 0xE8 ; 232
|
|
a84: cf 2e mov r12, r31
|
|
a86: d1 2c mov r13, r1
|
|
a88: f0 2d mov r31, r0
|
|
}
|
|
UEINTX = ~(_BV(RXOUTI)|_BV(STALLEDI)); // clear interrupt flags
|
|
UEINTX = 0x7F; // free bank (FIFOCON), has to be executed after RXOUTI!
|
|
return;
|
|
}
|
|
STALL; // stall
|
|
a8a: 0b ee ldi r16, 0xEB ; 235
|
|
a8c: 10 e0 ldi r17, 0x00 ; 0
|
|
a8e: 91 e2 ldi r25, 0x21 ; 33
|
|
a90: c2 cf rjmp .-124 ; 0xa16 <__vector_12+0x4a8>
|
|
}
|
|
}
|
|
STALL; // stall
|
|
}
|
|
a92: 2a 96 adiw r28, 0x0a ; 10
|
|
a94: 0f b6 in r0, 0x3f ; 63
|
|
a96: f8 94 cli
|
|
a98: de bf out 0x3e, r29 ; 62
|
|
a9a: 0f be out 0x3f, r0 ; 63
|
|
a9c: cd bf out 0x3d, r28 ; 61
|
|
a9e: df 91 pop r29
|
|
aa0: cf 91 pop r28
|
|
aa2: ff 91 pop r31
|
|
aa4: ef 91 pop r30
|
|
aa6: bf 91 pop r27
|
|
aa8: af 91 pop r26
|
|
aaa: 9f 91 pop r25
|
|
aac: 8f 91 pop r24
|
|
aae: 7f 91 pop r23
|
|
ab0: 6f 91 pop r22
|
|
ab2: 5f 91 pop r21
|
|
ab4: 4f 91 pop r20
|
|
ab6: 3f 91 pop r19
|
|
ab8: 2f 91 pop r18
|
|
aba: 1f 91 pop r17
|
|
abc: 0f 91 pop r16
|
|
abe: ff 90 pop r15
|
|
ac0: ef 90 pop r14
|
|
ac2: df 90 pop r13
|
|
ac4: cf 90 pop r12
|
|
ac6: bf 90 pop r11
|
|
ac8: af 90 pop r10
|
|
aca: 9f 90 pop r9
|
|
acc: 8f 90 pop r8
|
|
ace: 7f 90 pop r7
|
|
ad0: 6f 90 pop r6
|
|
ad2: 5f 90 pop r5
|
|
ad4: 4f 90 pop r4
|
|
ad6: 3f 90 pop r3
|
|
ad8: 0f 90 pop r0
|
|
ada: 0f be out 0x3f, r0 ; 63
|
|
adc: 0f 90 pop r0
|
|
ade: 1f 90 pop r1
|
|
ae0: 18 95 reti
|
|
|
|
00000ae2 <__mulhi3>:
|
|
ae2: 55 27 eor r21, r21
|
|
ae4: 00 24 eor r0, r0
|
|
|
|
00000ae6 <__mulhi3_loop>:
|
|
ae6: 80 ff sbrs r24, 0
|
|
ae8: 02 c0 rjmp .+4 ; 0xaee <__mulhi3_skip1>
|
|
aea: 06 0e add r0, r22
|
|
aec: 57 1f adc r21, r23
|
|
|
|
00000aee <__mulhi3_skip1>:
|
|
aee: 66 0f add r22, r22
|
|
af0: 77 1f adc r23, r23
|
|
af2: 61 15 cp r22, r1
|
|
af4: 71 05 cpc r23, r1
|
|
af6: 21 f0 breq .+8 ; 0xb00 <__mulhi3_exit>
|
|
af8: 96 95 lsr r25
|
|
afa: 87 95 ror r24
|
|
afc: 00 97 sbiw r24, 0x00 ; 0
|
|
afe: 99 f7 brne .-26 ; 0xae6 <__mulhi3_loop>
|
|
|
|
00000b00 <__mulhi3_exit>:
|
|
b00: 95 2f mov r25, r21
|
|
b02: 80 2d mov r24, r0
|
|
b04: 08 95 ret
|
|
|
|
00000b06 <malloc>:
|
|
b06: 0f 93 push r16
|
|
b08: 1f 93 push r17
|
|
b0a: cf 93 push r28
|
|
b0c: df 93 push r29
|
|
b0e: 82 30 cpi r24, 0x02 ; 2
|
|
b10: 91 05 cpc r25, r1
|
|
b12: 10 f4 brcc .+4 ; 0xb18 <malloc+0x12>
|
|
b14: 82 e0 ldi r24, 0x02 ; 2
|
|
b16: 90 e0 ldi r25, 0x00 ; 0
|
|
b18: e0 91 42 01 lds r30, 0x0142
|
|
b1c: f0 91 43 01 lds r31, 0x0143
|
|
b20: 20 e0 ldi r18, 0x00 ; 0
|
|
b22: 30 e0 ldi r19, 0x00 ; 0
|
|
b24: c0 e0 ldi r28, 0x00 ; 0
|
|
b26: d0 e0 ldi r29, 0x00 ; 0
|
|
b28: 23 c0 rjmp .+70 ; 0xb70 <malloc+0x6a>
|
|
b2a: 40 81 ld r20, Z
|
|
b2c: 51 81 ldd r21, Z+1 ; 0x01
|
|
b2e: 48 17 cp r20, r24
|
|
b30: 59 07 cpc r21, r25
|
|
b32: a8 f0 brcs .+42 ; 0xb5e <malloc+0x58>
|
|
b34: 48 17 cp r20, r24
|
|
b36: 59 07 cpc r21, r25
|
|
b38: 61 f4 brne .+24 ; 0xb52 <malloc+0x4c>
|
|
b3a: 82 81 ldd r24, Z+2 ; 0x02
|
|
b3c: 93 81 ldd r25, Z+3 ; 0x03
|
|
b3e: 20 97 sbiw r28, 0x00 ; 0
|
|
b40: 19 f0 breq .+6 ; 0xb48 <malloc+0x42>
|
|
b42: 9b 83 std Y+3, r25 ; 0x03
|
|
b44: 8a 83 std Y+2, r24 ; 0x02
|
|
b46: 2e c0 rjmp .+92 ; 0xba4 <malloc+0x9e>
|
|
b48: 90 93 43 01 sts 0x0143, r25
|
|
b4c: 80 93 42 01 sts 0x0142, r24
|
|
b50: 29 c0 rjmp .+82 ; 0xba4 <malloc+0x9e>
|
|
b52: 21 15 cp r18, r1
|
|
b54: 31 05 cpc r19, r1
|
|
b56: 29 f0 breq .+10 ; 0xb62 <malloc+0x5c>
|
|
b58: 42 17 cp r20, r18
|
|
b5a: 53 07 cpc r21, r19
|
|
b5c: 10 f0 brcs .+4 ; 0xb62 <malloc+0x5c>
|
|
b5e: a9 01 movw r20, r18
|
|
b60: 02 c0 rjmp .+4 ; 0xb66 <malloc+0x60>
|
|
b62: be 01 movw r22, r28
|
|
b64: df 01 movw r26, r30
|
|
b66: 02 81 ldd r16, Z+2 ; 0x02
|
|
b68: 13 81 ldd r17, Z+3 ; 0x03
|
|
b6a: ef 01 movw r28, r30
|
|
b6c: 9a 01 movw r18, r20
|
|
b6e: f8 01 movw r30, r16
|
|
b70: 30 97 sbiw r30, 0x00 ; 0
|
|
b72: d9 f6 brne .-74 ; 0xb2a <malloc+0x24>
|
|
b74: 21 15 cp r18, r1
|
|
b76: 31 05 cpc r19, r1
|
|
b78: 09 f1 breq .+66 ; 0xbbc <malloc+0xb6>
|
|
b7a: 28 1b sub r18, r24
|
|
b7c: 39 0b sbc r19, r25
|
|
b7e: 24 30 cpi r18, 0x04 ; 4
|
|
b80: 31 05 cpc r19, r1
|
|
b82: 90 f4 brcc .+36 ; 0xba8 <malloc+0xa2>
|
|
b84: 12 96 adiw r26, 0x02 ; 2
|
|
b86: 8d 91 ld r24, X+
|
|
b88: 9c 91 ld r25, X
|
|
b8a: 13 97 sbiw r26, 0x03 ; 3
|
|
b8c: 61 15 cp r22, r1
|
|
b8e: 71 05 cpc r23, r1
|
|
b90: 21 f0 breq .+8 ; 0xb9a <malloc+0x94>
|
|
b92: fb 01 movw r30, r22
|
|
b94: 93 83 std Z+3, r25 ; 0x03
|
|
b96: 82 83 std Z+2, r24 ; 0x02
|
|
b98: 04 c0 rjmp .+8 ; 0xba2 <malloc+0x9c>
|
|
b9a: 90 93 43 01 sts 0x0143, r25
|
|
b9e: 80 93 42 01 sts 0x0142, r24
|
|
ba2: fd 01 movw r30, r26
|
|
ba4: 32 96 adiw r30, 0x02 ; 2
|
|
ba6: 44 c0 rjmp .+136 ; 0xc30 <malloc+0x12a>
|
|
ba8: fd 01 movw r30, r26
|
|
baa: e2 0f add r30, r18
|
|
bac: f3 1f adc r31, r19
|
|
bae: 81 93 st Z+, r24
|
|
bb0: 91 93 st Z+, r25
|
|
bb2: 22 50 subi r18, 0x02 ; 2
|
|
bb4: 31 09 sbc r19, r1
|
|
bb6: 2d 93 st X+, r18
|
|
bb8: 3c 93 st X, r19
|
|
bba: 3a c0 rjmp .+116 ; 0xc30 <malloc+0x12a>
|
|
bbc: 20 91 40 01 lds r18, 0x0140
|
|
bc0: 30 91 41 01 lds r19, 0x0141
|
|
bc4: 23 2b or r18, r19
|
|
bc6: 41 f4 brne .+16 ; 0xbd8 <malloc+0xd2>
|
|
bc8: 20 91 11 01 lds r18, 0x0111
|
|
bcc: 30 91 12 01 lds r19, 0x0112
|
|
bd0: 30 93 41 01 sts 0x0141, r19
|
|
bd4: 20 93 40 01 sts 0x0140, r18
|
|
bd8: 20 91 0f 01 lds r18, 0x010F
|
|
bdc: 30 91 10 01 lds r19, 0x0110
|
|
be0: 21 15 cp r18, r1
|
|
be2: 31 05 cpc r19, r1
|
|
be4: 41 f4 brne .+16 ; 0xbf6 <malloc+0xf0>
|
|
be6: 2d b7 in r18, 0x3d ; 61
|
|
be8: 3e b7 in r19, 0x3e ; 62
|
|
bea: 40 91 13 01 lds r20, 0x0113
|
|
bee: 50 91 14 01 lds r21, 0x0114
|
|
bf2: 24 1b sub r18, r20
|
|
bf4: 35 0b sbc r19, r21
|
|
bf6: e0 91 40 01 lds r30, 0x0140
|
|
bfa: f0 91 41 01 lds r31, 0x0141
|
|
bfe: e2 17 cp r30, r18
|
|
c00: f3 07 cpc r31, r19
|
|
c02: a0 f4 brcc .+40 ; 0xc2c <malloc+0x126>
|
|
c04: 2e 1b sub r18, r30
|
|
c06: 3f 0b sbc r19, r31
|
|
c08: 28 17 cp r18, r24
|
|
c0a: 39 07 cpc r19, r25
|
|
c0c: 78 f0 brcs .+30 ; 0xc2c <malloc+0x126>
|
|
c0e: ac 01 movw r20, r24
|
|
c10: 4e 5f subi r20, 0xFE ; 254
|
|
c12: 5f 4f sbci r21, 0xFF ; 255
|
|
c14: 24 17 cp r18, r20
|
|
c16: 35 07 cpc r19, r21
|
|
c18: 48 f0 brcs .+18 ; 0xc2c <malloc+0x126>
|
|
c1a: 4e 0f add r20, r30
|
|
c1c: 5f 1f adc r21, r31
|
|
c1e: 50 93 41 01 sts 0x0141, r21
|
|
c22: 40 93 40 01 sts 0x0140, r20
|
|
c26: 81 93 st Z+, r24
|
|
c28: 91 93 st Z+, r25
|
|
c2a: 02 c0 rjmp .+4 ; 0xc30 <malloc+0x12a>
|
|
c2c: e0 e0 ldi r30, 0x00 ; 0
|
|
c2e: f0 e0 ldi r31, 0x00 ; 0
|
|
c30: cf 01 movw r24, r30
|
|
c32: df 91 pop r29
|
|
c34: cf 91 pop r28
|
|
c36: 1f 91 pop r17
|
|
c38: 0f 91 pop r16
|
|
c3a: 08 95 ret
|
|
|
|
00000c3c <free>:
|
|
c3c: ef 92 push r14
|
|
c3e: ff 92 push r15
|
|
c40: 0f 93 push r16
|
|
c42: 1f 93 push r17
|
|
c44: cf 93 push r28
|
|
c46: df 93 push r29
|
|
c48: 00 97 sbiw r24, 0x00 ; 0
|
|
c4a: 09 f4 brne .+2 ; 0xc4e <free+0x12>
|
|
c4c: 8f c0 rjmp .+286 ; 0xd6c <free+0x130>
|
|
c4e: dc 01 movw r26, r24
|
|
c50: 12 97 sbiw r26, 0x02 ; 2
|
|
c52: 13 96 adiw r26, 0x03 ; 3
|
|
c54: 1c 92 st X, r1
|
|
c56: 1e 92 st -X, r1
|
|
c58: 12 97 sbiw r26, 0x02 ; 2
|
|
c5a: e0 90 42 01 lds r14, 0x0142
|
|
c5e: f0 90 43 01 lds r15, 0x0143
|
|
c62: e1 14 cp r14, r1
|
|
c64: f1 04 cpc r15, r1
|
|
c66: 89 f4 brne .+34 ; 0xc8a <free+0x4e>
|
|
c68: 2d 91 ld r18, X+
|
|
c6a: 3c 91 ld r19, X
|
|
c6c: 11 97 sbiw r26, 0x01 ; 1
|
|
c6e: 28 0f add r18, r24
|
|
c70: 39 1f adc r19, r25
|
|
c72: 80 91 40 01 lds r24, 0x0140
|
|
c76: 90 91 41 01 lds r25, 0x0141
|
|
c7a: 82 17 cp r24, r18
|
|
c7c: 93 07 cpc r25, r19
|
|
c7e: 89 f5 brne .+98 ; 0xce2 <free+0xa6>
|
|
c80: b0 93 41 01 sts 0x0141, r27
|
|
c84: a0 93 40 01 sts 0x0140, r26
|
|
c88: 71 c0 rjmp .+226 ; 0xd6c <free+0x130>
|
|
c8a: e7 01 movw r28, r14
|
|
c8c: 20 e0 ldi r18, 0x00 ; 0
|
|
c8e: 30 e0 ldi r19, 0x00 ; 0
|
|
c90: 01 c0 rjmp .+2 ; 0xc94 <free+0x58>
|
|
c92: ea 01 movw r28, r20
|
|
c94: ca 17 cp r28, r26
|
|
c96: db 07 cpc r29, r27
|
|
c98: 38 f4 brcc .+14 ; 0xca8 <free+0x6c>
|
|
c9a: 4a 81 ldd r20, Y+2 ; 0x02
|
|
c9c: 5b 81 ldd r21, Y+3 ; 0x03
|
|
c9e: 9e 01 movw r18, r28
|
|
ca0: 41 15 cp r20, r1
|
|
ca2: 51 05 cpc r21, r1
|
|
ca4: b1 f7 brne .-20 ; 0xc92 <free+0x56>
|
|
ca6: 22 c0 rjmp .+68 ; 0xcec <free+0xb0>
|
|
ca8: bc 01 movw r22, r24
|
|
caa: 62 50 subi r22, 0x02 ; 2
|
|
cac: 71 09 sbc r23, r1
|
|
cae: fb 01 movw r30, r22
|
|
cb0: d3 83 std Z+3, r29 ; 0x03
|
|
cb2: c2 83 std Z+2, r28 ; 0x02
|
|
cb4: 00 81 ld r16, Z
|
|
cb6: 11 81 ldd r17, Z+1 ; 0x01
|
|
cb8: ac 01 movw r20, r24
|
|
cba: 40 0f add r20, r16
|
|
cbc: 51 1f adc r21, r17
|
|
cbe: 4c 17 cp r20, r28
|
|
cc0: 5d 07 cpc r21, r29
|
|
cc2: 61 f4 brne .+24 ; 0xcdc <free+0xa0>
|
|
cc4: 48 81 ld r20, Y
|
|
cc6: 59 81 ldd r21, Y+1 ; 0x01
|
|
cc8: 40 0f add r20, r16
|
|
cca: 51 1f adc r21, r17
|
|
ccc: 4e 5f subi r20, 0xFE ; 254
|
|
cce: 5f 4f sbci r21, 0xFF ; 255
|
|
cd0: 51 83 std Z+1, r21 ; 0x01
|
|
cd2: 40 83 st Z, r20
|
|
cd4: 4a 81 ldd r20, Y+2 ; 0x02
|
|
cd6: 5b 81 ldd r21, Y+3 ; 0x03
|
|
cd8: 53 83 std Z+3, r21 ; 0x03
|
|
cda: 42 83 std Z+2, r20 ; 0x02
|
|
cdc: 21 15 cp r18, r1
|
|
cde: 31 05 cpc r19, r1
|
|
ce0: 29 f4 brne .+10 ; 0xcec <free+0xb0>
|
|
ce2: b0 93 43 01 sts 0x0143, r27
|
|
ce6: a0 93 42 01 sts 0x0142, r26
|
|
cea: 40 c0 rjmp .+128 ; 0xd6c <free+0x130>
|
|
cec: f9 01 movw r30, r18
|
|
cee: b3 83 std Z+3, r27 ; 0x03
|
|
cf0: a2 83 std Z+2, r26 ; 0x02
|
|
cf2: e9 01 movw r28, r18
|
|
cf4: 69 91 ld r22, Y+
|
|
cf6: 79 91 ld r23, Y+
|
|
cf8: c6 0f add r28, r22
|
|
cfa: d7 1f adc r29, r23
|
|
cfc: ac 17 cp r26, r28
|
|
cfe: bd 07 cpc r27, r29
|
|
d00: 79 f4 brne .+30 ; 0xd20 <free+0xe4>
|
|
d02: dc 01 movw r26, r24
|
|
d04: 5e 91 ld r21, -X
|
|
d06: 4e 91 ld r20, -X
|
|
d08: 46 0f add r20, r22
|
|
d0a: 57 1f adc r21, r23
|
|
d0c: 4e 5f subi r20, 0xFE ; 254
|
|
d0e: 5f 4f sbci r21, 0xFF ; 255
|
|
d10: 51 83 std Z+1, r21 ; 0x01
|
|
d12: 40 83 st Z, r20
|
|
d14: 12 96 adiw r26, 0x02 ; 2
|
|
d16: 8d 91 ld r24, X+
|
|
d18: 9c 91 ld r25, X
|
|
d1a: 13 97 sbiw r26, 0x03 ; 3
|
|
d1c: 93 83 std Z+3, r25 ; 0x03
|
|
d1e: 82 83 std Z+2, r24 ; 0x02
|
|
d20: a0 e0 ldi r26, 0x00 ; 0
|
|
d22: b0 e0 ldi r27, 0x00 ; 0
|
|
d24: 02 c0 rjmp .+4 ; 0xd2a <free+0xee>
|
|
d26: d7 01 movw r26, r14
|
|
d28: 7c 01 movw r14, r24
|
|
d2a: f7 01 movw r30, r14
|
|
d2c: 82 81 ldd r24, Z+2 ; 0x02
|
|
d2e: 93 81 ldd r25, Z+3 ; 0x03
|
|
d30: 00 97 sbiw r24, 0x00 ; 0
|
|
d32: c9 f7 brne .-14 ; 0xd26 <free+0xea>
|
|
d34: c7 01 movw r24, r14
|
|
d36: 02 96 adiw r24, 0x02 ; 2
|
|
d38: 20 81 ld r18, Z
|
|
d3a: 31 81 ldd r19, Z+1 ; 0x01
|
|
d3c: 82 0f add r24, r18
|
|
d3e: 93 1f adc r25, r19
|
|
d40: 20 91 40 01 lds r18, 0x0140
|
|
d44: 30 91 41 01 lds r19, 0x0141
|
|
d48: 28 17 cp r18, r24
|
|
d4a: 39 07 cpc r19, r25
|
|
d4c: 79 f4 brne .+30 ; 0xd6c <free+0x130>
|
|
d4e: 10 97 sbiw r26, 0x00 ; 0
|
|
d50: 29 f4 brne .+10 ; 0xd5c <free+0x120>
|
|
d52: 10 92 43 01 sts 0x0143, r1
|
|
d56: 10 92 42 01 sts 0x0142, r1
|
|
d5a: 04 c0 rjmp .+8 ; 0xd64 <free+0x128>
|
|
d5c: 13 96 adiw r26, 0x03 ; 3
|
|
d5e: 1c 92 st X, r1
|
|
d60: 1e 92 st -X, r1
|
|
d62: 12 97 sbiw r26, 0x02 ; 2
|
|
d64: f0 92 41 01 sts 0x0141, r15
|
|
d68: e0 92 40 01 sts 0x0140, r14
|
|
d6c: cd b7 in r28, 0x3d ; 61
|
|
d6e: de b7 in r29, 0x3e ; 62
|
|
d70: e6 e0 ldi r30, 0x06 ; 6
|
|
d72: 0c 94 d1 06 jmp 0xda2 ; 0xda2 <__epilogue_restores__+0x18>
|
|
|
|
00000d76 <strupr>:
|
|
d76: dc 01 movw r26, r24
|
|
d78: 6c 91 ld r22, X
|
|
d7a: 61 56 subi r22, 0x61 ; 97
|
|
d7c: 6a 31 cpi r22, 0x1A ; 26
|
|
d7e: 08 f0 brcs .+2 ; 0xd82 <strupr+0xc>
|
|
d80: 60 5e subi r22, 0xE0 ; 224
|
|
d82: 6f 5b subi r22, 0xBF ; 191
|
|
d84: 6d 93 st X+, r22
|
|
d86: c1 f7 brne .-16 ; 0xd78 <strupr+0x2>
|
|
d88: 08 95 ret
|
|
|
|
00000d8a <__epilogue_restores__>:
|
|
d8a: 2a 88 ldd r2, Y+18 ; 0x12
|
|
d8c: 39 88 ldd r3, Y+17 ; 0x11
|
|
d8e: 48 88 ldd r4, Y+16 ; 0x10
|
|
d90: 5f 84 ldd r5, Y+15 ; 0x0f
|
|
d92: 6e 84 ldd r6, Y+14 ; 0x0e
|
|
d94: 7d 84 ldd r7, Y+13 ; 0x0d
|
|
d96: 8c 84 ldd r8, Y+12 ; 0x0c
|
|
d98: 9b 84 ldd r9, Y+11 ; 0x0b
|
|
d9a: aa 84 ldd r10, Y+10 ; 0x0a
|
|
d9c: b9 84 ldd r11, Y+9 ; 0x09
|
|
d9e: c8 84 ldd r12, Y+8 ; 0x08
|
|
da0: df 80 ldd r13, Y+7 ; 0x07
|
|
da2: ee 80 ldd r14, Y+6 ; 0x06
|
|
da4: fd 80 ldd r15, Y+5 ; 0x05
|
|
da6: 0c 81 ldd r16, Y+4 ; 0x04
|
|
da8: 1b 81 ldd r17, Y+3 ; 0x03
|
|
daa: aa 81 ldd r26, Y+2 ; 0x02
|
|
dac: b9 81 ldd r27, Y+1 ; 0x01
|
|
dae: ce 0f add r28, r30
|
|
db0: d1 1d adc r29, r1
|
|
db2: 0f b6 in r0, 0x3f ; 63
|
|
db4: f8 94 cli
|
|
db6: de bf out 0x3e, r29 ; 62
|
|
db8: 0f be out 0x3f, r0 ; 63
|
|
dba: cd bf out 0x3d, r28 ; 61
|
|
dbc: ed 01 movw r28, r26
|
|
dbe: 08 95 ret
|
|
|
|
00000dc0 <_exit>:
|
|
dc0: f8 94 cli
|
|
|
|
00000dc2 <__stop_program>:
|
|
dc2: ff cf rjmp .-2 ; 0xdc2 <__stop_program>
|