
USB10.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .data         00000018  00800100  000019c8  00001a3c  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  1 .text         000019c8  00000000  00000000  00000074  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .bss          00000095  00800118  000019e0  00001a54  2**0
                  ALLOC
  3 .debug_aranges 00000380  00000000  00000000  00001a54  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_pubnames 000008d0  00000000  00000000  00001dd4  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   000036b5  00000000  00000000  000026a4  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_abbrev 0000136e  00000000  00000000  00005d59  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_line   000032d3  00000000  00000000  000070c7  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_frame  00000540  00000000  00000000  0000a39c  2**2
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_str    00001534  00000000  00000000  0000a8dc  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_loc    000013d8  00000000  00000000  0000be10  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_ranges 000003e8  00000000  00000000  0000d1e8  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <__vectors>:

}


void uart_puts ( const char * s )
{
       0:	b7 c0       	rjmp	.+366    	; 0x170 <__ctors_end>
	
	Delay(I2C_PERIOD);
}

void Delay(uint8_t delay)
{
       2:	00 00       	nop

volatile SchedulerDelayCounter_t Scheduler_TickCounter;
volatile uint8_t                 Scheduler_TotalTasks;

bool Scheduler_HasDelayElapsed(const uint16_t Delay, SchedulerDelayCounter_t* const DelayCounter)
{
       4:	d1 c0       	rjmp	.+418    	; 0x1a8 <__bad_interrupt>
	
	Endpoint_AllocateMemory();
}

void Endpoint_ClearEndpoints(void)
{
       6:	00 00       	nop
       8:	cf c0       	rjmp	.+414    	; 0x1a8 <__bad_interrupt>
       a:	00 00       	nop
       c:	cd c0       	rjmp	.+410    	; 0x1a8 <__bad_interrupt>
       e:	00 00       	nop
      10:	cb c0       	rjmp	.+406    	; 0x1a8 <__bad_interrupt>
      12:	00 00       	nop
      14:	c9 c0       	rjmp	.+402    	; 0x1a8 <__bad_interrupt>
      16:	00 00       	nop
      18:	c7 c0       	rjmp	.+398    	; 0x1a8 <__bad_interrupt>
      1a:	00 00       	nop
      1c:	c5 c0       	rjmp	.+394    	; 0x1a8 <__bad_interrupt>
      1e:	00 00       	nop
      20:	c3 c0       	rjmp	.+390    	; 0x1a8 <__bad_interrupt>
      22:	00 00       	nop
      24:	c1 c0       	rjmp	.+386    	; 0x1a8 <__bad_interrupt>
      26:	00 00       	nop
      28:	bf c0       	rjmp	.+382    	; 0x1a8 <__bad_interrupt>
      2a:	00 00       	nop
      2c:	0c 94 05 0c 	jmp	0x180a	; 0x180a <__vector_11>
      30:	bb c0       	rjmp	.+374    	; 0x1a8 <__bad_interrupt>
      32:	00 00       	nop
      34:	b9 c0       	rjmp	.+370    	; 0x1a8 <__bad_interrupt>
      36:	00 00       	nop
      38:	b7 c0       	rjmp	.+366    	; 0x1a8 <__bad_interrupt>
      3a:	00 00       	nop
      3c:	b5 c0       	rjmp	.+362    	; 0x1a8 <__bad_interrupt>
      3e:	00 00       	nop
      40:	b3 c0       	rjmp	.+358    	; 0x1a8 <__bad_interrupt>
      42:	00 00       	nop
      44:	b1 c0       	rjmp	.+354    	; 0x1a8 <__bad_interrupt>
      46:	00 00       	nop
      48:	af c0       	rjmp	.+350    	; 0x1a8 <__bad_interrupt>
      4a:	00 00       	nop
      4c:	ad c0       	rjmp	.+346    	; 0x1a8 <__bad_interrupt>
      4e:	00 00       	nop
      50:	ab c0       	rjmp	.+342    	; 0x1a8 <__bad_interrupt>
      52:	00 00       	nop
      54:	a9 c0       	rjmp	.+338    	; 0x1a8 <__bad_interrupt>
      56:	00 00       	nop
      58:	a7 c0       	rjmp	.+334    	; 0x1a8 <__bad_interrupt>
      5a:	00 00       	nop
      5c:	8b c1       	rjmp	.+790    	; 0x374 <__vector_23>
      5e:	00 00       	nop
      60:	a3 c0       	rjmp	.+326    	; 0x1a8 <__bad_interrupt>
      62:	00 00       	nop
      64:	da c0       	rjmp	.+436    	; 0x21a <__vector_25>
      66:	00 00       	nop
      68:	9f c0       	rjmp	.+318    	; 0x1a8 <__bad_interrupt>
      6a:	00 00       	nop
      6c:	9d c0       	rjmp	.+314    	; 0x1a8 <__bad_interrupt>
      6e:	00 00       	nop
      70:	9b c0       	rjmp	.+310    	; 0x1a8 <__bad_interrupt>
      72:	00 00       	nop

00000074 <MYSTRING>:
      74:	49 27 6d 20 69 6e 20 46 6c 61 73 68 00              I'm in Flash.

00000081 <__c.2389>:
      81:	0d 0a 53 4f 43 20 52 6f 62 6f 74 69 63 73 20 48     ..SOC Robotics H
      91:	65 6c 70 20 47 75 69 64 65 2e 0d 0a 2e 2e 2e 2e     elp Guide.......
      a1:	2e 2e 2e 2e 41 73 6b 20 53 74 65 76 65 3f 00        ....Ask Steve?.

000000b0 <__c.2281>:
      b0:	53 4f 43 20 52 6f 62 6f 74 69 63 73 20 55 53 42     SOC Robotics USB
      c0:	31 30 2c 20 28 63 29 20 32 30 30 38 0d 0a 0d 0a     10, (c) 2008....
      d0:	00                                                  .

000000d1 <DeviceDescriptor>:
      d1:	12 01 10 01 02 00 00 08 eb 03 4b 20 00 00 01 02     ..........K ....
      e1:	00 01                                               ..

000000e3 <ConfigurationDescriptor>:
      e3:	09 02 43 00 02 01 00 c0 32 09 04 00 00 01 02 02     ..C.....2.......
      f3:	01 00 05 24 00 01 10 05 24 01 03 01 04 24 02 06     ...$....$....$..
     103:	05 24 06 00 01 07 05 82 03 08 00 ff 09 04 01 00     .$..............
     113:	02 0a 00 00 00 07 05 04 02 10 00 00 07 05 83 02     ................
     123:	10 00 00                                            ...

00000126 <LanguageString>:
     126:	04 03 09 04                                         ....

0000012a <ManufacturerString>:
     12a:	18 03 44 00 65 00 61 00 6e 00 20 00 43 00 61 00     ..D.e.a.n. .C.a.
     13a:	6d 00 65 00 72 00 61 00 00 00                       m.e.r.a...

00000144 <ProductString>:
     144:	2a 03 4d 00 79 00 55 00 53 00 42 00 20 00 55 00     *.M.y.U.S.B. .U.
     154:	53 00 42 00 2d 00 52 00 53 00 32 00 33 00 32 00     S.B.-.R.S.2.3.2.
     164:	20 00 44 00 65 00 6d 00 6f 00 00 00                  .D.e.m.o...

00000170 <__ctors_end>:
     170:	11 24       	eor	r1, r1
     172:	1f be       	out	0x3f, r1	; 63
     174:	cf ef       	ldi	r28, 0xFF	; 255
     176:	d2 e0       	ldi	r29, 0x02	; 2
     178:	de bf       	out	0x3e, r29	; 62
     17a:	cd bf       	out	0x3d, r28	; 61

0000017c <__do_copy_data>:
     17c:	11 e0       	ldi	r17, 0x01	; 1
     17e:	a0 e0       	ldi	r26, 0x00	; 0
     180:	b1 e0       	ldi	r27, 0x01	; 1
     182:	e8 ec       	ldi	r30, 0xC8	; 200
     184:	f9 e1       	ldi	r31, 0x19	; 25
     186:	02 c0       	rjmp	.+4      	; 0x18c <.do_copy_data_start>

00000188 <.do_copy_data_loop>:
     188:	05 90       	lpm	r0, Z+
     18a:	0d 92       	st	X+, r0

0000018c <.do_copy_data_start>:
     18c:	a8 31       	cpi	r26, 0x18	; 24
     18e:	b1 07       	cpc	r27, r17
     190:	d9 f7       	brne	.-10     	; 0x188 <.do_copy_data_loop>

00000192 <__do_clear_bss>:
     192:	11 e0       	ldi	r17, 0x01	; 1
     194:	a8 e1       	ldi	r26, 0x18	; 24
     196:	b1 e0       	ldi	r27, 0x01	; 1
     198:	01 c0       	rjmp	.+2      	; 0x19c <.do_clear_bss_start>

0000019a <.do_clear_bss_loop>:
     19a:	1d 92       	st	X+, r1

0000019c <.do_clear_bss_start>:
     19c:	ad 3a       	cpi	r26, 0xAD	; 173
     19e:	b1 07       	cpc	r27, r17
     1a0:	e1 f7       	brne	.-8      	; 0x19a <.do_clear_bss_loop>
     1a2:	f4 d3       	rcall	.+2024   	; 0x98c <main>
     1a4:	0c 94 e2 0c 	jmp	0x19c4	; 0x19c4 <_exit>

000001a8 <__bad_interrupt>:
     1a8:	2b cf       	rjmp	.-426    	; 0x0 <__vectors>

000001aa <ReconfigureUSART>:
		Buffer_StoreElementOnTop(&Tx_Buffer, UDR1);
	}
}

void ReconfigureUSART(void)
{
     1aa:	80 91 13 01 	lds	r24, 0x0113
     1ae:	81 30       	cpi	r24, 0x01	; 1
     1b0:	11 f4       	brne	.+4      	; 0x1b6 <ReconfigureUSART+0xc>
     1b2:	90 e3       	ldi	r25, 0x30	; 48
     1b4:	05 c0       	rjmp	.+10     	; 0x1c0 <ReconfigureUSART+0x16>
	uint8_t ConfigMask = 0;

	/* Determine parity - non odd/even parity mode defaults to no parity */
	if (LineCoding.ParityType == Parity_Odd)
	  ConfigMask = ((1 << UPM11) | (1 << UPM10));
	else if (LineCoding.ParityType == Parity_Even)
     1b6:	82 30       	cpi	r24, 0x02	; 2
     1b8:	11 f4       	brne	.+4      	; 0x1be <ReconfigureUSART+0x14>
     1ba:	90 e2       	ldi	r25, 0x20	; 32
     1bc:	01 c0       	rjmp	.+2      	; 0x1c0 <ReconfigureUSART+0x16>
     1be:	90 e0       	ldi	r25, 0x00	; 0
	  ConfigMask = (1 << UPM11);

	/* Determine stop bits - 1.5 stop bits is set as 1 stop bit due to hardware limitations */
	if (LineCoding.CharFormat == TwoStopBits)
     1c0:	80 91 12 01 	lds	r24, 0x0112
     1c4:	82 30       	cpi	r24, 0x02	; 2
     1c6:	09 f4       	brne	.+2      	; 0x1ca <ReconfigureUSART+0x20>
	  ConfigMask |= (1 << USBS1);
     1c8:	98 60       	ori	r25, 0x08	; 8

	/* Determine data size - 5, 6, 7, or 8 bits are supported */
	if (LineCoding.DataBits == 6)
     1ca:	80 91 14 01 	lds	r24, 0x0114
     1ce:	86 30       	cpi	r24, 0x06	; 6
     1d0:	11 f4       	brne	.+4      	; 0x1d6 <ReconfigureUSART+0x2c>
	  ConfigMask |= (1 << UCSZ10);
     1d2:	92 60       	ori	r25, 0x02	; 2
     1d4:	07 c0       	rjmp	.+14     	; 0x1e4 <ReconfigureUSART+0x3a>
	else if (LineCoding.DataBits == 7)
     1d6:	87 30       	cpi	r24, 0x07	; 7
     1d8:	11 f4       	brne	.+4      	; 0x1de <ReconfigureUSART+0x34>
	  ConfigMask |= (1 << UCSZ11);
     1da:	94 60       	ori	r25, 0x04	; 4
     1dc:	03 c0       	rjmp	.+6      	; 0x1e4 <ReconfigureUSART+0x3a>
	else if (LineCoding.DataBits == 8)
     1de:	88 30       	cpi	r24, 0x08	; 8
     1e0:	09 f4       	brne	.+2      	; 0x1e4 <ReconfigureUSART+0x3a>
	  ConfigMask |= ((1 << UCSZ11) | (1 << UCSZ10));
     1e2:	96 60       	ori	r25, 0x06	; 6

	/* Enable double speed, gives better error percentages at 8MHz */
	UCSR1A = (1 << U2X1);
     1e4:	82 e0       	ldi	r24, 0x02	; 2
     1e6:	80 93 c8 00 	sts	0x00C8, r24

	/* Enable transmit and receive modules and interrupts */
	UCSR1B = ((1 << TXCIE1) | (1 << RXCIE1) | (1 << TXEN1) | (1 << RXEN1));//| (1 << UDRIE1)
     1ea:	88 ed       	ldi	r24, 0xD8	; 216
     1ec:	80 93 c9 00 	sts	0x00C9, r24

	/* Set the USART mode to the mask generated by the Line Coding options */
	UCSR1C = ConfigMask;
     1f0:	90 93 ca 00 	sts	0x00CA, r25

	/* Set the USART baud rate register to the desired baud rate value */
	UBRR1  = MY_SERIAL_2X_UBBRVAL((uint16_t)LineCoding.BaudRateBPS);
     1f4:	20 91 0e 01 	lds	r18, 0x010E
     1f8:	30 91 0f 01 	lds	r19, 0x010F
     1fc:	40 e0       	ldi	r20, 0x00	; 0
     1fe:	50 e0       	ldi	r21, 0x00	; 0
     200:	60 e4       	ldi	r22, 0x40	; 64
     202:	72 e4       	ldi	r23, 0x42	; 66
     204:	8f e0       	ldi	r24, 0x0F	; 15
     206:	90 e0       	ldi	r25, 0x00	; 0
     208:	0e 94 c0 0c 	call	0x1980	; 0x1980 <__udivmodsi4>
     20c:	21 50       	subi	r18, 0x01	; 1
     20e:	30 40       	sbci	r19, 0x00	; 0
     210:	30 93 cd 00 	sts	0x00CD, r19
     214:	20 93 cc 00 	sts	0x00CC, r18
}
     218:	08 95       	ret

0000021a <__vector_25>:
		Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
	}
}

ISR(USART1_TX_vect)
{
     21a:	1f 92       	push	r1
     21c:	0f 92       	push	r0
     21e:	0f b6       	in	r0, 0x3f	; 63
     220:	0f 92       	push	r0
     222:	11 24       	eor	r1, r1
     224:	2f 93       	push	r18
     226:	3f 93       	push	r19
     228:	4f 93       	push	r20
     22a:	5f 93       	push	r21
     22c:	6f 93       	push	r22
     22e:	7f 93       	push	r23
     230:	8f 93       	push	r24
     232:	9f 93       	push	r25
     234:	af 93       	push	r26
     236:	bf 93       	push	r27
     238:	ef 93       	push	r30
     23a:	ff 93       	push	r31
	/* Send next character if avaliable */
	if (Rx_Buffer.Elements != 0 && mode == SERIAL)
     23c:	80 91 a4 01 	lds	r24, 0x01A4
     240:	88 23       	and	r24, r24
     242:	51 f0       	breq	.+20     	; 0x258 <__vector_25+0x3e>
     244:	80 91 1a 01 	lds	r24, 0x011A
     248:	81 30       	cpi	r24, 0x01	; 1
     24a:	31 f4       	brne	.+12     	; 0x258 <__vector_25+0x3e>
	{
		UDR1 = Buffer_GetElementFromBottom(&Rx_Buffer);
     24c:	80 e6       	ldi	r24, 0x60	; 96
     24e:	91 e0       	ldi	r25, 0x01	; 1
     250:	86 d4       	rcall	.+2316   	; 0xb5e <Buffer_GetElementFromBottom>
     252:	80 93 ce 00 	sts	0x00CE, r24
     256:	02 c0       	rjmp	.+4      	; 0x25c <__vector_25+0x42>
	}
	else
	{
		Transmitting = false;
     258:	10 92 18 01 	sts	0x0118, r1
	}
	  
}
     25c:	ff 91       	pop	r31
     25e:	ef 91       	pop	r30
     260:	bf 91       	pop	r27
     262:	af 91       	pop	r26
     264:	9f 91       	pop	r25
     266:	8f 91       	pop	r24
     268:	7f 91       	pop	r23
     26a:	6f 91       	pop	r22
     26c:	5f 91       	pop	r21
     26e:	4f 91       	pop	r20
     270:	3f 91       	pop	r19
     272:	2f 91       	pop	r18
     274:	0f 90       	pop	r0
     276:	0f be       	out	0x3f, r0	; 63
     278:	0f 90       	pop	r0
     27a:	1f 90       	pop	r1
     27c:	18 95       	reti

0000027e <RemoveWhiteSpace>:
	return number;

}

void RemoveWhiteSpace(void)
{
     27e:	80 e6       	ldi	r24, 0x60	; 96
     280:	91 e0       	ldi	r25, 0x01	; 1
     282:	6d d4       	rcall	.+2266   	; 0xb5e <Buffer_GetElementFromBottom>
     284:	68 2f       	mov	r22, r24
	uint8_t temp;

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
	//remove white space
	while(temp == ' ' || temp == '\t' || temp == ',')
     286:	80 32       	cpi	r24, 0x20	; 32
     288:	d1 f3       	breq	.-12     	; 0x27e <RemoveWhiteSpace>
     28a:	89 30       	cpi	r24, 0x09	; 9
     28c:	c1 f3       	breq	.-16     	; 0x27e <RemoveWhiteSpace>
     28e:	8c 32       	cpi	r24, 0x2C	; 44
     290:	b1 f3       	breq	.-20     	; 0x27e <RemoveWhiteSpace>
	{
		temp = Buffer_GetElementFromBottom(&Rx_Buffer);
	}
	Buffer_StoreElementOnBottom(&Rx_Buffer, temp);
     292:	80 e6       	ldi	r24, 0x60	; 96
     294:	91 e0       	ldi	r25, 0x01	; 1
}
     296:	93 c4       	rjmp	.+2342   	; 0xbbe <Buffer_StoreElementOnBottom>

00000298 <GetHexNumber>:
	UBRR1  = MY_SERIAL_2X_UBBRVAL((uint16_t)LineCoding.BaudRateBPS);
}


uint8_t GetHexNumber(void)
{
     298:	1f 93       	push	r17
	uint8_t temp, number;

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     29a:	80 e6       	ldi	r24, 0x60	; 96
     29c:	91 e0       	ldi	r25, 0x01	; 1
     29e:	5f d4       	rcall	.+2238   	; 0xb5e <Buffer_GetElementFromBottom>
     2a0:	68 2f       	mov	r22, r24

	if(temp >= 'a' && temp <= 'f')
     2a2:	81 56       	subi	r24, 0x61	; 97
     2a4:	86 30       	cpi	r24, 0x06	; 6
     2a6:	18 f4       	brcc	.+6      	; 0x2ae <GetHexNumber+0x16>
	{
		number = temp -'a' + 0xA;
     2a8:	16 2f       	mov	r17, r22
     2aa:	17 55       	subi	r17, 0x57	; 87
     2ac:	10 c0       	rjmp	.+32     	; 0x2ce <GetHexNumber+0x36>
	}
	else if(temp >= 'A' && temp <= 'F')
     2ae:	86 2f       	mov	r24, r22
     2b0:	81 54       	subi	r24, 0x41	; 65
     2b2:	86 30       	cpi	r24, 0x06	; 6
     2b4:	18 f4       	brcc	.+6      	; 0x2bc <GetHexNumber+0x24>
	{
		number = temp -'A' + 0xA;
     2b6:	16 2f       	mov	r17, r22
     2b8:	17 53       	subi	r17, 0x37	; 55
     2ba:	09 c0       	rjmp	.+18     	; 0x2ce <GetHexNumber+0x36>
	}
	else if(temp >= '0' && temp <= '9')
     2bc:	16 2f       	mov	r17, r22
     2be:	10 53       	subi	r17, 0x30	; 48
     2c0:	1a 30       	cpi	r17, 0x0A	; 10
     2c2:	28 f0       	brcs	.+10     	; 0x2ce <GetHexNumber+0x36>
	{
		number = temp -'0';
	}
	else
	{
		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     2c4:	80 e6       	ldi	r24, 0x60	; 96
     2c6:	91 e0       	ldi	r25, 0x01	; 1
     2c8:	7a d4       	rcall	.+2292   	; 0xbbe <Buffer_StoreElementOnBottom>
     2ca:	10 e0       	ldi	r17, 0x00	; 0
     2cc:	1b c0       	rjmp	.+54     	; 0x304 <__stack+0x5>
		return 0;
	}

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     2ce:	80 e6       	ldi	r24, 0x60	; 96
     2d0:	91 e0       	ldi	r25, 0x01	; 1
     2d2:	45 d4       	rcall	.+2186   	; 0xb5e <Buffer_GetElementFromBottom>
     2d4:	68 2f       	mov	r22, r24


	number <<=4;//scale the number up 4 bits
     2d6:	12 95       	swap	r17
     2d8:	10 7f       	andi	r17, 0xF0	; 240

	if(temp >= 'a' && temp <= 'f')
     2da:	81 56       	subi	r24, 0x61	; 97
     2dc:	86 30       	cpi	r24, 0x06	; 6
     2de:	10 f4       	brcc	.+4      	; 0x2e4 <GetHexNumber+0x4c>
	{
		number += temp -'a' + 0xA;
     2e0:	67 55       	subi	r22, 0x57	; 87
     2e2:	05 c0       	rjmp	.+10     	; 0x2ee <GetHexNumber+0x56>
	}
	else if(temp >= 'A' && temp <= 'F')
     2e4:	86 2f       	mov	r24, r22
     2e6:	81 54       	subi	r24, 0x41	; 65
     2e8:	86 30       	cpi	r24, 0x06	; 6
     2ea:	18 f4       	brcc	.+6      	; 0x2f2 <GetHexNumber+0x5a>
	{
		number += temp -'A' + 0xA;
     2ec:	67 53       	subi	r22, 0x37	; 55
     2ee:	16 0f       	add	r17, r22
     2f0:	09 c0       	rjmp	.+18     	; 0x304 <__stack+0x5>
	}
	else if(temp >= '0' && temp <= '9')
     2f2:	86 2f       	mov	r24, r22
     2f4:	80 53       	subi	r24, 0x30	; 48
     2f6:	8a 30       	cpi	r24, 0x0A	; 10
     2f8:	10 f4       	brcc	.+4      	; 0x2fe <GetHexNumber+0x66>
	{
		number += temp -'0';
     2fa:	18 0f       	add	r17, r24
     2fc:	03 c0       	rjmp	.+6      	; 0x304 <__stack+0x5>
	}
	else
	{
		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if the character is no good to us, return it back to the buffer
     2fe:	80 e6       	ldi	r24, 0x60	; 96
     300:	91 e0       	ldi	r25, 0x01	; 1
     302:	5d d4       	rcall	.+2234   	; 0xbbe <Buffer_StoreElementOnBottom>
	}


	return number;

}
     304:	81 2f       	mov	r24, r17
     306:	1f 91       	pop	r17
     308:	08 95       	ret

0000030a <ParseNumber>:


uint8_t ParseNumber(void)
{
     30a:	1f 93       	push	r17
	uint8_t temp, number = 0;

	
	RemoveWhiteSpace();
     30c:	b8 df       	rcall	.-144    	; 0x27e <RemoveWhiteSpace>

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     30e:	80 e6       	ldi	r24, 0x60	; 96
     310:	91 e0       	ldi	r25, 0x01	; 1
     312:	25 d4       	rcall	.+2122   	; 0xb5e <Buffer_GetElementFromBottom>
     314:	28 2f       	mov	r18, r24

	if(temp == '\\')
     316:	8c 35       	cpi	r24, 0x5C	; 92
     318:	81 f4       	brne	.+32     	; 0x33a <ParseNumber+0x30>
	{
		temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     31a:	80 e6       	ldi	r24, 0x60	; 96
     31c:	91 e0       	ldi	r25, 0x01	; 1
     31e:	1f d4       	rcall	.+2110   	; 0xb5e <Buffer_GetElementFromBottom>
     320:	68 2f       	mov	r22, r24
		if(temp == 'x' || temp == 'X')
     322:	88 37       	cpi	r24, 0x78	; 120
     324:	11 f0       	breq	.+4      	; 0x32a <ParseNumber+0x20>
     326:	88 35       	cpi	r24, 0x58	; 88
     328:	19 f4       	brne	.+6      	; 0x330 <ParseNumber+0x26>
		{
			number = GetHexNumber();
     32a:	b6 df       	rcall	.-148    	; 0x298 <GetHexNumber>
     32c:	18 2f       	mov	r17, r24
     32e:	1f c0       	rjmp	.+62     	; 0x36e <ParseNumber+0x64>
		}
		else
		{
			Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     330:	80 e6       	ldi	r24, 0x60	; 96
     332:	91 e0       	ldi	r25, 0x01	; 1
     334:	44 d4       	rcall	.+2184   	; 0xbbe <Buffer_StoreElementOnBottom>
     336:	10 e0       	ldi	r17, 0x00	; 0
     338:	1a c0       	rjmp	.+52     	; 0x36e <ParseNumber+0x64>
			return 0;
		}	
	}
	else if(temp >= '0' && temp <= '9' )
     33a:	80 53       	subi	r24, 0x30	; 48
     33c:	8a 30       	cpi	r24, 0x0A	; 10
     33e:	10 f0       	brcs	.+4      	; 0x344 <ParseNumber+0x3a>
     340:	12 2f       	mov	r17, r18
     342:	15 c0       	rjmp	.+42     	; 0x36e <ParseNumber+0x64>
     344:	10 e0       	ldi	r17, 0x00	; 0
	{
		do
		{
			number *= 10;
     346:	81 2f       	mov	r24, r17
     348:	90 e0       	ldi	r25, 0x00	; 0
     34a:	6a e0       	ldi	r22, 0x0A	; 10
     34c:	70 e0       	ldi	r23, 0x00	; 0
     34e:	0e 94 9a 0c 	call	0x1934	; 0x1934 <__mulhi3>
			number += temp - '0';
     352:	12 2f       	mov	r17, r18
     354:	10 53       	subi	r17, 0x30	; 48
     356:	18 0f       	add	r17, r24
			temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     358:	80 e6       	ldi	r24, 0x60	; 96
     35a:	91 e0       	ldi	r25, 0x01	; 1
     35c:	00 d4       	rcall	.+2048   	; 0xb5e <Buffer_GetElementFromBottom>
     35e:	28 2f       	mov	r18, r24
		} while (temp >= '0' && temp <= '9' );
     360:	80 53       	subi	r24, 0x30	; 48
     362:	8a 30       	cpi	r24, 0x0A	; 10
     364:	80 f3       	brcs	.-32     	; 0x346 <ParseNumber+0x3c>

		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     366:	62 2f       	mov	r22, r18
     368:	80 e6       	ldi	r24, 0x60	; 96
     36a:	91 e0       	ldi	r25, 0x01	; 1
     36c:	28 d4       	rcall	.+2128   	; 0xbbe <Buffer_StoreElementOnBottom>
	}
	

	return number;

}
     36e:	81 2f       	mov	r24, r17
     370:	1f 91       	pop	r17
     372:	08 95       	ret

00000374 <__vector_23>:

//	  UCSR1A = (1<<UDRE1);
//}

ISR(USART1_RX_vect)
{
     374:	1f 92       	push	r1
     376:	0f 92       	push	r0
     378:	0f b6       	in	r0, 0x3f	; 63
     37a:	0f 92       	push	r0
     37c:	11 24       	eor	r1, r1
     37e:	2f 93       	push	r18
     380:	3f 93       	push	r19
     382:	4f 93       	push	r20
     384:	5f 93       	push	r21
     386:	6f 93       	push	r22
     388:	7f 93       	push	r23
     38a:	8f 93       	push	r24
     38c:	9f 93       	push	r25
     38e:	af 93       	push	r26
     390:	bf 93       	push	r27
     392:	ef 93       	push	r30
     394:	ff 93       	push	r31
	if(mode == SERIAL)
     396:	80 91 1a 01 	lds	r24, 0x011A
     39a:	81 30       	cpi	r24, 0x01	; 1
     39c:	29 f4       	brne	.+10     	; 0x3a8 <__vector_23+0x34>
	{
		/* Character recieved, store it into the buffer */
		Buffer_StoreElementOnTop(&Tx_Buffer, UDR1);
     39e:	60 91 ce 00 	lds	r22, 0x00CE
     3a2:	8b e1       	ldi	r24, 0x1B	; 27
     3a4:	91 e0       	ldi	r25, 0x01	; 1
     3a6:	79 d3       	rcall	.+1778   	; 0xa9a <Buffer_StoreElementOnTop>
	}
}
     3a8:	ff 91       	pop	r31
     3aa:	ef 91       	pop	r30
     3ac:	bf 91       	pop	r27
     3ae:	af 91       	pop	r26
     3b0:	9f 91       	pop	r25
     3b2:	8f 91       	pop	r24
     3b4:	7f 91       	pop	r23
     3b6:	6f 91       	pop	r22
     3b8:	5f 91       	pop	r21
     3ba:	4f 91       	pop	r20
     3bc:	3f 91       	pop	r19
     3be:	2f 91       	pop	r18
     3c0:	0f 90       	pop	r0
     3c2:	0f be       	out	0x3f, r0	; 63
     3c4:	0f 90       	pop	r0
     3c6:	1f 90       	pop	r1
     3c8:	18 95       	reti

000003ca <StringToBuffer_P>:
			break;
	}
}

void StringToBuffer_P(const char *data)
{
     3ca:	cf 93       	push	r28
     3cc:	df 93       	push	r29
     3ce:	ec 01       	movw	r28, r24
     3d0:	06 c0       	rjmp	.+12     	; 0x3de <StringToBuffer_P+0x14>
	while (pgm_read_byte(data) != 0x00)
	{
		Buffer_StoreElementOnTop(&Tx_Buffer, pgm_read_byte(data++));
     3d2:	21 96       	adiw	r28, 0x01	; 1
     3d4:	f9 01       	movw	r30, r18
     3d6:	64 91       	lpm	r22, Z+
     3d8:	8b e1       	ldi	r24, 0x1B	; 27
     3da:	91 e0       	ldi	r25, 0x01	; 1
     3dc:	5e d3       	rcall	.+1724   	; 0xa9a <Buffer_StoreElementOnTop>
     3de:	9e 01       	movw	r18, r28
	}
}

void StringToBuffer_P(const char *data)
{
	while (pgm_read_byte(data) != 0x00)
     3e0:	fe 01       	movw	r30, r28
     3e2:	84 91       	lpm	r24, Z+
     3e4:	88 23       	and	r24, r24
     3e6:	a9 f7       	brne	.-22     	; 0x3d2 <StringToBuffer_P+0x8>
	{
		Buffer_StoreElementOnTop(&Tx_Buffer, pgm_read_byte(data++));
	}

}
     3e8:	df 91       	pop	r29
     3ea:	cf 91       	pop	r28
     3ec:	08 95       	ret

000003ee <Command_Task>:
}



TASK(Command_Task)
{
     3ee:	9f 92       	push	r9
     3f0:	af 92       	push	r10
     3f2:	bf 92       	push	r11
     3f4:	cf 92       	push	r12
     3f6:	df 92       	push	r13
     3f8:	ef 92       	push	r14
     3fa:	ff 92       	push	r15
     3fc:	0f 93       	push	r16
     3fe:	1f 93       	push	r17
     400:	df 93       	push	r29
     402:	cf 93       	push	r28
     404:	cd b7       	in	r28, 0x3d	; 61
     406:	de b7       	in	r29, 0x3e	; 62
     408:	c0 54       	subi	r28, 0x40	; 64
     40a:	d0 40       	sbci	r29, 0x00	; 0
     40c:	0f b6       	in	r0, 0x3f	; 63
     40e:	f8 94       	cli
     410:	de bf       	out	0x3e, r29	; 62
     412:	0f be       	out	0x3f, r0	; 63
     414:	cd bf       	out	0x3d, r28	; 61
	uint8_t i, address = 0, lenght = 0, axis, oldValue;
	uint8_t temp[64];


	RemoveWhiteSpace();
     416:	33 df       	rcall	.-410    	; 0x27e <RemoveWhiteSpace>


	switch (Buffer_GetElementFromBottom(&Rx_Buffer))
     418:	80 e6       	ldi	r24, 0x60	; 96
     41a:	91 e0       	ldi	r25, 0x01	; 1
     41c:	a0 d3       	rcall	.+1856   	; 0xb5e <Buffer_GetElementFromBottom>
     41e:	83 35       	cpi	r24, 0x53	; 83
     420:	09 f4       	brne	.+2      	; 0x424 <Command_Task+0x36>
     422:	e5 c0       	rjmp	.+458    	; 0x5ee <Command_Task+0x200>
     424:	84 35       	cpi	r24, 0x54	; 84
     426:	a8 f4       	brcc	.+42     	; 0x452 <Command_Task+0x64>
     428:	83 34       	cpi	r24, 0x43	; 67
     42a:	31 f1       	breq	.+76     	; 0x478 <Command_Task+0x8a>
     42c:	84 34       	cpi	r24, 0x44	; 68
     42e:	50 f4       	brcc	.+20     	; 0x444 <Command_Task+0x56>
     430:	82 34       	cpi	r24, 0x42	; 66
     432:	09 f4       	brne	.+2      	; 0x436 <Command_Task+0x48>
     434:	e6 c0       	rjmp	.+460    	; 0x602 <Command_Task+0x214>
     436:	88 23       	and	r24, r24
     438:	09 f4       	brne	.+2      	; 0x43c <Command_Task+0x4e>
     43a:	2c c1       	rjmp	.+600    	; 0x694 <Command_Task+0x2a6>
     43c:	8f 33       	cpi	r24, 0x3F	; 63
     43e:	09 f0       	breq	.+2      	; 0x442 <Command_Task+0x54>
     440:	1d c1       	rjmp	.+570    	; 0x67c <Command_Task+0x28e>
     442:	9f c0       	rjmp	.+318    	; 0x582 <Command_Task+0x194>
     444:	8c 34       	cpi	r24, 0x4C	; 76
     446:	09 f4       	brne	.+2      	; 0x44a <Command_Task+0x5c>
     448:	e2 c0       	rjmp	.+452    	; 0x60e <Command_Task+0x220>
     44a:	8d 34       	cpi	r24, 0x4D	; 77
     44c:	09 f0       	breq	.+2      	; 0x450 <Command_Task+0x62>
     44e:	16 c1       	rjmp	.+556    	; 0x67c <Command_Task+0x28e>
     450:	9c c0       	rjmp	.+312    	; 0x58a <Command_Task+0x19c>
     452:	8c 36       	cpi	r24, 0x6C	; 108
     454:	09 f4       	brne	.+2      	; 0x458 <Command_Task+0x6a>
     456:	db c0       	rjmp	.+438    	; 0x60e <Command_Task+0x220>
     458:	8d 36       	cpi	r24, 0x6D	; 109
     45a:	38 f4       	brcc	.+14     	; 0x46a <Command_Task+0x7c>
     45c:	82 36       	cpi	r24, 0x62	; 98
     45e:	09 f4       	brne	.+2      	; 0x462 <Command_Task+0x74>
     460:	d0 c0       	rjmp	.+416    	; 0x602 <Command_Task+0x214>
     462:	83 36       	cpi	r24, 0x63	; 99
     464:	09 f0       	breq	.+2      	; 0x468 <Command_Task+0x7a>
     466:	0a c1       	rjmp	.+532    	; 0x67c <Command_Task+0x28e>
     468:	07 c0       	rjmp	.+14     	; 0x478 <Command_Task+0x8a>
     46a:	8d 36       	cpi	r24, 0x6D	; 109
     46c:	09 f4       	brne	.+2      	; 0x470 <Command_Task+0x82>
     46e:	8d c0       	rjmp	.+282    	; 0x58a <Command_Task+0x19c>
     470:	83 37       	cpi	r24, 0x73	; 115
     472:	09 f0       	breq	.+2      	; 0x476 <Command_Task+0x88>
     474:	03 c1       	rjmp	.+518    	; 0x67c <Command_Task+0x28e>
     476:	bb c0       	rjmp	.+374    	; 0x5ee <Command_Task+0x200>
	{
		case 'c':
		case 'C':
			
			I2C_Port = Buffer_GetElementFromBottom(&Rx_Buffer);
     478:	80 e6       	ldi	r24, 0x60	; 96
     47a:	91 e0       	ldi	r25, 0x01	; 1
     47c:	70 d3       	rcall	.+1760   	; 0xb5e <Buffer_GetElementFromBottom>
     47e:	80 93 15 01 	sts	0x0115, r24
			//should check to ensure val ok!
			
			I2C_Init();
     482:	dc d3       	rcall	.+1976   	; 0xc3c <I2C_Init>
						
			RemoveWhiteSpace();
     484:	fc de       	rcall	.-520    	; 0x27e <RemoveWhiteSpace>

			address = ParseNumber();
     486:	41 df       	rcall	.-382    	; 0x30a <ParseNumber>
     488:	98 2e       	mov	r9, r24
			RemoveWhiteSpace();
     48a:	f9 de       	rcall	.-526    	; 0x27e <RemoveWhiteSpace>

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     48c:	80 e6       	ldi	r24, 0x60	; 96
     48e:	91 e0       	ldi	r25, 0x01	; 1
     490:	66 d3       	rcall	.+1740   	; 0xb5e <Buffer_GetElementFromBottom>

			if(oldValue == 'w' || oldValue == 'W')
     492:	87 37       	cpi	r24, 0x77	; 119
     494:	19 f0       	breq	.+6      	; 0x49c <Command_Task+0xae>
     496:	87 35       	cpi	r24, 0x57	; 87
     498:	09 f0       	breq	.+2      	; 0x49c <Command_Task+0xae>
     49a:	49 c0       	rjmp	.+146    	; 0x52e <Command_Task+0x140>
			{
						
				lenght = ParseNumber();
     49c:	36 df       	rcall	.-404    	; 0x30a <ParseNumber>
     49e:	e8 2e       	mov	r14, r24

				oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     4a0:	80 e6       	ldi	r24, 0x60	; 96
     4a2:	91 e0       	ldi	r25, 0x01	; 1
     4a4:	5c d3       	rcall	.+1720   	; 0xb5e <Buffer_GetElementFromBottom>
     4a6:	68 2f       	mov	r22, r24
				if(oldValue != ' ' && oldValue != ',')
     4a8:	80 32       	cpi	r24, 0x20	; 32
     4aa:	29 f0       	breq	.+10     	; 0x4b6 <Command_Task+0xc8>
     4ac:	8c 32       	cpi	r24, 0x2C	; 44
     4ae:	19 f0       	breq	.+6      	; 0x4b6 <Command_Task+0xc8>
				{
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     4b0:	80 e6       	ldi	r24, 0x60	; 96
     4b2:	91 e0       	ldi	r25, 0x01	; 1
     4b4:	84 d3       	rcall	.+1800   	; 0xbbe <Buffer_StoreElementOnBottom>
     4b6:	ff 24       	eor	r15, r15
     4b8:	5e 01       	movw	r10, r28
     4ba:	08 94       	sec
     4bc:	a1 1c       	adc	r10, r1
     4be:	b1 1c       	adc	r11, r1
						{
							temp[i] = GetHexNumber();
						}
						else
						{
							if(i < lenght-1)//will we even get a chance to send it.  If so write it
     4c0:	ce 2c       	mov	r12, r14
     4c2:	dd 24       	eor	r13, r13
     4c4:	08 94       	sec
     4c6:	c1 08       	sbc	r12, r1
     4c8:	d1 08       	sbc	r13, r1
     4ca:	26 c0       	rjmp	.+76     	; 0x518 <Command_Task+0x12a>
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
				}
						
				for (i = 0; i < lenght; i++)
				{
					temp[i] = Buffer_GetElementFromBottom(&Rx_Buffer);
     4cc:	0f 2d       	mov	r16, r15
     4ce:	10 e0       	ldi	r17, 0x00	; 0
     4d0:	80 e6       	ldi	r24, 0x60	; 96
     4d2:	91 e0       	ldi	r25, 0x01	; 1
     4d4:	44 d3       	rcall	.+1672   	; 0xb5e <Buffer_GetElementFromBottom>
     4d6:	f5 01       	movw	r30, r10
     4d8:	e0 0f       	add	r30, r16
     4da:	f1 1f       	adc	r31, r17
     4dc:	80 83       	st	Z, r24
					if(temp[i] == '\\')
     4de:	8c 35       	cpi	r24, 0x5C	; 92
     4e0:	d1 f4       	brne	.+52     	; 0x516 <Command_Task+0x128>
					{	
						oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     4e2:	80 e6       	ldi	r24, 0x60	; 96
     4e4:	91 e0       	ldi	r25, 0x01	; 1
     4e6:	3b d3       	rcall	.+1654   	; 0xb5e <Buffer_GetElementFromBottom>
     4e8:	68 2f       	mov	r22, r24

						if(oldValue == 'x' || oldValue == 'X')
     4ea:	88 37       	cpi	r24, 0x78	; 120
     4ec:	11 f0       	breq	.+4      	; 0x4f2 <Command_Task+0x104>
     4ee:	88 35       	cpi	r24, 0x58	; 88
     4f0:	31 f4       	brne	.+12     	; 0x4fe <Command_Task+0x110>
						{
							temp[i] = GetHexNumber();
     4f2:	d2 de       	rcall	.-604    	; 0x298 <GetHexNumber>
     4f4:	0a 0d       	add	r16, r10
     4f6:	1b 1d       	adc	r17, r11
     4f8:	f8 01       	movw	r30, r16
     4fa:	80 83       	st	Z, r24
     4fc:	0c c0       	rjmp	.+24     	; 0x516 <Command_Task+0x128>
						}
						else
						{
							if(i < lenght-1)//will we even get a chance to send it.  If so write it
     4fe:	0c 15       	cp	r16, r12
     500:	1d 05       	cpc	r17, r13
     502:	34 f4       	brge	.+12     	; 0x510 <Command_Task+0x122>
							{
								temp[++i] = oldValue;
     504:	f3 94       	inc	r15
     506:	f5 01       	movw	r30, r10
     508:	ef 0d       	add	r30, r15
     50a:	f1 1d       	adc	r31, r1
     50c:	80 83       	st	Z, r24
     50e:	03 c0       	rjmp	.+6      	; 0x516 <Command_Task+0x128>
							}
							else//put the data back.  This is not needed though as we will dump the data latter
							{
								Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     510:	80 e6       	ldi	r24, 0x60	; 96
     512:	91 e0       	ldi	r25, 0x01	; 1
     514:	54 d3       	rcall	.+1704   	; 0xbbe <Buffer_StoreElementOnBottom>
				if(oldValue != ' ' && oldValue != ',')
				{
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
				}
						
				for (i = 0; i < lenght; i++)
     516:	f3 94       	inc	r15
     518:	fe 14       	cp	r15, r14
     51a:	c0 f2       	brcs	.-80     	; 0x4cc <Command_Task+0xde>
							} 
						}	
					}
				}

				if(I2C_Write(address, temp, lenght) != lenght)
     51c:	4e 2d       	mov	r20, r14
     51e:	50 e0       	ldi	r21, 0x00	; 0
     520:	b5 01       	movw	r22, r10
     522:	89 2d       	mov	r24, r9
     524:	5c d5       	rcall	.+2744   	; 0xfde <I2C_Write>
     526:	8e 15       	cp	r24, r14
     528:	09 f4       	brne	.+2      	; 0x52c <Command_Task+0x13e>
     52a:	b4 c0       	rjmp	.+360    	; 0x694 <Command_Task+0x2a6>
     52c:	20 c0       	rjmp	.+64     	; 0x56e <Command_Task+0x180>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
					Buffer_StoreElementOnTop(&Tx_Buffer, '-');
				}					
						 
			}
			else if(oldValue == 'r' || oldValue == 'R')
     52e:	82 37       	cpi	r24, 0x72	; 114
     530:	19 f0       	breq	.+6      	; 0x538 <Command_Task+0x14a>
     532:	82 35       	cpi	r24, 0x52	; 82
     534:	09 f0       	breq	.+2      	; 0x538 <Command_Task+0x14a>
     536:	ae c0       	rjmp	.+348    	; 0x694 <Command_Task+0x2a6>
			{
				lenght = ParseNumber();
     538:	e8 de       	rcall	.-560    	; 0x30a <ParseNumber>
     53a:	18 2f       	mov	r17, r24

				if(I2C_Read(address, temp, lenght) == lenght)
     53c:	48 2f       	mov	r20, r24
     53e:	50 e0       	ldi	r21, 0x00	; 0
     540:	7e 01       	movw	r14, r28
     542:	08 94       	sec
     544:	e1 1c       	adc	r14, r1
     546:	f1 1c       	adc	r15, r1
     548:	b7 01       	movw	r22, r14
     54a:	89 2d       	mov	r24, r9
     54c:	10 d5       	rcall	.+2592   	; 0xf6e <I2C_Read>
     54e:	d8 2e       	mov	r13, r24
     550:	81 17       	cp	r24, r17
     552:	69 f4       	brne	.+26     	; 0x56e <Command_Task+0x180>
     554:	87 01       	movw	r16, r14
     556:	06 c0       	rjmp	.+12     	; 0x564 <Command_Task+0x176>
				{
					for (i = 0; i < lenght; i++)
					{
						Buffer_StoreElementOnTop(&Tx_Buffer, temp[i]);
     558:	f8 01       	movw	r30, r16
     55a:	61 91       	ld	r22, Z+
     55c:	8f 01       	movw	r16, r30
     55e:	8b e1       	ldi	r24, 0x1B	; 27
     560:	91 e0       	ldi	r25, 0x01	; 1
     562:	9b d2       	rcall	.+1334   	; 0xa9a <Buffer_StoreElementOnTop>
			{
				lenght = ParseNumber();

				if(I2C_Read(address, temp, lenght) == lenght)
				{
					for (i = 0; i < lenght; i++)
     564:	80 2f       	mov	r24, r16
     566:	8e 19       	sub	r24, r14
     568:	8d 15       	cp	r24, r13
     56a:	b0 f3       	brcs	.-20     	; 0x558 <Command_Task+0x16a>
     56c:	93 c0       	rjmp	.+294    	; 0x694 <Command_Task+0x2a6>
						Buffer_StoreElementOnTop(&Tx_Buffer, temp[i]);
					}
				}
				else
				{
					Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     56e:	6d e0       	ldi	r22, 0x0D	; 13
     570:	8b e1       	ldi	r24, 0x1B	; 27
     572:	91 e0       	ldi	r25, 0x01	; 1
     574:	92 d2       	rcall	.+1316   	; 0xa9a <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     576:	6a e0       	ldi	r22, 0x0A	; 10
     578:	8b e1       	ldi	r24, 0x1B	; 27
     57a:	91 e0       	ldi	r25, 0x01	; 1
     57c:	8e d2       	rcall	.+1308   	; 0xa9a <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '-');
     57e:	6d e2       	ldi	r22, 0x2D	; 45
     580:	86 c0       	rjmp	.+268    	; 0x68e <Command_Task+0x2a0>
				}			
			}
			
			break;
		case '?':
			StringToBuffer_P(PSTR("\r\nSOC Robotics Help Guide.\r\n........Ask Steve?"));
     582:	81 e8       	ldi	r24, 0x81	; 129
     584:	90 e0       	ldi	r25, 0x00	; 0
     586:	21 df       	rcall	.-446    	; 0x3ca <StringToBuffer_P>
     588:	85 c0       	rjmp	.+266    	; 0x694 <Command_Task+0x2a6>
			break;
		case 'm':
		case 'M':
					
			RemoveWhiteSpace();
     58a:	79 de       	rcall	.-782    	; 0x27e <RemoveWhiteSpace>

			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     58c:	80 e6       	ldi	r24, 0x60	; 96
     58e:	91 e0       	ldi	r25, 0x01	; 1
     590:	e6 d2       	rcall	.+1484   	; 0xb5e <Buffer_GetElementFromBottom>
     592:	8a 35       	cpi	r24, 0x5A	; 90
     594:	49 f0       	breq	.+18     	; 0x5a8 <Command_Task+0x1ba>
     596:	8b 35       	cpi	r24, 0x5B	; 91
     598:	18 f4       	brcc	.+6      	; 0x5a0 <Command_Task+0x1b2>
     59a:	89 35       	cpi	r24, 0x59	; 89
     59c:	49 f4       	brne	.+18     	; 0x5b0 <Command_Task+0x1c2>
     59e:	06 c0       	rjmp	.+12     	; 0x5ac <Command_Task+0x1be>
     5a0:	89 37       	cpi	r24, 0x79	; 121
     5a2:	21 f0       	breq	.+8      	; 0x5ac <Command_Task+0x1be>
     5a4:	8a 37       	cpi	r24, 0x7A	; 122
     5a6:	21 f4       	brne	.+8      	; 0x5b0 <Command_Task+0x1c2>
     5a8:	02 e0       	ldi	r16, 0x02	; 2
     5aa:	03 c0       	rjmp	.+6      	; 0x5b2 <Command_Task+0x1c4>
     5ac:	01 e0       	ldi	r16, 0x01	; 1
     5ae:	01 c0       	rjmp	.+2      	; 0x5b2 <Command_Task+0x1c4>
     5b0:	00 e0       	ldi	r16, 0x00	; 0
					axis = X_AXIS;
					break;
				
			}

			RemoveWhiteSpace();
     5b2:	65 de       	rcall	.-822    	; 0x27e <RemoveWhiteSpace>

			lenght = ParseNumber();
     5b4:	aa de       	rcall	.-684    	; 0x30a <ParseNumber>
     5b6:	f8 2e       	mov	r15, r24

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     5b8:	80 e6       	ldi	r24, 0x60	; 96
     5ba:	91 e0       	ldi	r25, 0x01	; 1
     5bc:	d0 d2       	rcall	.+1440   	; 0xb5e <Buffer_GetElementFromBottom>
     5be:	68 2f       	mov	r22, r24

			if(oldValue != ' ' && oldValue != ',')//allow for 1 peice of white space
     5c0:	80 32       	cpi	r24, 0x20	; 32
     5c2:	29 f0       	breq	.+10     	; 0x5ce <Command_Task+0x1e0>
     5c4:	8c 32       	cpi	r24, 0x2C	; 44
     5c6:	19 f0       	breq	.+6      	; 0x5ce <Command_Task+0x1e0>
			{
				Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     5c8:	80 e6       	ldi	r24, 0x60	; 96
     5ca:	91 e0       	ldi	r25, 0x01	; 1
     5cc:	f8 d2       	rcall	.+1520   	; 0xbbe <Buffer_StoreElementOnBottom>
     5ce:	10 e0       	ldi	r17, 0x00	; 0
     5d0:	06 c0       	rjmp	.+12     	; 0x5de <Command_Task+0x1f0>
			}
						
			for (i = 0; i < lenght && Rx_Buffer.Elements != 0; i++)
			{
				SendByte(Buffer_GetElementFromBottom(&Rx_Buffer),axis);
     5d2:	80 e6       	ldi	r24, 0x60	; 96
     5d4:	91 e0       	ldi	r25, 0x01	; 1
     5d6:	c3 d2       	rcall	.+1414   	; 0xb5e <Buffer_GetElementFromBottom>
     5d8:	60 2f       	mov	r22, r16
     5da:	87 d5       	rcall	.+2830   	; 0x10ea <SendByte>
			if(oldValue != ' ' && oldValue != ',')//allow for 1 peice of white space
			{
				Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
			}
						
			for (i = 0; i < lenght && Rx_Buffer.Elements != 0; i++)
     5dc:	1f 5f       	subi	r17, 0xFF	; 255
     5de:	1f 15       	cp	r17, r15
     5e0:	08 f0       	brcs	.+2      	; 0x5e4 <Command_Task+0x1f6>
     5e2:	58 c0       	rjmp	.+176    	; 0x694 <Command_Task+0x2a6>
     5e4:	80 91 a4 01 	lds	r24, 0x01A4
     5e8:	88 23       	and	r24, r24
     5ea:	99 f7       	brne	.-26     	; 0x5d2 <Command_Task+0x1e4>
     5ec:	53 c0       	rjmp	.+166    	; 0x694 <Command_Task+0x2a6>

			break;

		case 's'://enter serial mode
		case 'S':
			mode = SERIAL;
     5ee:	81 e0       	ldi	r24, 0x01	; 1
     5f0:	80 93 1a 01 	sts	0x011A, r24
			Buffer_Initialize(&Rx_Buffer);//dump any unused data
     5f4:	80 e6       	ldi	r24, 0x60	; 96
     5f6:	91 e0       	ldi	r25, 0x01	; 1
     5f8:	3c d2       	rcall	.+1144   	; 0xa72 <Buffer_Initialize>
			Buffer_Initialize(&Tx_Buffer);//dump any unused data
     5fa:	8b e1       	ldi	r24, 0x1B	; 27
     5fc:	91 e0       	ldi	r25, 0x01	; 1
     5fe:	39 d2       	rcall	.+1138   	; 0xa72 <Buffer_Initialize>
     600:	49 c0       	rjmp	.+146    	; 0x694 <Command_Task+0x2a6>
		case 0://empty command
			break;

		case 'b'://start the bootloader
		case 'B':
			(*bootloader)();//will not return
     602:	e0 91 00 01 	lds	r30, 0x0100
     606:	f0 91 01 01 	lds	r31, 0x0101
     60a:	09 95       	icall
     60c:	43 c0       	rjmp	.+134    	; 0x694 <Command_Task+0x2a6>
			break;

		case 'l':
		case 'L':

			RemoveWhiteSpace();
     60e:	37 de       	rcall	.-914    	; 0x27e <RemoveWhiteSpace>

			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     610:	80 e6       	ldi	r24, 0x60	; 96
     612:	91 e0       	ldi	r25, 0x01	; 1
     614:	a4 d2       	rcall	.+1352   	; 0xb5e <Buffer_GetElementFromBottom>
     616:	82 35       	cpi	r24, 0x52	; 82
     618:	f1 f0       	breq	.+60     	; 0x656 <Command_Task+0x268>
     61a:	83 35       	cpi	r24, 0x53	; 83
     61c:	20 f4       	brcc	.+8      	; 0x626 <Command_Task+0x238>
     61e:	87 34       	cpi	r24, 0x47	; 71
     620:	09 f0       	breq	.+2      	; 0x624 <Command_Task+0x236>
     622:	38 c0       	rjmp	.+112    	; 0x694 <Command_Task+0x2a6>
     624:	05 c0       	rjmp	.+10     	; 0x630 <Command_Task+0x242>
     626:	87 36       	cpi	r24, 0x67	; 103
     628:	19 f0       	breq	.+6      	; 0x630 <Command_Task+0x242>
     62a:	82 37       	cpi	r24, 0x72	; 114
     62c:	99 f5       	brne	.+102    	; 0x694 <Command_Task+0x2a6>
     62e:	13 c0       	rjmp	.+38     	; 0x656 <Command_Task+0x268>
			{
				case 'g':
				case 'G':
						
					RemoveWhiteSpace();
     630:	26 de       	rcall	.-948    	; 0x27e <RemoveWhiteSpace>

					switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     632:	80 e6       	ldi	r24, 0x60	; 96
     634:	91 e0       	ldi	r25, 0x01	; 1
     636:	93 d2       	rcall	.+1318   	; 0xb5e <Buffer_GetElementFromBottom>
     638:	8f 34       	cpi	r24, 0x4F	; 79
     63a:	49 f0       	breq	.+18     	; 0x64e <Command_Task+0x260>
     63c:	80 35       	cpi	r24, 0x50	; 80
     63e:	18 f4       	brcc	.+6      	; 0x646 <Command_Task+0x258>
     640:	86 34       	cpi	r24, 0x46	; 70
     642:	41 f5       	brne	.+80     	; 0x694 <Command_Task+0x2a6>
     644:	06 c0       	rjmp	.+12     	; 0x652 <Command_Task+0x264>
     646:	86 36       	cpi	r24, 0x66	; 102
     648:	21 f0       	breq	.+8      	; 0x652 <Command_Task+0x264>
     64a:	8f 36       	cpi	r24, 0x6F	; 111
     64c:	19 f5       	brne	.+70     	; 0x694 <Command_Task+0x2a6>
					{
						case 'o':
						case 'O':
							greenLedOn();
     64e:	2d 98       	cbi	0x05, 5	; 5
     650:	21 c0       	rjmp	.+66     	; 0x694 <Command_Task+0x2a6>
							break;

						case 'f':
						case 'F':
							greenLedOff();				
     652:	2d 9a       	sbi	0x05, 5	; 5
     654:	1f c0       	rjmp	.+62     	; 0x694 <Command_Task+0x2a6>
					break;

				case 'r':
				case 'R':

					RemoveWhiteSpace();
     656:	13 de       	rcall	.-986    	; 0x27e <RemoveWhiteSpace>

					switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     658:	80 e6       	ldi	r24, 0x60	; 96
     65a:	91 e0       	ldi	r25, 0x01	; 1
     65c:	80 d2       	rcall	.+1280   	; 0xb5e <Buffer_GetElementFromBottom>
     65e:	8f 34       	cpi	r24, 0x4F	; 79
     660:	49 f0       	breq	.+18     	; 0x674 <Command_Task+0x286>
     662:	80 35       	cpi	r24, 0x50	; 80
     664:	18 f4       	brcc	.+6      	; 0x66c <Command_Task+0x27e>
     666:	86 34       	cpi	r24, 0x46	; 70
     668:	a9 f4       	brne	.+42     	; 0x694 <Command_Task+0x2a6>
     66a:	06 c0       	rjmp	.+12     	; 0x678 <Command_Task+0x28a>
     66c:	86 36       	cpi	r24, 0x66	; 102
     66e:	21 f0       	breq	.+8      	; 0x678 <Command_Task+0x28a>
     670:	8f 36       	cpi	r24, 0x6F	; 111
     672:	81 f4       	brne	.+32     	; 0x694 <Command_Task+0x2a6>
					{
						case 'o':
						case 'O':
							redLedOn();
     674:	42 98       	cbi	0x08, 2	; 8
     676:	0e c0       	rjmp	.+28     	; 0x694 <Command_Task+0x2a6>
							break;

						case 'f':
						case 'F':
							redLedOff();				
     678:	42 9a       	sbi	0x08, 2	; 8
     67a:	0c c0       	rjmp	.+24     	; 0x694 <Command_Task+0x2a6>
			}

			break;

		default:
			Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     67c:	6d e0       	ldi	r22, 0x0D	; 13
     67e:	8b e1       	ldi	r24, 0x1B	; 27
     680:	91 e0       	ldi	r25, 0x01	; 1
     682:	0b d2       	rcall	.+1046   	; 0xa9a <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     684:	6a e0       	ldi	r22, 0x0A	; 10
     686:	8b e1       	ldi	r24, 0x1B	; 27
     688:	91 e0       	ldi	r25, 0x01	; 1
     68a:	07 d2       	rcall	.+1038   	; 0xa9a <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '?');			
     68c:	6f e3       	ldi	r22, 0x3F	; 63
     68e:	8b e1       	ldi	r24, 0x1B	; 27
     690:	91 e0       	ldi	r25, 0x01	; 1
     692:	03 d2       	rcall	.+1030   	; 0xa9a <Buffer_StoreElementOnTop>

	}
	
	if(mode != SERIAL)
     694:	80 91 1a 01 	lds	r24, 0x011A
     698:	81 30       	cpi	r24, 0x01	; 1
     69a:	79 f0       	breq	.+30     	; 0x6ba <Command_Task+0x2cc>
	{
		Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     69c:	6d e0       	ldi	r22, 0x0D	; 13
     69e:	8b e1       	ldi	r24, 0x1B	; 27
     6a0:	91 e0       	ldi	r25, 0x01	; 1
     6a2:	fb d1       	rcall	.+1014   	; 0xa9a <Buffer_StoreElementOnTop>
		Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     6a4:	6a e0       	ldi	r22, 0x0A	; 10
     6a6:	8b e1       	ldi	r24, 0x1B	; 27
     6a8:	91 e0       	ldi	r25, 0x01	; 1
     6aa:	f7 d1       	rcall	.+1006   	; 0xa9a <Buffer_StoreElementOnTop>
		Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     6ac:	6e e3       	ldi	r22, 0x3E	; 62
     6ae:	8b e1       	ldi	r24, 0x1B	; 27
     6b0:	91 e0       	ldi	r25, 0x01	; 1
     6b2:	f3 d1       	rcall	.+998    	; 0xa9a <Buffer_StoreElementOnTop>
					
		Buffer_Initialize(&Rx_Buffer);//dump any unused data
     6b4:	80 e6       	ldi	r24, 0x60	; 96
     6b6:	91 e0       	ldi	r25, 0x01	; 1
     6b8:	dc d1       	rcall	.+952    	; 0xa72 <Buffer_Initialize>
	}

	Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     6ba:	61 e0       	ldi	r22, 0x01	; 1
     6bc:	84 e8       	ldi	r24, 0x84	; 132
     6be:	93 e0       	ldi	r25, 0x03	; 3
     6c0:	a2 d5       	rcall	.+2884   	; 0x1206 <Scheduler_SetTaskMode>

	Scheduler_SetTaskMode(Command_Task, TASK_STOP);
     6c2:	60 e0       	ldi	r22, 0x00	; 0
     6c4:	87 ef       	ldi	r24, 0xF7	; 247
     6c6:	91 e0       	ldi	r25, 0x01	; 1
     6c8:	9e d5       	rcall	.+2876   	; 0x1206 <Scheduler_SetTaskMode>

}
     6ca:	c0 5c       	subi	r28, 0xC0	; 192
     6cc:	df 4f       	sbci	r29, 0xFF	; 255
     6ce:	0f b6       	in	r0, 0x3f	; 63
     6d0:	f8 94       	cli
     6d2:	de bf       	out	0x3e, r29	; 62
     6d4:	0f be       	out	0x3f, r0	; 63
     6d6:	cd bf       	out	0x3d, r28	; 61
     6d8:	cf 91       	pop	r28
     6da:	df 91       	pop	r29
     6dc:	1f 91       	pop	r17
     6de:	0f 91       	pop	r16
     6e0:	ff 90       	pop	r15
     6e2:	ef 90       	pop	r14
     6e4:	df 90       	pop	r13
     6e6:	cf 90       	pop	r12
     6e8:	bf 90       	pop	r11
     6ea:	af 90       	pop	r10
     6ec:	9f 90       	pop	r9
     6ee:	08 95       	ret

000006f0 <Event_USB_Disconnect>:
	Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);

}

EVENT_HANDLER(USB_Disconnect)
{
     6f0:	60 e0       	ldi	r22, 0x00	; 0
     6f2:	84 e8       	ldi	r24, 0x84	; 132
     6f4:	93 e0       	ldi	r25, 0x03	; 3
     6f6:	87 d5       	rcall	.+2830   	; 0x1206 <Scheduler_SetTaskMode>
	/* Stop running CDC and USB management tasks */
	Scheduler_SetTaskMode(CDC_Task, TASK_STOP);
	Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
     6f8:	60 e0       	ldi	r22, 0x00	; 0
     6fa:	8c ee       	ldi	r24, 0xEC	; 236
     6fc:	9b e0       	ldi	r25, 0x0B	; 11

}
     6fe:	83 c5       	rjmp	.+2822   	; 0x1206 <Scheduler_SetTaskMode>

00000700 <Event_USB_Connect>:

}
*/

EVENT_HANDLER(USB_Connect)
{
     700:	61 e0       	ldi	r22, 0x01	; 1
     702:	8c ee       	ldi	r24, 0xEC	; 236
     704:	9b e0       	ldi	r25, 0x0B	; 11
	/* Start USB management task */
	Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);

}
     706:	7f c5       	rjmp	.+2814   	; 0x1206 <Scheduler_SetTaskMode>

00000708 <CDC_Task>:

}


TASK(CDC_Task)
{
     708:	0f 93       	push	r16
     70a:	1f 93       	push	r17
	uint8_t temp;
	
	if (USB_IsConnected)
     70c:	80 91 ac 01 	lds	r24, 0x01AC
     710:	88 23       	and	r24, r24
     712:	09 f4       	brne	.+2      	; 0x716 <CDC_Task+0xe>
     714:	dd c0       	rjmp	.+442    	; 0x8d0 <CDC_Task+0x1c8>
	{
		/* Select the Serial Rx Endpoint */
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);
     716:	84 e0       	ldi	r24, 0x04	; 4
     718:	80 93 e9 00 	sts	0x00E9, r24

		if (Endpoint_ReadWriteAllowed())
     71c:	80 91 e8 00 	lds	r24, 0x00E8
     720:	85 fd       	sbrc	r24, 5
     722:	8d c0       	rjmp	.+282    	; 0x83e <CDC_Task+0x136>
     724:	97 c0       	rjmp	.+302    	; 0x854 <CDC_Task+0x14c>
		{
			/* Read the recieved data endpoint into the transmission buffer */
			while (Endpoint_BytesInEndpoint())
			{
				if(mode == COMMAND)
     726:	90 91 1a 01 	lds	r25, 0x011A
     72a:	99 23       	and	r25, r25
     72c:	69 f5       	brne	.+90     	; 0x788 <CDC_Task+0x80>
		/* Inline Functions: */
			/** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints. */
			static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint8_t Endpoint_Read_Byte(void)
			{
				return UEDATX;
     72e:	10 91 f1 00 	lds	r17, 0x00F1
				{
					temp =  Endpoint_Read_Byte();

					Buffer_StoreElementOnTop(&Tx_Buffer, temp);//echo the character back
     732:	61 2f       	mov	r22, r17
     734:	8b e1       	ldi	r24, 0x1B	; 27
     736:	91 e0       	ldi	r25, 0x01	; 1
     738:	b0 d1       	rcall	.+864    	; 0xa9a <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Rx_Buffer, temp);//save it to our buffer
     73a:	61 2f       	mov	r22, r17
     73c:	80 e6       	ldi	r24, 0x60	; 96
     73e:	91 e0       	ldi	r25, 0x01	; 1
     740:	ac d1       	rcall	.+856    	; 0xa9a <Buffer_StoreElementOnTop>

					if(temp == '\b')
     742:	18 30       	cpi	r17, 0x08	; 8
     744:	79 f4       	brne	.+30     	; 0x764 <CDC_Task+0x5c>
					{
						Buffer_StoreElementOnTop(&Tx_Buffer, ' ');//clear the mistake
     746:	60 e2       	ldi	r22, 0x20	; 32
     748:	8b e1       	ldi	r24, 0x1B	; 27
     74a:	91 e0       	ldi	r25, 0x01	; 1
     74c:	a6 d1       	rcall	.+844    	; 0xa9a <Buffer_StoreElementOnTop>
						Buffer_StoreElementOnTop(&Tx_Buffer, '\b');
     74e:	68 e0       	ldi	r22, 0x08	; 8
     750:	8b e1       	ldi	r24, 0x1B	; 27
     752:	91 e0       	ldi	r25, 0x01	; 1
     754:	a2 d1       	rcall	.+836    	; 0xa9a <Buffer_StoreElementOnTop>
					
						Buffer_GetElementFromTop(&Rx_Buffer);//remove the \b and the character sent from our buffer
     756:	80 e6       	ldi	r24, 0x60	; 96
     758:	91 e0       	ldi	r25, 0x01	; 1
     75a:	d6 d1       	rcall	.+940    	; 0xb08 <Buffer_GetElementFromTop>
						Buffer_GetElementFromTop(&Rx_Buffer);
     75c:	80 e6       	ldi	r24, 0x60	; 96
     75e:	91 e0       	ldi	r25, 0x01	; 1
     760:	d3 d1       	rcall	.+934    	; 0xb08 <Buffer_GetElementFromTop>
     762:	6e c0       	rjmp	.+220    	; 0x840 <CDC_Task+0x138>
					}
					else if(temp == '\r')
     764:	1d 30       	cpi	r17, 0x0D	; 13
     766:	09 f0       	breq	.+2      	; 0x76a <CDC_Task+0x62>
     768:	6b c0       	rjmp	.+214    	; 0x840 <CDC_Task+0x138>
					{
					//	Buffer_StoreElementOnTop(&Tx_Buffer, '\n');//ensure \r\n is sent back
						Buffer_GetElementFromTop(&Tx_Buffer);//remove the \r
     76a:	8b e1       	ldi	r24, 0x1B	; 27
     76c:	91 e0       	ldi	r25, 0x01	; 1
     76e:	cc d1       	rcall	.+920    	; 0xb08 <Buffer_GetElementFromTop>
						Buffer_GetElementFromTop(&Rx_Buffer);//remove the \r
     770:	80 e6       	ldi	r24, 0x60	; 96
     772:	91 e0       	ldi	r25, 0x01	; 1
     774:	c9 d1       	rcall	.+914    	; 0xb08 <Buffer_GetElementFromTop>

					
						Scheduler_SetTaskMode(CDC_Task, TASK_STOP);//stop it for a while
     776:	60 e0       	ldi	r22, 0x00	; 0
     778:	84 e8       	ldi	r24, 0x84	; 132
     77a:	93 e0       	ldi	r25, 0x03	; 3
     77c:	44 d5       	rcall	.+2696   	; 0x1206 <Scheduler_SetTaskMode>


						Scheduler_SetTaskMode(Command_Task, TASK_RUN);//process the data
     77e:	61 e0       	ldi	r22, 0x01	; 1
     780:	87 ef       	ldi	r24, 0xF7	; 247
     782:	91 e0       	ldi	r25, 0x01	; 1
     784:	40 d5       	rcall	.+2688   	; 0x1206 <Scheduler_SetTaskMode>
     786:	61 c0       	rjmp	.+194    	; 0x84a <CDC_Task+0x142>

						break;//don't care about any other data
					}
				}
				else if(mode == SERIAL)
     788:	91 30       	cpi	r25, 0x01	; 1
     78a:	09 f0       	breq	.+2      	; 0x78e <CDC_Task+0x86>
     78c:	59 c0       	rjmp	.+178    	; 0x840 <CDC_Task+0x138>
     78e:	10 91 f1 00 	lds	r17, 0x00F1
				{
					temp = Endpoint_Read_Byte();
					if(temp == '\\')
     792:	1c 35       	cpi	r17, 0x5C	; 92
     794:	79 f4       	brne	.+30     	; 0x7b4 <CDC_Task+0xac>
					{
						if (escapeCharReceived == true)
     796:	80 91 19 01 	lds	r24, 0x0119
     79a:	88 23       	and	r24, r24
     79c:	41 f0       	breq	.+16     	; 0x7ae <CDC_Task+0xa6>
						{

							escapeCharReceived = false;
     79e:	10 92 19 01 	sts	0x0119, r1
							Buffer_StoreElementOnTop(&Rx_Buffer, '\\');//pass on the old one
     7a2:	6c e5       	ldi	r22, 0x5C	; 92
     7a4:	80 e6       	ldi	r24, 0x60	; 96
     7a6:	91 e0       	ldi	r25, 0x01	; 1
     7a8:	78 d1       	rcall	.+752    	; 0xa9a <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Rx_Buffer, temp);//pass on the new one
     7aa:	6c e5       	ldi	r22, 0x5C	; 92
     7ac:	44 c0       	rjmp	.+136    	; 0x836 <CDC_Task+0x12e>
						}
						else
						{
							escapeCharReceived = true;
     7ae:	90 93 19 01 	sts	0x0119, r25
     7b2:	46 c0       	rjmp	.+140    	; 0x840 <CDC_Task+0x138>
						}
					}
					else if( escapeCharReceived == true)
     7b4:	80 91 19 01 	lds	r24, 0x0119
     7b8:	88 23       	and	r24, r24
     7ba:	09 f4       	brne	.+2      	; 0x7be <CDC_Task+0xb6>
     7bc:	3b c0       	rjmp	.+118    	; 0x834 <CDC_Task+0x12c>
					{
					
						if(temp == 'c' || temp == 'C')
     7be:	13 36       	cpi	r17, 0x63	; 99
     7c0:	11 f0       	breq	.+4      	; 0x7c6 <CDC_Task+0xbe>
     7c2:	13 34       	cpi	r17, 0x43	; 67
     7c4:	61 f5       	brne	.+88     	; 0x81e <CDC_Task+0x116>
						{
							/* Initiate the transmission of the buffer contents if USART idle */
							if (Transmitting == false && Rx_Buffer.Elements != 0)
     7c6:	80 91 18 01 	lds	r24, 0x0118
     7ca:	88 23       	and	r24, r24
     7cc:	81 f4       	brne	.+32     	; 0x7ee <CDC_Task+0xe6>
     7ce:	80 91 a4 01 	lds	r24, 0x01A4
     7d2:	88 23       	and	r24, r24
     7d4:	61 f0       	breq	.+24     	; 0x7ee <CDC_Task+0xe6>
							{
								Transmitting = true;
     7d6:	00 93 18 01 	sts	0x0118, r16
								Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
     7da:	80 e6       	ldi	r24, 0x60	; 96
     7dc:	91 e0       	ldi	r25, 0x01	; 1
     7de:	bf d1       	rcall	.+894    	; 0xb5e <Buffer_GetElementFromBottom>
     7e0:	98 2f       	mov	r25, r24
			 *
			 *  \param DataByte  Byte to transmit through the USART
			 */
			static inline void Serial_TxByte(const char DataByte)
			{
				while (!(UCSR1A & (1 << UDRE1)));
     7e2:	80 91 c8 00 	lds	r24, 0x00C8
     7e6:	85 ff       	sbrs	r24, 5
     7e8:	fc cf       	rjmp	.-8      	; 0x7e2 <CDC_Task+0xda>
				UDR1 = DataByte;
     7ea:	90 93 ce 00 	sts	0x00CE, r25
							}
							while(Transmitting == true)//wait until we finish
     7ee:	80 91 18 01 	lds	r24, 0x0118
     7f2:	88 23       	and	r24, r24
     7f4:	e1 f7       	brne	.-8      	; 0x7ee <CDC_Task+0xe6>
							{
								;
							}
							mode = COMMAND;
     7f6:	10 92 1a 01 	sts	0x011A, r1
							Buffer_Initialize(&Rx_Buffer);//clear out all data
     7fa:	80 e6       	ldi	r24, 0x60	; 96
     7fc:	91 e0       	ldi	r25, 0x01	; 1
     7fe:	39 d1       	rcall	.+626    	; 0xa72 <Buffer_Initialize>
							Buffer_Initialize(&Tx_Buffer);
     800:	8b e1       	ldi	r24, 0x1B	; 27
     802:	91 e0       	ldi	r25, 0x01	; 1
     804:	36 d1       	rcall	.+620    	; 0xa72 <Buffer_Initialize>

							Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     806:	6d e0       	ldi	r22, 0x0D	; 13
     808:	8b e1       	ldi	r24, 0x1B	; 27
     80a:	91 e0       	ldi	r25, 0x01	; 1
     80c:	46 d1       	rcall	.+652    	; 0xa9a <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     80e:	6a e0       	ldi	r22, 0x0A	; 10
     810:	8b e1       	ldi	r24, 0x1B	; 27
     812:	91 e0       	ldi	r25, 0x01	; 1
     814:	42 d1       	rcall	.+644    	; 0xa9a <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     816:	6e e3       	ldi	r22, 0x3E	; 62
     818:	8b e1       	ldi	r24, 0x1B	; 27
     81a:	91 e0       	ldi	r25, 0x01	; 1
     81c:	07 c0       	rjmp	.+14     	; 0x82c <CDC_Task+0x124>

						}
						else
						{
							Buffer_StoreElementOnTop(&Rx_Buffer, '\\');//pass on all the data
     81e:	6c e5       	ldi	r22, 0x5C	; 92
     820:	80 e6       	ldi	r24, 0x60	; 96
     822:	91 e0       	ldi	r25, 0x01	; 1
     824:	3a d1       	rcall	.+628    	; 0xa9a <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Rx_Buffer, temp);
     826:	61 2f       	mov	r22, r17
     828:	80 e6       	ldi	r24, 0x60	; 96
     82a:	91 e0       	ldi	r25, 0x01	; 1
     82c:	36 d1       	rcall	.+620    	; 0xa9a <Buffer_StoreElementOnTop>
						}

						escapeCharReceived = false;
     82e:	10 92 19 01 	sts	0x0119, r1
     832:	06 c0       	rjmp	.+12     	; 0x840 <CDC_Task+0x138>
					}
					else
					{
						Buffer_StoreElementOnTop(&Rx_Buffer, temp);
     834:	61 2f       	mov	r22, r17
     836:	80 e6       	ldi	r24, 0x60	; 96
     838:	91 e0       	ldi	r25, 0x01	; 1
     83a:	2f d1       	rcall	.+606    	; 0xa9a <Buffer_StoreElementOnTop>
     83c:	01 c0       	rjmp	.+2      	; 0x840 <CDC_Task+0x138>
						if(temp == 'c' || temp == 'C')
						{
							/* Initiate the transmission of the buffer contents if USART idle */
							if (Transmitting == false && Rx_Buffer.Elements != 0)
							{
								Transmitting = true;
     83e:	01 e0       	ldi	r16, 0x01	; 1
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);

		if (Endpoint_ReadWriteAllowed())
		{
			/* Read the recieved data endpoint into the transmission buffer */
			while (Endpoint_BytesInEndpoint())
     840:	80 91 f2 00 	lds	r24, 0x00F2
     844:	88 23       	and	r24, r24
     846:	09 f0       	breq	.+2      	; 0x84a <CDC_Task+0x142>
     848:	6e cf       	rjmp	.-292    	; 0x726 <CDC_Task+0x1e>
					}	
				}
			}

			/* Clear the endpoint buffer */
			Endpoint_ClearCurrentBank();
     84a:	80 91 e8 00 	lds	r24, 0x00E8
     84e:	8f 77       	andi	r24, 0x7F	; 127
     850:	80 93 e8 00 	sts	0x00E8, r24
		}
		

		/* Select the Serial Tx Endpoint */
		Endpoint_SelectEndpoint(CDC_TX_EPNUM);
     854:	83 e0       	ldi	r24, 0x03	; 3
     856:	80 93 e9 00 	sts	0x00E9, r24

		/* Initiate the transmission of the buffer contents if USART idle */
		if (Transmitting == false && mode == SERIAL && Rx_Buffer.Elements != 0)
     85a:	80 91 18 01 	lds	r24, 0x0118
     85e:	88 23       	and	r24, r24
     860:	a1 f4       	brne	.+40     	; 0x88a <CDC_Task+0x182>
     862:	90 91 1a 01 	lds	r25, 0x011A
     866:	91 30       	cpi	r25, 0x01	; 1
     868:	81 f4       	brne	.+32     	; 0x88a <CDC_Task+0x182>
     86a:	80 91 a4 01 	lds	r24, 0x01A4
     86e:	88 23       	and	r24, r24
     870:	61 f0       	breq	.+24     	; 0x88a <CDC_Task+0x182>
		{
				Transmitting = true;
     872:	90 93 18 01 	sts	0x0118, r25
				Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
     876:	80 e6       	ldi	r24, 0x60	; 96
     878:	91 e0       	ldi	r25, 0x01	; 1
     87a:	71 d1       	rcall	.+738    	; 0xb5e <Buffer_GetElementFromBottom>
     87c:	98 2f       	mov	r25, r24
			 *
			 *  \param DataByte  Byte to transmit through the USART
			 */
			static inline void Serial_TxByte(const char DataByte)
			{
				while (!(UCSR1A & (1 << UDRE1)));
     87e:	80 91 c8 00 	lds	r24, 0x00C8
     882:	85 ff       	sbrs	r24, 5
     884:	fc cf       	rjmp	.-8      	; 0x87e <CDC_Task+0x176>
				UDR1 = DataByte;
     886:	90 93 ce 00 	sts	0x00CE, r25
		}


		/* Write the Data to the Endpoint */
		if(Tx_Buffer.Elements != 0)
     88a:	80 91 5f 01 	lds	r24, 0x015F
     88e:	88 23       	and	r24, r24
     890:	f9 f0       	breq	.+62     	; 0x8d0 <CDC_Task+0x1c8>
		{

			do{
				/* Wait until Serial Tx Endpoint Ready for Read/Write */
				while (!(Endpoint_ReadWriteAllowed()));
     892:	80 91 e8 00 	lds	r24, 0x00E8
     896:	85 ff       	sbrs	r24, 5
     898:	fc cf       	rjmp	.-8      	; 0x892 <CDC_Task+0x18a>

				Endpoint_Write_Byte(Buffer_GetElementFromBottom(&Tx_Buffer));
     89a:	8b e1       	ldi	r24, 0x1B	; 27
     89c:	91 e0       	ldi	r25, 0x01	; 1
     89e:	5f d1       	rcall	.+702    	; 0xb5e <Buffer_GetElementFromBottom>
			}

			/** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints. */
			static inline void Endpoint_Write_Byte(const uint8_t Byte)
			{
				UEDATX = Byte;
     8a0:	80 93 f1 00 	sts	0x00F1, r24

				/* Check if the endpoint is full */
				if (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE)
     8a4:	80 91 f2 00 	lds	r24, 0x00F2
     8a8:	80 31       	cpi	r24, 0x10	; 16
     8aa:	49 f4       	brne	.+18     	; 0x8be <CDC_Task+0x1b6>
				{
					/* Send the data */
					Endpoint_ClearCurrentBank();
     8ac:	80 91 e8 00 	lds	r24, 0x00E8
     8b0:	8f 77       	andi	r24, 0x7F	; 127
     8b2:	80 93 e8 00 	sts	0x00E8, r24

					/* Wait until Serial Tx Endpoint Ready for Read/Write */
					while (!(Endpoint_ReadWriteAllowed()));
     8b6:	80 91 e8 00 	lds	r24, 0x00E8
     8ba:	85 ff       	sbrs	r24, 5
     8bc:	fc cf       	rjmp	.-8      	; 0x8b6 <CDC_Task+0x1ae>
				}
			}while (Tx_Buffer.Elements != 0);
     8be:	80 91 5f 01 	lds	r24, 0x015F
     8c2:	88 23       	and	r24, r24
     8c4:	31 f7       	brne	.-52     	; 0x892 <CDC_Task+0x18a>

			/* Send the last packet of the transfer to the host */
			Endpoint_ClearCurrentBank();
     8c6:	80 91 e8 00 	lds	r24, 0x00E8
     8ca:	8f 77       	andi	r24, 0x7F	; 127
     8cc:	80 93 e8 00 	sts	0x00E8, r24

		}
	}
}
     8d0:	1f 91       	pop	r17
     8d2:	0f 91       	pop	r16
     8d4:	08 95       	ret

000008d6 <Event_USB_UnhandledControlPacket>:
	/* Start CDC task */
	Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
}

EVENT_HANDLER(USB_UnhandledControlPacket)
{
     8d6:	81 32       	cpi	r24, 0x21	; 33
     8d8:	31 f0       	breq	.+12     	; 0x8e6 <Event_USB_UnhandledControlPacket+0x10>
     8da:	82 32       	cpi	r24, 0x22	; 34
     8dc:	49 f1       	breq	.+82     	; 0x930 <Event_USB_UnhandledControlPacket+0x5a>
     8de:	80 32       	cpi	r24, 0x20	; 32
     8e0:	09 f0       	breq	.+2      	; 0x8e4 <Event_USB_UnhandledControlPacket+0xe>
     8e2:	3d c0       	rjmp	.+122    	; 0x95e <Event_USB_UnhandledControlPacket+0x88>
     8e4:	13 c0       	rjmp	.+38     	; 0x90c <Event_USB_UnhandledControlPacket+0x36>

	/* Process CDC specific control requests */
	switch (bRequest)
	{
		case GET_LINE_CODING:
			if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
     8e6:	61 3a       	cpi	r22, 0xA1	; 161
     8e8:	09 f0       	breq	.+2      	; 0x8ec <Event_USB_UnhandledControlPacket+0x16>
     8ea:	39 c0       	rjmp	.+114    	; 0x95e <Event_USB_UnhandledControlPacket+0x88>
			{
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     8ec:	80 91 e8 00 	lds	r24, 0x00E8
     8f0:	87 7f       	andi	r24, 0xF7	; 247
     8f2:	80 93 e8 00 	sts	0x00E8, r24

				/* Write the line coding data to the control endpoint */
				Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
     8f6:	67 e0       	ldi	r22, 0x07	; 7
     8f8:	70 e0       	ldi	r23, 0x00	; 0
     8fa:	8e e0       	ldi	r24, 0x0E	; 14
     8fc:	91 e0       	ldi	r25, 0x01	; 1
     8fe:	35 d5       	rcall	.+2666   	; 0x136a <Endpoint_Write_Control_Stream_LE>

				/* Send the line coding data to the host and clear the control endpoint */
				Endpoint_ClearSetupOUT();
     900:	80 91 e8 00 	lds	r24, 0x00E8
     904:	8b 7f       	andi	r24, 0xFB	; 251
     906:	80 93 e8 00 	sts	0x00E8, r24
     90a:	08 95       	ret
			}

			break;
		case SET_LINE_CODING:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
     90c:	61 32       	cpi	r22, 0x21	; 33
     90e:	39 f5       	brne	.+78     	; 0x95e <Event_USB_UnhandledControlPacket+0x88>
			{
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     910:	80 91 e8 00 	lds	r24, 0x00E8
     914:	87 7f       	andi	r24, 0xF7	; 247
     916:	80 93 e8 00 	sts	0x00E8, r24

				/* Read the line coding data in from the host into the global struct */
				Endpoint_Read_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
     91a:	67 e0       	ldi	r22, 0x07	; 7
     91c:	70 e0       	ldi	r23, 0x00	; 0
     91e:	8e e0       	ldi	r24, 0x0E	; 14
     920:	91 e0       	ldi	r25, 0x01	; 1
     922:	67 d5       	rcall	.+2766   	; 0x13f2 <Endpoint_Read_Control_Stream_LE>

				/* Send the line coding data to the host and clear the control endpoint */
				Endpoint_ClearSetupIN();
     924:	80 91 e8 00 	lds	r24, 0x00E8
     928:	8e 7f       	andi	r24, 0xFE	; 254
     92a:	80 93 e8 00 	sts	0x00E8, r24

				/* Reconfigure the USART with the new settings */
				ReconfigureUSART();
     92e:	3d cc       	rjmp	.-1926   	; 0x1aa <ReconfigureUSART>
			}

			break;
		case SET_CONTROL_LINE_STATE:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
     930:	61 32       	cpi	r22, 0x21	; 33
     932:	a9 f4       	brne	.+42     	; 0x95e <Event_USB_UnhandledControlPacket+0x88>
			{
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     934:	80 91 e8 00 	lds	r24, 0x00E8
     938:	87 7f       	andi	r24, 0xF7	; 247
     93a:	80 93 e8 00 	sts	0x00E8, r24

				/* Send an empty packet to acknowedge the command (currently unused) */
				Endpoint_ClearSetupIN();
     93e:	80 91 e8 00 	lds	r24, 0x00E8
     942:	8e 7f       	andi	r24, 0xFE	; 254
     944:	80 93 e8 00 	sts	0x00E8, r24
				if(mode == COMMAND)
     948:	80 91 1a 01 	lds	r24, 0x011A
     94c:	88 23       	and	r24, r24
     94e:	39 f4       	brne	.+14     	; 0x95e <Event_USB_UnhandledControlPacket+0x88>
				{
					
					StringToBuffer_P(PSTR("SOC Robotics USB10, (c) 2008\r\n\r\n"));
     950:	80 eb       	ldi	r24, 0xB0	; 176
     952:	90 e0       	ldi	r25, 0x00	; 0
     954:	3a dd       	rcall	.-1420   	; 0x3ca <StringToBuffer_P>
					Buffer_StoreElementOnTop(&Tx_Buffer, '>');//prompt character
     956:	6e e3       	ldi	r22, 0x3E	; 62
     958:	8b e1       	ldi	r24, 0x1B	; 27
     95a:	91 e0       	ldi	r25, 0x01	; 1
     95c:	9e c0       	rjmp	.+316    	; 0xa9a <Buffer_StoreElementOnTop>
     95e:	08 95       	ret

00000960 <Event_USB_ConfigurationChanged>:
	Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);

}

EVENT_HANDLER(USB_ConfigurationChanged)
{
     960:	20 e0       	ldi	r18, 0x00	; 0
     962:	41 ec       	ldi	r20, 0xC1	; 193
     964:	68 e0       	ldi	r22, 0x08	; 8
     966:	70 e0       	ldi	r23, 0x00	; 0
     968:	82 e0       	ldi	r24, 0x02	; 2
     96a:	d8 d4       	rcall	.+2480   	; 0x131c <Endpoint_ConfigureEndpoint_P>
	/* Setup CDC Notification, Rx and Tx Endpoints */
	Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
		                       ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
	                           ENDPOINT_BANK_SINGLE);

	Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK,
     96c:	24 e0       	ldi	r18, 0x04	; 4
     96e:	41 e8       	ldi	r20, 0x81	; 129
     970:	60 e1       	ldi	r22, 0x10	; 16
     972:	70 e0       	ldi	r23, 0x00	; 0
     974:	83 e0       	ldi	r24, 0x03	; 3
     976:	d2 d4       	rcall	.+2468   	; 0x131c <Endpoint_ConfigureEndpoint_P>
		                       ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
	                           ENDPOINT_BANK_DOUBLE);

	Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
     978:	24 e0       	ldi	r18, 0x04	; 4
     97a:	40 e8       	ldi	r20, 0x80	; 128
     97c:	60 e1       	ldi	r22, 0x10	; 16
     97e:	70 e0       	ldi	r23, 0x00	; 0
     980:	84 e0       	ldi	r24, 0x04	; 4
     982:	cc d4       	rcall	.+2456   	; 0x131c <Endpoint_ConfigureEndpoint_P>
		                       ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
	                           ENDPOINT_BANK_DOUBLE);


	/* Start CDC task */
	Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     984:	61 e0       	ldi	r22, 0x01	; 1
     986:	84 e8       	ldi	r24, 0x84	; 132
     988:	93 e0       	ldi	r25, 0x03	; 3
}
     98a:	3d c4       	rjmp	.+2170   	; 0x1206 <Scheduler_SetTaskMode>

0000098c <main>:

const char MYSTRING[] PROGMEM = "I'm in Flash";


int main(void)
{
     98c:	1f 93       	push	r17
     98e:	cf 93       	push	r28
     990:	df 93       	push	r29
	/* Disable watchdog if enabled by bootloader/fuses */
	MCUSR &= ~(1 << WDRF);
     992:	84 b7       	in	r24, 0x34	; 52
     994:	87 7f       	andi	r24, 0xF7	; 247
     996:	84 bf       	out	0x34, r24	; 52
	wdt_disable();
     998:	88 e1       	ldi	r24, 0x18	; 24
     99a:	0f b6       	in	r0, 0x3f	; 63
     99c:	f8 94       	cli
     99e:	80 93 60 00 	sts	0x0060, r24
     9a2:	10 92 60 00 	sts	0x0060, r1
     9a6:	0f be       	out	0x3f, r0	; 63
			 *  \param PrescalerMask   The mask of the new prescaler setting for CLKPR
			 */
			static inline void SetSystemClockPrescaler(uint8_t PrescalerMask)
			{
					uint8_t tmp = (1 << CLKPCE);
					__asm__ __volatile__ (
     9a8:	91 e0       	ldi	r25, 0x01	; 1
     9aa:	80 e8       	ldi	r24, 0x80	; 128
     9ac:	0f b6       	in	r0, 0x3f	; 63
     9ae:	f8 94       	cli
     9b0:	80 93 61 00 	sts	0x0061, r24
     9b4:	90 93 61 00 	sts	0x0061, r25
     9b8:	0f be       	out	0x3f, r0	; 63

	/* Divide the 16Mhz crystal clock to 8Mhz to allow for 3.3V operation*/
	SetSystemClockPrescaler(1);

	I2C_Init();
     9ba:	40 d1       	rcall	.+640    	; 0xc3c <I2C_Init>
	StepDirLineCoding_Init();
     9bc:	46 d3       	rcall	.+1676   	; 0x104a <StepDirLineCoding_Init>

	greenLedOff();//this may interfere with the above
     9be:	2d 9a       	sbi	0x05, 5	; 5
	redLedOff();
     9c0:	42 9a       	sbi	0x08, 2	; 8

	DDRC |= (1<<2);
     9c2:	3a 9a       	sbi	0x07, 2	; 7
	DDRB |= (1<<5);
     9c4:	25 9a       	sbi	0x04, 5	; 4


	/* Ringbuffer Initialization */
	Buffer_Initialize(&Rx_Buffer);
     9c6:	80 e6       	ldi	r24, 0x60	; 96
     9c8:	91 e0       	ldi	r25, 0x01	; 1
     9ca:	53 d0       	rcall	.+166    	; 0xa72 <Buffer_Initialize>
	Buffer_Initialize(&Tx_Buffer);
     9cc:	8b e1       	ldi	r24, 0x1B	; 27
     9ce:	91 e0       	ldi	r25, 0x01	; 1
     9d0:	50 d0       	rcall	.+160    	; 0xa72 <Buffer_Initialize>
			#define MAX_DELAYCTR_COUNT                0xFFFF

		/* Inline Functions: */
			static inline void Scheduler_InitScheduler(const uint8_t TotalTasks)
			{
				Scheduler_TotalTasks = TotalTasks;
     9d2:	13 e0       	ldi	r17, 0x03	; 3
     9d4:	10 93 a5 01 	sts	0x01A5, r17

	/* Initialize Scheduler so that it can be used */
	Scheduler_Init();

	/* Initialize USB Subsystem */
	USB_Init();
     9d8:	96 d4       	rcall	.+2348   	; 0x1306 <USB_Init>
     9da:	10 93 a5 01 	sts	0x01A5, r17
     9de:	c2 e0       	ldi	r28, 0x02	; 2
     9e0:	d1 e0       	ldi	r29, 0x01	; 1
     9e2:	07 c0       	rjmp	.+14     	; 0x9f2 <main+0x66>
				{
					TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
					while (CurrTask != &Scheduler_TaskList[TotalTasks])
					{
						if (CurrTask->TaskStatus == TASK_RUN)
     9e4:	8a 81       	ldd	r24, Y+2	; 0x02
     9e6:	88 23       	and	r24, r24
     9e8:	19 f0       	breq	.+6      	; 0x9f0 <main+0x64>
						  CurrTask->Task();
     9ea:	e8 81       	ld	r30, Y
     9ec:	f9 81       	ldd	r31, Y+1	; 0x01
     9ee:	09 95       	icall

						CurrTask++;
     9f0:	24 96       	adiw	r28, 0x04	; 4

				for (;;)
				{
					TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
					while (CurrTask != &Scheduler_TaskList[TotalTasks])
     9f2:	81 e0       	ldi	r24, 0x01	; 1
     9f4:	ce 30       	cpi	r28, 0x0E	; 14
     9f6:	d8 07       	cpc	r29, r24
     9f8:	a9 f7       	brne	.-22     	; 0x9e4 <main+0x58>
     9fa:	2c 97       	sbiw	r28, 0x0c	; 12
     9fc:	fa cf       	rjmp	.-12     	; 0x9f2 <main+0x66>

000009fe <USB_GetDescriptor>:
	UnicodeString:          L"MyUSB USB-RS232 Demo"
};

bool USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
                       void** const DescriptorAddress, uint16_t* const DescriptorSize)
{
     9fe:	cf 93       	push	r28
     a00:	df 93       	push	r29
     a02:	da 01       	movw	r26, r20
     a04:	e9 01       	movw	r28, r18
	void*    Address = NULL;
	uint16_t Size    = 0;

	switch (wValue >> 8)
     a06:	29 2f       	mov	r18, r25
     a08:	33 27       	eor	r19, r19
     a0a:	22 30       	cpi	r18, 0x02	; 2
     a0c:	31 05       	cpc	r19, r1
     a0e:	39 f0       	breq	.+14     	; 0xa1e <USB_GetDescriptor+0x20>
     a10:	23 30       	cpi	r18, 0x03	; 3
     a12:	31 05       	cpc	r19, r1
     a14:	49 f0       	breq	.+18     	; 0xa28 <USB_GetDescriptor+0x2a>
     a16:	21 30       	cpi	r18, 0x01	; 1
     a18:	31 05       	cpc	r19, r1
     a1a:	e9 f4       	brne	.+58     	; 0xa56 <USB_GetDescriptor+0x58>
     a1c:	20 c0       	rjmp	.+64     	; 0xa5e <USB_GetDescriptor+0x60>
     a1e:	e3 ee       	ldi	r30, 0xE3	; 227
     a20:	f0 e0       	ldi	r31, 0x00	; 0
     a22:	83 e4       	ldi	r24, 0x43	; 67
     a24:	90 e0       	ldi	r25, 0x00	; 0
     a26:	1f c0       	rjmp	.+62     	; 0xa66 <USB_GetDescriptor+0x68>
		case DTYPE_Configuration:
			Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
			Size    = sizeof(USB_Descriptor_Configuration_t);
			break;
		case DTYPE_String:
			switch (wValue & 0xFF)
     a28:	90 70       	andi	r25, 0x00	; 0
     a2a:	81 30       	cpi	r24, 0x01	; 1
     a2c:	91 05       	cpc	r25, r1
     a2e:	51 f0       	breq	.+20     	; 0xa44 <USB_GetDescriptor+0x46>
     a30:	81 30       	cpi	r24, 0x01	; 1
     a32:	91 05       	cpc	r25, r1
     a34:	18 f0       	brcs	.+6      	; 0xa3c <USB_GetDescriptor+0x3e>
     a36:	02 97       	sbiw	r24, 0x02	; 2
     a38:	71 f4       	brne	.+28     	; 0xa56 <USB_GetDescriptor+0x58>
     a3a:	08 c0       	rjmp	.+16     	; 0xa4c <USB_GetDescriptor+0x4e>
			{
				case 0x00:
					Address = DESCRIPTOR_ADDRESS(LanguageString);
					Size    = pgm_read_byte(&LanguageString.Header.Size);
     a3c:	e6 e2       	ldi	r30, 0x26	; 38
     a3e:	f1 e0       	ldi	r31, 0x01	; 1
     a40:	84 91       	lpm	r24, Z+
     a42:	07 c0       	rjmp	.+14     	; 0xa52 <USB_GetDescriptor+0x54>
					break;
				case 0x01:
					Address = DESCRIPTOR_ADDRESS(ManufacturerString);
					Size    = pgm_read_byte(&ManufacturerString.Header.Size);
     a44:	ea e2       	ldi	r30, 0x2A	; 42
     a46:	f1 e0       	ldi	r31, 0x01	; 1
     a48:	84 91       	lpm	r24, Z+
     a4a:	03 c0       	rjmp	.+6      	; 0xa52 <USB_GetDescriptor+0x54>
					break;
				case 0x02:
					Address = DESCRIPTOR_ADDRESS(ProductString);
					Size    = pgm_read_byte(&ProductString.Header.Size);
     a4c:	e4 e4       	ldi	r30, 0x44	; 68
     a4e:	f1 e0       	ldi	r31, 0x01	; 1
     a50:	84 91       	lpm	r24, Z+
     a52:	90 e0       	ldi	r25, 0x00	; 0
     a54:	08 c0       	rjmp	.+16     	; 0xa66 <USB_GetDescriptor+0x68>
     a56:	80 e0       	ldi	r24, 0x00	; 0

		return true;
	}
		
	return false;
}
     a58:	df 91       	pop	r29
     a5a:	cf 91       	pop	r28
     a5c:	08 95       	ret
					Address = DESCRIPTOR_ADDRESS(ManufacturerString);
					Size    = pgm_read_byte(&ManufacturerString.Header.Size);
					break;
				case 0x02:
					Address = DESCRIPTOR_ADDRESS(ProductString);
					Size    = pgm_read_byte(&ProductString.Header.Size);
     a5e:	e1 ed       	ldi	r30, 0xD1	; 209
     a60:	f0 e0       	ldi	r31, 0x00	; 0
     a62:	82 e1       	ldi	r24, 0x12	; 18
     a64:	90 e0       	ldi	r25, 0x00	; 0
			break;
	}
	
	if (Address != NULL)
	{
		*DescriptorAddress = Address;
     a66:	ed 93       	st	X+, r30
     a68:	fc 93       	st	X, r31
		*DescriptorSize    = Size;
     a6a:	99 83       	std	Y+1, r25	; 0x01
     a6c:	88 83       	st	Y, r24
     a6e:	81 e0       	ldi	r24, 0x01	; 1
     a70:	f3 cf       	rjmp	.-26     	; 0xa58 <USB_GetDescriptor+0x5a>

00000a72 <Buffer_Initialize>:
*/

#include "RingBuff.h"

void Buffer_Initialize(RingBuff_t* Buffer)
{
     a72:	fc 01       	movw	r30, r24
	BUFF_ATOMIC_BLOCK
     a74:	8f b7       	in	r24, 0x3f	; 63
    return 1;
}

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     a76:	f8 94       	cli
	{
		Buffer->TopPtr    = (RingBuff_Data_t*)&Buffer->Buffer;
     a78:	df 01       	movw	r26, r30
     a7a:	a0 5c       	subi	r26, 0xC0	; 192
     a7c:	bf 4f       	sbci	r27, 0xFF	; 255
     a7e:	11 96       	adiw	r26, 0x01	; 1
     a80:	fc 93       	st	X, r31
     a82:	ee 93       	st	-X, r30
		Buffer->BottomPtr   = (RingBuff_Data_t*)&Buffer->Buffer;
     a84:	df 01       	movw	r26, r30
     a86:	ae 5b       	subi	r26, 0xBE	; 190
     a88:	bf 4f       	sbci	r27, 0xFF	; 255
     a8a:	11 96       	adiw	r26, 0x01	; 1
     a8c:	fc 93       	st	X, r31
     a8e:	ee 93       	st	-X, r30
		Buffer->Elements = 0;
     a90:	ec 5b       	subi	r30, 0xBC	; 188
     a92:	ff 4f       	sbci	r31, 0xFF	; 255
     a94:	10 82       	st	Z, r1
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     a96:	8f bf       	out	0x3f, r24	; 63
    __asm__ volatile ("" ::: "memory");
     a98:	08 95       	ret

00000a9a <Buffer_StoreElementOnTop>:
	}
}

void Buffer_StoreElementOnTop(RingBuff_t* Buffer, RingBuff_Data_t Data)
{
     a9a:	ac 01       	movw	r20, r24
	BUFF_ATOMIC_BLOCK
     a9c:	7f b7       	in	r23, 0x3f	; 63
    return 1;
}

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     a9e:	f8 94       	cli
	{
		if (Buffer->Elements == BUFF_LENGTH)//i.e. buffer is full.  So we will remove our oldest data
     aa0:	fc 01       	movw	r30, r24
     aa2:	ec 5b       	subi	r30, 0xBC	; 188
     aa4:	ff 4f       	sbci	r31, 0xFF	; 255
     aa6:	80 81       	ld	r24, Z
     aa8:	80 34       	cpi	r24, 0x40	; 64
     aaa:	99 f4       	brne	.+38     	; 0xad2 <Buffer_StoreElementOnTop+0x38>
		{
			Buffer->BottomPtr++;
     aac:	fa 01       	movw	r30, r20
     aae:	ee 5b       	subi	r30, 0xBE	; 190
     ab0:	ff 4f       	sbci	r31, 0xFF	; 255
     ab2:	80 81       	ld	r24, Z
     ab4:	91 81       	ldd	r25, Z+1	; 0x01
     ab6:	01 96       	adiw	r24, 0x01	; 1
     ab8:	91 83       	std	Z+1, r25	; 0x01
     aba:	80 83       	st	Z, r24

			if (Buffer->BottomPtr == &Buffer->Buffer[BUFF_LENGTH])
     abc:	20 81       	ld	r18, Z
     abe:	31 81       	ldd	r19, Z+1	; 0x01
     ac0:	ca 01       	movw	r24, r20
     ac2:	80 5c       	subi	r24, 0xC0	; 192
     ac4:	9f 4f       	sbci	r25, 0xFF	; 255
     ac6:	28 17       	cp	r18, r24
     ac8:	39 07       	cpc	r19, r25
     aca:	31 f4       	brne	.+12     	; 0xad8 <Buffer_StoreElementOnTop+0x3e>
			{
				Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     acc:	51 83       	std	Z+1, r21	; 0x01
     ace:	40 83       	st	Z, r20
     ad0:	03 c0       	rjmp	.+6      	; 0xad8 <Buffer_StoreElementOnTop+0x3e>
			}
		}
		else
		{
			Buffer->Elements++;
     ad2:	80 81       	ld	r24, Z
     ad4:	8f 5f       	subi	r24, 0xFF	; 255
     ad6:	80 83       	st	Z, r24
		}


		*(Buffer->TopPtr) = Data;
     ad8:	da 01       	movw	r26, r20
     ada:	a0 5c       	subi	r26, 0xC0	; 192
     adc:	bf 4f       	sbci	r27, 0xFF	; 255
     ade:	ed 91       	ld	r30, X+
     ae0:	fc 91       	ld	r31, X
     ae2:	11 97       	sbiw	r26, 0x01	; 1
     ae4:	60 83       	st	Z, r22
		Buffer->TopPtr++;
     ae6:	8d 91       	ld	r24, X+
     ae8:	9c 91       	ld	r25, X
     aea:	11 97       	sbiw	r26, 0x01	; 1
     aec:	01 96       	adiw	r24, 0x01	; 1
     aee:	11 96       	adiw	r26, 0x01	; 1
     af0:	9c 93       	st	X, r25
     af2:	8e 93       	st	-X, r24

		if (Buffer->TopPtr == &Buffer->Buffer[BUFF_LENGTH])
     af4:	ed 91       	ld	r30, X+
     af6:	fc 91       	ld	r31, X
     af8:	11 97       	sbiw	r26, 0x01	; 1
     afa:	ea 17       	cp	r30, r26
     afc:	fb 07       	cpc	r31, r27
     afe:	11 f4       	brne	.+4      	; 0xb04 <Buffer_StoreElementOnTop+0x6a>
		{
			Buffer->TopPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     b00:	51 83       	std	Z+1, r21	; 0x01
     b02:	40 83       	st	Z, r20
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     b04:	7f bf       	out	0x3f, r23	; 63
    __asm__ volatile ("" ::: "memory");
     b06:	08 95       	ret

00000b08 <Buffer_GetElementFromTop>:
		}
	}
}

RingBuff_Data_t Buffer_GetElementFromTop(RingBuff_t* Buffer)
{
     b08:	dc 01       	movw	r26, r24
	RingBuff_Data_t BuffData;

	BUFF_ATOMIC_BLOCK
     b0a:	2f b7       	in	r18, 0x3f	; 63
    return 1;
}

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     b0c:	f8 94       	cli
	{
		if (!(Buffer->Elements))
     b0e:	ac 5b       	subi	r26, 0xBC	; 188
     b10:	bf 4f       	sbci	r27, 0xFF	; 255
     b12:	8c 91       	ld	r24, X
     b14:	a4 54       	subi	r26, 0x44	; 68
     b16:	b0 40       	sbci	r27, 0x00	; 0
     b18:	88 23       	and	r24, r24
     b1a:	11 f4       	brne	.+4      	; 0xb20 <Buffer_GetElementFromTop+0x18>
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     b1c:	2f bf       	out	0x3f, r18	; 63
    __asm__ volatile ("" ::: "memory");
     b1e:	08 95       	ret
		{
			return 0;
		}

		if(Buffer->TopPtr == (RingBuff_Data_t*)&Buffer->Buffer)//at index 0
     b20:	fd 01       	movw	r30, r26
     b22:	e0 5c       	subi	r30, 0xC0	; 192
     b24:	ff 4f       	sbci	r31, 0xFF	; 255
     b26:	80 81       	ld	r24, Z
     b28:	91 81       	ldd	r25, Z+1	; 0x01
     b2a:	8a 17       	cp	r24, r26
     b2c:	9b 07       	cpc	r25, r27
     b2e:	29 f4       	brne	.+10     	; 0xb3a <Buffer_GetElementFromTop+0x32>
		{
			Buffer->TopPtr = (RingBuff_Data_t*)&Buffer->Buffer[BUFF_LENGTH-1];//now at the top of the array
     b30:	df 96       	adiw	r26, 0x3f	; 63
     b32:	b1 83       	std	Z+1, r27	; 0x01
     b34:	a0 83       	st	Z, r26
     b36:	df 97       	sbiw	r26, 0x3f	; 63
     b38:	05 c0       	rjmp	.+10     	; 0xb44 <Buffer_GetElementFromTop+0x3c>
		}
		else
		{
			Buffer->TopPtr--;
     b3a:	80 81       	ld	r24, Z
     b3c:	91 81       	ldd	r25, Z+1	; 0x01
     b3e:	01 97       	sbiw	r24, 0x01	; 1
     b40:	91 83       	std	Z+1, r25	; 0x01
     b42:	80 83       	st	Z, r24
		}

		Buffer->Elements--;
     b44:	fd 01       	movw	r30, r26
     b46:	ec 5b       	subi	r30, 0xBC	; 188
     b48:	ff 4f       	sbci	r31, 0xFF	; 255
     b4a:	80 81       	ld	r24, Z
     b4c:	81 50       	subi	r24, 0x01	; 1
     b4e:	80 83       	st	Z, r24

		BuffData = *(Buffer->TopPtr);
     b50:	a0 5c       	subi	r26, 0xC0	; 192
     b52:	bf 4f       	sbci	r27, 0xFF	; 255
     b54:	ed 91       	ld	r30, X+
     b56:	fc 91       	ld	r31, X
     b58:	80 81       	ld	r24, Z
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     b5a:	2f bf       	out	0x3f, r18	; 63
    __asm__ volatile ("" ::: "memory");
     b5c:	08 95       	ret

00000b5e <Buffer_GetElementFromBottom>:
	return BuffData;
}

//if no elements return 0
RingBuff_Data_t Buffer_GetElementFromBottom(RingBuff_t* Buffer)
{
     b5e:	cf 93       	push	r28
     b60:	df 93       	push	r29
     b62:	ac 01       	movw	r20, r24
	RingBuff_Data_t BuffData;

	BUFF_ATOMIC_BLOCK
     b64:	6f b7       	in	r22, 0x3f	; 63
    return 1;
}

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     b66:	f8 94       	cli
	{
		if (!(Buffer->Elements))
     b68:	ec 01       	movw	r28, r24
     b6a:	cc 5b       	subi	r28, 0xBC	; 188
     b6c:	df 4f       	sbci	r29, 0xFF	; 255
     b6e:	88 81       	ld	r24, Y
     b70:	88 23       	and	r24, r24
     b72:	19 f4       	brne	.+6      	; 0xb7a <Buffer_GetElementFromBottom+0x1c>
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     b74:	6f bf       	out	0x3f, r22	; 63
    __asm__ volatile ("" ::: "memory");
     b76:	e0 e0       	ldi	r30, 0x00	; 0
     b78:	1e c0       	rjmp	.+60     	; 0xbb6 <Buffer_GetElementFromBottom+0x58>
		  return 0;

		BuffData = *(Buffer->BottomPtr);
     b7a:	da 01       	movw	r26, r20
     b7c:	ae 5b       	subi	r26, 0xBE	; 190
     b7e:	bf 4f       	sbci	r27, 0xFF	; 255
     b80:	ed 91       	ld	r30, X+
     b82:	fc 91       	ld	r31, X
     b84:	11 97       	sbiw	r26, 0x01	; 1
     b86:	e0 81       	ld	r30, Z

		Buffer->BottomPtr++;
     b88:	8d 91       	ld	r24, X+
     b8a:	9c 91       	ld	r25, X
     b8c:	11 97       	sbiw	r26, 0x01	; 1
     b8e:	01 96       	adiw	r24, 0x01	; 1
     b90:	11 96       	adiw	r26, 0x01	; 1
     b92:	9c 93       	st	X, r25
     b94:	8e 93       	st	-X, r24
		Buffer->Elements--;
     b96:	88 81       	ld	r24, Y
     b98:	81 50       	subi	r24, 0x01	; 1
     b9a:	88 83       	st	Y, r24

		if (Buffer->BottomPtr == &Buffer->Buffer[BUFF_LENGTH])
     b9c:	2d 91       	ld	r18, X+
     b9e:	3c 91       	ld	r19, X
     ba0:	11 97       	sbiw	r26, 0x01	; 1
     ba2:	ca 01       	movw	r24, r20
     ba4:	80 5c       	subi	r24, 0xC0	; 192
     ba6:	9f 4f       	sbci	r25, 0xFF	; 255
     ba8:	28 17       	cp	r18, r24
     baa:	39 07       	cpc	r19, r25
     bac:	19 f4       	brne	.+6      	; 0xbb4 <Buffer_GetElementFromBottom+0x56>
		  Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     bae:	11 96       	adiw	r26, 0x01	; 1
     bb0:	5c 93       	st	X, r21
     bb2:	4e 93       	st	-X, r20
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     bb4:	6f bf       	out	0x3f, r22	; 63
    __asm__ volatile ("" ::: "memory");
     bb6:	8e 2f       	mov	r24, r30
     bb8:	df 91       	pop	r29
     bba:	cf 91       	pop	r28
     bbc:	08 95       	ret

00000bbe <Buffer_StoreElementOnBottom>:

	return BuffData;
}
//does not check to see if the buffer is full.
void Buffer_StoreElementOnBottom(RingBuff_t* Buffer, RingBuff_Data_t Data)
{
     bbe:	dc 01       	movw	r26, r24
	BUFF_ATOMIC_BLOCK
     bc0:	2f b7       	in	r18, 0x3f	; 63
    return 1;
}

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     bc2:	f8 94       	cli
	{
		if(Buffer->Elements == BUFF_LENGTH)//i.e. buffer is full.  So we have no room
     bc4:	ac 5b       	subi	r26, 0xBC	; 188
     bc6:	bf 4f       	sbci	r27, 0xFF	; 255
     bc8:	8c 91       	ld	r24, X
     bca:	a4 54       	subi	r26, 0x44	; 68
     bcc:	b0 40       	sbci	r27, 0x00	; 0
     bce:	80 34       	cpi	r24, 0x40	; 64
     bd0:	d9 f0       	breq	.+54     	; 0xc08 <Buffer_StoreElementOnBottom+0x4a>
		{
			return;
		}
		if(Buffer->BottomPtr == (RingBuff_Data_t*)&Buffer->Buffer)
     bd2:	fd 01       	movw	r30, r26
     bd4:	ee 5b       	subi	r30, 0xBE	; 190
     bd6:	ff 4f       	sbci	r31, 0xFF	; 255
     bd8:	80 81       	ld	r24, Z
     bda:	91 81       	ldd	r25, Z+1	; 0x01
     bdc:	8a 17       	cp	r24, r26
     bde:	9b 07       	cpc	r25, r27
     be0:	29 f4       	brne	.+10     	; 0xbec <Buffer_StoreElementOnBottom+0x2e>
		{
			Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer[BUFF_LENGTH-1];
     be2:	df 96       	adiw	r26, 0x3f	; 63
     be4:	b1 83       	std	Z+1, r27	; 0x01
     be6:	a0 83       	st	Z, r26
     be8:	df 97       	sbiw	r26, 0x3f	; 63
     bea:	05 c0       	rjmp	.+10     	; 0xbf6 <Buffer_StoreElementOnBottom+0x38>
		}
		else
		{
			Buffer->BottomPtr--;
     bec:	80 81       	ld	r24, Z
     bee:	91 81       	ldd	r25, Z+1	; 0x01
     bf0:	01 97       	sbiw	r24, 0x01	; 1
     bf2:	91 83       	std	Z+1, r25	; 0x01
     bf4:	80 83       	st	Z, r24
		}

		*(Buffer->BottomPtr) = Data;
     bf6:	ae 5b       	subi	r26, 0xBE	; 190
     bf8:	bf 4f       	sbci	r27, 0xFF	; 255
     bfa:	ed 91       	ld	r30, X+
     bfc:	fd 91       	ld	r31, X+
     bfe:	60 83       	st	Z, r22
		Buffer->Elements++;
     c00:	fd 01       	movw	r30, r26
     c02:	80 81       	ld	r24, Z
     c04:	8f 5f       	subi	r24, 0xFF	; 255
     c06:	80 83       	st	Z, r24
    (void)__s;
}

static __inline__ void __iRestore(const  uint8_t *__s)
{
    SREG = *__s;
     c08:	2f bf       	out	0x3f, r18	; 63
    __asm__ volatile ("" ::: "memory");
     c0a:	08 95       	ret

00000c0c <Set_High>:
}



void Set_High(uint8_t x)
{
     c0c:	90 91 15 01 	lds	r25, 0x0115
     c10:	92 33       	cpi	r25, 0x32	; 50
     c12:	41 f0       	breq	.+16     	; 0xc24 <Set_High+0x18>
     c14:	93 33       	cpi	r25, 0x33	; 51
     c16:	61 f0       	breq	.+24     	; 0xc30 <Set_High+0x24>
     c18:	91 33       	cpi	r25, 0x31	; 49
     c1a:	79 f4       	brne	.+30     	; 0xc3a <Set_High+0x2e>
	switch(I2C_Port)
	{
		case '1':
			if(x == SCL)
     c1c:	88 23       	and	r24, r24
     c1e:	31 f0       	breq	.+12     	; 0xc2c <Set_High+0x20>
			{
				DDRD &= ~(1<<5);
			}
			else
			{
				DDRD &= ~(1<<6);
     c20:	56 98       	cbi	0x0a, 6	; 10
     c22:	08 95       	ret
			}
			break;
		case '2':
			if(x == SCL)
     c24:	88 23       	and	r24, r24
     c26:	11 f4       	brne	.+4      	; 0xc2c <Set_High+0x20>
			{
				DDRD &= ~(1<<4);
     c28:	54 98       	cbi	0x0a, 4	; 10
     c2a:	08 95       	ret
			}
			else
			{
				DDRD &= ~(1<<5);
     c2c:	55 98       	cbi	0x0a, 5	; 10
     c2e:	08 95       	ret
			}
			break;
		case '3':
			if(x == SCL)
     c30:	88 23       	and	r24, r24
     c32:	11 f4       	brne	.+4      	; 0xc38 <Set_High+0x2c>
			{
				DDRB &= ~(1<<3);
     c34:	23 98       	cbi	0x04, 3	; 4
     c36:	08 95       	ret
			}
			else
			{
				DDRB &= ~(1<<0);
     c38:	20 98       	cbi	0x04, 0	; 4
     c3a:	08 95       	ret

00000c3c <I2C_Init>:
volatile uint8_t I2C_Port = '1';
/*
 * This function will set up the I2C port pins to their correct values
 */ 
void I2C_Init(void)
{
     c3c:	80 91 15 01 	lds	r24, 0x0115
     c40:	82 33       	cpi	r24, 0x32	; 50
     c42:	39 f0       	breq	.+14     	; 0xc52 <I2C_Init+0x16>
     c44:	83 33       	cpi	r24, 0x33	; 51
     c46:	49 f0       	breq	.+18     	; 0xc5a <I2C_Init+0x1e>
     c48:	81 33       	cpi	r24, 0x31	; 49
     c4a:	51 f4       	brne	.+20     	; 0xc60 <I2C_Init+0x24>
	
	switch(I2C_Port)
	{
		case '1':
			PORTD &= ~((1<<5) | (1<<6));
     c4c:	8b b1       	in	r24, 0x0b	; 11
     c4e:	8f 79       	andi	r24, 0x9F	; 159
     c50:	02 c0       	rjmp	.+4      	; 0xc56 <I2C_Init+0x1a>
			break;
		case '2':
			PORTD &= ~((1<<4) | (1<<5));
     c52:	8b b1       	in	r24, 0x0b	; 11
     c54:	8f 7c       	andi	r24, 0xCF	; 207
     c56:	8b b9       	out	0x0b, r24	; 11
     c58:	03 c0       	rjmp	.+6      	; 0xc60 <I2C_Init+0x24>
			break;
		case '3':
			PORTB &= ~((1<<0) | (1<<3));
     c5a:	85 b1       	in	r24, 0x05	; 5
     c5c:	86 7f       	andi	r24, 0xF6	; 246
     c5e:	85 b9       	out	0x05, r24	; 5
			break;
	}	
	
	Set_High(SDA);
     c60:	81 e0       	ldi	r24, 0x01	; 1
     c62:	d4 df       	rcall	.-88     	; 0xc0c <Set_High>
	Set_High(SCL);//ensure that the I2C lines are released
     c64:	80 e0       	ldi	r24, 0x00	; 0
}
     c66:	d2 cf       	rjmp	.-92     	; 0xc0c <Set_High>

00000c68 <Set_Low>:
			break;
	}

} 
void Set_Low(uint8_t x)
{
     c68:	90 91 15 01 	lds	r25, 0x0115
     c6c:	92 33       	cpi	r25, 0x32	; 50
     c6e:	41 f0       	breq	.+16     	; 0xc80 <Set_Low+0x18>
     c70:	93 33       	cpi	r25, 0x33	; 51
     c72:	61 f0       	breq	.+24     	; 0xc8c <Set_Low+0x24>
     c74:	91 33       	cpi	r25, 0x31	; 49
     c76:	79 f4       	brne	.+30     	; 0xc96 <Set_Low+0x2e>
	switch(I2C_Port)
	{
		case '1'://to molex
			if(x == SCL)
     c78:	88 23       	and	r24, r24
     c7a:	31 f0       	breq	.+12     	; 0xc88 <Set_Low+0x20>
			{
				DDRD |= (1<<5);
			}
			else
			{
				DDRD |= (1<<6);
     c7c:	56 9a       	sbi	0x0a, 6	; 10
     c7e:	08 95       	ret
			}
			break;
		case '2'://to pins
			if(x == SCL)
     c80:	88 23       	and	r24, r24
     c82:	11 f4       	brne	.+4      	; 0xc88 <Set_Low+0x20>
			{
				DDRD |= (1<<4);
     c84:	54 9a       	sbi	0x0a, 4	; 10
     c86:	08 95       	ret
			}
			else
			{
				DDRD |= (1<<5);
     c88:	55 9a       	sbi	0x0a, 5	; 10
     c8a:	08 95       	ret
			}
			break;
		case '3'://to motor
			if(x == SCL)
     c8c:	88 23       	and	r24, r24
     c8e:	11 f4       	brne	.+4      	; 0xc94 <Set_Low+0x2c>
			{
				DDRB |= (1<<3);
     c90:	23 9a       	sbi	0x04, 3	; 4
     c92:	08 95       	ret
			}
			else
			{
				DDRB |= (1<<0);
     c94:	20 9a       	sbi	0x04, 0	; 4
     c96:	08 95       	ret

00000c98 <I2C_Pulse_SCL>:

/*
 * This function will pulse the SCL line so that the slave can read in/out its data
 */
void I2C_Pulse_SCL(void)
{	
     c98:	df 93       	push	r29
     c9a:	cf 93       	push	r28
     c9c:	0f 92       	push	r0
     c9e:	cd b7       	in	r28, 0x3d	; 61
     ca0:	de b7       	in	r29, 0x3e	; 62
	//  Set SCL high
	Set_High(SCL);
     ca2:	80 e0       	ldi	r24, 0x00	; 0
     ca4:	b3 df       	rcall	.-154    	; 0xc0c <Set_High>
     ca6:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     ca8:	21 e0       	ldi	r18, 0x01	; 1
     caa:	29 83       	std	Y+1, r18	; 0x01
     cac:	03 c0       	rjmp	.+6      	; 0xcb4 <I2C_Pulse_SCL+0x1c>
     cae:	89 81       	ldd	r24, Y+1	; 0x01
     cb0:	8f 5f       	subi	r24, 0xFF	; 255
     cb2:	89 83       	std	Y+1, r24	; 0x01
     cb4:	89 81       	ldd	r24, Y+1	; 0x01
     cb6:	8a 30       	cpi	r24, 0x0A	; 10
     cb8:	d0 f3       	brcs	.-12     	; 0xcae <I2C_Pulse_SCL+0x16>
		{
		
				;
			
		}
		delay--;
     cba:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     cbc:	b1 f7       	brne	.-20     	; 0xcaa <I2C_Pulse_SCL+0x12>
	
	//  Delay
	Delay(I2C_PERIOD);
	
	// Set SCL Low
	Set_Low(SCL);
     cbe:	80 e0       	ldi	r24, 0x00	; 0
     cc0:	d3 df       	rcall	.-90     	; 0xc68 <Set_Low>
     cc2:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     cc4:	21 e0       	ldi	r18, 0x01	; 1
     cc6:	29 83       	std	Y+1, r18	; 0x01
     cc8:	03 c0       	rjmp	.+6      	; 0xcd0 <I2C_Pulse_SCL+0x38>
     cca:	89 81       	ldd	r24, Y+1	; 0x01
     ccc:	8f 5f       	subi	r24, 0xFF	; 255
     cce:	89 83       	std	Y+1, r24	; 0x01
     cd0:	89 81       	ldd	r24, Y+1	; 0x01
     cd2:	8a 30       	cpi	r24, 0x0A	; 10
     cd4:	d0 f3       	brcs	.-12     	; 0xcca <I2C_Pulse_SCL+0x32>
		{
		
				;
			
		}
		delay--;
     cd6:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     cd8:	b1 f7       	brne	.-20     	; 0xcc6 <I2C_Pulse_SCL+0x2e>
	
	// Set SCL Low
	Set_Low(SCL);
	
	Delay(I2C_PERIOD);
}
     cda:	0f 90       	pop	r0
     cdc:	cf 91       	pop	r28
     cde:	df 91       	pop	r29
     ce0:	08 95       	ret

00000ce2 <I2C_Send_NACK>:
	I2C_Pulse_SCL()	;
	Set_High(SDA);//release the line
}

void I2C_Send_NACK(void)
{
     ce2:	81 e0       	ldi	r24, 0x01	; 1
     ce4:	93 df       	rcall	.-218    	; 0xc0c <Set_High>
	Set_High(SDA);
	//may want a bit of a delay here?
	I2C_Pulse_SCL();
     ce6:	d8 cf       	rjmp	.-80     	; 0xc98 <I2C_Pulse_SCL>

00000ce8 <I2C_Start>:
	
/*
 * This places a start condition onto the I2C lines
 */
void I2C_Start(void)
{
     ce8:	df 93       	push	r29
     cea:	cf 93       	push	r28
     cec:	0f 92       	push	r0
     cee:	cd b7       	in	r28, 0x3d	; 61
     cf0:	de b7       	in	r29, 0x3e	; 62
	Set_Low(SDA);
     cf2:	81 e0       	ldi	r24, 0x01	; 1
     cf4:	b9 df       	rcall	.-142    	; 0xc68 <Set_Low>
     cf6:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     cf8:	21 e0       	ldi	r18, 0x01	; 1
     cfa:	29 83       	std	Y+1, r18	; 0x01
     cfc:	03 c0       	rjmp	.+6      	; 0xd04 <I2C_Start+0x1c>
     cfe:	89 81       	ldd	r24, Y+1	; 0x01
     d00:	8f 5f       	subi	r24, 0xFF	; 255
     d02:	89 83       	std	Y+1, r24	; 0x01
     d04:	89 81       	ldd	r24, Y+1	; 0x01
     d06:	8a 30       	cpi	r24, 0x0A	; 10
     d08:	d0 f3       	brcs	.-12     	; 0xcfe <I2C_Start+0x16>
		{
		
				;
			
		}
		delay--;
     d0a:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     d0c:	b1 f7       	brne	.-20     	; 0xcfa <I2C_Start+0x12>
 */
void I2C_Start(void)
{
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_Low(SCL);
     d0e:	80 e0       	ldi	r24, 0x00	; 0
     d10:	ab df       	rcall	.-170    	; 0xc68 <Set_Low>
     d12:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     d14:	21 e0       	ldi	r18, 0x01	; 1
     d16:	29 83       	std	Y+1, r18	; 0x01
     d18:	03 c0       	rjmp	.+6      	; 0xd20 <I2C_Start+0x38>
     d1a:	89 81       	ldd	r24, Y+1	; 0x01
     d1c:	8f 5f       	subi	r24, 0xFF	; 255
     d1e:	89 83       	std	Y+1, r24	; 0x01
     d20:	89 81       	ldd	r24, Y+1	; 0x01
     d22:	8a 30       	cpi	r24, 0x0A	; 10
     d24:	d0 f3       	brcs	.-12     	; 0xd1a <I2C_Start+0x32>
		{
		
				;
			
		}
		delay--;
     d26:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     d28:	b1 f7       	brne	.-20     	; 0xd16 <I2C_Start+0x2e>
{
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_Low(SCL);
	Delay(I2C_PERIOD);
}
     d2a:	0f 90       	pop	r0
     d2c:	cf 91       	pop	r28
     d2e:	df 91       	pop	r29
     d30:	08 95       	ret

00000d32 <I2C_Send_ACK>:

/*
 * This function will place an ACK on the bus for the slave to read
 */
void I2C_Send_ACK(void)
{
     d32:	81 e0       	ldi	r24, 0x01	; 1
     d34:	99 df       	rcall	.-206    	; 0xc68 <Set_Low>
	Set_Low(SDA);
	//may want a bit of a delay here?
	I2C_Pulse_SCL()	;
     d36:	b0 df       	rcall	.-160    	; 0xc98 <I2C_Pulse_SCL>
	Set_High(SDA);//release the line
     d38:	81 e0       	ldi	r24, 0x01	; 1
}
     d3a:	68 cf       	rjmp	.-304    	; 0xc0c <Set_High>

00000d3c <Wait_On_SCL_Low>:
			break;
	}
}

void Wait_On_SCL_Low(void)
{
     d3c:	80 91 15 01 	lds	r24, 0x0115
     d40:	82 33       	cpi	r24, 0x32	; 50
     d42:	39 f0       	breq	.+14     	; 0xd52 <Wait_On_SCL_Low+0x16>
     d44:	83 33       	cpi	r24, 0x33	; 51
     d46:	41 f0       	breq	.+16     	; 0xd58 <Wait_On_SCL_Low+0x1c>
     d48:	81 33       	cpi	r24, 0x31	; 49
     d4a:	41 f4       	brne	.+16     	; 0xd5c <Wait_On_SCL_Low+0x20>
	switch(I2C_Port)
	{
		case '1'://to molex
			while( !(PIND & (1<<5)) );	
     d4c:	4d 9b       	sbis	0x09, 5	; 9
     d4e:	fe cf       	rjmp	.-4      	; 0xd4c <Wait_On_SCL_Low+0x10>
     d50:	08 95       	ret
			break;
		case '2'://to pins
			while( !(PIND & (1<<4)) );	
     d52:	4c 9b       	sbis	0x09, 4	; 9
     d54:	fe cf       	rjmp	.-4      	; 0xd52 <Wait_On_SCL_Low+0x16>
     d56:	08 95       	ret
			break;
		case '3'://to motor
			while( !(PINB & (1<<3)) );	
     d58:	1b 9b       	sbis	0x03, 3	; 3
     d5a:	fe cf       	rjmp	.-4      	; 0xd58 <Wait_On_SCL_Low+0x1c>
     d5c:	08 95       	ret

00000d5e <I2C_Pulse_SCL_After_ACK>:
 *
 * Returns:	0 if everything is ok
 *			1 if there was a timeout
 */
uint8_t I2C_Pulse_SCL_After_ACK(void)
{	
     d5e:	df 93       	push	r29
     d60:	cf 93       	push	r28
     d62:	0f 92       	push	r0
     d64:	cd b7       	in	r28, 0x3d	; 61
     d66:	de b7       	in	r29, 0x3e	; 62
	//  Set SCL high
	Set_High(SCL);
     d68:	80 e0       	ldi	r24, 0x00	; 0
     d6a:	50 df       	rcall	.-352    	; 0xc0c <Set_High>
	
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
     d6c:	e7 df       	rcall	.-50     	; 0xd3c <Wait_On_SCL_Low>
     d6e:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     d70:	21 e0       	ldi	r18, 0x01	; 1
     d72:	29 83       	std	Y+1, r18	; 0x01
     d74:	03 c0       	rjmp	.+6      	; 0xd7c <I2C_Pulse_SCL_After_ACK+0x1e>
     d76:	89 81       	ldd	r24, Y+1	; 0x01
     d78:	8f 5f       	subi	r24, 0xFF	; 255
     d7a:	89 83       	std	Y+1, r24	; 0x01
     d7c:	89 81       	ldd	r24, Y+1	; 0x01
     d7e:	8a 30       	cpi	r24, 0x0A	; 10
     d80:	d0 f3       	brcs	.-12     	; 0xd76 <I2C_Pulse_SCL_After_ACK+0x18>
		{
		
				;
			
		}
		delay--;
     d82:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     d84:	b1 f7       	brne	.-20     	; 0xd72 <I2C_Pulse_SCL_After_ACK+0x14>
	
	//  Delay
	Delay(I2C_PERIOD);
	
	// Set SCL Low
	Set_Low(SCL);
     d86:	80 e0       	ldi	r24, 0x00	; 0
     d88:	6f df       	rcall	.-290    	; 0xc68 <Set_Low>
     d8a:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     d8c:	21 e0       	ldi	r18, 0x01	; 1
     d8e:	29 83       	std	Y+1, r18	; 0x01
     d90:	03 c0       	rjmp	.+6      	; 0xd98 <I2C_Pulse_SCL_After_ACK+0x3a>
     d92:	89 81       	ldd	r24, Y+1	; 0x01
     d94:	8f 5f       	subi	r24, 0xFF	; 255
     d96:	89 83       	std	Y+1, r24	; 0x01
     d98:	89 81       	ldd	r24, Y+1	; 0x01
     d9a:	8a 30       	cpi	r24, 0x0A	; 10
     d9c:	d0 f3       	brcs	.-12     	; 0xd92 <I2C_Pulse_SCL_After_ACK+0x34>
		{
		
				;
			
		}
		delay--;
     d9e:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     da0:	b1 f7       	brne	.-20     	; 0xd8e <I2C_Pulse_SCL_After_ACK+0x30>
	Set_Low(SCL);
	
	Delay(I2C_PERIOD);

	return 0;
}
     da2:	80 e0       	ldi	r24, 0x00	; 0
     da4:	0f 90       	pop	r0
     da6:	cf 91       	pop	r28
     da8:	df 91       	pop	r29
     daa:	08 95       	ret

00000dac <I2C_Send_Byte>:
 *
 * Returns:	1 if there was a timeout
 *			0 otherwise
 */
uint8_t I2C_Send_Byte(uint8_t data)
{
     dac:	0f 93       	push	r16
     dae:	1f 93       	push	r17
     db0:	18 2f       	mov	r17, r24
	uint8_t i;

	
	if( data & 0x80)
     db2:	87 ff       	sbrs	r24, 7
     db4:	03 c0       	rjmp	.+6      	; 0xdbc <I2C_Send_Byte+0x10>
	{
		Set_High(SDA);
     db6:	81 e0       	ldi	r24, 0x01	; 1
     db8:	29 df       	rcall	.-430    	; 0xc0c <Set_High>
     dba:	02 c0       	rjmp	.+4      	; 0xdc0 <I2C_Send_Byte+0x14>
	}
	else
	{
		Set_Low(SDA);
     dbc:	81 e0       	ldi	r24, 0x01	; 1
     dbe:	54 df       	rcall	.-344    	; 0xc68 <Set_Low>
	}
		
	if(I2C_Pulse_SCL_After_ACK())//ensure that the slave is not holding the SCL line to force us to wait
     dc0:	ce df       	rcall	.-100    	; 0xd5e <I2C_Pulse_SCL_After_ACK>
     dc2:	88 23       	and	r24, r24
     dc4:	11 f0       	breq	.+4      	; 0xdca <I2C_Send_Byte+0x1e>
     dc6:	81 e0       	ldi	r24, 0x01	; 1
     dc8:	13 c0       	rjmp	.+38     	; 0xdf0 <I2C_Send_Byte+0x44>
	{
		return 1;
	}
	data <<= 1;//shift the next data bit up
     dca:	01 2f       	mov	r16, r17
     dcc:	00 0f       	add	r16, r16
     dce:	11 e0       	ldi	r17, 0x01	; 1
	
	for(i = 1; i < 8; i++)//write out each data bit, MSB first
	{
		if( data & 0x80)
     dd0:	07 ff       	sbrs	r16, 7
     dd2:	03 c0       	rjmp	.+6      	; 0xdda <I2C_Send_Byte+0x2e>
		{
			Set_High(SDA);
     dd4:	81 e0       	ldi	r24, 0x01	; 1
     dd6:	1a df       	rcall	.-460    	; 0xc0c <Set_High>
     dd8:	02 c0       	rjmp	.+4      	; 0xdde <I2C_Send_Byte+0x32>
		}
		else
		{
			Set_Low(SDA);
     dda:	81 e0       	ldi	r24, 0x01	; 1
     ddc:	45 df       	rcall	.-374    	; 0xc68 <Set_Low>
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SL line down
     dde:	5c df       	rcall	.-328    	; 0xc98 <I2C_Pulse_SCL>
	{
		return 1;
	}
	data <<= 1;//shift the next data bit up
	
	for(i = 1; i < 8; i++)//write out each data bit, MSB first
     de0:	1f 5f       	subi	r17, 0xFF	; 255
     de2:	18 30       	cpi	r17, 0x08	; 8
     de4:	11 f0       	breq	.+4      	; 0xdea <I2C_Send_Byte+0x3e>
		{
			Set_Low(SDA);
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SL line down
		data <<= 1;//shift the next data bit up
     de6:	00 0f       	add	r16, r16
     de8:	f3 cf       	rjmp	.-26     	; 0xdd0 <I2C_Send_Byte+0x24>
	}

	Set_High(SDA);//release line
     dea:	81 e0       	ldi	r24, 0x01	; 1
     dec:	0f df       	rcall	.-482    	; 0xc0c <Set_High>
     dee:	80 e0       	ldi	r24, 0x00	; 0

	return 0;

}
     df0:	1f 91       	pop	r17
     df2:	0f 91       	pop	r16
     df4:	08 95       	ret

00000df6 <I2C_Stop>:

/*
 * This function places a stop condition onto the I2C bus
 */
void I2C_Stop(void)
{
     df6:	df 93       	push	r29
     df8:	cf 93       	push	r28
     dfa:	0f 92       	push	r0
     dfc:	cd b7       	in	r28, 0x3d	; 61
     dfe:	de b7       	in	r29, 0x3e	; 62
	
	Set_Low(SDA);
     e00:	81 e0       	ldi	r24, 0x01	; 1
     e02:	32 df       	rcall	.-412    	; 0xc68 <Set_Low>
     e04:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     e06:	21 e0       	ldi	r18, 0x01	; 1
     e08:	29 83       	std	Y+1, r18	; 0x01
     e0a:	03 c0       	rjmp	.+6      	; 0xe12 <I2C_Stop+0x1c>
     e0c:	89 81       	ldd	r24, Y+1	; 0x01
     e0e:	8f 5f       	subi	r24, 0xFF	; 255
     e10:	89 83       	std	Y+1, r24	; 0x01
     e12:	89 81       	ldd	r24, Y+1	; 0x01
     e14:	8a 30       	cpi	r24, 0x0A	; 10
     e16:	d0 f3       	brcs	.-12     	; 0xe0c <I2C_Stop+0x16>
		{
		
				;
			
		}
		delay--;
     e18:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     e1a:	b1 f7       	brne	.-20     	; 0xe08 <I2C_Stop+0x12>
void I2C_Stop(void)
{
	
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_High(SCL);
     e1c:	80 e0       	ldi	r24, 0x00	; 0
     e1e:	f6 de       	rcall	.-532    	; 0xc0c <Set_High>
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
     e20:	8d df       	rcall	.-230    	; 0xd3c <Wait_On_SCL_Low>
     e22:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     e24:	21 e0       	ldi	r18, 0x01	; 1
     e26:	29 83       	std	Y+1, r18	; 0x01
     e28:	03 c0       	rjmp	.+6      	; 0xe30 <I2C_Stop+0x3a>
     e2a:	89 81       	ldd	r24, Y+1	; 0x01
     e2c:	8f 5f       	subi	r24, 0xFF	; 255
     e2e:	89 83       	std	Y+1, r24	; 0x01
     e30:	89 81       	ldd	r24, Y+1	; 0x01
     e32:	8a 30       	cpi	r24, 0x0A	; 10
     e34:	d0 f3       	brcs	.-12     	; 0xe2a <I2C_Stop+0x34>
		{
		
				;
			
		}
		delay--;
     e36:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     e38:	b1 f7       	brne	.-20     	; 0xe26 <I2C_Stop+0x30>
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_High(SCL);
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
	Delay(I2C_PERIOD);
	Set_High(SDA);
     e3a:	81 e0       	ldi	r24, 0x01	; 1
     e3c:	e7 de       	rcall	.-562    	; 0xc0c <Set_High>
     e3e:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     e40:	21 e0       	ldi	r18, 0x01	; 1
     e42:	29 83       	std	Y+1, r18	; 0x01
     e44:	03 c0       	rjmp	.+6      	; 0xe4c <I2C_Stop+0x56>
     e46:	89 81       	ldd	r24, Y+1	; 0x01
     e48:	8f 5f       	subi	r24, 0xFF	; 255
     e4a:	89 83       	std	Y+1, r24	; 0x01
     e4c:	89 81       	ldd	r24, Y+1	; 0x01
     e4e:	8a 30       	cpi	r24, 0x0A	; 10
     e50:	d0 f3       	brcs	.-12     	; 0xe46 <I2C_Stop+0x50>
		{
		
				;
			
		}
		delay--;
     e52:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     e54:	b1 f7       	brne	.-20     	; 0xe42 <I2C_Stop+0x4c>
	Set_High(SCL);
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
	Delay(I2C_PERIOD);
	Set_High(SDA);
	Delay(I2C_PERIOD);
}
     e56:	0f 90       	pop	r0
     e58:	cf 91       	pop	r28
     e5a:	df 91       	pop	r29
     e5c:	08 95       	ret

00000e5e <I2C_Pin_Value>:
	}
}


uint8_t I2C_Pin_Value(uint8_t x)
{
     e5e:	90 91 15 01 	lds	r25, 0x0115
     e62:	92 33       	cpi	r25, 0x32	; 50
     e64:	59 f0       	breq	.+22     	; 0xe7c <I2C_Pin_Value+0x1e>
     e66:	93 33       	cpi	r25, 0x33	; 51
     e68:	89 f0       	breq	.+34     	; 0xe8c <I2C_Pin_Value+0x2e>
     e6a:	91 33       	cpi	r25, 0x31	; 49
     e6c:	11 f0       	breq	.+4      	; 0xe72 <I2C_Pin_Value+0x14>
     e6e:	80 e0       	ldi	r24, 0x00	; 0
     e70:	08 95       	ret
	switch(I2C_Port)
	{
		case '1'://to molex
			if(x == SCL)
     e72:	88 23       	and	r24, r24
     e74:	41 f0       	breq	.+16     	; 0xe86 <I2C_Pin_Value+0x28>
			{
				return (PIND & (1<<5));
			}
			else
			{
				return (PIND & (1<<6));
     e76:	89 b1       	in	r24, 0x09	; 9
     e78:	80 74       	andi	r24, 0x40	; 64
     e7a:	08 95       	ret
			}
			break;
		case '2'://to pins
			if(x == SCL)
     e7c:	88 23       	and	r24, r24
     e7e:	19 f4       	brne	.+6      	; 0xe86 <I2C_Pin_Value+0x28>
			{
				return (PIND & (1<<4));
     e80:	89 b1       	in	r24, 0x09	; 9
     e82:	80 71       	andi	r24, 0x10	; 16
     e84:	08 95       	ret
			}
			else
			{
				return (PIND & (1<<5));
     e86:	89 b1       	in	r24, 0x09	; 9
     e88:	80 72       	andi	r24, 0x20	; 32
     e8a:	08 95       	ret
			}
			break;
		case '3'://to motor
			if(x == SCL)
     e8c:	88 23       	and	r24, r24
     e8e:	19 f4       	brne	.+6      	; 0xe96 <I2C_Pin_Value+0x38>
			{
				return (PINB & (1<<3));
     e90:	83 b1       	in	r24, 0x03	; 3
     e92:	88 70       	andi	r24, 0x08	; 8
     e94:	08 95       	ret
			}
			else
			{
				return (PINB & (1<<0));
     e96:	83 b1       	in	r24, 0x03	; 3
     e98:	81 70       	andi	r24, 0x01	; 1
			}
			break;
	}
	return 0;
}
     e9a:	08 95       	ret

00000e9c <I2C_Receive_Byte>:
 * it is ready.  You can enable a timeout to ensure that the Master does not wait to long.
 *
 * Returns:	The 8 bit databyte read in
 */
uint8_t I2C_Receive_Byte(void)
{
     e9c:	0f 93       	push	r16
     e9e:	1f 93       	push	r17
     ea0:	df 93       	push	r29
     ea2:	cf 93       	push	r28
     ea4:	0f 92       	push	r0
     ea6:	cd b7       	in	r28, 0x3d	; 61
     ea8:	de b7       	in	r29, 0x3e	; 62
	uint8_t i;
	uint8_t received = 0x00;
	
	Set_High(SCL);
     eaa:	80 e0       	ldi	r24, 0x00	; 0
     eac:	af de       	rcall	.-674    	; 0xc0c <Set_High>
	
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
     eae:	46 df       	rcall	.-372    	; 0xd3c <Wait_On_SCL_Low>
     eb0:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     eb2:	21 e0       	ldi	r18, 0x01	; 1
     eb4:	29 83       	std	Y+1, r18	; 0x01
     eb6:	03 c0       	rjmp	.+6      	; 0xebe <I2C_Receive_Byte+0x22>
     eb8:	89 81       	ldd	r24, Y+1	; 0x01
     eba:	8f 5f       	subi	r24, 0xFF	; 255
     ebc:	89 83       	std	Y+1, r24	; 0x01
     ebe:	89 81       	ldd	r24, Y+1	; 0x01
     ec0:	8a 30       	cpi	r24, 0x0A	; 10
     ec2:	d0 f3       	brcs	.-12     	; 0xeb8 <I2C_Receive_Byte+0x1c>
		{
		
				;
			
		}
		delay--;
     ec4:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     ec6:	b1 f7       	brne	.-20     	; 0xeb4 <I2C_Receive_Byte+0x18>
	*/

	//  Delay
	Delay(I2C_PERIOD);

	if(I2C_Pin_Value(SDA))
     ec8:	81 e0       	ldi	r24, 0x01	; 1
     eca:	c9 df       	rcall	.-110    	; 0xe5e <I2C_Pin_Value>
     ecc:	18 2f       	mov	r17, r24
	{
		received |= 1;//append 1 to our databyte
	}
	// Set SCL Low
	Set_Low(SCL);
     ece:	80 e0       	ldi	r24, 0x00	; 0
     ed0:	cb de       	rcall	.-618    	; 0xc68 <Set_Low>
     ed2:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     ed4:	21 e0       	ldi	r18, 0x01	; 1
     ed6:	29 83       	std	Y+1, r18	; 0x01
     ed8:	03 c0       	rjmp	.+6      	; 0xee0 <I2C_Receive_Byte+0x44>
     eda:	89 81       	ldd	r24, Y+1	; 0x01
     edc:	8f 5f       	subi	r24, 0xFF	; 255
     ede:	89 83       	std	Y+1, r24	; 0x01
     ee0:	89 81       	ldd	r24, Y+1	; 0x01
     ee2:	8a 30       	cpi	r24, 0x0A	; 10
     ee4:	d0 f3       	brcs	.-12     	; 0xeda <I2C_Receive_Byte+0x3e>
		{
		
				;
			
		}
		delay--;
     ee6:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     ee8:	b1 f7       	brne	.-20     	; 0xed6 <I2C_Receive_Byte+0x3a>
     eea:	81 2f       	mov	r24, r17
     eec:	11 11       	cpse	r17, r1
     eee:	81 e0       	ldi	r24, 0x01	; 1
     ef0:	18 2f       	mov	r17, r24
     ef2:	01 e0       	ldi	r16, 0x01	; 1
	
	
	//should really pulse the line high and then read.  Should work though as it
	for(i = 1; i < 8; i++)//write out each data bit, MSB first
	{
		received <<= 1;//shift the up
     ef4:	11 0f       	add	r17, r17
		if(I2C_Pin_Value(SDA))
     ef6:	81 e0       	ldi	r24, 0x01	; 1
     ef8:	b2 df       	rcall	.-156    	; 0xe5e <I2C_Pin_Value>
     efa:	81 11       	cpse	r24, r1
		{
			received |= 1;//append 1 to our databyte
     efc:	11 60       	ori	r17, 0x01	; 1
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SCL line down
     efe:	cc de       	rcall	.-616    	; 0xc98 <I2C_Pulse_SCL>
	Delay(I2C_PERIOD);

	
	
	//should really pulse the line high and then read.  Should work though as it
	for(i = 1; i < 8; i++)//write out each data bit, MSB first
     f00:	0f 5f       	subi	r16, 0xFF	; 255
     f02:	08 30       	cpi	r16, 0x08	; 8
     f04:	b9 f7       	brne	.-18     	; 0xef4 <I2C_Receive_Byte+0x58>
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SCL line down
	}

	return received;

}
     f06:	81 2f       	mov	r24, r17
     f08:	0f 90       	pop	r0
     f0a:	cf 91       	pop	r28
     f0c:	df 91       	pop	r29
     f0e:	1f 91       	pop	r17
     f10:	0f 91       	pop	r16
     f12:	08 95       	ret

00000f14 <I2C_Get_ACK>:
 *
 * Returns:	ACK if we read an ACK (0) from the slave
 *			NACK if we read a NACK (1) from the slave
 */
uint8_t I2C_Get_ACK(void)
{
     f14:	1f 93       	push	r17
     f16:	df 93       	push	r29
     f18:	cf 93       	push	r28
     f1a:	0f 92       	push	r0
     f1c:	cd b7       	in	r28, 0x3d	; 61
     f1e:	de b7       	in	r29, 0x3e	; 62
	uint8_t value = ACK;	
	
	//  Set SCL high
	Set_High(SCL);
     f20:	80 e0       	ldi	r24, 0x00	; 0
     f22:	74 de       	rcall	.-792    	; 0xc0c <Set_High>
     f24:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     f26:	21 e0       	ldi	r18, 0x01	; 1
     f28:	29 83       	std	Y+1, r18	; 0x01
     f2a:	03 c0       	rjmp	.+6      	; 0xf32 <I2C_Get_ACK+0x1e>
     f2c:	89 81       	ldd	r24, Y+1	; 0x01
     f2e:	8f 5f       	subi	r24, 0xFF	; 255
     f30:	89 83       	std	Y+1, r24	; 0x01
     f32:	89 81       	ldd	r24, Y+1	; 0x01
     f34:	8a 30       	cpi	r24, 0x0A	; 10
     f36:	d0 f3       	brcs	.-12     	; 0xf2c <I2C_Get_ACK+0x18>
		{
		
				;
			
		}
		delay--;
     f38:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     f3a:	b1 f7       	brne	.-20     	; 0xf28 <I2C_Get_ACK+0x14>
	//  Set SCL high
	Set_High(SCL);
	//  Delay
	Delay(I2C_PERIOD);

	if ( I2C_Pin_Value(SDA) )//read in if we got an ACK (0) or a NACK (1)
     f3c:	81 e0       	ldi	r24, 0x01	; 1
     f3e:	8f df       	rcall	.-226    	; 0xe5e <I2C_Pin_Value>
     f40:	18 2f       	mov	r17, r24
		value = NACK;
	}
	
	
	// Set SCL Low
	Set_Low(SCL);
     f42:	80 e0       	ldi	r24, 0x00	; 0
     f44:	91 de       	rcall	.-734    	; 0xc68 <Set_Low>
     f46:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     f48:	21 e0       	ldi	r18, 0x01	; 1
     f4a:	29 83       	std	Y+1, r18	; 0x01
     f4c:	03 c0       	rjmp	.+6      	; 0xf54 <I2C_Get_ACK+0x40>
     f4e:	89 81       	ldd	r24, Y+1	; 0x01
     f50:	8f 5f       	subi	r24, 0xFF	; 255
     f52:	89 83       	std	Y+1, r24	; 0x01
     f54:	89 81       	ldd	r24, Y+1	; 0x01
     f56:	8a 30       	cpi	r24, 0x0A	; 10
     f58:	d0 f3       	brcs	.-12     	; 0xf4e <I2C_Get_ACK+0x3a>
		{
		
				;
			
		}
		delay--;
     f5a:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     f5c:	b1 f7       	brne	.-20     	; 0xf4a <I2C_Get_ACK+0x36>
     f5e:	81 2f       	mov	r24, r17
     f60:	11 11       	cpse	r17, r1
     f62:	81 e0       	ldi	r24, 0x01	; 1
	
	Delay(I2C_PERIOD);	

	
	return value;
}
     f64:	0f 90       	pop	r0
     f66:	cf 91       	pop	r28
     f68:	df 91       	pop	r29
     f6a:	1f 91       	pop	r17
     f6c:	08 95       	ret

00000f6e <I2C_Read>:
 * Returns:	0 if the device was not there or if we got a timeout.  A timeout
 *			can occur if the slave holds SCL low for to long after a ACK while
 *			it is processing the data.
 */
uint8_t I2C_Read(uint8_t address, uint8_t *data, uint16_t lenght)
{
     f6e:	cf 92       	push	r12
     f70:	df 92       	push	r13
     f72:	ef 92       	push	r14
     f74:	ff 92       	push	r15
     f76:	0f 93       	push	r16
     f78:	1f 93       	push	r17
     f7a:	cf 93       	push	r28
     f7c:	df 93       	push	r29
     f7e:	18 2f       	mov	r17, r24
     f80:	6b 01       	movw	r12, r22
     f82:	7a 01       	movw	r14, r20
	uint16_t i;

	I2C_Start();//place a start condition on the I2C lines
     f84:	b1 de       	rcall	.-670    	; 0xce8 <I2C_Start>

	//send our slaves address
	if(I2C_Send_Byte((address<<1) | 1))//shift the address to its correct location in the data byte.  A LSB of 1 indicates a read transfere
     f86:	11 0f       	add	r17, r17
     f88:	81 2f       	mov	r24, r17
     f8a:	81 60       	ori	r24, 0x01	; 1
     f8c:	0f df       	rcall	.-482    	; 0xdac <I2C_Send_Byte>
     f8e:	88 23       	and	r24, r24
     f90:	49 f4       	brne	.+18     	; 0xfa4 <I2C_Read+0x36>
	{
		I2C_Stop();//release the lines
		return 0;//there was a timeout
	}
	
	if (I2C_Get_ACK() == NACK)//If the slave does not ACK itself send a stop condition and return 0
     f92:	c0 df       	rcall	.-128    	; 0xf14 <I2C_Get_ACK>
     f94:	81 30       	cpi	r24, 0x01	; 1
     f96:	31 f0       	breq	.+12     	; 0xfa4 <I2C_Read+0x36>
     f98:	c0 e0       	ldi	r28, 0x00	; 0
     f9a:	d0 e0       	ldi	r29, 0x00	; 0
	//read the data
	for(i = 0; i < lenght; i++)
	{
		data[i] = I2C_Receive_Byte();
	
		if (i < lenght-1)//if the slave NACKed our data, send a STOP and return the number of bytes transmitted
     f9c:	87 01       	movw	r16, r14
     f9e:	01 50       	subi	r16, 0x01	; 1
     fa0:	10 40       	sbci	r17, 0x00	; 0
     fa2:	0f c0       	rjmp	.+30     	; 0xfc2 <I2C_Read+0x54>
		return 0;//there was a timeout
	}
	
	if (I2C_Get_ACK() == NACK)//If the slave does not ACK itself send a stop condition and return 0
	{
		I2C_Stop();//release the lines
     fa4:	28 df       	rcall	.-432    	; 0xdf6 <I2C_Stop>
     fa6:	80 e0       	ldi	r24, 0x00	; 0
     fa8:	11 c0       	rjmp	.+34     	; 0xfcc <I2C_Read+0x5e>
	}
	
	//read the data
	for(i = 0; i < lenght; i++)
	{
		data[i] = I2C_Receive_Byte();
     faa:	78 df       	rcall	.-272    	; 0xe9c <I2C_Receive_Byte>
     fac:	f6 01       	movw	r30, r12
     fae:	ec 0f       	add	r30, r28
     fb0:	fd 1f       	adc	r31, r29
     fb2:	80 83       	st	Z, r24
	
		if (i < lenght-1)//if the slave NACKed our data, send a STOP and return the number of bytes transmitted
     fb4:	c0 17       	cp	r28, r16
     fb6:	d1 07       	cpc	r29, r17
     fb8:	10 f4       	brcc	.+4      	; 0xfbe <I2C_Read+0x50>
		{
			I2C_Send_ACK();	
     fba:	bb de       	rcall	.-650    	; 0xd32 <I2C_Send_ACK>
     fbc:	01 c0       	rjmp	.+2      	; 0xfc0 <I2C_Read+0x52>
		}
		else
		{
			I2C_Send_NACK();//Nack the last byte
     fbe:	91 de       	rcall	.-734    	; 0xce2 <I2C_Send_NACK>
		return 0;
		
	}
	
	//read the data
	for(i = 0; i < lenght; i++)
     fc0:	21 96       	adiw	r28, 0x01	; 1
     fc2:	ce 15       	cp	r28, r14
     fc4:	df 05       	cpc	r29, r15
     fc6:	88 f3       	brcs	.-30     	; 0xfaa <I2C_Read+0x3c>
		{
			I2C_Send_NACK();//Nack the last byte
		}
	}

	I2C_Stop();//Transaction is over so place a stop condition on the bus
     fc8:	16 df       	rcall	.-468    	; 0xdf6 <I2C_Stop>

	return lenght;
     fca:	8e 2d       	mov	r24, r14

}
     fcc:	df 91       	pop	r29
     fce:	cf 91       	pop	r28
     fd0:	1f 91       	pop	r17
     fd2:	0f 91       	pop	r16
     fd4:	ff 90       	pop	r15
     fd6:	ef 90       	pop	r14
     fd8:	df 90       	pop	r13
     fda:	cf 90       	pop	r12
     fdc:	08 95       	ret

00000fde <I2C_Write>:
 * Returns:	0 if the device was not there or if we got a timeout.  A timeout
 *			can occur if the slave holds SCL low for to long after a ACK while
 *			it is processing the data.
 */
uint8_t I2C_Write(uint8_t address, uint8_t *data, uint16_t lenght)
{
     fde:	cf 92       	push	r12
     fe0:	df 92       	push	r13
     fe2:	ef 92       	push	r14
     fe4:	ff 92       	push	r15
     fe6:	1f 93       	push	r17
     fe8:	cf 93       	push	r28
     fea:	df 93       	push	r29
     fec:	18 2f       	mov	r17, r24
     fee:	6b 01       	movw	r12, r22
     ff0:	7a 01       	movw	r14, r20
	uint16_t i;

	I2C_Start();//place a start condition on the I2C lines
     ff2:	7a de       	rcall	.-780    	; 0xce8 <I2C_Start>

	//send our slaves address
	if(I2C_Send_Byte(address<<1))//shift the address to its correct location in the data byte.  A LSB of 0 indicates a write transfere
     ff4:	81 2f       	mov	r24, r17
     ff6:	88 0f       	add	r24, r24
     ff8:	d9 de       	rcall	.-590    	; 0xdac <I2C_Send_Byte>
     ffa:	88 23       	and	r24, r24
     ffc:	69 f4       	brne	.+26     	; 0x1018 <I2C_Write+0x3a>
	{
		I2C_Stop();//release the lines
		return 0;//there was a timeout
	}
	
	if (I2C_Get_ACK() == NACK)//If the slave does not ACK itself send a stop condition and return 0
     ffe:	8a df       	rcall	.-236    	; 0xf14 <I2C_Get_ACK>
    1000:	81 30       	cpi	r24, 0x01	; 1
    1002:	51 f0       	breq	.+20     	; 0x1018 <I2C_Write+0x3a>
    1004:	c0 e0       	ldi	r28, 0x00	; 0
    1006:	d0 e0       	ldi	r29, 0x00	; 0
    1008:	13 c0       	rjmp	.+38     	; 0x1030 <I2C_Write+0x52>
	}
	
	//send the data
	for(i = 0; i < lenght; i++)
	{
		if( I2C_Send_Byte(data[i]) )
    100a:	f6 01       	movw	r30, r12
    100c:	ec 0f       	add	r30, r28
    100e:	fd 1f       	adc	r31, r29
    1010:	80 81       	ld	r24, Z
    1012:	cc de       	rcall	.-616    	; 0xdac <I2C_Send_Byte>
    1014:	88 23       	and	r24, r24
    1016:	19 f0       	breq	.+6      	; 0x101e <I2C_Write+0x40>
		{
			I2C_Stop();//release the lines
    1018:	ee de       	rcall	.-548    	; 0xdf6 <I2C_Stop>
    101a:	80 e0       	ldi	r24, 0x00	; 0
    101c:	0e c0       	rjmp	.+28     	; 0x103a <I2C_Write+0x5c>
			return 0;//There was a timeout
		}
		if (I2C_Get_ACK() == NACK)//if the slave NACKed our data, send a STOP and return the number of bytes transmitted
    101e:	7a df       	rcall	.-268    	; 0xf14 <I2C_Get_ACK>
    1020:	81 30       	cpi	r24, 0x01	; 1
    1022:	29 f4       	brne	.+10     	; 0x102e <I2C_Write+0x50>
		{
			I2C_Stop();//release the lines
    1024:	e8 de       	rcall	.-560    	; 0xdf6 <I2C_Stop>
			return i+1;
    1026:	9e 01       	movw	r18, r28
    1028:	2f 5f       	subi	r18, 0xFF	; 255
    102a:	82 2f       	mov	r24, r18
    102c:	06 c0       	rjmp	.+12     	; 0x103a <I2C_Write+0x5c>
		return 0;
		
	}
	
	//send the data
	for(i = 0; i < lenght; i++)
    102e:	21 96       	adiw	r28, 0x01	; 1
    1030:	ce 15       	cp	r28, r14
    1032:	df 05       	cpc	r29, r15
    1034:	50 f3       	brcs	.-44     	; 0x100a <I2C_Write+0x2c>
			return i+1;
		
		}
	}

	I2C_Stop();//Transaction is over so place a stop condition on the bus
    1036:	df de       	rcall	.-578    	; 0xdf6 <I2C_Stop>

	return lenght;
    1038:	8e 2d       	mov	r24, r14

}
    103a:	df 91       	pop	r29
    103c:	cf 91       	pop	r28
    103e:	1f 91       	pop	r17
    1040:	ff 90       	pop	r15
    1042:	ef 90       	pop	r14
    1044:	df 90       	pop	r13
    1046:	cf 90       	pop	r12
    1048:	08 95       	ret

0000104a <StepDirLineCoding_Init>:

#define DelayUsec() asm volatile ("NOP" ::);asm volatile ("NOP" ::);asm volatile ("NOP" ::);asm volatile ("NOP" ::);asm volatile ("NOP" ::);asm volatile ("NOP" ::);asm volatile ("NOP" ::);asm volatile ("NOP" ::);


void StepDirLineCoding_Init(void)
{
    104a:	85 b1       	in	r24, 0x05	; 5
    104c:	80 7c       	andi	r24, 0xC0	; 192
    104e:	85 b9       	out	0x05, r24	; 5
	//Assuming we want them low as default??
	PORTB &= ~( (1<<STEP_X) | (1<<DIR_X) | (1<<STEP_Y) | (1<<DIR_Y) | (1<<STEP_Z) | (1<<DIR_Z) );
	//If we want thenm high by default
	//PORTB |= ( (1<<STEP_X) | (1<<DIR_X) | (1<<STEP_Y) | (1<<DIR_Y) | (1<<STEP_Z) | (1<<DIR_Z) );
	DDRB |= ( (1<<STEP_X) | (1<<DIR_X) | (1<<STEP_Y) | (1<<DIR_Y) | (1<<STEP_Z) | (1<<DIR_Z) );
    1050:	84 b1       	in	r24, 0x04	; 4
    1052:	8f 63       	ori	r24, 0x3F	; 63
    1054:	84 b9       	out	0x04, r24	; 4

}
    1056:	08 95       	ret

00001058 <StartCodition>:


void StartCodition(uint8_t step, uint8_t dir)
{
    1058:	95 b1       	in	r25, 0x05	; 5
    105a:	21 e0       	ldi	r18, 0x01	; 1
    105c:	30 e0       	ldi	r19, 0x00	; 0
    105e:	a9 01       	movw	r20, r18
    1060:	02 c0       	rjmp	.+4      	; 0x1066 <StartCodition+0xe>
    1062:	44 0f       	add	r20, r20
    1064:	55 1f       	adc	r21, r21
    1066:	6a 95       	dec	r22
    1068:	e2 f7       	brpl	.-8      	; 0x1062 <StartCodition+0xa>
    106a:	ba 01       	movw	r22, r20
    106c:	94 2b       	or	r25, r20
    106e:	95 b9       	out	0x05, r25	; 5
	Set_High(dir);
	Set_High(step);
    1070:	95 b1       	in	r25, 0x05	; 5
    1072:	02 c0       	rjmp	.+4      	; 0x1078 <StartCodition+0x20>
    1074:	22 0f       	add	r18, r18
    1076:	33 1f       	adc	r19, r19
    1078:	8a 95       	dec	r24
    107a:	e2 f7       	brpl	.-8      	; 0x1074 <StartCodition+0x1c>
    107c:	92 2b       	or	r25, r18
    107e:	95 b9       	out	0x05, r25	; 5
	DelayUsec();
    1080:	00 00       	nop
    1082:	00 00       	nop
    1084:	00 00       	nop
    1086:	00 00       	nop
    1088:	00 00       	nop
    108a:	00 00       	nop
    108c:	00 00       	nop
    108e:	00 00       	nop
	DelayUsec();
    1090:	00 00       	nop
    1092:	00 00       	nop
    1094:	00 00       	nop
    1096:	00 00       	nop
    1098:	00 00       	nop
    109a:	00 00       	nop
    109c:	00 00       	nop
    109e:	00 00       	nop
	DelayUsec();
    10a0:	00 00       	nop
    10a2:	00 00       	nop
    10a4:	00 00       	nop
    10a6:	00 00       	nop
    10a8:	00 00       	nop
    10aa:	00 00       	nop
    10ac:	00 00       	nop
    10ae:	00 00       	nop
	DelayUsec();
    10b0:	00 00       	nop
    10b2:	00 00       	nop
    10b4:	00 00       	nop
    10b6:	00 00       	nop
    10b8:	00 00       	nop
    10ba:	00 00       	nop
    10bc:	00 00       	nop
    10be:	00 00       	nop
	DelayUsec();
    10c0:	00 00       	nop
    10c2:	00 00       	nop
    10c4:	00 00       	nop
    10c6:	00 00       	nop
    10c8:	00 00       	nop
    10ca:	00 00       	nop
    10cc:	00 00       	nop
    10ce:	00 00       	nop
	Set_Low(dir);
    10d0:	85 b1       	in	r24, 0x05	; 5
    10d2:	60 95       	com	r22
    10d4:	68 23       	and	r22, r24
    10d6:	65 b9       	out	0x05, r22	; 5
	DelayUsec();
    10d8:	00 00       	nop
    10da:	00 00       	nop
    10dc:	00 00       	nop
    10de:	00 00       	nop
    10e0:	00 00       	nop
    10e2:	00 00       	nop
    10e4:	00 00       	nop
    10e6:	00 00       	nop
}
    10e8:	08 95       	ret

000010ea <SendByte>:
// STEP raising edge.  DIR must be high before firing
// STEP.  If DIR goes low within 5 usec then the board 
// assumes this is a command function not a step
// function and decodes the data sent
void SendByte(uint8_t inchar,uint8_t axisselect)
{
    10ea:	ff 92       	push	r15
    10ec:	0f 93       	push	r16
    10ee:	1f 93       	push	r17
    10f0:	f8 2e       	mov	r15, r24
	uint8_t axisdir,axisstep;
	uint8_t i;
	
	switch(axisselect)
    10f2:	61 30       	cpi	r22, 0x01	; 1
    10f4:	29 f0       	breq	.+10     	; 0x1100 <SendByte+0x16>
    10f6:	62 30       	cpi	r22, 0x02	; 2
    10f8:	31 f4       	brne	.+12     	; 0x1106 <SendByte+0x1c>
    10fa:	02 e0       	ldi	r16, 0x02	; 2
    10fc:	11 e0       	ldi	r17, 0x01	; 1
    10fe:	05 c0       	rjmp	.+10     	; 0x110a <SendByte+0x20>
    1100:	00 e0       	ldi	r16, 0x00	; 0
    1102:	13 e0       	ldi	r17, 0x03	; 3
    1104:	02 c0       	rjmp	.+4      	; 0x110a <SendByte+0x20>
    1106:	04 e0       	ldi	r16, 0x04	; 4
    1108:	15 e0       	ldi	r17, 0x05	; 5
			break;
	}		
	


	StartCodition(axisstep,axisdir);
    110a:	60 2f       	mov	r22, r16
    110c:	81 2f       	mov	r24, r17
    110e:	a4 df       	rcall	.-184    	; 0x1058 <StartCodition>
	
	for(i=0; i<8; i++)
	{
		Set_Low(axisstep);
    1110:	81 e0       	ldi	r24, 0x01	; 1
    1112:	90 e0       	ldi	r25, 0x00	; 0
    1114:	38 2f       	mov	r19, r24
    1116:	01 c0       	rjmp	.+2      	; 0x111a <SendByte+0x30>
    1118:	33 0f       	add	r19, r19
    111a:	1a 95       	dec	r17
    111c:	ea f7       	brpl	.-6      	; 0x1118 <SendByte+0x2e>
    111e:	93 2f       	mov	r25, r19
    1120:	90 95       	com	r25
		DelayUsec();
		DelayUsec();

		if(inchar&0x01)
		{
			Set_High(axisdir);
    1122:	68 2f       	mov	r22, r24
    1124:	01 c0       	rjmp	.+2      	; 0x1128 <SendByte+0x3e>
    1126:	66 0f       	add	r22, r22
    1128:	0a 95       	dec	r16
    112a:	ea f7       	brpl	.-6      	; 0x1126 <SendByte+0x3c>
		}
		else
		{
			Set_Low(axisdir);
    112c:	46 2f       	mov	r20, r22
    112e:	40 95       	com	r20
    1130:	20 e0       	ldi	r18, 0x00	; 0

	StartCodition(axisstep,axisdir);
	
	for(i=0; i<8; i++)
	{
		Set_Low(axisstep);
    1132:	85 b1       	in	r24, 0x05	; 5
    1134:	89 23       	and	r24, r25
    1136:	85 b9       	out	0x05, r24	; 5

		DelayUsec();//may be better to move this delay to after we modify 
    1138:	00 00       	nop
    113a:	00 00       	nop
    113c:	00 00       	nop
    113e:	00 00       	nop
    1140:	00 00       	nop
    1142:	00 00       	nop
    1144:	00 00       	nop
    1146:	00 00       	nop
		DelayUsec();
    1148:	00 00       	nop
    114a:	00 00       	nop
    114c:	00 00       	nop
    114e:	00 00       	nop
    1150:	00 00       	nop
    1152:	00 00       	nop
    1154:	00 00       	nop
    1156:	00 00       	nop
		DelayUsec();
    1158:	00 00       	nop
    115a:	00 00       	nop
    115c:	00 00       	nop
    115e:	00 00       	nop
    1160:	00 00       	nop
    1162:	00 00       	nop
    1164:	00 00       	nop
    1166:	00 00       	nop
		DelayUsec();
    1168:	00 00       	nop
    116a:	00 00       	nop
    116c:	00 00       	nop
    116e:	00 00       	nop
    1170:	00 00       	nop
    1172:	00 00       	nop
    1174:	00 00       	nop
    1176:	00 00       	nop
		DelayUsec();
    1178:	00 00       	nop
    117a:	00 00       	nop
    117c:	00 00       	nop
    117e:	00 00       	nop
    1180:	00 00       	nop
    1182:	00 00       	nop
    1184:	00 00       	nop
    1186:	00 00       	nop

		if(inchar&0x01)
    1188:	f0 fe       	sbrs	r15, 0
    118a:	03 c0       	rjmp	.+6      	; 0x1192 <SendByte+0xa8>
		{
			Set_High(axisdir);
    118c:	85 b1       	in	r24, 0x05	; 5
    118e:	86 2b       	or	r24, r22
    1190:	02 c0       	rjmp	.+4      	; 0x1196 <SendByte+0xac>
		}
		else
		{
			Set_Low(axisdir);
    1192:	85 b1       	in	r24, 0x05	; 5
    1194:	84 23       	and	r24, r20
    1196:	85 b9       	out	0x05, r24	; 5
		}

		Set_High(axisstep);
    1198:	85 b1       	in	r24, 0x05	; 5
    119a:	83 2b       	or	r24, r19
    119c:	85 b9       	out	0x05, r24	; 5

		DelayUsec();
    119e:	00 00       	nop
    11a0:	00 00       	nop
    11a2:	00 00       	nop
    11a4:	00 00       	nop
    11a6:	00 00       	nop
    11a8:	00 00       	nop
    11aa:	00 00       	nop
    11ac:	00 00       	nop
		DelayUsec();
    11ae:	00 00       	nop
    11b0:	00 00       	nop
    11b2:	00 00       	nop
    11b4:	00 00       	nop
    11b6:	00 00       	nop
    11b8:	00 00       	nop
    11ba:	00 00       	nop
    11bc:	00 00       	nop
		DelayUsec();
    11be:	00 00       	nop
    11c0:	00 00       	nop
    11c2:	00 00       	nop
    11c4:	00 00       	nop
    11c6:	00 00       	nop
    11c8:	00 00       	nop
    11ca:	00 00       	nop
    11cc:	00 00       	nop
		DelayUsec();
    11ce:	00 00       	nop
    11d0:	00 00       	nop
    11d2:	00 00       	nop
    11d4:	00 00       	nop
    11d6:	00 00       	nop
    11d8:	00 00       	nop
    11da:	00 00       	nop
    11dc:	00 00       	nop
		DelayUsec();
    11de:	00 00       	nop
    11e0:	00 00       	nop
    11e2:	00 00       	nop
    11e4:	00 00       	nop
    11e6:	00 00       	nop
    11e8:	00 00       	nop
    11ea:	00 00       	nop
    11ec:	00 00       	nop
	


	StartCodition(axisstep,axisdir);
	
	for(i=0; i<8; i++)
    11ee:	2f 5f       	subi	r18, 0xFF	; 255
    11f0:	28 30       	cpi	r18, 0x08	; 8
    11f2:	11 f0       	breq	.+4      	; 0x11f8 <SendByte+0x10e>
		DelayUsec();
		DelayUsec();
		DelayUsec();
		DelayUsec();
		DelayUsec();
		inchar >>= 1;//shift the bits down
    11f4:	f6 94       	lsr	r15
    11f6:	9d cf       	rjmp	.-198    	; 0x1132 <SendByte+0x48>
	}

	Set_Low(axisstep);
    11f8:	85 b1       	in	r24, 0x05	; 5
    11fa:	98 23       	and	r25, r24
    11fc:	95 b9       	out	0x05, r25	; 5
}
    11fe:	1f 91       	pop	r17
    1200:	0f 91       	pop	r16
    1202:	ff 90       	pop	r15
    1204:	08 95       	ret

00001206 <Scheduler_SetTaskMode>:
	
	return false;
}

void Scheduler_SetTaskMode(const TaskPtr_t Task, const bool TaskStatus)
{
    1206:	9c 01       	movw	r18, r24
    1208:	e2 e0       	ldi	r30, 0x02	; 2
    120a:	f1 e0       	ldi	r31, 0x01	; 1
    120c:	08 c0       	rjmp	.+16     	; 0x121e <Scheduler_SetTaskMode+0x18>
	TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
	while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
	{
		if (CurrTask->Task == Task)
    120e:	80 81       	ld	r24, Z
    1210:	91 81       	ldd	r25, Z+1	; 0x01
    1212:	82 17       	cp	r24, r18
    1214:	93 07       	cpc	r25, r19
    1216:	11 f4       	brne	.+4      	; 0x121c <Scheduler_SetTaskMode+0x16>
		{
			CurrTask->TaskStatus = TaskStatus;
    1218:	62 83       	std	Z+2, r22	; 0x02
    121a:	08 95       	ret
			break;
		}
		
		CurrTask++;
    121c:	34 96       	adiw	r30, 0x04	; 4

void Scheduler_SetTaskMode(const TaskPtr_t Task, const bool TaskStatus)
{
	TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
	while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
    121e:	80 91 a5 01 	lds	r24, 0x01A5
    1222:	90 e0       	ldi	r25, 0x00	; 0
    1224:	88 0f       	add	r24, r24
    1226:	99 1f       	adc	r25, r25
    1228:	88 0f       	add	r24, r24
    122a:	99 1f       	adc	r25, r25
    122c:	8e 5f       	subi	r24, 0xFE	; 254
    122e:	9e 4f       	sbci	r25, 0xFE	; 254
    1230:	e8 17       	cp	r30, r24
    1232:	f9 07       	cpc	r31, r25
    1234:	61 f7       	brne	.-40     	; 0x120e <Scheduler_SetTaskMode+0x8>
    1236:	08 95       	ret

00001238 <USB_SetupInterface>:
	UHWCON &= ~(1 << UIDE);
	#endif
}

void USB_SetupInterface(void)
{
    1238:	df 93       	push	r29
    123a:	cf 93       	push	r28
    123c:	00 d0       	rcall	.+0      	; 0x123e <USB_SetupInterface+0x6>
    123e:	00 d0       	rcall	.+0      	; 0x1240 <USB_SetupInterface+0x8>
    1240:	cd b7       	in	r28, 0x3d	; 61
    1242:	de b7       	in	r29, 0x3e	; 62
	USB_INT_DisableAllInterrupts();
    1244:	dc d2       	rcall	.+1464   	; 0x17fe <USB_INT_DisableAllInterrupts>
	USB_INT_ClearAllInterrupts();
    1246:	de d2       	rcall	.+1468   	; 0x1804 <USB_INT_ClearAllInterrupts>

	USB_IsConnected         = false;
    1248:	10 92 ac 01 	sts	0x01AC, r1
	#if defined(USB_CAN_BE_HOST)
	USB_HostState           = HOST_STATE_Unattached;
	#endif

	#if defined(USB_CAN_BE_DEVICE)
	USB_ConfigurationNumber  = 0;
    124c:	10 92 aa 01 	sts	0x01AA, r1
	USB_RemoteWakeupEnabled  = false;
    1250:	10 92 a9 01 	sts	0x01A9, r1
	USB_CurrentlySelfPowered = false;
    1254:	10 92 a8 01 	sts	0x01A8, r1
	#if defined(USB_MODIFIED_FULL_CONTROLLER) && !defined(MANUAL_PLL_CONTROL)
	PLLFRQ = ((1 << PLLUSB) | (1 << PDIV3) | (1 << PDIV1));
	#endif
	
	#if !defined(MANUAL_PLL_CONTROL)
	USB_PLL_On();
    1258:	84 e0       	ldi	r24, 0x04	; 4
    125a:	89 bd       	out	0x29, r24	; 41
    125c:	89 b5       	in	r24, 0x29	; 41
    125e:	82 60       	ori	r24, 0x02	; 2
    1260:	89 bd       	out	0x29, r24	; 41
	#endif

	while (!(USB_PLL_IsReady()));
    1262:	09 b4       	in	r0, 0x29	; 41
    1264:	00 fe       	sbrs	r0, 0
    1266:	fd cf       	rjmp	.-6      	; 0x1262 <USB_SetupInterface+0x2a>
		
	USB_Interface_Reset();
    1268:	80 91 d8 00 	lds	r24, 0x00D8
    126c:	98 2f       	mov	r25, r24
    126e:	9f 77       	andi	r25, 0x7F	; 127
    1270:	90 93 d8 00 	sts	0x00D8, r25
    1274:	80 68       	ori	r24, 0x80	; 128
    1276:	80 93 d8 00 	sts	0x00D8, r24
		USB_INT_Enable(USB_INT_VBUS);
		#endif
	#endif
		
	if (!(USB_Options & USB_OPT_REG_DISABLED))
	  USB_REG_On();
    127a:	80 91 63 00 	lds	r24, 0x0063
    127e:	8e 7f       	andi	r24, 0xFE	; 254
    1280:	80 93 63 00 	sts	0x0063, r24
	
	USB_CLK_Unfreeze();
    1284:	80 91 d8 00 	lds	r24, 0x00D8
    1288:	8f 7d       	andi	r24, 0xDF	; 223
    128a:	80 93 d8 00 	sts	0x00D8, r24
	
	#if defined(USB_CAN_BE_DEVICE)
	USB_Descriptor_Device_t* DeviceDescriptorPtr;
	uint16_t                 DeviceDescriptorSize;

	if (USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr, &DeviceDescriptorSize) == true)
    128e:	9e 01       	movw	r18, r28
    1290:	2d 5f       	subi	r18, 0xFD	; 253
    1292:	3f 4f       	sbci	r19, 0xFF	; 255
    1294:	ae 01       	movw	r20, r28
    1296:	4f 5f       	subi	r20, 0xFF	; 255
    1298:	5f 4f       	sbci	r21, 0xFF	; 255
    129a:	60 e0       	ldi	r22, 0x00	; 0
    129c:	80 e0       	ldi	r24, 0x00	; 0
    129e:	91 e0       	ldi	r25, 0x01	; 1
    12a0:	ae db       	rcall	.-2212   	; 0x9fe <USB_GetDescriptor>
    12a2:	88 23       	and	r24, r24
    12a4:	31 f0       	breq	.+12     	; 0x12b2 <USB_SetupInterface+0x7a>
		#if defined(USE_RAM_DESCRIPTORS)
			USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;
		#elif defined(USE_EEPROM_DESCRIPTORS)
			USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
		#else
			USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);
    12a6:	e9 81       	ldd	r30, Y+1	; 0x01
    12a8:	fa 81       	ldd	r31, Y+2	; 0x02
    12aa:	37 96       	adiw	r30, 0x07	; 7
    12ac:	e4 91       	lpm	r30, Z+
    12ae:	e0 93 16 01 	sts	0x0116, r30
		#endif
	}
	#endif

	USB_Attach();
    12b2:	80 91 e0 00 	lds	r24, 0x00E0
    12b6:	8e 7f       	andi	r24, 0xFE	; 254
    12b8:	80 93 e0 00 	sts	0x00E0, r24
	
	#if defined(USB_DEVICE_ONLY)	
	USB_INT_Enable(USB_INT_SUSPEND);
    12bc:	80 91 e2 00 	lds	r24, 0x00E2
    12c0:	81 60       	ori	r24, 0x01	; 1
    12c2:	80 93 e2 00 	sts	0x00E2, r24
	USB_INT_Enable(USB_INT_EORSTI);	
    12c6:	80 91 e2 00 	lds	r24, 0x00E2
    12ca:	88 60       	ori	r24, 0x08	; 8
    12cc:	80 93 e2 00 	sts	0x00E2, r24
	#endif
	
	#if defined(USB_CAN_BE_BOTH)
	USB_InitTaskPointer();
	#endif
}
    12d0:	0f 90       	pop	r0
    12d2:	0f 90       	pop	r0
    12d4:	0f 90       	pop	r0
    12d6:	0f 90       	pop	r0
    12d8:	cf 91       	pop	r28
    12da:	df 91       	pop	r29
    12dc:	08 95       	ret

000012de <USB_ShutDown>:
	
	sei();
}

void USB_ShutDown(void)
{
    12de:	80 91 ac 01 	lds	r24, 0x01AC
    12e2:	88 23       	and	r24, r24
    12e4:	09 f0       	breq	.+2      	; 0x12e8 <USB_ShutDown+0xa>
	if (USB_IsConnected)
	  RAISE_EVENT(USB_Disconnect);
    12e6:	04 da       	rcall	.-3064   	; 0x6f0 <Event_USB_Disconnect>

	USB_INT_DisableAllInterrupts();
    12e8:	8a d2       	rcall	.+1300   	; 0x17fe <USB_INT_DisableAllInterrupts>
	USB_INT_ClearAllInterrupts();
    12ea:	8c d2       	rcall	.+1304   	; 0x1804 <USB_INT_ClearAllInterrupts>

	USB_IsConnected         = false;
    12ec:	10 92 ac 01 	sts	0x01AC, r1
	USB_IsInitialized       = false;
    12f0:	10 92 ab 01 	sts	0x01AB, r1
	#if defined(USB_CAN_BE_HOST)
	USB_HostState           = HOST_STATE_Unattached;
	#endif

	#if defined(USB_CAN_BE_DEVICE)
	USB_ConfigurationNumber = 0;
    12f4:	10 92 aa 01 	sts	0x01AA, r1
	
	#if !defined(USE_STATIC_OPTIONS)
	USB_Options     = 0;
	#endif

	USB_Interface_Disable();
    12f8:	80 91 d8 00 	lds	r24, 0x00D8
    12fc:	8f 77       	andi	r24, 0x7F	; 127
    12fe:	80 93 d8 00 	sts	0x00D8, r24
	USB_PLL_Off();
    1302:	19 bc       	out	0x29, r1	; 41
	#endif

	#if defined(USB_CAN_BE_BOTH)
	UHWCON &= ~(1 << UIDE);
	#endif
}
    1304:	08 95       	ret

00001306 <USB_Init>:
			   
               #if !defined(USE_STATIC_OPTIONS)
               const uint8_t Options
               #endif
               )
{
    1306:	80 91 ab 01 	lds	r24, 0x01AB
    130a:	88 23       	and	r24, r24
    130c:	09 f0       	breq	.+2      	; 0x1310 <USB_Init+0xa>
	if (USB_IsInitialized)
	  USB_ShutDown();
    130e:	e7 df       	rcall	.-50     	; 0x12de <USB_ShutDown>
	#endif

	#if defined(USB_CAN_BE_BOTH)
	USB_InitTaskPointer();
	#else
	USB_IsInitialized = true;
    1310:	81 e0       	ldi	r24, 0x01	; 1
    1312:	80 93 ab 01 	sts	0x01AB, r24

	#if defined(USB_DEVICE_ONLY)
		#if defined(USB_FULL_CONTROLLER) || defined(USB_MODIFIED_FULL_CONTROLLER)
		USB_INT_Enable(USB_INT_VBUS);
		#else
		USB_SetupInterface();
    1316:	90 df       	rcall	.-224    	; 0x1238 <USB_SetupInterface>
	  USB_INT_Enable(USB_INT_VBUS);
	else
	  USB_SetupInterface();
	#endif
	
	sei();
    1318:	78 94       	sei
}
    131a:	08 95       	ret

0000131c <Endpoint_ConfigureEndpoint_P>:

void Endpoint_ConfigureEndpoint_P(const uint8_t  EndpointNum,
                                  const uint16_t EndpointSize,
                                  const uint8_t  UECFG0Xdata,
                                  const uint8_t  UECFG1Xdata)
{
    131c:	80 93 e9 00 	sts	0x00E9, r24
	Endpoint_SelectEndpoint(EndpointNum);
	Endpoint_EnableEndpoint();
    1320:	80 91 eb 00 	lds	r24, 0x00EB
    1324:	81 60       	ori	r24, 0x01	; 1
    1326:	80 93 eb 00 	sts	0x00EB, r24
	
	UECFG0X = UECFG0Xdata;
    132a:	40 93 ec 00 	sts	0x00EC, r20
	UECFG1X = ((UECFG1X & (1 << ALLOC)) | UECFG1Xdata | Endpoint_BytesToEPSizeMask(EndpointSize));
    132e:	90 91 ed 00 	lds	r25, 0x00ED
		/* Inline Functions: */
			static inline uint8_t Endpoint_BytesToEPSizeMask(uint16_t Bytes)
			                                                 ATTR_WARN_UNUSED_RESULT ATTR_CONST;
			static inline uint8_t Endpoint_BytesToEPSizeMask(uint16_t Bytes)
			{
				Bytes &= ENDPOINT_EPSIZE_MASK;
    1332:	77 70       	andi	r23, 0x07	; 7
			
				if (Bytes <= 8)
    1334:	69 30       	cpi	r22, 0x09	; 9
    1336:	71 05       	cpc	r23, r1
    1338:	10 f4       	brcc	.+4      	; 0x133e <Endpoint_ConfigureEndpoint_P+0x22>
    133a:	80 e0       	ldi	r24, 0x00	; 0
    133c:	0b c0       	rjmp	.+22     	; 0x1354 <Endpoint_ConfigureEndpoint_P+0x38>
				  return (0 << EPSIZE0);
				else if (Bytes <= 16)
    133e:	61 31       	cpi	r22, 0x11	; 17
    1340:	71 05       	cpc	r23, r1
    1342:	10 f4       	brcc	.+4      	; 0x1348 <Endpoint_ConfigureEndpoint_P+0x2c>
    1344:	80 e1       	ldi	r24, 0x10	; 16
    1346:	06 c0       	rjmp	.+12     	; 0x1354 <Endpoint_ConfigureEndpoint_P+0x38>
				  return (1 << EPSIZE0);
				else if (Bytes <= 32)
    1348:	61 32       	cpi	r22, 0x21	; 33
    134a:	71 05       	cpc	r23, r1
    134c:	10 f0       	brcs	.+4      	; 0x1352 <Endpoint_ConfigureEndpoint_P+0x36>
    134e:	80 e3       	ldi	r24, 0x30	; 48
    1350:	01 c0       	rjmp	.+2      	; 0x1354 <Endpoint_ConfigureEndpoint_P+0x38>
    1352:	80 e2       	ldi	r24, 0x20	; 32
    1354:	92 70       	andi	r25, 0x02	; 2
    1356:	92 2b       	or	r25, r18
    1358:	89 2b       	or	r24, r25
    135a:	80 93 ed 00 	sts	0x00ED, r24
	
	Endpoint_AllocateMemory();
    135e:	80 91 ed 00 	lds	r24, 0x00ED
    1362:	82 60       	ori	r24, 0x02	; 2
    1364:	80 93 ed 00 	sts	0x00ED, r24
}
    1368:	08 95       	ret

0000136a <Endpoint_Write_Control_Stream_LE>:
	
	return ENDPOINT_RWSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
{
    136a:	1f 93       	push	r17
    136c:	9c 01       	movw	r18, r24
    136e:	fb 01       	movw	r30, r22
	uint8_t* DataStream = (uint8_t*)Buffer;
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
    1370:	10 91 16 01 	lds	r17, 0x0116
    1374:	cb 01       	movw	r24, r22
    1376:	61 2f       	mov	r22, r17
    1378:	70 e0       	ldi	r23, 0x00	; 0
    137a:	ee d2       	rcall	.+1500   	; 0x1958 <__udivmodhi4>
    137c:	89 2b       	or	r24, r25
    137e:	21 f0       	breq	.+8      	; 0x1388 <Endpoint_Write_Control_Stream_LE+0x1e>
    1380:	40 e0       	ldi	r20, 0x00	; 0
    1382:	50 e0       	ldi	r21, 0x00	; 0
    1384:	30 97       	sbiw	r30, 0x00	; 0
    1386:	11 f4       	brne	.+4      	; 0x138c <Endpoint_Write_Control_Stream_LE+0x22>
    1388:	41 e0       	ldi	r20, 0x01	; 1
    138a:	50 e0       	ldi	r21, 0x00	; 0
	return ENDPOINT_RWSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
{
	uint8_t* DataStream = (uint8_t*)Buffer;
    138c:	d9 01       	movw	r26, r18
    138e:	13 c0       	rjmp	.+38     	; 0x13b6 <Endpoint_Write_Control_Stream_LE+0x4c>
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
	{
		while (!(Endpoint_IsSetupINReady()));
    1390:	80 91 e8 00 	lds	r24, 0x00E8
    1394:	80 ff       	sbrs	r24, 0
    1396:	fc cf       	rjmp	.-8      	; 0x1390 <Endpoint_Write_Control_Stream_LE+0x26>
    1398:	05 c0       	rjmp	.+10     	; 0x13a4 <Endpoint_Write_Control_Stream_LE+0x3a>
		
		while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
		{
			Endpoint_Write_Byte(*(DataStream++));
    139a:	8d 91       	ld	r24, X+
			}

			/** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints. */
			static inline void Endpoint_Write_Byte(const uint8_t Byte)
			{
				UEDATX = Byte;
    139c:	80 93 f1 00 	sts	0x00F1, r24
			
			Length--;
    13a0:	31 97       	sbiw	r30, 0x01	; 1
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
	{
		while (!(Endpoint_IsSetupINReady()));
		
		while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
    13a2:	21 f0       	breq	.+8      	; 0x13ac <Endpoint_Write_Control_Stream_LE+0x42>
    13a4:	80 91 f2 00 	lds	r24, 0x00F2
    13a8:	81 17       	cp	r24, r17
    13aa:	b8 f3       	brcs	.-18     	; 0x139a <Endpoint_Write_Control_Stream_LE+0x30>
			Endpoint_Write_Byte(*(DataStream++));
			
			Length--;
		}
		
		Endpoint_ClearSetupIN();
    13ac:	80 91 e8 00 	lds	r24, 0x00E8
    13b0:	8e 7f       	andi	r24, 0xFE	; 254
    13b2:	80 93 e8 00 	sts	0x00E8, r24
uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
{
	uint8_t* DataStream = (uint8_t*)Buffer;
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
    13b6:	30 97       	sbiw	r30, 0x00	; 0
    13b8:	21 f0       	breq	.+8      	; 0x13c2 <Endpoint_Write_Control_Stream_LE+0x58>
    13ba:	80 91 e8 00 	lds	r24, 0x00E8
    13be:	82 ff       	sbrs	r24, 2
    13c0:	e7 cf       	rjmp	.-50     	; 0x1390 <Endpoint_Write_Control_Stream_LE+0x26>
		}
		
		Endpoint_ClearSetupIN();
	}
	
	if (Endpoint_IsSetupOUTReceived())
    13c2:	80 91 e8 00 	lds	r24, 0x00E8
    13c6:	82 ff       	sbrs	r24, 2
    13c8:	02 c0       	rjmp	.+4      	; 0x13ce <Endpoint_Write_Control_Stream_LE+0x64>
    13ca:	81 e0       	ldi	r24, 0x01	; 1
    13cc:	10 c0       	rjmp	.+32     	; 0x13ee <Endpoint_Write_Control_Stream_LE+0x84>
	  return ENDPOINT_RWCSTREAM_ERROR_HostAborted;
	
	if (SendZLP)
    13ce:	45 2b       	or	r20, r21
    13d0:	49 f0       	breq	.+18     	; 0x13e4 <Endpoint_Write_Control_Stream_LE+0x7a>
	{
		while (!(Endpoint_IsSetupINReady()));
    13d2:	80 91 e8 00 	lds	r24, 0x00E8
    13d6:	80 ff       	sbrs	r24, 0
    13d8:	fc cf       	rjmp	.-8      	; 0x13d2 <Endpoint_Write_Control_Stream_LE+0x68>
		Endpoint_ClearSetupIN();
    13da:	80 91 e8 00 	lds	r24, 0x00E8
    13de:	8e 7f       	andi	r24, 0xFE	; 254
    13e0:	80 93 e8 00 	sts	0x00E8, r24
	}
	
	while (!(Endpoint_IsSetupOUTReceived()));
    13e4:	80 91 e8 00 	lds	r24, 0x00E8
    13e8:	82 ff       	sbrs	r24, 2
    13ea:	fc cf       	rjmp	.-8      	; 0x13e4 <Endpoint_Write_Control_Stream_LE+0x7a>
    13ec:	80 e0       	ldi	r24, 0x00	; 0

	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}
    13ee:	1f 91       	pop	r17
    13f0:	08 95       	ret

000013f2 <Endpoint_Read_Control_Stream_LE>:

	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)
{
    13f2:	fc 01       	movw	r30, r24
    13f4:	14 c0       	rjmp	.+40     	; 0x141e <Endpoint_Read_Control_Stream_LE+0x2c>
	uint8_t* DataStream = (uint8_t*)Buffer;
	
	while (Length)
	{
		while (!(Endpoint_IsSetupOUTReceived()));
    13f6:	80 91 e8 00 	lds	r24, 0x00E8
    13fa:	82 ff       	sbrs	r24, 2
    13fc:	fc cf       	rjmp	.-8      	; 0x13f6 <Endpoint_Read_Control_Stream_LE+0x4>
    13fe:	06 c0       	rjmp	.+12     	; 0x140c <Endpoint_Read_Control_Stream_LE+0x1a>
		/* Inline Functions: */
			/** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints. */
			static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint8_t Endpoint_Read_Byte(void)
			{
				return UEDATX;
    1400:	80 91 f1 00 	lds	r24, 0x00F1
		
		while (Length && Endpoint_BytesInEndpoint())
		{
			*(DataStream++) = Endpoint_Read_Byte();
    1404:	81 93       	st	Z+, r24
			
			Length--;
    1406:	61 50       	subi	r22, 0x01	; 1
    1408:	70 40       	sbci	r23, 0x00	; 0
	
	while (Length)
	{
		while (!(Endpoint_IsSetupOUTReceived()));
		
		while (Length && Endpoint_BytesInEndpoint())
    140a:	21 f0       	breq	.+8      	; 0x1414 <Endpoint_Read_Control_Stream_LE+0x22>
    140c:	80 91 f2 00 	lds	r24, 0x00F2
    1410:	88 23       	and	r24, r24
    1412:	b1 f7       	brne	.-20     	; 0x1400 <Endpoint_Read_Control_Stream_LE+0xe>
			*(DataStream++) = Endpoint_Read_Byte();
			
			Length--;
		}
		
		Endpoint_ClearSetupOUT();
    1414:	80 91 e8 00 	lds	r24, 0x00E8
    1418:	8b 7f       	andi	r24, 0xFB	; 251
    141a:	80 93 e8 00 	sts	0x00E8, r24

uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)
{
	uint8_t* DataStream = (uint8_t*)Buffer;
	
	while (Length)
    141e:	61 15       	cp	r22, r1
    1420:	71 05       	cpc	r23, r1
    1422:	49 f7       	brne	.-46     	; 0x13f6 <Endpoint_Read_Control_Stream_LE+0x4>
		}
		
		Endpoint_ClearSetupOUT();
	}
	
	while (!(Endpoint_IsSetupINReady()));
    1424:	80 91 e8 00 	lds	r24, 0x00E8
    1428:	80 ff       	sbrs	r24, 0
    142a:	fc cf       	rjmp	.-8      	; 0x1424 <Endpoint_Read_Control_Stream_LE+0x32>
	
	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}
    142c:	80 e0       	ldi	r24, 0x00	; 0
    142e:	08 95       	ret

00001430 <USB_Device_ProcessControlPacket>:
uint8_t USB_ConfigurationNumber;
bool    USB_RemoteWakeupEnabled;
bool    USB_CurrentlySelfPowered;

void USB_Device_ProcessControlPacket(void)
{
    1430:	ff 92       	push	r15
    1432:	0f 93       	push	r16
    1434:	1f 93       	push	r17
    1436:	df 93       	push	r29
    1438:	cf 93       	push	r28
    143a:	cd b7       	in	r28, 0x3d	; 61
    143c:	de b7       	in	r29, 0x3e	; 62
    143e:	28 97       	sbiw	r28, 0x08	; 8
    1440:	0f b6       	in	r0, 0x3f	; 63
    1442:	f8 94       	cli
    1444:	de bf       	out	0x3e, r29	; 62
    1446:	0f be       	out	0x3f, r0	; 63
    1448:	cd bf       	out	0x3d, r28	; 61
		/* Inline Functions: */
			/** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints. */
			static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint8_t Endpoint_Read_Byte(void)
			{
				return UEDATX;
    144a:	60 91 f1 00 	lds	r22, 0x00F1
	uint8_t bmRequestType  = Endpoint_Read_Byte();
	uint8_t bRequest       = Endpoint_Read_Byte();
	bool    RequestHandled = false;
	
	switch (bRequest)
    144e:	40 91 f1 00 	lds	r20, 0x00F1
    1452:	45 30       	cpi	r20, 0x05	; 5
    1454:	09 f4       	brne	.+2      	; 0x1458 <USB_Device_ProcessControlPacket+0x28>
    1456:	cb c0       	rjmp	.+406    	; 0x15ee <USB_Device_ProcessControlPacket+0x1be>
    1458:	46 30       	cpi	r20, 0x06	; 6
    145a:	48 f4       	brcc	.+18     	; 0x146e <USB_Device_ProcessControlPacket+0x3e>
    145c:	41 30       	cpi	r20, 0x01	; 1
    145e:	09 f4       	brne	.+2      	; 0x1462 <USB_Device_ProcessControlPacket+0x32>
    1460:	74 c0       	rjmp	.+232    	; 0x154a <USB_Device_ProcessControlPacket+0x11a>
    1462:	41 30       	cpi	r20, 0x01	; 1
    1464:	70 f0       	brcs	.+28     	; 0x1482 <USB_Device_ProcessControlPacket+0x52>
    1466:	43 30       	cpi	r20, 0x03	; 3
    1468:	09 f0       	breq	.+2      	; 0x146c <USB_Device_ProcessControlPacket+0x3c>
    146a:	9a c1       	rjmp	.+820    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
    146c:	6e c0       	rjmp	.+220    	; 0x154a <USB_Device_ProcessControlPacket+0x11a>
    146e:	48 30       	cpi	r20, 0x08	; 8
    1470:	09 f4       	brne	.+2      	; 0x1474 <USB_Device_ProcessControlPacket+0x44>
    1472:	48 c1       	rjmp	.+656    	; 0x1704 <USB_Device_ProcessControlPacket+0x2d4>
    1474:	49 30       	cpi	r20, 0x09	; 9
    1476:	09 f4       	brne	.+2      	; 0x147a <USB_Device_ProcessControlPacket+0x4a>
    1478:	60 c1       	rjmp	.+704    	; 0x173a <USB_Device_ProcessControlPacket+0x30a>
    147a:	46 30       	cpi	r20, 0x06	; 6
    147c:	09 f0       	breq	.+2      	; 0x1480 <USB_Device_ProcessControlPacket+0x50>
    147e:	90 c1       	rjmp	.+800    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
    1480:	d6 c0       	rjmp	.+428    	; 0x162e <USB_Device_ProcessControlPacket+0x1fe>
	{
		case REQ_GetStatus:
			if (((bmRequestType & (CONTROL_REQTYPE_DIRECTION | CONTROL_REQTYPE_TYPE)) ==
    1482:	26 2f       	mov	r18, r22
    1484:	30 e0       	ldi	r19, 0x00	; 0
    1486:	c9 01       	movw	r24, r18
    1488:	80 7e       	andi	r24, 0xE0	; 224
    148a:	90 70       	andi	r25, 0x00	; 0
    148c:	80 38       	cpi	r24, 0x80	; 128
    148e:	91 05       	cpc	r25, r1
    1490:	09 f0       	breq	.+2      	; 0x1494 <USB_Device_ProcessControlPacket+0x64>
    1492:	86 c1       	rjmp	.+780    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
    1494:	c9 01       	movw	r24, r18
    1496:	8f 71       	andi	r24, 0x1F	; 31
    1498:	90 70       	andi	r25, 0x00	; 0
    149a:	83 30       	cpi	r24, 0x03	; 3
    149c:	91 05       	cpc	r25, r1
    149e:	09 f4       	brne	.+2      	; 0x14a2 <USB_Device_ProcessControlPacket+0x72>
    14a0:	7f c1       	rjmp	.+766    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
			/** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints. */
			static inline void Endpoint_Discard_Word(void)
			{
				uint8_t Dummy;
				
				Dummy = UEDATX;
    14a2:	20 91 f1 00 	lds	r18, 0x00F1
				Dummy = UEDATX;
    14a6:	20 91 f1 00 	lds	r18, 0x00F1
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    14aa:	20 91 f1 00 	lds	r18, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    14ae:	40 91 f1 00 	lds	r20, 0x00F1

	Endpoint_Discard_Word();

	uint16_t wIndex = Endpoint_Read_Word_LE();
	
	switch (bmRequestType & CONTROL_REQTYPE_RECIPIENT)
    14b2:	81 30       	cpi	r24, 0x01	; 1
    14b4:	91 05       	cpc	r25, r1
    14b6:	31 f0       	breq	.+12     	; 0x14c4 <USB_Device_ProcessControlPacket+0x94>
    14b8:	82 30       	cpi	r24, 0x02	; 2
    14ba:	91 05       	cpc	r25, r1
    14bc:	f9 f0       	breq	.+62     	; 0x14fc <USB_Device_ProcessControlPacket+0xcc>
    14be:	89 2b       	or	r24, r25
    14c0:	21 f0       	breq	.+8      	; 0x14ca <USB_Device_ProcessControlPacket+0x9a>
    14c2:	70 c1       	rjmp	.+736    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
    14c4:	20 e0       	ldi	r18, 0x00	; 0
    14c6:	30 e0       	ldi	r19, 0x00	; 0
    14c8:	2d c0       	rjmp	.+90     	; 0x1524 <USB_Device_ProcessControlPacket+0xf4>
	{
		case REQREC_DEVICE:
			if (USB_GetDescriptor(((DTYPE_Configuration << 8) | USB_ConfigurationNumber), 0,
    14ca:	80 91 aa 01 	lds	r24, 0x01AA
    14ce:	90 e0       	ldi	r25, 0x00	; 0
    14d0:	9e 01       	movw	r18, r28
    14d2:	29 5f       	subi	r18, 0xF9	; 249
    14d4:	3f 4f       	sbci	r19, 0xFF	; 255
    14d6:	ae 01       	movw	r20, r28
    14d8:	4f 5f       	subi	r20, 0xFF	; 255
    14da:	5f 4f       	sbci	r21, 0xFF	; 255
    14dc:	60 e0       	ldi	r22, 0x00	; 0
    14de:	92 60       	ori	r25, 0x02	; 2
    14e0:	8e da       	rcall	.-2788   	; 0x9fe <USB_GetDescriptor>
    14e2:	88 23       	and	r24, r24
    14e4:	09 f4       	brne	.+2      	; 0x14e8 <USB_Device_ProcessControlPacket+0xb8>
    14e6:	5e c1       	rjmp	.+700    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
#if defined(USE_RAM_DESCRIPTORS)
			ConfigAttributes = ConfigDescriptorPtr->ConfigAttributes;
#elif defined(USE_EEPROM_DESCRIPTORS)
			ConfigAttributes = eeprom_read_byte(&ConfigDescriptorPtr->ConfigAttributes);
#else
			ConfigAttributes = pgm_read_byte(&ConfigDescriptorPtr->ConfigAttributes);
    14e8:	80 91 a8 01 	lds	r24, 0x01A8
    14ec:	28 2f       	mov	r18, r24
    14ee:	30 e0       	ldi	r19, 0x00	; 0
#endif

			if (USB_CurrentlySelfPowered)
			  CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
			
			if (USB_RemoteWakeupEnabled)
    14f0:	80 91 a9 01 	lds	r24, 0x01A9
    14f4:	88 23       	and	r24, r24
    14f6:	b1 f0       	breq	.+44     	; 0x1524 <USB_Device_ProcessControlPacket+0xf4>
			  CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
    14f8:	22 60       	ori	r18, 0x02	; 2
    14fa:	14 c0       	rjmp	.+40     	; 0x1524 <USB_Device_ProcessControlPacket+0xf4>
		case REQREC_INTERFACE:
			// No bits set, all bits currently reserved
				
			break;
		case REQREC_ENDPOINT:
			Endpoint_SelectEndpoint(wIndex);
    14fc:	94 2f       	mov	r25, r20
    14fe:	80 e0       	ldi	r24, 0x00	; 0
    1500:	30 e0       	ldi	r19, 0x00	; 0
    1502:	82 2b       	or	r24, r18
    1504:	93 2b       	or	r25, r19
    1506:	80 93 e9 00 	sts	0x00E9, r24

			CurrentStatus = Endpoint_IsStalled();
    150a:	80 91 eb 00 	lds	r24, 0x00EB
    150e:	28 2f       	mov	r18, r24
    1510:	30 e0       	ldi	r19, 0x00	; 0
    1512:	85 e0       	ldi	r24, 0x05	; 5
    1514:	36 95       	lsr	r19
    1516:	27 95       	ror	r18
    1518:	8a 95       	dec	r24
    151a:	e1 f7       	brne	.-8      	; 0x1514 <USB_Device_ProcessControlPacket+0xe4>
    151c:	21 70       	andi	r18, 0x01	; 1
    151e:	30 70       	andi	r19, 0x00	; 0

			Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);			  
    1520:	10 92 e9 00 	sts	0x00E9, r1
			break;
		default:
			return;
	}
	
	Endpoint_ClearSetupReceived();
    1524:	80 91 e8 00 	lds	r24, 0x00E8
    1528:	87 7f       	andi	r24, 0xF7	; 247
    152a:	80 93 e8 00 	sts	0x00E8, r24
			/** Writes two bytes to the currently selected endpoint's bank in little endian format, for IN
			 *  direction endpoints.
			 */
			static inline void Endpoint_Write_Word_LE(const uint16_t Word)
			{
				UEDATX = (Word & 0xFF);
    152e:	20 93 f1 00 	sts	0x00F1, r18
				UEDATX = (Word >> 8);
    1532:	30 93 f1 00 	sts	0x00F1, r19
	
	Endpoint_Write_Word_LE(CurrentStatus);

	Endpoint_ClearSetupIN();
    1536:	80 91 e8 00 	lds	r24, 0x00E8
    153a:	8e 7f       	andi	r24, 0xFE	; 254
    153c:	80 93 e8 00 	sts	0x00E8, r24
	
	while (!(Endpoint_IsSetupOUTReceived()));
    1540:	80 91 e8 00 	lds	r24, 0x00E8
    1544:	82 ff       	sbrs	r24, 2
    1546:	fc cf       	rjmp	.-8      	; 0x1540 <USB_Device_ProcessControlPacket+0x110>
    1548:	f2 c0       	rjmp	.+484    	; 0x172e <USB_Device_ProcessControlPacket+0x2fe>
			}

			break;
		case REQ_ClearFeature:
		case REQ_SetFeature:
			if (((bmRequestType & (CONTROL_REQTYPE_DIRECTION | CONTROL_REQTYPE_TYPE)) ==
    154a:	26 2f       	mov	r18, r22
    154c:	30 e0       	ldi	r19, 0x00	; 0
    154e:	86 2f       	mov	r24, r22
    1550:	80 7e       	andi	r24, 0xE0	; 224
    1552:	09 f0       	breq	.+2      	; 0x1556 <USB_Device_ProcessControlPacket+0x126>
    1554:	25 c1       	rjmp	.+586    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
    1556:	c9 01       	movw	r24, r18
    1558:	8f 71       	andi	r24, 0x1F	; 31
    155a:	90 70       	andi	r25, 0x00	; 0
    155c:	83 30       	cpi	r24, 0x03	; 3
    155e:	91 05       	cpc	r25, r1
    1560:	09 f4       	brne	.+2      	; 0x1564 <USB_Device_ProcessControlPacket+0x134>
    1562:	1e c1       	rjmp	.+572    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    1564:	20 91 f1 00 	lds	r18, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1568:	50 91 f1 00 	lds	r21, 0x00F1
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    156c:	70 91 f1 00 	lds	r23, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1570:	60 91 f1 00 	lds	r22, 0x00F1
static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType)
{
	uint16_t wValue = Endpoint_Read_Word_LE();
	uint16_t wIndex = Endpoint_Read_Word_LE();
	
	switch (bmRequestType & CONTROL_REQTYPE_RECIPIENT)
    1574:	02 97       	sbiw	r24, 0x02	; 2
    1576:	09 f0       	breq	.+2      	; 0x157a <USB_Device_ProcessControlPacket+0x14a>
    1578:	15 c1       	rjmp	.+554    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
	{
		case REQREC_ENDPOINT:
			if (wValue == FEATURE_ENDPOINT_HALT)
    157a:	95 2f       	mov	r25, r21
    157c:	80 e0       	ldi	r24, 0x00	; 0
    157e:	30 e0       	ldi	r19, 0x00	; 0
    1580:	82 2b       	or	r24, r18
    1582:	93 2b       	or	r25, r19
    1584:	89 2b       	or	r24, r25
    1586:	09 f0       	breq	.+2      	; 0x158a <USB_Device_ProcessControlPacket+0x15a>
    1588:	0d c1       	rjmp	.+538    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
			{
				uint8_t EndpointIndex = (wIndex & ENDPOINT_EPNUM_MASK);
    158a:	80 e0       	ldi	r24, 0x00	; 0
    158c:	27 2f       	mov	r18, r23
    158e:	28 2b       	or	r18, r24
    1590:	27 70       	andi	r18, 0x07	; 7
				
				if (EndpointIndex != ENDPOINT_CONTROLEP)
    1592:	09 f4       	brne	.+2      	; 0x1596 <USB_Device_ProcessControlPacket+0x166>
    1594:	07 c1       	rjmp	.+526    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
				{
					Endpoint_SelectEndpoint(EndpointIndex);
    1596:	20 93 e9 00 	sts	0x00E9, r18

					if (Endpoint_IsEnabled())
    159a:	80 91 eb 00 	lds	r24, 0x00EB
    159e:	80 ff       	sbrs	r24, 0
    15a0:	1b c0       	rjmp	.+54     	; 0x15d8 <USB_Device_ProcessControlPacket+0x1a8>
					{				
						if (bRequest == REQ_ClearFeature)
    15a2:	41 30       	cpi	r20, 0x01	; 1
    15a4:	a1 f4       	brne	.+40     	; 0x15ce <USB_Device_ProcessControlPacket+0x19e>
						{
							Endpoint_ClearStall();
    15a6:	80 91 eb 00 	lds	r24, 0x00EB
    15aa:	80 61       	ori	r24, 0x10	; 16
    15ac:	80 93 eb 00 	sts	0x00EB, r24
							Endpoint_ResetFIFO(EndpointIndex);
    15b0:	81 e0       	ldi	r24, 0x01	; 1
    15b2:	90 e0       	ldi	r25, 0x00	; 0
    15b4:	02 c0       	rjmp	.+4      	; 0x15ba <USB_Device_ProcessControlPacket+0x18a>
    15b6:	88 0f       	add	r24, r24
    15b8:	99 1f       	adc	r25, r25
    15ba:	2a 95       	dec	r18
    15bc:	e2 f7       	brpl	.-8      	; 0x15b6 <USB_Device_ProcessControlPacket+0x186>
    15be:	80 93 ea 00 	sts	0x00EA, r24
    15c2:	10 92 ea 00 	sts	0x00EA, r1
							Endpoint_ResetDataToggle();
    15c6:	80 91 eb 00 	lds	r24, 0x00EB
    15ca:	88 60       	ori	r24, 0x08	; 8
    15cc:	03 c0       	rjmp	.+6      	; 0x15d4 <USB_Device_ProcessControlPacket+0x1a4>
						}
						else
						{
							Endpoint_StallTransaction();						
    15ce:	80 91 eb 00 	lds	r24, 0x00EB
    15d2:	80 62       	ori	r24, 0x20	; 32
    15d4:	80 93 eb 00 	sts	0x00EB, r24
						}
					}

					Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
    15d8:	10 92 e9 00 	sts	0x00E9, r1
					Endpoint_ClearSetupReceived();
    15dc:	80 91 e8 00 	lds	r24, 0x00E8
    15e0:	87 7f       	andi	r24, 0xF7	; 247
    15e2:	80 93 e8 00 	sts	0x00E8, r24
					Endpoint_ClearSetupIN();
    15e6:	80 91 e8 00 	lds	r24, 0x00E8
    15ea:	8e 7f       	andi	r24, 0xFE	; 254
    15ec:	a3 c0       	rjmp	.+326    	; 0x1734 <USB_Device_ProcessControlPacket+0x304>
				RequestHandled = true;
			}

			break;
		case REQ_SetAddress:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
    15ee:	66 23       	and	r22, r22
    15f0:	09 f0       	breq	.+2      	; 0x15f4 <USB_Device_ProcessControlPacket+0x1c4>
    15f2:	d6 c0       	rjmp	.+428    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
		/* Inline Functions: */
			/** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints. */
			static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint8_t Endpoint_Read_Byte(void)
			{
				return UEDATX;
    15f4:	90 91 f1 00 	lds	r25, 0x00F1

static void USB_Device_SetAddress(void)
{
	uint8_t wValue_LSB = Endpoint_Read_Byte();

	UDADDR = ((UDADDR & (1 << ADDEN)) | (wValue_LSB & 0x7F));
    15f8:	80 91 e3 00 	lds	r24, 0x00E3
    15fc:	9f 77       	andi	r25, 0x7F	; 127
    15fe:	80 78       	andi	r24, 0x80	; 128
    1600:	98 2b       	or	r25, r24
    1602:	90 93 e3 00 	sts	0x00E3, r25

	Endpoint_ClearSetupReceived();
    1606:	80 91 e8 00 	lds	r24, 0x00E8
    160a:	87 7f       	andi	r24, 0xF7	; 247
    160c:	80 93 e8 00 	sts	0x00E8, r24

	Endpoint_ClearSetupIN();
    1610:	80 91 e8 00 	lds	r24, 0x00E8
    1614:	8e 7f       	andi	r24, 0xFE	; 254
    1616:	80 93 e8 00 	sts	0x00E8, r24
	while (!(Endpoint_IsSetupINReady()));
    161a:	80 91 e8 00 	lds	r24, 0x00E8
    161e:	80 ff       	sbrs	r24, 0
    1620:	fc cf       	rjmp	.-8      	; 0x161a <USB_Device_ProcessControlPacket+0x1ea>
	
	UDADDR |= (1 << ADDEN);
    1622:	80 91 e3 00 	lds	r24, 0x00E3
    1626:	80 68       	ori	r24, 0x80	; 128
    1628:	80 93 e3 00 	sts	0x00E3, r24
    162c:	bb c0       	rjmp	.+374    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    162e:	e0 91 f1 00 	lds	r30, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1632:	30 91 f1 00 	lds	r19, 0x00F1
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    1636:	80 91 f1 00 	lds	r24, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    163a:	20 91 f1 00 	lds	r18, 0x00F1
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    163e:	00 91 f1 00 	lds	r16, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1642:	10 91 f1 00 	lds	r17, 0x00F1
	void*    DescriptorPointer;
	uint16_t DescriptorSize;
	
	bool     SendZLP;
	
	if (!(USB_GetDescriptor(wValue, wIndex, &DescriptorPointer, &DescriptorSize)))
    1646:	72 2f       	mov	r23, r18
    1648:	60 e0       	ldi	r22, 0x00	; 0
    164a:	90 e0       	ldi	r25, 0x00	; 0
    164c:	68 2b       	or	r22, r24
    164e:	79 2b       	or	r23, r25
    1650:	93 2f       	mov	r25, r19
    1652:	80 e0       	ldi	r24, 0x00	; 0
    1654:	f0 e0       	ldi	r31, 0x00	; 0
    1656:	9e 01       	movw	r18, r28
    1658:	29 5f       	subi	r18, 0xF9	; 249
    165a:	3f 4f       	sbci	r19, 0xFF	; 255
    165c:	ae 01       	movw	r20, r28
    165e:	4d 5f       	subi	r20, 0xFD	; 253
    1660:	5f 4f       	sbci	r21, 0xFF	; 255
    1662:	8e 2b       	or	r24, r30
    1664:	9f 2b       	or	r25, r31
    1666:	cb d9       	rcall	.-3178   	; 0x9fe <USB_GetDescriptor>
    1668:	88 23       	and	r24, r24
    166a:	09 f4       	brne	.+2      	; 0x166e <USB_Device_ProcessControlPacket+0x23e>
    166c:	9b c0       	rjmp	.+310    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
	  return;
	
	Endpoint_ClearSetupReceived();
    166e:	80 91 e8 00 	lds	r24, 0x00E8
    1672:	87 7f       	andi	r24, 0xF7	; 247
    1674:	80 93 e8 00 	sts	0x00E8, r24
    1678:	91 2f       	mov	r25, r17
    167a:	80 e0       	ldi	r24, 0x00	; 0
    167c:	40 2f       	mov	r20, r16
    167e:	50 e0       	ldi	r21, 0x00	; 0
    1680:	2f 81       	ldd	r18, Y+7	; 0x07
    1682:	38 85       	ldd	r19, Y+8	; 0x08
    1684:	48 2b       	or	r20, r24
    1686:	59 2b       	or	r21, r25
    1688:	24 17       	cp	r18, r20
    168a:	35 07       	cpc	r19, r21
    168c:	08 f4       	brcc	.+2      	; 0x1690 <USB_Device_ProcessControlPacket+0x260>
    168e:	a9 01       	movw	r20, r18
	
	if (wLength > DescriptorSize)
	  wLength = DescriptorSize;
	  
	SendZLP = !(wLength % USB_ControlEndpointSize);
    1690:	60 91 16 01 	lds	r22, 0x0116
    1694:	ab 81       	ldd	r26, Y+3	; 0x03
    1696:	bc 81       	ldd	r27, Y+4	; 0x04
    1698:	9a 01       	movw	r18, r20
    169a:	16 c0       	rjmp	.+44     	; 0x16c8 <USB_Device_ProcessControlPacket+0x298>
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
	{
		while (!(Endpoint_IsSetupINReady()));
    169c:	80 91 e8 00 	lds	r24, 0x00E8
    16a0:	80 ff       	sbrs	r24, 0
    16a2:	fc cf       	rjmp	.-8      	; 0x169c <USB_Device_ProcessControlPacket+0x26c>
    16a4:	08 c0       	rjmp	.+16     	; 0x16b6 <USB_Device_ProcessControlPacket+0x286>
    16a6:	fd 01       	movw	r30, r26
    16a8:	11 96       	adiw	r26, 0x01	; 1
			#if defined(USE_RAM_DESCRIPTORS)
			Endpoint_Write_Byte(*((uint8_t*)DescriptorPointer++));
			#elif defined (USE_EEPROM_DESCRIPTORS)
			Endpoint_Write_Byte(eeprom_read_byte(DescriptorPointer++));			
			#else
			Endpoint_Write_Byte(pgm_read_byte(DescriptorPointer++));
    16aa:	e4 91       	lpm	r30, Z+
			}

			/** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints. */
			static inline void Endpoint_Write_Byte(const uint8_t Byte)
			{
				UEDATX = Byte;
    16ac:	e0 93 f1 00 	sts	0x00F1, r30
			#endif
			
			wLength--;
    16b0:	21 50       	subi	r18, 0x01	; 1
    16b2:	30 40       	sbci	r19, 0x00	; 0
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
	{
		while (!(Endpoint_IsSetupINReady()));
		
		while (wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
    16b4:	21 f0       	breq	.+8      	; 0x16be <USB_Device_ProcessControlPacket+0x28e>
    16b6:	80 91 f2 00 	lds	r24, 0x00F2
    16ba:	86 17       	cp	r24, r22
    16bc:	a0 f3       	brcs	.-24     	; 0x16a6 <USB_Device_ProcessControlPacket+0x276>
			#endif
			
			wLength--;
		}
		
		Endpoint_ClearSetupIN();
    16be:	80 91 e8 00 	lds	r24, 0x00E8
    16c2:	8e 7f       	andi	r24, 0xFE	; 254
    16c4:	80 93 e8 00 	sts	0x00E8, r24
	if (wLength > DescriptorSize)
	  wLength = DescriptorSize;
	  
	SendZLP = !(wLength % USB_ControlEndpointSize);
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
    16c8:	21 15       	cp	r18, r1
    16ca:	31 05       	cpc	r19, r1
    16cc:	21 f0       	breq	.+8      	; 0x16d6 <USB_Device_ProcessControlPacket+0x2a6>
    16ce:	80 91 e8 00 	lds	r24, 0x00E8
    16d2:	82 ff       	sbrs	r24, 2
    16d4:	e3 cf       	rjmp	.-58     	; 0x169c <USB_Device_ProcessControlPacket+0x26c>
		}
		
		Endpoint_ClearSetupIN();
	}
	
	if (Endpoint_IsSetupOUTReceived())
    16d6:	80 91 e8 00 	lds	r24, 0x00E8
    16da:	82 fd       	sbrc	r24, 2
    16dc:	28 c0       	rjmp	.+80     	; 0x172e <USB_Device_ProcessControlPacket+0x2fe>
	{
		Endpoint_ClearSetupOUT();
		return;
	}
	
	if (SendZLP)
    16de:	ca 01       	movw	r24, r20
    16e0:	70 e0       	ldi	r23, 0x00	; 0
    16e2:	3a d1       	rcall	.+628    	; 0x1958 <__udivmodhi4>
    16e4:	89 2b       	or	r24, r25
    16e6:	49 f4       	brne	.+18     	; 0x16fa <USB_Device_ProcessControlPacket+0x2ca>
	{
		while (!(Endpoint_IsSetupINReady()));
    16e8:	80 91 e8 00 	lds	r24, 0x00E8
    16ec:	80 ff       	sbrs	r24, 0
    16ee:	fc cf       	rjmp	.-8      	; 0x16e8 <USB_Device_ProcessControlPacket+0x2b8>
		Endpoint_ClearSetupIN();
    16f0:	80 91 e8 00 	lds	r24, 0x00E8
    16f4:	8e 7f       	andi	r24, 0xFE	; 254
    16f6:	80 93 e8 00 	sts	0x00E8, r24
	}

	while (!(Endpoint_IsSetupOUTReceived()));
    16fa:	80 91 e8 00 	lds	r24, 0x00E8
    16fe:	82 ff       	sbrs	r24, 2
    1700:	fc cf       	rjmp	.-8      	; 0x16fa <USB_Device_ProcessControlPacket+0x2ca>
    1702:	15 c0       	rjmp	.+42     	; 0x172e <USB_Device_ProcessControlPacket+0x2fe>
			USB_Device_GetDescriptor();
			RequestHandled = true;
			
			break;
		case REQ_GetConfiguration:
			if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
    1704:	60 38       	cpi	r22, 0x80	; 128
    1706:	09 f0       	breq	.+2      	; 0x170a <USB_Device_ProcessControlPacket+0x2da>
    1708:	4b c0       	rjmp	.+150    	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
	RAISE_EVENT(USB_ConfigurationChanged);
}

void USB_Device_GetConfiguration(void)
{
	Endpoint_ClearSetupReceived();	
    170a:	80 91 e8 00 	lds	r24, 0x00E8
    170e:	87 7f       	andi	r24, 0xF7	; 247
    1710:	80 93 e8 00 	sts	0x00E8, r24

	Endpoint_Write_Byte(USB_ConfigurationNumber);
    1714:	80 91 aa 01 	lds	r24, 0x01AA
    1718:	80 93 f1 00 	sts	0x00F1, r24
	
	Endpoint_ClearSetupIN();
    171c:	80 91 e8 00 	lds	r24, 0x00E8
    1720:	8e 7f       	andi	r24, 0xFE	; 254
    1722:	80 93 e8 00 	sts	0x00E8, r24

	while (!(Endpoint_IsSetupOUTReceived()));
    1726:	80 91 e8 00 	lds	r24, 0x00E8
    172a:	82 ff       	sbrs	r24, 2
    172c:	fc cf       	rjmp	.-8      	; 0x1726 <USB_Device_ProcessControlPacket+0x2f6>
	Endpoint_ClearSetupOUT();
    172e:	80 91 e8 00 	lds	r24, 0x00E8
    1732:	8b 7f       	andi	r24, 0xFB	; 251
    1734:	80 93 e8 00 	sts	0x00E8, r24
    1738:	35 c0       	rjmp	.+106    	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
				RequestHandled = true;
			}

			break;
		case REQ_SetConfiguration:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
    173a:	66 23       	and	r22, r22
    173c:	89 f5       	brne	.+98     	; 0x17a0 <USB_Device_ProcessControlPacket+0x370>
			static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT;
			static inline uint16_t Endpoint_Read_Word_LE(void)
			{
				uint16_t Data;
				
				Data  = UEDATX;
    173e:	00 91 f1 00 	lds	r16, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1742:	10 91 f1 00 	lds	r17, 0x00F1
}

static void USB_Device_SetConfiguration(void)
{
	uint16_t                 wValue               = Endpoint_Read_Word_LE();
	bool                     NotAlreadyConfigured = !(USB_ConfigurationNumber);
    1746:	f0 90 aa 01 	lds	r15, 0x01AA
	USB_Descriptor_Device_t* DevDescriptorPtr;
	uint16_t                 DevDescriptorSize;

	if ((USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr, &DevDescriptorSize) == false) ||
    174a:	9e 01       	movw	r18, r28
    174c:	29 5f       	subi	r18, 0xF9	; 249
    174e:	3f 4f       	sbci	r19, 0xFF	; 255
    1750:	ae 01       	movw	r20, r28
    1752:	4b 5f       	subi	r20, 0xFB	; 251
    1754:	5f 4f       	sbci	r21, 0xFF	; 255
    1756:	80 e0       	ldi	r24, 0x00	; 0
    1758:	91 e0       	ldi	r25, 0x01	; 1
    175a:	51 d9       	rcall	.-3422   	; 0x9fe <USB_GetDescriptor>
    175c:	88 23       	and	r24, r24
    175e:	11 f1       	breq	.+68     	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
    1760:	91 2f       	mov	r25, r17
    1762:	80 e0       	ldi	r24, 0x00	; 0
    1764:	20 2f       	mov	r18, r16
    1766:	30 e0       	ldi	r19, 0x00	; 0
    1768:	28 2b       	or	r18, r24
    176a:	39 2b       	or	r19, r25
#if defined(USE_RAM_DESCRIPTORS)
	    (wValue > DevDescriptorPtr->NumberOfConfigurations))
#elif defined (USE_EEPROM_DESCRIPTORS)
	    (wValue > eeprom_read_byte(&DevDescriptorPtr->NumberOfConfigurations)))
#else
	    (wValue > pgm_read_byte(&DevDescriptorPtr->NumberOfConfigurations)))
    176c:	ed 81       	ldd	r30, Y+5	; 0x05
    176e:	fe 81       	ldd	r31, Y+6	; 0x06
    1770:	71 96       	adiw	r30, 0x11	; 17
    1772:	e4 91       	lpm	r30, Z+
	uint16_t                 wValue               = Endpoint_Read_Word_LE();
	bool                     NotAlreadyConfigured = !(USB_ConfigurationNumber);
	USB_Descriptor_Device_t* DevDescriptorPtr;
	uint16_t                 DevDescriptorSize;

	if ((USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr, &DevDescriptorSize) == false) ||
    1774:	8e 2f       	mov	r24, r30
    1776:	90 e0       	ldi	r25, 0x00	; 0
    1778:	82 17       	cp	r24, r18
    177a:	93 07       	cpc	r25, r19
    177c:	98 f0       	brcs	.+38     	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>
#endif
	{
		return;
	}
	
	Endpoint_ClearSetupReceived();
    177e:	80 91 e8 00 	lds	r24, 0x00E8
    1782:	87 7f       	andi	r24, 0xF7	; 247
    1784:	80 93 e8 00 	sts	0x00E8, r24

	USB_ConfigurationNumber = wValue;
    1788:	20 93 aa 01 	sts	0x01AA, r18

	Endpoint_ClearSetupIN();
    178c:	80 91 e8 00 	lds	r24, 0x00E8
    1790:	8e 7f       	andi	r24, 0xFE	; 254
    1792:	80 93 e8 00 	sts	0x00E8, r24

	if (NotAlreadyConfigured)
    1796:	ff 20       	and	r15, r15
    1798:	09 f4       	brne	.+2      	; 0x179c <USB_Device_ProcessControlPacket+0x36c>
	  RAISE_EVENT(USB_DeviceEnumerationComplete);
    179a:	cb d0       	rcall	.+406    	; 0x1932 <Event_USB_DeviceEnumerationComplete>

	RAISE_EVENT(USB_ConfigurationChanged);
    179c:	e1 d8       	rcall	.-3646   	; 0x960 <Event_USB_ConfigurationChanged>
    179e:	02 c0       	rjmp	.+4      	; 0x17a4 <USB_Device_ProcessControlPacket+0x374>

			break;
	}

	if (!(RequestHandled))
	  RAISE_EVENT(USB_UnhandledControlPacket, bRequest, bmRequestType);
    17a0:	84 2f       	mov	r24, r20
    17a2:	99 d8       	rcall	.-3790   	; 0x8d6 <Event_USB_UnhandledControlPacket>
	  
	if (Endpoint_IsSetupReceived())
    17a4:	80 91 e8 00 	lds	r24, 0x00E8
    17a8:	83 ff       	sbrs	r24, 3
    17aa:	0a c0       	rjmp	.+20     	; 0x17c0 <USB_Device_ProcessControlPacket+0x390>
	{
		Endpoint_StallTransaction();
    17ac:	80 91 eb 00 	lds	r24, 0x00EB
    17b0:	80 62       	ori	r24, 0x20	; 32
    17b2:	80 93 eb 00 	sts	0x00EB, r24
		Endpoint_ClearSetupReceived();		
    17b6:	80 91 e8 00 	lds	r24, 0x00E8
    17ba:	87 7f       	andi	r24, 0xF7	; 247
    17bc:	80 93 e8 00 	sts	0x00E8, r24
	}
}
    17c0:	28 96       	adiw	r28, 0x08	; 8
    17c2:	0f b6       	in	r0, 0x3f	; 63
    17c4:	f8 94       	cli
    17c6:	de bf       	out	0x3e, r29	; 62
    17c8:	0f be       	out	0x3f, r0	; 63
    17ca:	cd bf       	out	0x3d, r28	; 61
    17cc:	cf 91       	pop	r28
    17ce:	df 91       	pop	r29
    17d0:	1f 91       	pop	r17
    17d2:	0f 91       	pop	r16
    17d4:	ff 90       	pop	r15
    17d6:	08 95       	ret

000017d8 <USB_USBTask>:
#if defined(USB_CAN_BE_HOST)
volatile uint8_t   USB_HostState;
#endif

TASK(USB_USBTask)
{
    17d8:	1f 93       	push	r17
#endif

#if defined(USB_CAN_BE_DEVICE)
static void USB_DeviceTask(void)
{
	if (USB_IsConnected)
    17da:	80 91 ac 01 	lds	r24, 0x01AC
    17de:	88 23       	and	r24, r24
    17e0:	61 f0       	breq	.+24     	; 0x17fa <USB_USBTask+0x22>
	{
		uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
    17e2:	10 91 e9 00 	lds	r17, 0x00E9
	
		Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
    17e6:	10 92 e9 00 	sts	0x00E9, r1

		if (Endpoint_IsSetupReceived())
    17ea:	80 91 e8 00 	lds	r24, 0x00E8
    17ee:	83 ff       	sbrs	r24, 3
    17f0:	01 c0       	rjmp	.+2      	; 0x17f4 <USB_USBTask+0x1c>
		  USB_Device_ProcessControlPacket();
    17f2:	1e de       	rcall	.-964    	; 0x1430 <USB_Device_ProcessControlPacket>
#if defined(USB_CAN_BE_DEVICE)
static void USB_DeviceTask(void)
{
	if (USB_IsConnected)
	{
		uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
    17f4:	17 70       	andi	r17, 0x07	; 7
		Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);

		if (Endpoint_IsSetupReceived())
		  USB_Device_ProcessControlPacket();
		  
		Endpoint_SelectEndpoint(PrevEndpoint);
    17f6:	10 93 e9 00 	sts	0x00E9, r17
		USB_DeviceTask();
	#else
		if (USB_IsInitialized)
		  (*USB_TaskPtr)();
	#endif
}
    17fa:	1f 91       	pop	r17
    17fc:	08 95       	ret

000017fe <USB_INT_DisableAllInterrupts>:

#include "../LowLevel/USBMode.h"
#include "USBInterrupt.h"

void USB_INT_DisableAllInterrupts(void)
{
    17fe:	10 92 e2 00 	sts	0x00E2, r1
	#endif
	
	#if defined(USB_CAN_BE_DEVICE)
	UDIEN   = 0;
	#endif
}
    1802:	08 95       	ret

00001804 <USB_INT_ClearAllInterrupts>:

void USB_INT_ClearAllInterrupts(void)
{
    1804:	10 92 e1 00 	sts	0x00E1, r1
	#endif
	
	#if defined(USB_CAN_BE_DEVICE)
	UDINT   = 0;
	#endif
}
    1808:	08 95       	ret

0000180a <__vector_11>:

ISR(USB_GEN_vect)
{
    180a:	1f 92       	push	r1
    180c:	0f 92       	push	r0
    180e:	0f b6       	in	r0, 0x3f	; 63
    1810:	0f 92       	push	r0
    1812:	11 24       	eor	r1, r1
    1814:	2f 93       	push	r18
    1816:	3f 93       	push	r19
    1818:	4f 93       	push	r20
    181a:	5f 93       	push	r21
    181c:	6f 93       	push	r22
    181e:	7f 93       	push	r23
    1820:	8f 93       	push	r24
    1822:	9f 93       	push	r25
    1824:	af 93       	push	r26
    1826:	bf 93       	push	r27
    1828:	ef 93       	push	r30
    182a:	ff 93       	push	r31
			USB_IsConnected = false;
		}
	}
	#endif

	if (USB_INT_HasOccurred(USB_INT_SUSPEND) && USB_INT_IsEnabled(USB_INT_SUSPEND))
    182c:	80 91 e1 00 	lds	r24, 0x00E1
    1830:	80 ff       	sbrs	r24, 0
    1832:	1e c0       	rjmp	.+60     	; 0x1870 <__vector_11+0x66>
    1834:	80 91 e2 00 	lds	r24, 0x00E2
    1838:	80 ff       	sbrs	r24, 0
    183a:	1a c0       	rjmp	.+52     	; 0x1870 <__vector_11+0x66>
	{
		USB_INT_Clear(USB_INT_SUSPEND);
    183c:	80 91 e1 00 	lds	r24, 0x00E1
    1840:	8e 7f       	andi	r24, 0xFE	; 254
    1842:	80 93 e1 00 	sts	0x00E1, r24

		USB_INT_Disable(USB_INT_SUSPEND);
    1846:	80 91 e2 00 	lds	r24, 0x00E2
    184a:	8e 7f       	andi	r24, 0xFE	; 254
    184c:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_WAKEUP);
    1850:	80 91 e2 00 	lds	r24, 0x00E2
    1854:	80 61       	ori	r24, 0x10	; 16
    1856:	80 93 e2 00 	sts	0x00E2, r24
		
		USB_CLK_Freeze();
    185a:	80 91 d8 00 	lds	r24, 0x00D8
    185e:	80 62       	ori	r24, 0x20	; 32
    1860:	80 93 d8 00 	sts	0x00D8, r24
		#if !defined(MANUAL_PLL_CONTROL)
		USB_PLL_Off();
    1864:	19 bc       	out	0x29, r1	; 41
		#endif

		RAISE_EVENT(USB_Suspend);
    1866:	65 d0       	rcall	.+202    	; 0x1932 <Event_USB_DeviceEnumerationComplete>

		#if defined(USB_LIMITED_CONTROLLER)
		USB_IsConnected = false;
    1868:	10 92 ac 01 	sts	0x01AC, r1
		RAISE_EVENT(USB_Disconnect);
    186c:	0e 94 78 03 	call	0x6f0	; 0x6f0 <Event_USB_Disconnect>
		#endif
	}

	if (USB_INT_HasOccurred(USB_INT_WAKEUP) && USB_INT_IsEnabled(USB_INT_WAKEUP))
    1870:	80 91 e1 00 	lds	r24, 0x00E1
    1874:	84 ff       	sbrs	r24, 4
    1876:	26 c0       	rjmp	.+76     	; 0x18c4 <__vector_11+0xba>
    1878:	80 91 e2 00 	lds	r24, 0x00E2
    187c:	84 ff       	sbrs	r24, 4
    187e:	22 c0       	rjmp	.+68     	; 0x18c4 <__vector_11+0xba>
	{
		#if !defined(MANUAL_PLL_CONTROL)
		USB_PLL_On();
    1880:	84 e0       	ldi	r24, 0x04	; 4
    1882:	89 bd       	out	0x29, r24	; 41
    1884:	89 b5       	in	r24, 0x29	; 41
    1886:	82 60       	ori	r24, 0x02	; 2
    1888:	89 bd       	out	0x29, r24	; 41
		#endif
		while (!(USB_PLL_IsReady()));
    188a:	09 b4       	in	r0, 0x29	; 41
    188c:	00 fe       	sbrs	r0, 0
    188e:	fd cf       	rjmp	.-6      	; 0x188a <__vector_11+0x80>

		USB_CLK_Unfreeze();
    1890:	80 91 d8 00 	lds	r24, 0x00D8
    1894:	8f 7d       	andi	r24, 0xDF	; 223
    1896:	80 93 d8 00 	sts	0x00D8, r24

		USB_INT_Clear(USB_INT_WAKEUP);
    189a:	80 91 e1 00 	lds	r24, 0x00E1
    189e:	8f 7e       	andi	r24, 0xEF	; 239
    18a0:	80 93 e1 00 	sts	0x00E1, r24

		USB_INT_Disable(USB_INT_WAKEUP);
    18a4:	80 91 e2 00 	lds	r24, 0x00E2
    18a8:	8f 7e       	andi	r24, 0xEF	; 239
    18aa:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_SUSPEND);
    18ae:	80 91 e2 00 	lds	r24, 0x00E2
    18b2:	81 60       	ori	r24, 0x01	; 1
    18b4:	80 93 e2 00 	sts	0x00E2, r24
		
		#if defined(USB_LIMITED_CONTROLLER)
		USB_IsConnected = true;
    18b8:	81 e0       	ldi	r24, 0x01	; 1
    18ba:	80 93 ac 01 	sts	0x01AC, r24
		RAISE_EVENT(USB_Connect);
    18be:	0e 94 80 03 	call	0x700	; 0x700 <Event_USB_Connect>
		#endif

		RAISE_EVENT(USB_WakeUp);
    18c2:	37 d0       	rcall	.+110    	; 0x1932 <Event_USB_DeviceEnumerationComplete>
	}
   
	if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
    18c4:	80 91 e1 00 	lds	r24, 0x00E1
    18c8:	83 ff       	sbrs	r24, 3
    18ca:	22 c0       	rjmp	.+68     	; 0x1910 <__vector_11+0x106>
    18cc:	80 91 e2 00 	lds	r24, 0x00E2
    18d0:	83 ff       	sbrs	r24, 3
    18d2:	1e c0       	rjmp	.+60     	; 0x1910 <__vector_11+0x106>
	{
		USB_INT_Clear(USB_INT_EORSTI);
    18d4:	80 91 e1 00 	lds	r24, 0x00E1
    18d8:	87 7f       	andi	r24, 0xF7	; 247
    18da:	80 93 e1 00 	sts	0x00E1, r24

		USB_ConfigurationNumber = 0;
    18de:	10 92 aa 01 	sts	0x01AA, r1

		USB_INT_Clear(USB_INT_SUSPEND);
    18e2:	80 91 e1 00 	lds	r24, 0x00E1
    18e6:	8e 7f       	andi	r24, 0xFE	; 254
    18e8:	80 93 e1 00 	sts	0x00E1, r24
		USB_INT_Disable(USB_INT_SUSPEND);
    18ec:	80 91 e2 00 	lds	r24, 0x00E2
    18f0:	8e 7f       	andi	r24, 0xFE	; 254
    18f2:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_WAKEUP);
    18f6:	80 91 e2 00 	lds	r24, 0x00E2
    18fa:	80 61       	ori	r24, 0x10	; 16
    18fc:	80 93 e2 00 	sts	0x00E2, r24

		Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
    1900:	60 91 16 01 	lds	r22, 0x0116
    1904:	20 e0       	ldi	r18, 0x00	; 0
    1906:	40 e0       	ldi	r20, 0x00	; 0
    1908:	70 e0       	ldi	r23, 0x00	; 0
    190a:	80 e0       	ldi	r24, 0x00	; 0
    190c:	07 dd       	rcall	.-1522   	; 0x131c <Endpoint_ConfigureEndpoint_P>
		                           ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
		                           ENDPOINT_BANK_SINGLE);

		RAISE_EVENT(USB_Reset);
    190e:	11 d0       	rcall	.+34     	; 0x1932 <Event_USB_DeviceEnumerationComplete>
		USB_OTGPAD_On();

		USB_SetupInterface();	
	}
	#endif
}
    1910:	ff 91       	pop	r31
    1912:	ef 91       	pop	r30
    1914:	bf 91       	pop	r27
    1916:	af 91       	pop	r26
    1918:	9f 91       	pop	r25
    191a:	8f 91       	pop	r24
    191c:	7f 91       	pop	r23
    191e:	6f 91       	pop	r22
    1920:	5f 91       	pop	r21
    1922:	4f 91       	pop	r20
    1924:	3f 91       	pop	r19
    1926:	2f 91       	pop	r18
    1928:	0f 90       	pop	r0
    192a:	0f be       	out	0x3f, r0	; 63
    192c:	0f 90       	pop	r0
    192e:	1f 90       	pop	r1
    1930:	18 95       	reti

00001932 <Event_USB_DeviceEnumerationComplete>:

#define INCLUDE_FROM_EVENTS_C
#include "Events.h"

static void __stub(void)
{
    1932:	08 95       	ret

00001934 <__mulhi3>:
    1934:	55 27       	eor	r21, r21
    1936:	00 24       	eor	r0, r0

00001938 <__mulhi3_loop>:
    1938:	80 ff       	sbrs	r24, 0
    193a:	02 c0       	rjmp	.+4      	; 0x1940 <__mulhi3_skip1>
    193c:	06 0e       	add	r0, r22
    193e:	57 1f       	adc	r21, r23

00001940 <__mulhi3_skip1>:
    1940:	66 0f       	add	r22, r22
    1942:	77 1f       	adc	r23, r23
    1944:	61 15       	cp	r22, r1
    1946:	71 05       	cpc	r23, r1
    1948:	21 f0       	breq	.+8      	; 0x1952 <__mulhi3_exit>
    194a:	96 95       	lsr	r25
    194c:	87 95       	ror	r24
    194e:	00 97       	sbiw	r24, 0x00	; 0
    1950:	99 f7       	brne	.-26     	; 0x1938 <__mulhi3_loop>

00001952 <__mulhi3_exit>:
    1952:	95 2f       	mov	r25, r21
    1954:	80 2d       	mov	r24, r0
    1956:	08 95       	ret

00001958 <__udivmodhi4>:
    1958:	aa 1b       	sub	r26, r26
    195a:	bb 1b       	sub	r27, r27
    195c:	51 e1       	ldi	r21, 0x11	; 17
    195e:	07 c0       	rjmp	.+14     	; 0x196e <__udivmodhi4_ep>

00001960 <__udivmodhi4_loop>:
    1960:	aa 1f       	adc	r26, r26
    1962:	bb 1f       	adc	r27, r27
    1964:	a6 17       	cp	r26, r22
    1966:	b7 07       	cpc	r27, r23
    1968:	10 f0       	brcs	.+4      	; 0x196e <__udivmodhi4_ep>
    196a:	a6 1b       	sub	r26, r22
    196c:	b7 0b       	sbc	r27, r23

0000196e <__udivmodhi4_ep>:
    196e:	88 1f       	adc	r24, r24
    1970:	99 1f       	adc	r25, r25
    1972:	5a 95       	dec	r21
    1974:	a9 f7       	brne	.-22     	; 0x1960 <__udivmodhi4_loop>
    1976:	80 95       	com	r24
    1978:	90 95       	com	r25
    197a:	bc 01       	movw	r22, r24
    197c:	cd 01       	movw	r24, r26
    197e:	08 95       	ret

00001980 <__udivmodsi4>:
    1980:	a1 e2       	ldi	r26, 0x21	; 33
    1982:	1a 2e       	mov	r1, r26
    1984:	aa 1b       	sub	r26, r26
    1986:	bb 1b       	sub	r27, r27
    1988:	fd 01       	movw	r30, r26
    198a:	0d c0       	rjmp	.+26     	; 0x19a6 <__udivmodsi4_ep>

0000198c <__udivmodsi4_loop>:
    198c:	aa 1f       	adc	r26, r26
    198e:	bb 1f       	adc	r27, r27
    1990:	ee 1f       	adc	r30, r30
    1992:	ff 1f       	adc	r31, r31
    1994:	a2 17       	cp	r26, r18
    1996:	b3 07       	cpc	r27, r19
    1998:	e4 07       	cpc	r30, r20
    199a:	f5 07       	cpc	r31, r21
    199c:	20 f0       	brcs	.+8      	; 0x19a6 <__udivmodsi4_ep>
    199e:	a2 1b       	sub	r26, r18
    19a0:	b3 0b       	sbc	r27, r19
    19a2:	e4 0b       	sbc	r30, r20
    19a4:	f5 0b       	sbc	r31, r21

000019a6 <__udivmodsi4_ep>:
    19a6:	66 1f       	adc	r22, r22
    19a8:	77 1f       	adc	r23, r23
    19aa:	88 1f       	adc	r24, r24
    19ac:	99 1f       	adc	r25, r25
    19ae:	1a 94       	dec	r1
    19b0:	69 f7       	brne	.-38     	; 0x198c <__udivmodsi4_loop>
    19b2:	60 95       	com	r22
    19b4:	70 95       	com	r23
    19b6:	80 95       	com	r24
    19b8:	90 95       	com	r25
    19ba:	9b 01       	movw	r18, r22
    19bc:	ac 01       	movw	r20, r24
    19be:	bd 01       	movw	r22, r26
    19c0:	cf 01       	movw	r24, r30
    19c2:	08 95       	ret

000019c4 <_exit>:
    19c4:	f8 94       	cli

000019c6 <__stop_program>:
    19c6:	ff cf       	rjmp	.-2      	; 0x19c6 <__stop_program>
