
USB_joystick.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000826  00000000  00000000  00000094  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000002  00800060  00000826  000008ba  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000042  00800062  00800062  000008bc  2**0
                  ALLOC
  3 .debug_aranges 00000080  00000000  00000000  000008bc  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_pubnames 000002bf  00000000  00000000  0000093c  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   0000111f  00000000  00000000  00000bfb  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_abbrev 00000714  00000000  00000000  00001d1a  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_line   00000963  00000000  00000000  0000242e  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_frame  00000130  00000000  00000000  00002d94  2**2
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_str    000005ae  00000000  00000000  00002ec4  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_loc    00000464  00000000  00000000  00003472  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_ranges 000000a0  00000000  00000000  000038d6  2**0
                  CONTENTS, READONLY, DEBUGGING

Disassembly of section .text:

00000000 <__vectors>:
   0:	75 c0       	rjmp	.+234    	; 0xec <__ctors_end>
   2:	3a c1       	rjmp	.+628    	; 0x278 <__vector_1>
   4:	8e c0       	rjmp	.+284    	; 0x122 <__bad_interrupt>
   6:	8d c0       	rjmp	.+282    	; 0x122 <__bad_interrupt>
   8:	8c c0       	rjmp	.+280    	; 0x122 <__bad_interrupt>
   a:	8b c0       	rjmp	.+278    	; 0x122 <__bad_interrupt>
   c:	8a c0       	rjmp	.+276    	; 0x122 <__bad_interrupt>
   e:	89 c0       	rjmp	.+274    	; 0x122 <__bad_interrupt>
  10:	88 c0       	rjmp	.+272    	; 0x122 <__bad_interrupt>
  12:	87 c0       	rjmp	.+270    	; 0x122 <__bad_interrupt>
  14:	86 c0       	rjmp	.+268    	; 0x122 <__bad_interrupt>
  16:	85 c0       	rjmp	.+266    	; 0x122 <__bad_interrupt>
  18:	84 c0       	rjmp	.+264    	; 0x122 <__bad_interrupt>
  1a:	83 c0       	rjmp	.+262    	; 0x122 <__bad_interrupt>
  1c:	82 c0       	rjmp	.+260    	; 0x122 <__bad_interrupt>
  1e:	81 c0       	rjmp	.+258    	; 0x122 <__bad_interrupt>
  20:	80 c0       	rjmp	.+256    	; 0x122 <__bad_interrupt>
  22:	7f c0       	rjmp	.+254    	; 0x122 <__bad_interrupt>
  24:	7e c0       	rjmp	.+252    	; 0x122 <__bad_interrupt>

00000026 <usbDescriptorHidReport>:
  26:	05 01 09 04 a1 01 a1 00 09 30 09 31 35 81 45 7f     .........0.15.E.
  36:	75 08 95 02 81 02 05 09 19 01 29 04 15 00 25 04     u.........)...%.
  46:	75 01 95 08 81 03 c0 05 02 09 bb 15 81 25 7f 75     u............%.u
  56:	08 95 01 81 02 05 02 09 ba 15 81 25 7f 75 08 95     ...........%.u..
  66:	01 81 02 c0                                         ....

0000006a <usbDescriptorString0>:
  6a:	04 03 09 04                                         ....

0000006e <usbDescriptorStringVendor>:
  6e:	30 03 6a 00 61 00 6b 00 75 00 62 00 2e 00 74 00     0.j.a.k.u.b...t.
  7e:	69 00 6c 00 6c 00 65 00 72 00 40 00 74 00 69 00     i.l.l.e.r.@.t.i.
  8e:	73 00 63 00 61 00 6c 00 69 00 2e 00 63 00 7a 00     s.c.a.l.i...c.z.

0000009e <usbDescriptorStringDevice>:
  9e:	1a 03 4b 00 75 00 62 00 61 00 4a 00 6f 00 79 00     ..K.u.b.a.J.o.y.
  ae:	73 00 74 00 69 00 63 00 6b 00                       s.t.i.c.k.

000000b8 <usbDescriptorDevice>:
  b8:	12 01 10 01 00 00 00 08 c0 16 dc 27 00 01 01 02     ...........'....
  c8:	00 01                                               ..

000000ca <usbDescriptorConfiguration>:
  ca:	09 02 22 00 01 01 00 80 0a 09 04 00 00 01 03 00     ..".............
  da:	00 00 09 21 01 01 00 01 22 44 00 07 05 81 03 08     ...!...."D......
  ea:	00 64                                               .d

000000ec <__ctors_end>:
  ec:	11 24       	eor	r1, r1
  ee:	1f be       	out	0x3f, r1	; 63
  f0:	cf e5       	ldi	r28, 0x5F	; 95
  f2:	d4 e0       	ldi	r29, 0x04	; 4
  f4:	de bf       	out	0x3e, r29	; 62
  f6:	cd bf       	out	0x3d, r28	; 61

000000f8 <__do_copy_data>:
  f8:	10 e0       	ldi	r17, 0x00	; 0
  fa:	a0 e6       	ldi	r26, 0x60	; 96
  fc:	b0 e0       	ldi	r27, 0x00	; 0
  fe:	e6 e2       	ldi	r30, 0x26	; 38
 100:	f8 e0       	ldi	r31, 0x08	; 8
 102:	02 c0       	rjmp	.+4      	; 0x108 <.do_copy_data_start>

00000104 <.do_copy_data_loop>:
 104:	05 90       	lpm	r0, Z+
 106:	0d 92       	st	X+, r0

00000108 <.do_copy_data_start>:
 108:	a2 36       	cpi	r26, 0x62	; 98
 10a:	b1 07       	cpc	r27, r17
 10c:	d9 f7       	brne	.-10     	; 0x104 <.do_copy_data_loop>

0000010e <__do_clear_bss>:
 10e:	10 e0       	ldi	r17, 0x00	; 0
 110:	a2 e6       	ldi	r26, 0x62	; 98
 112:	b0 e0       	ldi	r27, 0x00	; 0
 114:	01 c0       	rjmp	.+2      	; 0x118 <.do_clear_bss_start>

00000116 <.do_clear_bss_loop>:
 116:	1d 92       	st	X+, r1

00000118 <.do_clear_bss_start>:
 118:	a4 3a       	cpi	r26, 0xA4	; 164
 11a:	b1 07       	cpc	r27, r17
 11c:	e1 f7       	brne	.-8      	; 0x116 <.do_clear_bss_loop>
 11e:	6c d0       	rcall	.+216    	; 0x1f8 <main>
 120:	80 c3       	rjmp	.+1792   	; 0x822 <_exit>

00000122 <__bad_interrupt>:
 122:	6e cf       	rjmp	.-292    	; 0x0 <__vectors>

00000124 <usbFunctionSetup>:

/* ------------------------------------------------------------------------- */

usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t    *rq = (void *)data;
 124:	fc 01       	movw	r30, r24

    /* The following requests are never used. But since they are required by
     * the specification, we implement them in this example.
     */
    if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){    /* class request type */
 126:	80 81       	ld	r24, Z
 128:	80 76       	andi	r24, 0x60	; 96
 12a:	80 32       	cpi	r24, 0x20	; 32
 12c:	e1 f4       	brne	.+56     	; 0x166 <usbFunctionSetup+0x42>
        if(rq->bRequest == USBRQ_HID_GET_REPORT){  /* wValue: ReportType (highbyte), ReportID (lowbyte) */
 12e:	81 81       	ldd	r24, Z+1	; 0x01
 130:	81 30       	cpi	r24, 0x01	; 1
 132:	41 f4       	brne	.+16     	; 0x144 <usbFunctionSetup+0x20>
            /* we only have one report type, so don't look at wValue */
            usbMsgPtr = (void *)&reportBuffer;
 134:	82 e6       	ldi	r24, 0x62	; 98
 136:	90 e0       	ldi	r25, 0x00	; 0
 138:	90 93 89 00 	sts	0x0089, r25
 13c:	80 93 88 00 	sts	0x0088, r24
 140:	85 e0       	ldi	r24, 0x05	; 5
 142:	08 95       	ret
            return sizeof(reportBuffer);
        }else if(rq->bRequest == USBRQ_HID_GET_IDLE){
 144:	82 30       	cpi	r24, 0x02	; 2
 146:	41 f4       	brne	.+16     	; 0x158 <usbFunctionSetup+0x34>
            usbMsgPtr = &idleRate;
 148:	87 e6       	ldi	r24, 0x67	; 103
 14a:	90 e0       	ldi	r25, 0x00	; 0
 14c:	90 93 89 00 	sts	0x0089, r25
 150:	80 93 88 00 	sts	0x0088, r24
 154:	81 e0       	ldi	r24, 0x01	; 1
 156:	08 95       	ret
            return 1;
        }else if(rq->bRequest == USBRQ_HID_SET_IDLE){
 158:	8a 30       	cpi	r24, 0x0A	; 10
 15a:	29 f4       	brne	.+10     	; 0x166 <usbFunctionSetup+0x42>
            idleRate = rq->wValue.bytes[1];
 15c:	83 81       	ldd	r24, Z+3	; 0x03
 15e:	80 93 67 00 	sts	0x0067, r24
 162:	80 e0       	ldi	r24, 0x00	; 0
 164:	08 95       	ret
 166:	80 e0       	ldi	r24, 0x00	; 0
        }
    }else{
        /* no vendor specific requests implemented */
    }
    return 0;   /* default for not implemented requests: return no data back to host */
}
 168:	08 95       	ret

0000016a <hw_handle_tsk>:
static report_t reportBuffer;
static uchar    idleRate;   /* repeat rate for keyboards, never used for mice */


void hw_handle_tsk( void)
{
 16a:	cf 92       	push	r12
 16c:	df 92       	push	r13
 16e:	ef 92       	push	r14
 170:	ff 92       	push	r15
 172:	0f 93       	push	r16
 174:	1f 93       	push	r17
	uint16_t th, rd, x, y;
	uint8_t temp;
	
	// get information from ADC channels (0 - 3) and store them to temporary variables
	x = adc_get(3);
 176:	83 e0       	ldi	r24, 0x03	; 3
 178:	ef d2       	rcall	.+1502   	; 0x758 <adc_get>
 17a:	7c 01       	movw	r14, r24
	y = adc_get(1);
 17c:	81 e0       	ldi	r24, 0x01	; 1
 17e:	ec d2       	rcall	.+1496   	; 0x758 <adc_get>
 180:	6c 01       	movw	r12, r24
	th = adc_get(2);
 182:	82 e0       	ldi	r24, 0x02	; 2
 184:	e9 d2       	rcall	.+1490   	; 0x758 <adc_get>
 186:	8c 01       	movw	r16, r24
	rd = adc_get(0);
 188:	80 e0       	ldi	r24, 0x00	; 0
 18a:	e6 d2       	rcall	.+1484   	; 0x758 <adc_get>

	// from ADC information there is simple count of position
	// offset is defined on the top of this file
	// offset is subcracted and result is devided by 4
	// to take stable information and satisfy 8-bit variable (ADC is 10-bit)
	reportBuffer.throttle = -1 * (int8_t)((th - ADC_OFFSET) >> 2);
 18c:	00 54       	subi	r16, 0x40	; 64
 18e:	12 40       	sbci	r17, 0x02	; 2
 190:	16 95       	lsr	r17
 192:	07 95       	ror	r16
 194:	16 95       	lsr	r17
 196:	07 95       	ror	r16
 198:	01 95       	neg	r16
 19a:	00 93 65 00 	sts	0x0065, r16
	reportBuffer.rudder =  (int8_t)((rd - ADC_OFFSET) >> 2);
 19e:	80 54       	subi	r24, 0x40	; 64
 1a0:	92 40       	sbci	r25, 0x02	; 2
 1a2:	96 95       	lsr	r25
 1a4:	87 95       	ror	r24
 1a6:	96 95       	lsr	r25
 1a8:	87 95       	ror	r24
 1aa:	80 93 66 00 	sts	0x0066, r24
	reportBuffer.dx = (int8_t)((x - ADC_OFFSET) >> 2);
 1ae:	80 ec       	ldi	r24, 0xC0	; 192
 1b0:	9d ef       	ldi	r25, 0xFD	; 253
 1b2:	e8 0e       	add	r14, r24
 1b4:	f9 1e       	adc	r15, r25
 1b6:	f6 94       	lsr	r15
 1b8:	e7 94       	ror	r14
 1ba:	f6 94       	lsr	r15
 1bc:	e7 94       	ror	r14
 1be:	e0 92 62 00 	sts	0x0062, r14
	reportBuffer.dy = (int8_t)((y - ADC_OFFSET) >> 2);
 1c2:	c8 0e       	add	r12, r24
 1c4:	d9 1e       	adc	r13, r25
 1c6:	d6 94       	lsr	r13
 1c8:	c7 94       	ror	r12
 1ca:	d6 94       	lsr	r13
 1cc:	c7 94       	ror	r12
 1ce:	c0 92 63 00 	sts	0x0063, r12
	 

	// last buttom is on PD7
	// PD7 should be input, so logical 0
	DDRD &= ~(1<<PD7);
 1d2:	8f 98       	cbi	0x11, 7	; 17
	// set up the pull-up resistor
	PORTD |= (1<<PD7);
 1d4:	97 9a       	sbi	0x12, 7	; 18
	// take value and store it to 4th bit in temp variable
	temp = ((PIND & (1<<PD7)) >> 4); 
 1d6:	10 b3       	in	r17, 0x10	; 16
 1d8:	12 95       	swap	r17
 1da:	18 70       	andi	r17, 0x08	; 8
	// then this bit should be inverted, its done by EX-OR
	temp ^= (1<<3);
	// take byte with information whitch buttons are pushed (0x1F is mask for lower 3 bits)
	// added value from last button whitch is stored in temp variable
	reportBuffer.buttons = (keyb_pushed() & 0x07) | temp;
 1dc:	1f d3       	rcall	.+1598   	; 0x81c <keyb_pushed>
 1de:	87 70       	andi	r24, 0x07	; 7
 1e0:	98 e0       	ldi	r25, 0x08	; 8
 1e2:	19 27       	eor	r17, r25
 1e4:	81 2b       	or	r24, r17
 1e6:	80 93 64 00 	sts	0x0064, r24
		
}
 1ea:	1f 91       	pop	r17
 1ec:	0f 91       	pop	r16
 1ee:	ff 90       	pop	r15
 1f0:	ef 90       	pop	r14
 1f2:	df 90       	pop	r13
 1f4:	cf 90       	pop	r12
 1f6:	08 95       	ret

000001f8 <main>:

int __attribute__((noreturn)) main(void)
{
uchar   i;
	
	adc_init( EXT_VREF);
 1f8:	82 e0       	ldi	r24, 0x02	; 2
 1fa:	95 d2       	rcall	.+1322   	; 0x726 <adc_init>
	keyb_init( PULLUP_YES);
 1fc:	80 e0       	ldi	r24, 0x00	; 0
 1fe:	e9 d2       	rcall	.+1490   	; 0x7d2 <keyb_init>
   wdt_enable(WDTO_1S);
 200:	2e e0       	ldi	r18, 0x0E	; 14
 202:	88 e1       	ldi	r24, 0x18	; 24
 204:	90 e0       	ldi	r25, 0x00	; 0
 206:	0f b6       	in	r0, 0x3f	; 63
 208:	f8 94       	cli
 20a:	a8 95       	wdr
 20c:	81 bd       	out	0x21, r24	; 33
 20e:	0f be       	out	0x3f, r0	; 63
 210:	21 bd       	out	0x21, r18	; 33
	/* RESET status: all port bits are inputs without pull-up.
	* That's the way we need D+ and D-. Therefore we don't need any
	* additional hardware initialization.
	*/

	usbInit();
 212:	53 d1       	rcall	.+678    	; 0x4ba <usbInit>
	usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */
 214:	8c 9a       	sbi	0x11, 4	; 17
 216:	20 e0       	ldi	r18, 0x00	; 0
    milliseconds can be achieved.
 */
void
_delay_loop_2(uint16_t __count)
{
	__asm__ volatile (
 218:	40 ea       	ldi	r20, 0xA0	; 160
 21a:	5f e0       	ldi	r21, 0x0F	; 15
 21c:	04 c0       	rjmp	.+8      	; 0x226 <main+0x2e>
	i = 0;
	while(--i){             /* fake USB disconnect for > 250 ms */
	  wdt_reset();
 21e:	a8 95       	wdr
 220:	ca 01       	movw	r24, r20
 222:	01 97       	sbiw	r24, 0x01	; 1
 224:	f1 f7       	brne	.-4      	; 0x222 <main+0x2a>
	*/

	usbInit();
	usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */
	i = 0;
	while(--i){             /* fake USB disconnect for > 250 ms */
 226:	21 50       	subi	r18, 0x01	; 1
 228:	d1 f7       	brne	.-12     	; 0x21e <main+0x26>
	  wdt_reset();
	  _delay_ms(1);
	}
	usbDeviceConnect();
 22a:	8c 98       	cbi	0x11, 4	; 17
	sei();
 22c:	78 94       	sei

	for(;;){                /* main event loop */
	  wdt_reset();
 22e:	a8 95       	wdr
	  usbPoll();
 230:	51 d1       	rcall	.+674    	; 0x4d4 <usbPoll>
	  if(usbInterruptIsReady()){
 232:	80 91 79 00 	lds	r24, 0x0079
 236:	84 ff       	sbrs	r24, 4
 238:	fa cf       	rjmp	.-12     	; 0x22e <main+0x36>
	      /* called after every poll of the interrupt endpoint */
			hw_handle_tsk();
 23a:	97 df       	rcall	.-210    	; 0x16a <hw_handle_tsk>
	      usbSetInterrupt((void *)&reportBuffer, sizeof(reportBuffer));
 23c:	82 e6       	ldi	r24, 0x62	; 98
 23e:	90 e0       	ldi	r25, 0x00	; 0
 240:	65 e0       	ldi	r22, 0x05	; 5
 242:	50 d2       	rcall	.+1184   	; 0x6e4 <usbSetInterrupt>
 244:	f4 cf       	rjmp	.-24     	; 0x22e <main+0x36>

00000246 <usbCrc16>:
 246:	a8 2f       	mov	r26, r24
 248:	b9 2f       	mov	r27, r25
 24a:	80 e0       	ldi	r24, 0x00	; 0
 24c:	90 e0       	ldi	r25, 0x00	; 0
 24e:	41 e0       	ldi	r20, 0x01	; 1
 250:	50 ea       	ldi	r21, 0xA0	; 160
 252:	60 95       	com	r22
 254:	30 e0       	ldi	r19, 0x00	; 0
 256:	09 c0       	rjmp	.+18     	; 0x26a <usbCrcLoopEntry>

00000258 <usbCrcByteLoop>:
 258:	2d 91       	ld	r18, X+
 25a:	82 27       	eor	r24, r18

0000025c <usbCrcBitLoop>:
 25c:	97 95       	ror	r25
 25e:	87 95       	ror	r24
 260:	10 f0       	brcs	.+4      	; 0x266 <usbCrcNoXor>
 262:	84 27       	eor	r24, r20
 264:	95 27       	eor	r25, r21

00000266 <usbCrcNoXor>:
 266:	30 5e       	subi	r19, 0xE0	; 224
 268:	c8 f3       	brcs	.-14     	; 0x25c <usbCrcBitLoop>

0000026a <usbCrcLoopEntry>:
 26a:	6f 5f       	subi	r22, 0xFF	; 255
 26c:	a8 f3       	brcs	.-22     	; 0x258 <usbCrcByteLoop>

0000026e <usbCrcReady>:
 26e:	08 95       	ret

00000270 <usbCrc16Append>:
 270:	ea df       	rcall	.-44     	; 0x246 <usbCrc16>
 272:	8d 93       	st	X+, r24
 274:	9d 93       	st	X+, r25
 276:	08 95       	ret

00000278 <__vector_1>:
 278:	cf 93       	push	r28
 27a:	cf b7       	in	r28, 0x3f	; 63
 27c:	cf 93       	push	r28
 27e:	df 93       	push	r29

00000280 <waitForJ>:
 280:	c3 95       	inc	r28
 282:	84 9b       	sbis	0x10, 4	; 16
 284:	e9 f7       	brne	.-6      	; 0x280 <waitForJ>

00000286 <waitForK>:
 286:	84 9b       	sbis	0x10, 4	; 16
 288:	0b c0       	rjmp	.+22     	; 0x2a0 <foundK>
 28a:	84 9b       	sbis	0x10, 4	; 16
 28c:	09 c0       	rjmp	.+18     	; 0x2a0 <foundK>
 28e:	84 9b       	sbis	0x10, 4	; 16
 290:	07 c0       	rjmp	.+14     	; 0x2a0 <foundK>
 292:	84 9b       	sbis	0x10, 4	; 16
 294:	05 c0       	rjmp	.+10     	; 0x2a0 <foundK>
 296:	84 9b       	sbis	0x10, 4	; 16
 298:	03 c0       	rjmp	.+6      	; 0x2a0 <foundK>
 29a:	84 9b       	sbis	0x10, 4	; 16
 29c:	01 c0       	rjmp	.+2      	; 0x2a0 <foundK>
 29e:	8b c0       	rjmp	.+278    	; 0x3b6 <sofError>

000002a0 <foundK>:
 2a0:	6f 93       	push	r22
 2a2:	c0 91 87 00 	lds	r28, 0x0087
 2a6:	dd 27       	eor	r29, r29
 2a8:	c2 57       	subi	r28, 0x72	; 114
 2aa:	df 4f       	sbci	r29, 0xFF	; 255
 2ac:	2f 93       	push	r18
 2ae:	65 e5       	ldi	r22, 0x55	; 85
 2b0:	84 9b       	sbis	0x10, 4	; 16
 2b2:	03 c0       	rjmp	.+6      	; 0x2ba <haveTwoBitsK>
 2b4:	2f 91       	pop	r18
 2b6:	6f 91       	pop	r22
 2b8:	e6 cf       	rjmp	.-52     	; 0x286 <waitForK>

000002ba <haveTwoBitsK>:
 2ba:	0f 93       	push	r16
 2bc:	1f 93       	push	r17
 2be:	4f 93       	push	r20
 2c0:	20 e0       	ldi	r18, 0x00	; 0
 2c2:	40 e1       	ldi	r20, 0x10	; 16
 2c4:	5f 93       	push	r21
 2c6:	00 b3       	in	r16, 0x10	; 16
 2c8:	04 71       	andi	r16, 0x14	; 20
 2ca:	04 fb       	bst	r16, 4
 2cc:	27 f9       	bld	r18, 7
 2ce:	3f 93       	push	r19
 2d0:	50 e0       	ldi	r21, 0x00	; 0
 2d2:	3b e0       	ldi	r19, 0x0B	; 11
 2d4:	39 c0       	rjmp	.+114    	; 0x348 <rxbit1>

000002d6 <unstuff6>:
 2d6:	14 71       	andi	r17, 0x14	; 20
 2d8:	40 64       	ori	r20, 0x40	; 64
 2da:	2f 77       	andi	r18, 0x7F	; 127
 2dc:	01 2f       	mov	r16, r17
 2de:	5f 5f       	subi	r21, 0xFF	; 255
 2e0:	1e c0       	rjmp	.+60     	; 0x31e <didUnstuff6>

000002e2 <unstuff7>:
 2e2:	40 68       	ori	r20, 0x80	; 128
 2e4:	10 b3       	in	r17, 0x10	; 16
 2e6:	14 71       	andi	r17, 0x14	; 20
 2e8:	2f 77       	andi	r18, 0x7F	; 127
 2ea:	52 50       	subi	r21, 0x02	; 2
 2ec:	1f c0       	rjmp	.+62     	; 0x32c <didUnstuff7>

000002ee <unstuffEven>:
 2ee:	40 64       	ori	r20, 0x40	; 64
 2f0:	00 b3       	in	r16, 0x10	; 16
 2f2:	2f 77       	andi	r18, 0x7F	; 127
 2f4:	04 71       	andi	r16, 0x14	; 20
 2f6:	d1 f1       	breq	.+116    	; 0x36c <se0>
 2f8:	5f 5f       	subi	r21, 0xFF	; 255
 2fa:	00 c0       	rjmp	.+0      	; 0x2fc <unstuffEven+0xe>
 2fc:	23 c0       	rjmp	.+70     	; 0x344 <didUnstuffE>

000002fe <unstuffOdd>:
 2fe:	40 62       	ori	r20, 0x20	; 32
 300:	10 b3       	in	r17, 0x10	; 16
 302:	2f 77       	andi	r18, 0x7F	; 127
 304:	14 71       	andi	r17, 0x14	; 20
 306:	91 f1       	breq	.+100    	; 0x36c <se0>
 308:	5f 5f       	subi	r21, 0xFF	; 255
 30a:	00 c0       	rjmp	.+0      	; 0x30c <unstuffOdd+0xe>
 30c:	25 c0       	rjmp	.+74     	; 0x358 <didUnstuffO>

0000030e <rxByteLoop>:
 30e:	04 71       	andi	r16, 0x14	; 20
 310:	10 27       	eor	r17, r16
 312:	51 50       	subi	r21, 0x01	; 1
 314:	12 f4       	brpl	.+4      	; 0x31a <skipLeap>
 316:	5d 5f       	subi	r21, 0xFD	; 253
	...

0000031a <skipLeap>:
 31a:	11 50       	subi	r17, 0x01	; 1
 31c:	27 95       	ror	r18

0000031e <didUnstuff6>:
 31e:	2c 3f       	cpi	r18, 0xFC	; 252
 320:	10 b3       	in	r17, 0x10	; 16
 322:	c8 f6       	brcc	.-78     	; 0x2d6 <unstuff6>
 324:	14 71       	andi	r17, 0x14	; 20
 326:	01 27       	eor	r16, r17
 328:	01 50       	subi	r16, 0x01	; 1
 32a:	27 95       	ror	r18

0000032c <didUnstuff7>:
 32c:	2c 3f       	cpi	r18, 0xFC	; 252
 32e:	c8 f6       	brcc	.-78     	; 0x2e2 <unstuff7>
 330:	42 27       	eor	r20, r18
 332:	49 93       	st	Y+, r20

00000334 <rxBitLoop>:
 334:	00 b3       	in	r16, 0x10	; 16
 336:	04 71       	andi	r16, 0x14	; 20
 338:	10 27       	eor	r17, r16
 33a:	4f 73       	andi	r20, 0x3F	; 63
 33c:	11 50       	subi	r17, 0x01	; 1
 33e:	27 95       	ror	r18
 340:	2c 3f       	cpi	r18, 0xFC	; 252
 342:	a8 f6       	brcc	.-86     	; 0x2ee <unstuffEven>

00000344 <didUnstuffE>:
 344:	46 95       	lsr	r20
 346:	46 95       	lsr	r20

00000348 <rxbit1>:
 348:	10 b3       	in	r17, 0x10	; 16
 34a:	14 71       	andi	r17, 0x14	; 20
 34c:	79 f0       	breq	.+30     	; 0x36c <se0>
 34e:	01 27       	eor	r16, r17
 350:	01 50       	subi	r16, 0x01	; 1
 352:	27 95       	ror	r18
 354:	2c 3f       	cpi	r18, 0xFC	; 252
 356:	98 f6       	brcc	.-90     	; 0x2fe <unstuffOdd>

00000358 <didUnstuffO>:
 358:	6b 5a       	subi	r22, 0xAB	; 171
 35a:	60 f3       	brcs	.-40     	; 0x334 <rxBitLoop>
 35c:	31 50       	subi	r19, 0x01	; 1
 35e:	00 b3       	in	r16, 0x10	; 16
 360:	b0 f6       	brcc	.-84     	; 0x30e <rxByteLoop>
 362:	00 c0       	rjmp	.+0      	; 0x364 <overflow>

00000364 <overflow>:
 364:	10 e4       	ldi	r17, 0x40	; 64
 366:	1a bf       	out	0x3a, r17	; 58

00000368 <ignorePacket>:
 368:	00 27       	eor	r16, r16
 36a:	19 c0       	rjmp	.+50     	; 0x39e <handleSetupOrOut>

0000036c <se0>:
 36c:	3b 50       	subi	r19, 0x0B	; 11
 36e:	31 95       	neg	r19
 370:	c3 1b       	sub	r28, r19
 372:	d0 40       	sbci	r29, 0x00	; 0
 374:	10 e4       	ldi	r17, 0x40	; 64
 376:	1a bf       	out	0x3a, r17	; 58
 378:	08 81       	ld	r16, Y
 37a:	03 3c       	cpi	r16, 0xC3	; 195
 37c:	09 f1       	breq	.+66     	; 0x3c0 <handleData>
 37e:	0b 34       	cpi	r16, 0x4B	; 75
 380:	f9 f0       	breq	.+62     	; 0x3c0 <handleData>
 382:	20 91 85 00 	lds	r18, 0x0085
 386:	19 81       	ldd	r17, Y+1	; 0x01
 388:	11 0f       	add	r17, r17
 38a:	12 13       	cpse	r17, r18
 38c:	ed cf       	rjmp	.-38     	; 0x368 <ignorePacket>
 38e:	4a 81       	ldd	r20, Y+2	; 0x02
 390:	44 1f       	adc	r20, r20
 392:	09 36       	cpi	r16, 0x69	; 105
 394:	51 f1       	breq	.+84     	; 0x3ea <handleIn>
 396:	0d 32       	cpi	r16, 0x2D	; 45
 398:	11 f0       	breq	.+4      	; 0x39e <handleSetupOrOut>
 39a:	01 3e       	cpi	r16, 0xE1	; 225
 39c:	29 f7       	brne	.-54     	; 0x368 <ignorePacket>

0000039e <handleSetupOrOut>:
 39e:	00 93 8c 00 	sts	0x008C, r16

000003a2 <doReturn>:
 3a2:	3f 91       	pop	r19
 3a4:	5f 91       	pop	r21
 3a6:	4f 91       	pop	r20
 3a8:	1f 91       	pop	r17
 3aa:	0f 91       	pop	r16
 3ac:	2f 91       	pop	r18
 3ae:	6f 91       	pop	r22
 3b0:	ca b7       	in	r28, 0x3a	; 58
 3b2:	c6 fd       	sbrc	r28, 6
 3b4:	65 cf       	rjmp	.-310    	; 0x280 <waitForJ>

000003b6 <sofError>:
 3b6:	df 91       	pop	r29
 3b8:	cf 91       	pop	r28
 3ba:	cf bf       	out	0x3f, r28	; 63
 3bc:	cf 91       	pop	r28
 3be:	18 95       	reti

000003c0 <handleData>:
 3c0:	20 91 8c 00 	lds	r18, 0x008C
 3c4:	22 23       	and	r18, r18
 3c6:	69 f3       	breq	.-38     	; 0x3a2 <doReturn>
 3c8:	10 91 8a 00 	lds	r17, 0x008A
 3cc:	11 23       	and	r17, r17
 3ce:	91 f5       	brne	.+100    	; 0x434 <sendNakAndReti>
 3d0:	34 30       	cpi	r19, 0x04	; 4
 3d2:	92 f1       	brmi	.+100    	; 0x438 <sendAckAndReti>
 3d4:	30 93 8a 00 	sts	0x008A, r19
 3d8:	20 93 86 00 	sts	0x0086, r18
 3dc:	10 91 87 00 	lds	r17, 0x0087
 3e0:	3b e0       	ldi	r19, 0x0B	; 11
 3e2:	31 1b       	sub	r19, r17
 3e4:	30 93 87 00 	sts	0x0087, r19
 3e8:	27 c0       	rjmp	.+78     	; 0x438 <sendAckAndReti>

000003ea <handleIn>:
 3ea:	00 91 8a 00 	lds	r16, 0x008A
 3ee:	01 30       	cpi	r16, 0x01	; 1
 3f0:	0c f5       	brge	.+66     	; 0x434 <sendNakAndReti>
 3f2:	0a e5       	ldi	r16, 0x5A	; 90
 3f4:	4f 70       	andi	r20, 0x0F	; 15
 3f6:	49 f4       	brne	.+18     	; 0x40a <handleIn1>
 3f8:	30 91 60 00 	lds	r19, 0x0060
 3fc:	34 fd       	sbrc	r19, 4
 3fe:	1d c0       	rjmp	.+58     	; 0x43a <sendCntAndReti>
 400:	00 93 60 00 	sts	0x0060, r16
 404:	ce e6       	ldi	r28, 0x6E	; 110
 406:	d0 e0       	ldi	r29, 0x00	; 0
 408:	1c c0       	rjmp	.+56     	; 0x442 <usbSendAndReti>

0000040a <handleIn1>:
 40a:	30 91 79 00 	lds	r19, 0x0079
 40e:	34 fd       	sbrc	r19, 4
 410:	14 c0       	rjmp	.+40     	; 0x43a <sendCntAndReti>
 412:	00 93 79 00 	sts	0x0079, r16
 416:	ca e7       	ldi	r28, 0x7A	; 122
 418:	d0 e0       	ldi	r29, 0x00	; 0
 41a:	13 c0       	rjmp	.+38     	; 0x442 <usbSendAndReti>

0000041c <bitstuffN>:
 41c:	05 27       	eor	r16, r21
 41e:	10 e0       	ldi	r17, 0x00	; 0
 420:	00 c0       	rjmp	.+0      	; 0x422 <bitstuffN+0x6>
 422:	00 00       	nop
 424:	02 bb       	out	0x12, r16	; 18
 426:	1a c0       	rjmp	.+52     	; 0x45c <didStuffN>

00000428 <bitstuff6>:
 428:	05 27       	eor	r16, r21
 42a:	10 e0       	ldi	r17, 0x00	; 0
 42c:	22 1f       	adc	r18, r18
 42e:	1d c0       	rjmp	.+58     	; 0x46a <didStuff6>

00000430 <bitstuff7>:
 430:	10 e0       	ldi	r17, 0x00	; 0
 432:	21 c0       	rjmp	.+66     	; 0x476 <didStuff7>

00000434 <sendNakAndReti>:
 434:	4a e5       	ldi	r20, 0x5A	; 90
 436:	02 c0       	rjmp	.+4      	; 0x43c <sendX3AndReti>

00000438 <sendAckAndReti>:
 438:	32 ed       	ldi	r19, 0xD2	; 210

0000043a <sendCntAndReti>:
 43a:	43 2f       	mov	r20, r19

0000043c <sendX3AndReti>:
 43c:	c4 e1       	ldi	r28, 0x14	; 20
 43e:	d0 e0       	ldi	r29, 0x00	; 0
 440:	32 e0       	ldi	r19, 0x02	; 2

00000442 <usbSendAndReti>:
 442:	11 b3       	in	r17, 0x11	; 17
 444:	14 61       	ori	r17, 0x14	; 20
 446:	94 9a       	sbi	0x12, 4	; 18
 448:	02 b3       	in	r16, 0x12	; 18
 44a:	11 bb       	out	0x11, r17	; 17
 44c:	54 e1       	ldi	r21, 0x14	; 20
 44e:	20 e8       	ldi	r18, 0x80	; 128

00000450 <txByteLoop>:
 450:	65 e3       	ldi	r22, 0x35	; 53

00000452 <txBitLoop>:
 452:	20 ff       	sbrs	r18, 0
 454:	05 27       	eor	r16, r21
 456:	02 bb       	out	0x12, r16	; 18
 458:	27 95       	ror	r18
 45a:	17 95       	ror	r17

0000045c <didStuffN>:
 45c:	1c 3f       	cpi	r17, 0xFC	; 252
 45e:	f0 f6       	brcc	.-68     	; 0x41c <bitstuffN>
 460:	66 95       	lsr	r22
 462:	b8 f7       	brcc	.-18     	; 0x452 <txBitLoop>
 464:	b1 f7       	brne	.-20     	; 0x452 <txBitLoop>
 466:	20 ff       	sbrs	r18, 0
 468:	05 27       	eor	r16, r21

0000046a <didStuff6>:
 46a:	02 bb       	out	0x12, r16	; 18
 46c:	27 95       	ror	r18
 46e:	17 95       	ror	r17
 470:	1c 3f       	cpi	r17, 0xFC	; 252
 472:	d0 f6       	brcc	.-76     	; 0x428 <bitstuff6>
 474:	27 95       	ror	r18

00000476 <didStuff7>:
 476:	17 95       	ror	r17
 478:	17 ff       	sbrs	r17, 7
 47a:	05 27       	eor	r16, r21
 47c:	00 00       	nop
 47e:	1c 3f       	cpi	r17, 0xFC	; 252
 480:	02 bb       	out	0x12, r16	; 18
 482:	b0 f6       	brcc	.-84     	; 0x430 <bitstuff7>
 484:	29 91       	ld	r18, Y+
 486:	3a 95       	dec	r19
 488:	19 f7       	brne	.-58     	; 0x450 <txByteLoop>
 48a:	0b 7e       	andi	r16, 0xEB	; 235
 48c:	10 91 8b 00 	lds	r17, 0x008B
 490:	11 0f       	add	r17, r17
 492:	c6 51       	subi	r28, 0x16	; 22
 494:	d0 40       	sbci	r29, 0x00	; 0
 496:	02 bb       	out	0x12, r16	; 18
 498:	11 f0       	breq	.+4      	; 0x49e <skipAddrAssign>
 49a:	10 93 85 00 	sts	0x0085, r17

0000049e <skipAddrAssign>:
 49e:	10 e4       	ldi	r17, 0x40	; 64
 4a0:	1a bf       	out	0x3a, r17	; 58
 4a2:	00 61       	ori	r16, 0x10	; 16
 4a4:	11 b3       	in	r17, 0x11	; 17
 4a6:	1b 7e       	andi	r17, 0xEB	; 235
 4a8:	40 2f       	mov	r20, r16
 4aa:	4b 7e       	andi	r20, 0xEB	; 235
 4ac:	54 e0       	ldi	r21, 0x04	; 4

000004ae <se0Delay>:
 4ae:	5a 95       	dec	r21
 4b0:	f1 f7       	brne	.-4      	; 0x4ae <se0Delay>
 4b2:	02 bb       	out	0x12, r16	; 18
 4b4:	11 bb       	out	0x11, r17	; 17
 4b6:	42 bb       	out	0x12, r20	; 18
 4b8:	74 cf       	rjmp	.-280    	; 0x3a2 <doReturn>

000004ba <usbInit>:
/* ------------------------------------------------------------------------- */

USB_PUBLIC void usbInit(void)
{
#if USB_INTR_CFG_SET != 0
    USB_INTR_CFG |= USB_INTR_CFG_SET;
 4ba:	85 b7       	in	r24, 0x35	; 53
 4bc:	82 60       	ori	r24, 0x02	; 2
 4be:	85 bf       	out	0x35, r24	; 53
#endif
#if USB_INTR_CFG_CLR != 0
    USB_INTR_CFG &= ~(USB_INTR_CFG_CLR);
#endif
    USB_INTR_ENABLE |= (1 << USB_INTR_ENABLE_BIT);
 4c0:	8b b7       	in	r24, 0x3b	; 59
 4c2:	80 64       	ori	r24, 0x40	; 64
 4c4:	8b bf       	out	0x3b, r24	; 59
/* ------------------------------------------------------------------------- */

static inline void  usbResetDataToggling(void)
{
#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE
    USB_SET_DATATOKEN1(USB_INITIAL_DATATOKEN);  /* reset data toggling for interrupt endpoint */
 4c6:	8b e4       	ldi	r24, 0x4B	; 75
 4c8:	80 93 7a 00 	sts	0x007A, r24
    USB_INTR_CFG &= ~(USB_INTR_CFG_CLR);
#endif
    USB_INTR_ENABLE |= (1 << USB_INTR_ENABLE_BIT);
    usbResetDataToggling();
#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE
    usbTxLen1 = USBPID_NAK;
 4cc:	8a e5       	ldi	r24, 0x5A	; 90
 4ce:	80 93 79 00 	sts	0x0079, r24
#if USB_CFG_HAVE_INTRIN_ENDPOINT3
    usbTxLen3 = USBPID_NAK;
#endif
#endif
}
 4d2:	08 95       	ret

000004d4 <usbPoll>:
}

/* ------------------------------------------------------------------------- */

USB_PUBLIC void usbPoll(void)
{
 4d4:	1f 93       	push	r17
 4d6:	cf 93       	push	r28
 4d8:	df 93       	push	r29
schar   len;
uchar   i;

    len = usbRxLen - 3;
 4da:	90 91 8a 00 	lds	r25, 0x008A
 4de:	93 50       	subi	r25, 0x03	; 3
    if(len >= 0){
 4e0:	97 fd       	sbrc	r25, 7
 4e2:	a5 c0       	rjmp	.+330    	; 0x62e <usbPoll+0x15a>
 * need data integrity checks with this driver, check the CRC in your app
 * code and report errors back to the host. Since the ACK was already sent,
 * retries must be handled on application level.
 * unsigned crc = usbCrc16(buffer + 1, usbRxLen - 3);
 */
        usbProcessRx(usbRxBuf + USB_BUFSIZE + 1 - usbInputBufOffset, len);
 4e4:	20 91 87 00 	lds	r18, 0x0087
    if(usbRxToken < 0x10){  /* OUT to endpoint != 0: endpoint number in usbRxToken */
        usbFunctionWriteOut(data, len);
        return;
    }
#endif
    if(usbRxToken == (uchar)USBPID_SETUP){
 4e8:	80 91 86 00 	lds	r24, 0x0086
 4ec:	8d 32       	cpi	r24, 0x2D	; 45
 4ee:	09 f0       	breq	.+2      	; 0x4f2 <usbPoll+0x1e>
 4f0:	9c c0       	rjmp	.+312    	; 0x62a <usbPoll+0x156>
        if(len != 8)    /* Setup size must be always 8 bytes. Ignore otherwise. */
 4f2:	98 30       	cpi	r25, 0x08	; 8
 4f4:	09 f0       	breq	.+2      	; 0x4f8 <usbPoll+0x24>
 4f6:	99 c0       	rjmp	.+306    	; 0x62a <usbPoll+0x156>
 * need data integrity checks with this driver, check the CRC in your app
 * code and report errors back to the host. Since the ACK was already sent,
 * retries must be handled on application level.
 * unsigned crc = usbCrc16(buffer + 1, usbRxLen - 3);
 */
        usbProcessRx(usbRxBuf + USB_BUFSIZE + 1 - usbInputBufOffset, len);
 4f8:	cc e0       	ldi	r28, 0x0C	; 12
 4fa:	d0 e0       	ldi	r29, 0x00	; 0
 4fc:	c2 1b       	sub	r28, r18
 4fe:	d1 09       	sbc	r29, r1
 500:	c2 57       	subi	r28, 0x72	; 114
 502:	df 4f       	sbci	r29, 0xFF	; 255
#endif
    if(usbRxToken == (uchar)USBPID_SETUP){
        if(len != 8)    /* Setup size must be always 8 bytes. Ignore otherwise. */
            return;
        usbMsgLen_t replyLen;
        usbTxBuf[0] = USBPID_DATA0;         /* initialize data toggling */
 504:	83 ec       	ldi	r24, 0xC3	; 195
 506:	80 93 6e 00 	sts	0x006E, r24
        usbTxLen = USBPID_NAK;              /* abort pending transmit */
 50a:	8a e5       	ldi	r24, 0x5A	; 90
 50c:	80 93 60 00 	sts	0x0060, r24
        usbMsgFlags = 0;
 510:	10 92 68 00 	sts	0x0068, r1
        uchar type = rq->bmRequestType & USBRQ_TYPE_MASK;
        if(type != USBRQ_TYPE_STANDARD){    /* standard requests are handled by driver */
 514:	88 81       	ld	r24, Y
 516:	80 76       	andi	r24, 0x60	; 96
 518:	21 f0       	breq	.+8      	; 0x522 <usbPoll+0x4e>
            replyLen = usbFunctionSetup(data);
 51a:	ce 01       	movw	r24, r28
 51c:	03 de       	rcall	.-1018   	; 0x124 <usbFunctionSetup>
 51e:	28 2f       	mov	r18, r24
 520:	7b c0       	rjmp	.+246    	; 0x618 <usbPoll+0x144>
 * standard requests instead of class and custom requests.
 */
static inline usbMsgLen_t usbDriverSetup(usbRequest_t *rq)
{
uchar   len  = 0, *dataPtr = usbTxBuf + 9;  /* there are 2 bytes free space at the end of the buffer */
uchar   value = rq->wValue.bytes[0];
 522:	9a 81       	ldd	r25, Y+2	; 0x02
#if USB_CFG_IMPLEMENT_HALT
uchar   index = rq->wIndex.bytes[0];
#endif

    dataPtr[0] = 0; /* default reply common to USBRQ_GET_STATUS and USBRQ_GET_INTERFACE */
 524:	10 92 77 00 	sts	0x0077, r1
    SWITCH_START(rq->bRequest)
 528:	89 81       	ldd	r24, Y+1	; 0x01
    SWITCH_CASE(USBRQ_GET_STATUS)           /* 0 */
 52a:	88 23       	and	r24, r24
 52c:	21 f4       	brne	.+8      	; 0x536 <usbPoll+0x62>
            dataPtr[0] =  USB_CFG_IS_SELF_POWERED;
#if USB_CFG_IMPLEMENT_HALT
        if(recipient == USBRQ_RCPT_ENDPOINT && index == 0x81)   /* request status for endpoint 1 */
            dataPtr[0] = usbTxLen1 == USBPID_STALL;
#endif
        dataPtr[1] = 0;
 52e:	10 92 78 00 	sts	0x0078, r1
 532:	22 e0       	ldi	r18, 0x02	; 2
 534:	6b c0       	rjmp	.+214    	; 0x60c <usbPoll+0x138>
        if(value == 0 && index == 0x81){    /* feature 0 == HALT for endpoint == 1 */
            usbTxLen1 = rq->bRequest == USBRQ_CLEAR_FEATURE ? USBPID_NAK : USBPID_STALL;
            usbResetDataToggling();
        }
#endif
    SWITCH_CASE(USBRQ_SET_ADDRESS)          /* 5 */
 536:	85 30       	cpi	r24, 0x05	; 5
 538:	19 f4       	brne	.+6      	; 0x540 <usbPoll+0x6c>
        usbNewDeviceAddr = value;
 53a:	90 93 8b 00 	sts	0x008B, r25
 53e:	65 c0       	rjmp	.+202    	; 0x60a <usbPoll+0x136>
        USB_SET_ADDRESS_HOOK();
    SWITCH_CASE(USBRQ_GET_DESCRIPTOR)       /* 6 */
 540:	86 30       	cpi	r24, 0x06	; 6
 542:	09 f0       	breq	.+2      	; 0x546 <usbPoll+0x72>
 544:	4e c0       	rjmp	.+156    	; 0x5e2 <usbPoll+0x10e>
static inline usbMsgLen_t usbDriverDescriptor(usbRequest_t *rq)
{
usbMsgLen_t len = 0;
uchar       flags = USB_FLG_MSGPTR_IS_ROM;

    SWITCH_START(rq->wValue.bytes[1])
 546:	8b 81       	ldd	r24, Y+3	; 0x03
    SWITCH_CASE(USBDESCR_DEVICE)    /* 1 */
 548:	81 30       	cpi	r24, 0x01	; 1
 54a:	41 f4       	brne	.+16     	; 0x55c <usbPoll+0x88>
        GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_DEVICE, usbDescriptorDevice)
 54c:	88 eb       	ldi	r24, 0xB8	; 184
 54e:	90 e0       	ldi	r25, 0x00	; 0
 550:	90 93 89 00 	sts	0x0089, r25
 554:	80 93 88 00 	sts	0x0088, r24
 558:	22 e1       	ldi	r18, 0x12	; 18
 55a:	3f c0       	rjmp	.+126    	; 0x5da <usbPoll+0x106>
    SWITCH_CASE(USBDESCR_CONFIG)    /* 2 */
 55c:	82 30       	cpi	r24, 0x02	; 2
 55e:	41 f4       	brne	.+16     	; 0x570 <usbPoll+0x9c>
        GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_CONFIGURATION, usbDescriptorConfiguration)
 560:	8a ec       	ldi	r24, 0xCA	; 202
 562:	90 e0       	ldi	r25, 0x00	; 0
 564:	90 93 89 00 	sts	0x0089, r25
 568:	80 93 88 00 	sts	0x0088, r24
 56c:	22 e2       	ldi	r18, 0x22	; 34
 56e:	35 c0       	rjmp	.+106    	; 0x5da <usbPoll+0x106>
    SWITCH_CASE(USBDESCR_STRING)    /* 3 */
 570:	83 30       	cpi	r24, 0x03	; 3
 572:	f1 f4       	brne	.+60     	; 0x5b0 <usbPoll+0xdc>
        if(USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_RAM)
            flags = 0;
        len = usbFunctionDescriptor(rq);
#else   /* USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC */
        SWITCH_START(rq->wValue.bytes[0])
        SWITCH_CASE(0)
 574:	99 23       	and	r25, r25
 576:	41 f4       	brne	.+16     	; 0x588 <usbPoll+0xb4>
            GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_0, usbDescriptorString0)
 578:	8a e6       	ldi	r24, 0x6A	; 106
 57a:	90 e0       	ldi	r25, 0x00	; 0
 57c:	90 93 89 00 	sts	0x0089, r25
 580:	80 93 88 00 	sts	0x0088, r24
 584:	24 e0       	ldi	r18, 0x04	; 4
 586:	29 c0       	rjmp	.+82     	; 0x5da <usbPoll+0x106>
        SWITCH_CASE(1)
 588:	91 30       	cpi	r25, 0x01	; 1
 58a:	41 f4       	brne	.+16     	; 0x59c <usbPoll+0xc8>
            GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_VENDOR, usbDescriptorStringVendor)
 58c:	8e e6       	ldi	r24, 0x6E	; 110
 58e:	90 e0       	ldi	r25, 0x00	; 0
 590:	90 93 89 00 	sts	0x0089, r25
 594:	80 93 88 00 	sts	0x0088, r24
 598:	20 e3       	ldi	r18, 0x30	; 48
 59a:	1f c0       	rjmp	.+62     	; 0x5da <usbPoll+0x106>
        SWITCH_CASE(2)
 59c:	92 30       	cpi	r25, 0x02	; 2
 59e:	e1 f4       	brne	.+56     	; 0x5d8 <usbPoll+0x104>
            GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_STRING_PRODUCT, usbDescriptorStringDevice)
 5a0:	8e e9       	ldi	r24, 0x9E	; 158
 5a2:	90 e0       	ldi	r25, 0x00	; 0
 5a4:	90 93 89 00 	sts	0x0089, r25
 5a8:	80 93 88 00 	sts	0x0088, r24
 5ac:	2a e1       	ldi	r18, 0x1A	; 26
 5ae:	15 c0       	rjmp	.+42     	; 0x5da <usbPoll+0x106>
                len = usbFunctionDescriptor(rq);
            }
        SWITCH_END
#endif  /* USB_CFG_DESCR_PROPS_STRINGS & USB_PROP_IS_DYNAMIC */
#if USB_CFG_DESCR_PROPS_HID_REPORT  /* only support HID descriptors if enabled */
    SWITCH_CASE(USBDESCR_HID)       /* 0x21 */
 5b0:	81 32       	cpi	r24, 0x21	; 33
 5b2:	41 f4       	brne	.+16     	; 0x5c4 <usbPoll+0xf0>
        GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID, usbDescriptorConfiguration + 18)
 5b4:	8c ed       	ldi	r24, 0xDC	; 220
 5b6:	90 e0       	ldi	r25, 0x00	; 0
 5b8:	90 93 89 00 	sts	0x0089, r25
 5bc:	80 93 88 00 	sts	0x0088, r24
 5c0:	29 e0       	ldi	r18, 0x09	; 9
 5c2:	0b c0       	rjmp	.+22     	; 0x5da <usbPoll+0x106>
    SWITCH_CASE(USBDESCR_HID_REPORT)/* 0x22 */
 5c4:	82 32       	cpi	r24, 0x22	; 34
 5c6:	41 f4       	brne	.+16     	; 0x5d8 <usbPoll+0x104>
        GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID_REPORT, usbDescriptorHidReport)
 5c8:	86 e2       	ldi	r24, 0x26	; 38
 5ca:	90 e0       	ldi	r25, 0x00	; 0
 5cc:	90 93 89 00 	sts	0x0089, r25
 5d0:	80 93 88 00 	sts	0x0088, r24
 5d4:	24 e4       	ldi	r18, 0x44	; 68
 5d6:	01 c0       	rjmp	.+2      	; 0x5da <usbPoll+0x106>
 5d8:	20 e0       	ldi	r18, 0x00	; 0
    SWITCH_DEFAULT
        if(USB_CFG_DESCR_PROPS_UNKNOWN & USB_PROP_IS_DYNAMIC){
            len = usbFunctionDescriptor(rq);
        }
    SWITCH_END
    usbMsgFlags = flags;
 5da:	80 e4       	ldi	r24, 0x40	; 64
 5dc:	80 93 68 00 	sts	0x0068, r24
 5e0:	1b c0       	rjmp	.+54     	; 0x618 <usbPoll+0x144>
        usbNewDeviceAddr = value;
        USB_SET_ADDRESS_HOOK();
    SWITCH_CASE(USBRQ_GET_DESCRIPTOR)       /* 6 */
        len = usbDriverDescriptor(rq);
        goto skipMsgPtrAssignment;
    SWITCH_CASE(USBRQ_GET_CONFIGURATION)    /* 8 */
 5e2:	88 30       	cpi	r24, 0x08	; 8
 5e4:	21 f4       	brne	.+8      	; 0x5ee <usbPoll+0x11a>
 5e6:	21 e0       	ldi	r18, 0x01	; 1
 5e8:	8d e8       	ldi	r24, 0x8D	; 141
 5ea:	90 e0       	ldi	r25, 0x00	; 0
 5ec:	11 c0       	rjmp	.+34     	; 0x610 <usbPoll+0x13c>
        dataPtr = &usbConfiguration;  /* send current configuration value */
        len = 1;
    SWITCH_CASE(USBRQ_SET_CONFIGURATION)    /* 9 */
 5ee:	89 30       	cpi	r24, 0x09	; 9
 5f0:	19 f4       	brne	.+6      	; 0x5f8 <usbPoll+0x124>
        usbConfiguration = value;
 5f2:	90 93 8d 00 	sts	0x008D, r25
 5f6:	09 c0       	rjmp	.+18     	; 0x60a <usbPoll+0x136>
        usbResetStall();
    SWITCH_CASE(USBRQ_GET_INTERFACE)        /* 10 */
 5f8:	8a 30       	cpi	r24, 0x0A	; 10
 5fa:	11 f4       	brne	.+4      	; 0x600 <usbPoll+0x12c>
 5fc:	21 e0       	ldi	r18, 0x01	; 1
 5fe:	06 c0       	rjmp	.+12     	; 0x60c <usbPoll+0x138>
        len = 1;
#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE
    SWITCH_CASE(USBRQ_SET_INTERFACE)        /* 11 */
 600:	8b 30       	cpi	r24, 0x0B	; 11
 602:	19 f4       	brne	.+6      	; 0x60a <usbPoll+0x136>
/* ------------------------------------------------------------------------- */

static inline void  usbResetDataToggling(void)
{
#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE
    USB_SET_DATATOKEN1(USB_INITIAL_DATATOKEN);  /* reset data toggling for interrupt endpoint */
 604:	8b e4       	ldi	r24, 0x4B	; 75
 606:	80 93 7a 00 	sts	0x007A, r24
 60a:	20 e0       	ldi	r18, 0x00	; 0
 60c:	87 e7       	ldi	r24, 0x77	; 119
 60e:	90 e0       	ldi	r25, 0x00	; 0
        usbResetStall();
#endif
    SWITCH_DEFAULT                          /* 7=SET_DESCRIPTOR, 12=SYNC_FRAME */
        /* Should we add an optional hook here? */
    SWITCH_END
    usbMsgPtr = dataPtr;
 610:	90 93 89 00 	sts	0x0089, r25
 614:	80 93 88 00 	sts	0x0088, r24
            }
            usbMsgFlags = USB_FLG_USE_USER_RW;
        }else   /* The 'else' prevents that we limit a replyLen of USB_NO_MSG to the maximum transfer len. */
#endif
        if(sizeof(replyLen) < sizeof(rq->wLength.word)){ /* help compiler with optimizing */
            if(!rq->wLength.bytes[1] && replyLen > rq->wLength.bytes[0])    /* limit length to max */
 618:	8f 81       	ldd	r24, Y+7	; 0x07
 61a:	88 23       	and	r24, r24
 61c:	21 f4       	brne	.+8      	; 0x626 <usbPoll+0x152>
 61e:	8e 81       	ldd	r24, Y+6	; 0x06
 620:	82 17       	cp	r24, r18
 622:	08 f4       	brcc	.+2      	; 0x626 <usbPoll+0x152>
 624:	28 2f       	mov	r18, r24
                replyLen = rq->wLength.bytes[0];
        }else{
            if(replyLen > rq->wLength.word)     /* limit length to max */
                replyLen = rq->wLength.word;
        }
        usbMsgLen = replyLen;
 626:	20 93 61 00 	sts	0x0061, r18
        usbProcessRx(usbRxBuf + USB_BUFSIZE + 1 - usbInputBufOffset, len);
#if USB_CFG_HAVE_FLOWCONTROL
        if(usbRxLen > 0)    /* only mark as available if not inactivated */
            usbRxLen = 0;
#else
        usbRxLen = 0;       /* mark rx buffer as available */
 62a:	10 92 8a 00 	sts	0x008A, r1
#endif
    }
    if(usbTxLen & 0x10){    /* transmit system idle */
 62e:	80 91 60 00 	lds	r24, 0x0060
 632:	84 ff       	sbrs	r24, 4
 634:	49 c0       	rjmp	.+146    	; 0x6c8 <usbPoll+0x1f4>
        if(usbMsgLen != USB_NO_MSG){    /* transmit data pending? */
 636:	80 91 61 00 	lds	r24, 0x0061
 63a:	8f 3f       	cpi	r24, 0xFF	; 255
 63c:	09 f4       	brne	.+2      	; 0x640 <usbPoll+0x16c>
 63e:	44 c0       	rjmp	.+136    	; 0x6c8 <usbPoll+0x1f4>
 640:	18 2f       	mov	r17, r24
 642:	89 30       	cpi	r24, 0x09	; 9
 644:	08 f0       	brcs	.+2      	; 0x648 <usbPoll+0x174>
 646:	18 e0       	ldi	r17, 0x08	; 8
uchar       len;

    wantLen = usbMsgLen;
    if(wantLen > 8)
        wantLen = 8;
    usbMsgLen -= wantLen;
 648:	81 1b       	sub	r24, r17
 64a:	80 93 61 00 	sts	0x0061, r24
    usbTxBuf[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* DATA toggling */
 64e:	80 91 6e 00 	lds	r24, 0x006E
 652:	98 e8       	ldi	r25, 0x88	; 136
 654:	89 27       	eor	r24, r25
 656:	80 93 6e 00 	sts	0x006E, r24
/* This function is similar to usbFunctionRead(), but it's also called for
 * data handled automatically by the driver (e.g. descriptor reads).
 */
static uchar usbDeviceRead(uchar *data, uchar len)
{
    if(len > 0){    /* don't bother app with 0 sized reads */
 65a:	11 23       	and	r17, r17
 65c:	41 f1       	breq	.+80     	; 0x6ae <usbPoll+0x1da>
        if(usbMsgFlags & USB_FLG_USE_USER_RW){
            len = usbFunctionRead(data, len);
        }else
#endif
        {
            uchar i = len, *r = usbMsgPtr;
 65e:	20 91 88 00 	lds	r18, 0x0088
 662:	30 91 89 00 	lds	r19, 0x0089
            if(usbMsgFlags & USB_FLG_MSGPTR_IS_ROM){    /* ROM data */
 666:	80 91 68 00 	lds	r24, 0x0068
 66a:	86 ff       	sbrs	r24, 6
 66c:	0d c0       	rjmp	.+26     	; 0x688 <usbPoll+0x1b4>
 66e:	af e6       	ldi	r26, 0x6F	; 111
 670:	b0 e0       	ldi	r27, 0x00	; 0
 672:	80 e0       	ldi	r24, 0x00	; 0
 674:	90 e0       	ldi	r25, 0x00	; 0
                do{
                    uchar c = USB_READ_FLASH(r);    /* assign to char size variable to enforce byte ops */
 676:	f9 01       	movw	r30, r18
 678:	e8 0f       	add	r30, r24
 67a:	f9 1f       	adc	r31, r25
 67c:	e4 91       	lpm	r30, Z+
                    *data++ = c;
 67e:	ed 93       	st	X+, r30
 680:	01 96       	adiw	r24, 0x01	; 1
                    r++;
                }while(--i);
 682:	18 17       	cp	r17, r24
 684:	c1 f7       	brne	.-16     	; 0x676 <usbPoll+0x1a2>
 686:	08 c0       	rjmp	.+16     	; 0x698 <usbPoll+0x1c4>
 688:	91 2f       	mov	r25, r17
 68a:	d9 01       	movw	r26, r18
 68c:	ef e6       	ldi	r30, 0x6F	; 111
 68e:	f0 e0       	ldi	r31, 0x00	; 0
            }else{  /* RAM data */
                do{
                    *data++ = *r++;
 690:	8d 91       	ld	r24, X+
 692:	81 93       	st	Z+, r24
                }while(--i);
 694:	91 50       	subi	r25, 0x01	; 1
 696:	e1 f7       	brne	.-8      	; 0x690 <usbPoll+0x1bc>
 698:	11 50       	subi	r17, 0x01	; 1
 69a:	81 2f       	mov	r24, r17
 69c:	90 e0       	ldi	r25, 0x00	; 0
 69e:	1f 5f       	subi	r17, 0xFF	; 255
 6a0:	01 96       	adiw	r24, 0x01	; 1
 6a2:	82 0f       	add	r24, r18
 6a4:	93 1f       	adc	r25, r19
            }
            usbMsgPtr = r;
 6a6:	90 93 89 00 	sts	0x0089, r25
 6aa:	80 93 88 00 	sts	0x0088, r24
        wantLen = 8;
    usbMsgLen -= wantLen;
    usbTxBuf[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* DATA toggling */
    len = usbDeviceRead(usbTxBuf + 1, wantLen);
    if(len <= 8){           /* valid data packet */
        usbCrc16Append(&usbTxBuf[1], len);
 6ae:	8f e6       	ldi	r24, 0x6F	; 111
 6b0:	90 e0       	ldi	r25, 0x00	; 0
 6b2:	61 2f       	mov	r22, r17
 6b4:	dd dd       	rcall	.-1094   	; 0x270 <usbCrc16Append>
        len += 4;           /* length including sync byte */
 6b6:	61 2f       	mov	r22, r17
 6b8:	6c 5f       	subi	r22, 0xFC	; 252
        if(len < 12)        /* a partial package identifies end of message */
 6ba:	6c 30       	cpi	r22, 0x0C	; 12
 6bc:	19 f0       	breq	.+6      	; 0x6c4 <usbPoll+0x1f0>
            usbMsgLen = USB_NO_MSG;
 6be:	8f ef       	ldi	r24, 0xFF	; 255
 6c0:	80 93 61 00 	sts	0x0061, r24
    }else{
        len = USBPID_STALL;   /* stall the endpoint */
        usbMsgLen = USB_NO_MSG;
    }
    usbTxLen = len;
 6c4:	60 93 60 00 	sts	0x0060, r22
 6c8:	94 e1       	ldi	r25, 0x14	; 20
        if(usbMsgLen != USB_NO_MSG){    /* transmit data pending? */
            usbBuildTxBlock();
        }
    }
    for(i = 20; i > 0; i--){
        uchar usbLineStatus = USBIN & USBMASK;
 6ca:	80 b3       	in	r24, 0x10	; 16
        if(usbLineStatus != 0)  /* SE0 has ended */
 6cc:	84 71       	andi	r24, 0x14	; 20
 6ce:	31 f4       	brne	.+12     	; 0x6dc <usbPoll+0x208>
    if(usbTxLen & 0x10){    /* transmit system idle */
        if(usbMsgLen != USB_NO_MSG){    /* transmit data pending? */
            usbBuildTxBlock();
        }
    }
    for(i = 20; i > 0; i--){
 6d0:	91 50       	subi	r25, 0x01	; 1
 6d2:	d9 f7       	brne	.-10     	; 0x6ca <usbPoll+0x1f6>
        uchar usbLineStatus = USBIN & USBMASK;
        if(usbLineStatus != 0)  /* SE0 has ended */
            goto isNotReset;
    }
    /* RESET condition, called multiple times during reset */
    usbNewDeviceAddr = 0;
 6d4:	10 92 8b 00 	sts	0x008B, r1
    usbDeviceAddr = 0;
 6d8:	10 92 85 00 	sts	0x0085, r1
    usbResetStall();
    DBG1(0xff, 0, 0);
isNotReset:
    usbHandleResetHook(i);
}
 6dc:	df 91       	pop	r29
 6de:	cf 91       	pop	r28
 6e0:	1f 91       	pop	r17
 6e2:	08 95       	ret

000006e4 <usbSetInterrupt>:
    txStatus->len = len + 4;    /* len must be given including sync byte */
    DBG2(0x21 + (((int)txStatus >> 3) & 3), txStatus->buffer, len + 3);
}

USB_PUBLIC void usbSetInterrupt(uchar *data, uchar len)
{
 6e4:	1f 93       	push	r17
 6e6:	dc 01       	movw	r26, r24
 6e8:	16 2f       	mov	r17, r22

#if USB_CFG_IMPLEMENT_HALT
    if(usbTxLen1 == USBPID_STALL)
        return;
#endif
    if(txStatus->len & 0x10){   /* packet buffer was empty */
 6ea:	80 91 79 00 	lds	r24, 0x0079
 6ee:	84 ff       	sbrs	r24, 4
 6f0:	07 c0       	rjmp	.+14     	; 0x700 <usbSetInterrupt+0x1c>
        txStatus->buffer[0] ^= USBPID_DATA0 ^ USBPID_DATA1; /* toggle token */
 6f2:	80 91 7a 00 	lds	r24, 0x007A
 6f6:	98 e8       	ldi	r25, 0x88	; 136
 6f8:	89 27       	eor	r24, r25
 6fa:	80 93 7a 00 	sts	0x007A, r24
 6fe:	03 c0       	rjmp	.+6      	; 0x706 <usbSetInterrupt+0x22>
    }else{
        txStatus->len = USBPID_NAK; /* avoid sending outdated (overwritten) interrupt data */
 700:	8a e5       	ldi	r24, 0x5A	; 90
 702:	80 93 79 00 	sts	0x0079, r24
 706:	91 2f       	mov	r25, r17
 708:	eb e7       	ldi	r30, 0x7B	; 123
 70a:	f0 e0       	ldi	r31, 0x00	; 0
    }
    p = txStatus->buffer + 1;
    i = len;
    do{                         /* if len == 0, we still copy 1 byte, but that's no problem */
        *p++ = *data++;
 70c:	8d 91       	ld	r24, X+
 70e:	81 93       	st	Z+, r24
    }while(--i > 0);            /* loop control at the end is 2 bytes shorter than at beginning */
 710:	91 50       	subi	r25, 0x01	; 1
 712:	e1 f7       	brne	.-8      	; 0x70c <usbSetInterrupt+0x28>
    usbCrc16Append(&txStatus->buffer[1], len);
 714:	8b e7       	ldi	r24, 0x7B	; 123
 716:	90 e0       	ldi	r25, 0x00	; 0
 718:	61 2f       	mov	r22, r17
 71a:	aa dd       	rcall	.-1196   	; 0x270 <usbCrc16Append>
    txStatus->len = len + 4;    /* len must be given including sync byte */
 71c:	1c 5f       	subi	r17, 0xFC	; 252
 71e:	10 93 79 00 	sts	0x0079, r17
}

USB_PUBLIC void usbSetInterrupt(uchar *data, uchar len)
{
    usbGenericSetInterrupt(data, len, &usbTxStatus1);
}
 722:	1f 91       	pop	r17
 724:	08 95       	ret

00000726 <adc_init>:
** inputs: 	none
** outputs: none
** ---------------------------------------------------------------------
*/
void adc_init(enum AREF_t AREF)
{
 726:	98 2f       	mov	r25, r24

	prescaler = (F_CPU / 200) / kHz;

	for (i=7; prescaler < (1<<i); i--);
	
	ADCSRA |= ((1<<ADEN) | i);
 728:	86 b1       	in	r24, 0x06	; 6
 72a:	86 68       	ori	r24, 0x86	; 134
 72c:	86 b9       	out	0x06, r24	; 6
	ADMUX|=(1<<REFS0)|(1<<REFS1);
 72e:	87 b1       	in	r24, 0x07	; 7
 730:	80 6c       	ori	r24, 0xC0	; 192
 732:	87 b9       	out	0x07, r24	; 7

	switch (AREF)
 734:	91 30       	cpi	r25, 0x01	; 1
 736:	49 f0       	breq	.+18     	; 0x74a <adc_init+0x24>
 738:	91 30       	cpi	r25, 0x01	; 1
 73a:	18 f0       	brcs	.+6      	; 0x742 <adc_init+0x1c>
 73c:	92 30       	cpi	r25, 0x02	; 2
 73e:	59 f4       	brne	.+22     	; 0x756 <adc_init+0x30>
 740:	07 c0       	rjmp	.+14     	; 0x750 <adc_init+0x2a>
	{
		case INTERNAL:
			ADMUX |= (1 << REFS1) | (1 << REFS0);
 742:	87 b1       	in	r24, 0x07	; 7
 744:	80 6c       	ori	r24, 0xC0	; 192
 746:	87 b9       	out	0x07, r24	; 7
 748:	08 95       	ret
			break;
		case EXT_AVCC:
			ADMUX |= (1 << REFS0);
 74a:	3e 9a       	sbi	0x07, 6	; 7
			ADMUX &= ~(1 << REFS1); 
 74c:	3f 98       	cbi	0x07, 7	; 7
 74e:	08 95       	ret
			break;
		case EXT_VREF:
			ADMUX &= ~((1 << REFS1) | (1 << REFS0)); 
 750:	87 b1       	in	r24, 0x07	; 7
 752:	8f 73       	andi	r24, 0x3F	; 63
 754:	87 b9       	out	0x07, r24	; 7
 756:	08 95       	ret

00000758 <adc_get>:
*/
unsigned int adc_get(unsigned char ADCx)
{
	unsigned int ADCval = 0;
	
	ADMUX &= 0b11100000;
 758:	97 b1       	in	r25, 0x07	; 7
 75a:	90 7e       	andi	r25, 0xE0	; 224
 75c:	97 b9       	out	0x07, r25	; 7
	ADMUX |= ADCx;
 75e:	97 b1       	in	r25, 0x07	; 7
 760:	98 2b       	or	r25, r24
 762:	97 b9       	out	0x07, r25	; 7
	ADCSRA |= (1<<ADSC);
 764:	36 9a       	sbi	0x06, 6	; 6
	while(!(ADCSRA & (1<<ADIF)));
 766:	34 9b       	sbis	0x06, 4	; 6
 768:	fe cf       	rjmp	.-4      	; 0x766 <adc_get+0xe>
	ADCval = ADC;
 76a:	24 b1       	in	r18, 0x04	; 4
 76c:	35 b1       	in	r19, 0x05	; 5

	return(ADCval);	
}
 76e:	c9 01       	movw	r24, r18
 770:	08 95       	ret

00000772 <adc_stop>:
** outputs: none
** ---------------------------------------------------------------------
*/
void adc_stop(void)
{
	ADCSRA &= ~(1<<ADEN);		
 772:	37 98       	cbi	0x06, 7	; 6
}
 774:	08 95       	ret

00000776 <adc_set_diff>:
** outputs: none
** ---------------------------------------------------------------------
*/
void adc_set_diff(unsigned char ADCx)
{
	ADMUX &= 0b11100000;
 776:	97 b1       	in	r25, 0x07	; 7
 778:	90 7e       	andi	r25, 0xE0	; 224
 77a:	97 b9       	out	0x07, r25	; 7
	ADMUX |= (16 + ADCx);
 77c:	97 b1       	in	r25, 0x07	; 7
 77e:	80 5f       	subi	r24, 0xF0	; 240
 780:	89 2b       	or	r24, r25
 782:	87 b9       	out	0x07, r24	; 7
 784:	80 e9       	ldi	r24, 0x90	; 144
 786:	91 e0       	ldi	r25, 0x01	; 1
 788:	01 97       	sbiw	r24, 0x01	; 1
 78a:	f1 f7       	brne	.-4      	; 0x788 <adc_set_diff+0x12>
	_delay_us(100);
}
 78c:	08 95       	ret

0000078e <adc_get_diff>:
*/
unsigned int adc_get_diff(void)
{
	unsigned int ADCval = 0;
	
	ADCSRA |= (1<<ADSC);
 78e:	36 9a       	sbi	0x06, 6	; 6
	while(!(1<<ADIF == (ADCSRA & 1<<ADIF)));
 790:	34 9b       	sbis	0x06, 4	; 6
 792:	fe cf       	rjmp	.-4      	; 0x790 <adc_get_diff+0x2>
	ADCval = ADC;
 794:	24 b1       	in	r18, 0x04	; 4
 796:	35 b1       	in	r19, 0x05	; 5

	return(ADCval);	
}
 798:	c9 01       	movw	r24, r18
 79a:	08 95       	ret

0000079c <adc_set_diff_1_0_gain>:
** inputs: 	gain enum (g10 or g200)
** outputs: none
** ---------------------------------------------------------------------
*/
void adc_set_diff_1_0_gain(enum GAIN_t gain)
{
 79c:	98 2f       	mov	r25, r24
	ADMUX &= 0b11100000;
 79e:	87 b1       	in	r24, 0x07	; 7
 7a0:	80 7e       	andi	r24, 0xE0	; 224
 7a2:	87 b9       	out	0x07, r24	; 7
	
	switch (gain)
 7a4:	9a 30       	cpi	r25, 0x0A	; 10
 7a6:	19 f0       	breq	.+6      	; 0x7ae <adc_set_diff_1_0_gain+0x12>
 7a8:	98 3c       	cpi	r25, 0xC8	; 200
 7aa:	39 f4       	brne	.+14     	; 0x7ba <adc_set_diff_1_0_gain+0x1e>
 7ac:	03 c0       	rjmp	.+6      	; 0x7b4 <adc_set_diff_1_0_gain+0x18>
	{
	case g10: 
		ADMUX |= (8 | (1<<MUX0));
 7ae:	87 b1       	in	r24, 0x07	; 7
 7b0:	89 60       	ori	r24, 0x09	; 9
 7b2:	02 c0       	rjmp	.+4      	; 0x7b8 <adc_set_diff_1_0_gain+0x1c>
		break;
	case g200:
		ADMUX |= (8 | (1<<MUX1) | (1<<MUX0));
 7b4:	87 b1       	in	r24, 0x07	; 7
 7b6:	8b 60       	ori	r24, 0x0B	; 11
 7b8:	87 b9       	out	0x07, r24	; 7
 7ba:	88 ec       	ldi	r24, 0xC8	; 200
 7bc:	90 e0       	ldi	r25, 0x00	; 0
 7be:	01 97       	sbiw	r24, 0x01	; 1
 7c0:	f1 f7       	brne	.-4      	; 0x7be <adc_set_diff_1_0_gain+0x22>
		break;
	}
	_delay_us(50);
		
}
 7c2:	08 95       	ret

000007c4 <adc_diff_1_0_gain>:
*/
unsigned int adc_diff_1_0_gain(void)
{
	unsigned int ADCval = 0;
	
	ADCSRA |= (1<<ADSC);
 7c4:	36 9a       	sbi	0x06, 6	; 6
	while(!(1<<ADIF == (ADCSRA & 1<<ADIF)));
 7c6:	34 9b       	sbis	0x06, 4	; 6
 7c8:	fe cf       	rjmp	.-4      	; 0x7c6 <adc_diff_1_0_gain+0x2>
	ADCval = ADC;
 7ca:	24 b1       	in	r18, 0x04	; 4
 7cc:	35 b1       	in	r19, 0x05	; 5

	return(ADCval);	
}
 7ce:	c9 01       	movw	r24, r18
 7d0:	08 95       	ret

000007d2 <keyb_init>:
** inputs: 	enum PULL_UP_t PULL_UP
** outputs: none
** ---------------------------------------------------------------------
*/
void keyb_init(enum PULL_UP_t PULL_UP)
{
 7d2:	58 2f       	mov	r21, r24
 7d4:	40 e0       	ldi	r20, 0x00	; 0
 7d6:	20 e0       	ldi	r18, 0x00	; 0
 7d8:	30 e0       	ldi	r19, 0x00	; 0
	unsigned char i;
	unsigned char pom = 0x00;
	
	for(i=FISRT_PIN; i<NUMBER_OF_KEYS; i++)
	{
		pom |= (1<<i); 	
 7da:	61 e0       	ldi	r22, 0x01	; 1
 7dc:	70 e0       	ldi	r23, 0x00	; 0
 7de:	cb 01       	movw	r24, r22
 7e0:	02 2e       	mov	r0, r18
 7e2:	02 c0       	rjmp	.+4      	; 0x7e8 <keyb_init+0x16>
 7e4:	88 0f       	add	r24, r24
 7e6:	99 1f       	adc	r25, r25
 7e8:	0a 94       	dec	r0
 7ea:	e2 f7       	brpl	.-8      	; 0x7e4 <keyb_init+0x12>
 7ec:	48 2b       	or	r20, r24
 7ee:	2f 5f       	subi	r18, 0xFF	; 255
 7f0:	3f 4f       	sbci	r19, 0xFF	; 255
void keyb_init(enum PULL_UP_t PULL_UP)
{
	unsigned char i;
	unsigned char pom = 0x00;
	
	for(i=FISRT_PIN; i<NUMBER_OF_KEYS; i++)
 7f2:	24 30       	cpi	r18, 0x04	; 4
 7f4:	31 05       	cpc	r19, r1
 7f6:	99 f7       	brne	.-26     	; 0x7de <keyb_init+0xc>
	{
		pom |= (1<<i); 	
	}

	KEYB_DDR &= ~(pom);		// zeros to place, what should be input pin
 7f8:	87 b3       	in	r24, 0x17	; 23
 7fa:	94 2f       	mov	r25, r20
 7fc:	90 95       	com	r25
 7fe:	89 23       	and	r24, r25
 800:	87 bb       	out	0x17, r24	; 23

	switch (PULL_UP)
 802:	55 23       	and	r21, r21
 804:	19 f0       	breq	.+6      	; 0x80c <keyb_init+0x3a>
 806:	51 30       	cpi	r21, 0x01	; 1
 808:	41 f4       	brne	.+16     	; 0x81a <keyb_init+0x48>
 80a:	04 c0       	rjmp	.+8      	; 0x814 <keyb_init+0x42>
	{
	case PULLUP_YES:
		KEYB_PORT |= pom;
 80c:	88 b3       	in	r24, 0x18	; 24
 80e:	48 2b       	or	r20, r24
 810:	48 bb       	out	0x18, r20	; 24
 812:	08 95       	ret
		break;
	case PULLUP_NO:
		KEYB_PORT &= ~(pom);
 814:	88 b3       	in	r24, 0x18	; 24
 816:	98 23       	and	r25, r24
 818:	98 bb       	out	0x18, r25	; 24
 81a:	08 95       	ret

0000081c <keyb_pushed>:
*/
unsigned char keyb_pushed(void)
{
	unsigned char buttons = 0;

	buttons = ~(KEYB_PIN);
 81c:	86 b3       	in	r24, 0x16	; 22

	return(buttons);
}
 81e:	80 95       	com	r24
 820:	08 95       	ret

00000822 <_exit>:
 822:	f8 94       	cli

00000824 <__stop_program>:
 824:	ff cf       	rjmp	.-2      	; 0x824 <__stop_program>
