
USB10.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .data         0000001c  00800100  00001d12  00001d86  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  1 .text         00001d12  00000000  00000000  00000074  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .bss          000000ab  0080011c  00001d2e  00001da2  2**0
                  ALLOC
  3 .debug_aranges 000003c8  00000000  00000000  00001da2  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_pubnames 0000098c  00000000  00000000  0000216a  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   00003ab6  00000000  00000000  00002af6  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_abbrev 0000137c  00000000  00000000  000065ac  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_line   00003790  00000000  00000000  00007928  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_frame  000005d0  00000000  00000000  0000b0b8  2**2
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_str    00001619  00000000  00000000  0000b688  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_loc    00001448  00000000  00000000  0000cca1  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_ranges 00000430  00000000  00000000  0000e0e9  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <__vectors>:




void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
       0:	d0 c0       	rjmp	.+416    	; 0x1a2 <__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:	ea c0       	rjmp	.+468    	; 0x1da <__bad_interrupt>
	
	Endpoint_AllocateMemory();
}

void Endpoint_ClearEndpoints(void)
{
       6:	00 00       	nop
       8:	e8 c0       	rjmp	.+464    	; 0x1da <__bad_interrupt>
       a:	00 00       	nop
       c:	e6 c0       	rjmp	.+460    	; 0x1da <__bad_interrupt>
       e:	00 00       	nop
      10:	e4 c0       	rjmp	.+456    	; 0x1da <__bad_interrupt>
      12:	00 00       	nop
      14:	e2 c0       	rjmp	.+452    	; 0x1da <__bad_interrupt>
      16:	00 00       	nop
      18:	e0 c0       	rjmp	.+448    	; 0x1da <__bad_interrupt>
      1a:	00 00       	nop
      1c:	de c0       	rjmp	.+444    	; 0x1da <__bad_interrupt>
      1e:	00 00       	nop
      20:	dc c0       	rjmp	.+440    	; 0x1da <__bad_interrupt>
      22:	00 00       	nop
      24:	da c0       	rjmp	.+436    	; 0x1da <__bad_interrupt>
      26:	00 00       	nop
      28:	d8 c0       	rjmp	.+432    	; 0x1da <__bad_interrupt>
      2a:	00 00       	nop
      2c:	0c 94 aa 0d 	jmp	0x1b54	; 0x1b54 <__vector_11>
      30:	d4 c0       	rjmp	.+424    	; 0x1da <__bad_interrupt>
      32:	00 00       	nop
      34:	d2 c0       	rjmp	.+420    	; 0x1da <__bad_interrupt>
      36:	00 00       	nop
      38:	d0 c0       	rjmp	.+416    	; 0x1da <__bad_interrupt>
      3a:	00 00       	nop
      3c:	ce c0       	rjmp	.+412    	; 0x1da <__bad_interrupt>
      3e:	00 00       	nop
      40:	cc c0       	rjmp	.+408    	; 0x1da <__bad_interrupt>
      42:	00 00       	nop
      44:	ca c0       	rjmp	.+404    	; 0x1da <__bad_interrupt>
      46:	00 00       	nop
      48:	c8 c0       	rjmp	.+400    	; 0x1da <__bad_interrupt>
      4a:	00 00       	nop
      4c:	c6 c0       	rjmp	.+396    	; 0x1da <__bad_interrupt>
      4e:	00 00       	nop
      50:	c4 c0       	rjmp	.+392    	; 0x1da <__bad_interrupt>
      52:	00 00       	nop
      54:	c2 c0       	rjmp	.+388    	; 0x1da <__bad_interrupt>
      56:	00 00       	nop
      58:	c0 c0       	rjmp	.+384    	; 0x1da <__bad_interrupt>
      5a:	00 00       	nop
      5c:	f5 c1       	rjmp	.+1002   	; 0x448 <__vector_23>
      5e:	00 00       	nop
      60:	bc c0       	rjmp	.+376    	; 0x1da <__bad_interrupt>
      62:	00 00       	nop
      64:	44 c1       	rjmp	.+648    	; 0x2ee <__vector_25>
      66:	00 00       	nop
      68:	b8 c0       	rjmp	.+368    	; 0x1da <__bad_interrupt>
      6a:	00 00       	nop
      6c:	b6 c0       	rjmp	.+364    	; 0x1da <__bad_interrupt>
      6e:	00 00       	nop
      70:	b4 c0       	rjmp	.+360    	; 0x1da <__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.2401>:
      81:	20 73 2d 73 65 72 69 61 6c 2c 20 63 2d 49 32 43      s-serial, c-I2C
      91:	2c 20 70 2d 70 72 6f 67 2c 20 6c 2d 6c 65 64 2c     , p-prog, l-led,
      a1:	20 62 2d 62 6f 6f 74 0d 0a 00                        b-boot...

000000ab <__c.2399>:
      ab:	0d 0a 55 53 42 31 30 20 43 6f 6d 6d 61 6e 64 20     ..USB10 Command 
      bb:	53 75 6d 6d 61 72 79 0d 0a 00                       Summary...

000000c5 <__c.2290>:
      c5:	0d 0a 55 53 42 31 30 20 46 65 72 72 65 74 20 55     ..USB10 Ferret U
      d5:	74 69 6c 69 74 79 20 56 31 2e 30 0a 0d 28 63 29     tility V1.0..(c)
      e5:	20 32 30 30 38 20 53 4f 43 20 52 6f 62 6f 74 69      2008 SOC Roboti
      f5:	63 73 2c 20 49 6e 63 2e 0d 0a 0d 0a 00              cs, Inc......

00000102 <DeviceDescriptor>:
     102:	12 01 10 01 02 00 00 08 eb 03 4b 20 00 00 01 02     ..........K ....
     112:	00 01                                               ..

00000114 <ConfigurationDescriptor>:
     114:	09 02 43 00 02 01 00 c0 32 09 04 00 00 01 02 02     ..C.....2.......
     124:	01 00 05 24 00 01 10 05 24 01 03 01 04 24 02 06     ...$....$....$..
     134:	05 24 06 00 01 07 05 82 03 08 00 ff 09 04 01 00     .$..............
     144:	02 0a 00 00 00 07 05 04 02 10 00 00 07 05 83 02     ................
     154:	10 00 00                                            ...

00000157 <LanguageString>:
     157:	04 03 09 04                                         ....

0000015b <ManufacturerString>:
     15b:	18 03 44 00 65 00 61 00 6e 00 20 00 43 00 61 00     ..D.e.a.n. .C.a.
     16b:	6d 00 65 00 72 00 61 00 00 00                       m.e.r.a...

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

000001a2 <__ctors_end>:
     1a2:	11 24       	eor	r1, r1
     1a4:	1f be       	out	0x3f, r1	; 63
     1a6:	cf ef       	ldi	r28, 0xFF	; 255
     1a8:	d2 e0       	ldi	r29, 0x02	; 2
     1aa:	de bf       	out	0x3e, r29	; 62
     1ac:	cd bf       	out	0x3d, r28	; 61

000001ae <__do_copy_data>:
     1ae:	11 e0       	ldi	r17, 0x01	; 1
     1b0:	a0 e0       	ldi	r26, 0x00	; 0
     1b2:	b1 e0       	ldi	r27, 0x01	; 1
     1b4:	e2 e1       	ldi	r30, 0x12	; 18
     1b6:	fd e1       	ldi	r31, 0x1D	; 29
     1b8:	02 c0       	rjmp	.+4      	; 0x1be <.do_copy_data_start>

000001ba <.do_copy_data_loop>:
     1ba:	05 90       	lpm	r0, Z+
     1bc:	0d 92       	st	X+, r0

000001be <.do_copy_data_start>:
     1be:	ac 31       	cpi	r26, 0x1C	; 28
     1c0:	b1 07       	cpc	r27, r17
     1c2:	d9 f7       	brne	.-10     	; 0x1ba <.do_copy_data_loop>

000001c4 <__do_clear_bss>:
     1c4:	11 e0       	ldi	r17, 0x01	; 1
     1c6:	ac e1       	ldi	r26, 0x1C	; 28
     1c8:	b1 e0       	ldi	r27, 0x01	; 1
     1ca:	01 c0       	rjmp	.+2      	; 0x1ce <.do_clear_bss_start>

000001cc <.do_clear_bss_loop>:
     1cc:	1d 92       	st	X+, r1

000001ce <.do_clear_bss_start>:
     1ce:	a7 3c       	cpi	r26, 0xC7	; 199
     1d0:	b1 07       	cpc	r27, r17
     1d2:	e1 f7       	brne	.-8      	; 0x1cc <.do_clear_bss_loop>
     1d4:	82 d5       	rcall	.+2820   	; 0xcda <main>
     1d6:	0c 94 87 0e 	jmp	0x1d0e	; 0x1d0e <_exit>

000001da <__bad_interrupt>:
     1da:	12 cf       	rjmp	.-476    	; 0x0 <__vectors>

000001dc <ISP_Int>:
	}
}


void ISP_Int(void)
{
     1dc:	80 91 1e 01 	lds	r24, 0x011E
     1e0:	83 30       	cpi	r24, 0x03	; 3
     1e2:	39 f4       	brne	.+14     	; 0x1f2 <ISP_Int+0x16>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     1e4:	42 9a       	sbi	0x08, 2	; 8

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1e6:	44 98       	cbi	0x08, 4	; 8

			Change_ISP_Pin(RES_2, HIGH);
			Change_ISP_Pin(MOSI_2, LOW);
			Change_ISP_Pin(SCK_2, LOW);
			//set my inputs/outputs
			DDRC &= ~(1<<MISO_2);
     1e8:	45 98       	cbi	0x08, 5	; 8
     1ea:	3f 98       	cbi	0x07, 7	; 7
			DDRC |= (1<<MOSI_2) | (1<<SCK_2) | (1<<RES_2);
     1ec:	87 b1       	in	r24, 0x07	; 7
     1ee:	84 63       	ori	r24, 0x34	; 52
     1f0:	87 b9       	out	0x07, r24	; 7
     1f2:	08 95       	ret

000001f4 <Write_ISP_Byte>:
}


//  Output MSB first
void  Write_ISP_Byte(unsigned char outbyte)
{
     1f4:	38 2f       	mov	r19, r24

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1f6:	45 98       	cbi	0x08, 5	; 8
     1f8:	20 e8       	ldi	r18, 0x80	; 128
     1fa:	90 e0       	ldi	r25, 0x00	; 0
	Change_ISP_Pin(SCK_2,LOW);
//	DelayUsec(5+INTERBITDELAY);
	mask = 0x80;
	for(i=0; i<8; i++)
	{
		if((outbyte&mask))
     1fc:	82 2f       	mov	r24, r18
     1fe:	83 23       	and	r24, r19
     200:	11 f0       	breq	.+4      	; 0x206 <Write_ISP_Byte+0x12>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     202:	44 9a       	sbi	0x08, 4	; 8
     204:	01 c0       	rjmp	.+2      	; 0x208 <Write_ISP_Byte+0x14>

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     206:	44 98       	cbi	0x08, 4	; 8
	}
	else
	{
		PORTC |= (1<<pinId);
     208:	45 9a       	sbi	0x08, 5	; 8

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     20a:	45 98       	cbi	0x08, 5	; 8
	unsigned char  i;

	Change_ISP_Pin(SCK_2,LOW);
//	DelayUsec(5+INTERBITDELAY);
	mask = 0x80;
	for(i=0; i<8; i++)
     20c:	9f 5f       	subi	r25, 0xFF	; 255
     20e:	98 30       	cpi	r25, 0x08	; 8
     210:	11 f0       	breq	.+4      	; 0x216 <Write_ISP_Byte+0x22>
	//	DelayUsec(INTERBITDELAY);
		Change_ISP_Pin(SCK_2,HIGH);
	//	DelayUsec(INTERBITDELAY);
		Change_ISP_Pin(SCK_2,LOW);
	//	DelayUsec(INTERBITDELAY);  // May not need this delay
		mask = mask>>1;
     212:	26 95       	lsr	r18
     214:	f3 cf       	rjmp	.-26     	; 0x1fc <Write_ISP_Byte+0x8>
     216:	08 95       	ret

00000218 <Write_Read_ISP_Byte>:
	
}


unsigned char Write_Read_ISP_Byte(unsigned char outbyte)
{
     218:	48 2f       	mov	r20, r24

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     21a:	45 98       	cbi	0x08, 5	; 8
     21c:	30 e8       	ldi	r19, 0x80	; 128
     21e:	90 e0       	ldi	r25, 0x00	; 0
     220:	20 e0       	ldi	r18, 0x00	; 0
//	DelayUsec(5+INTERBITDELAY);
	mask = 0x80;
	inbyte = 0x00;
	for(i=0; i<8; i++)
	{
		if((outbyte&mask))
     222:	83 2f       	mov	r24, r19
     224:	84 23       	and	r24, r20
     226:	11 f0       	breq	.+4      	; 0x22c <Write_Read_ISP_Byte+0x14>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     228:	44 9a       	sbi	0x08, 4	; 8
     22a:	01 c0       	rjmp	.+2      	; 0x22e <Write_Read_ISP_Byte+0x16>

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     22c:	44 98       	cbi	0x08, 4	; 8
	}
	else
	{
		PORTC |= (1<<pinId);
     22e:	45 9a       	sbi	0x08, 5	; 8
			Change_ISP_Pin(MOSI_2,LOW);
		}
	//	DelayUsec(10);
		Change_ISP_Pin(SCK_2,HIGH);
	//	DelayUsec(INTERBITDELAY);
		if(i>0)//??why check??
     230:	21 11       	cpse	r18, r1
		{
			inbyte = inbyte<<1;
     232:	99 0f       	add	r25, r25
		}	
		if(PINC & (1<<MISO_2))
     234:	37 99       	sbic	0x06, 7	; 6
		{
			inbyte |= 0x01;
     236:	91 60       	ori	r25, 0x01	; 1

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     238:	45 98       	cbi	0x08, 5	; 8

	Change_ISP_Pin(SCK_2,LOW);
//	DelayUsec(5+INTERBITDELAY);
	mask = 0x80;
	inbyte = 0x00;
	for(i=0; i<8; i++)
     23a:	2f 5f       	subi	r18, 0xFF	; 255
     23c:	28 30       	cpi	r18, 0x08	; 8
     23e:	11 f0       	breq	.+4      	; 0x244 <Write_Read_ISP_Byte+0x2c>
			inbyte |= 0x01;
		}
	//	DelayUsec(INTERBITDELAY);
		Change_ISP_Pin(SCK_2,LOW);
	//	DelayUsec(INTERBITDELAY);  // May not need this delay
		mask = mask>>1;	
     240:	36 95       	lsr	r19
     242:	ef cf       	rjmp	.-34     	; 0x222 <Write_Read_ISP_Byte+0xa>
	}
	return inbyte;
}
     244:	89 2f       	mov	r24, r25
     246:	08 95       	ret

00000248 <Chip_Busy_Status>:
		}
	}
	return '0';
}
unsigned char Chip_Busy_Status(void)
{
     248:	80 ef       	ldi	r24, 0xF0	; 240
     24a:	d4 df       	rcall	.-88     	; 0x1f4 <Write_ISP_Byte>
	unsigned char busybyte;

	//  Read Fuse Low Byte 0
	Write_ISP_Byte(0xF0);//POLL_RDYBSY
	Write_ISP_Byte(0x00);
     24c:	80 e0       	ldi	r24, 0x00	; 0
     24e:	d2 df       	rcall	.-92     	; 0x1f4 <Write_ISP_Byte>
	Write_ISP_Byte(0x00);
     250:	80 e0       	ldi	r24, 0x00	; 0
     252:	d0 df       	rcall	.-96     	; 0x1f4 <Write_ISP_Byte>
	busybyte = Write_Read_ISP_Byte(0x00);
     254:	80 e0       	ldi	r24, 0x00	; 0

	return busybyte;
}
     256:	e0 cf       	rjmp	.-64     	; 0x218 <Write_Read_ISP_Byte>

00000258 <Wait_For_Busy>:
	}
	return inbyte;
}

unsigned char Wait_For_Busy(void)
{
     258:	cf 93       	push	r28
     25a:	df 93       	push	r29
     25c:	c0 e0       	ldi	r28, 0x00	; 0
     25e:	d0 e0       	ldi	r29, 0x00	; 0
     260:	07 c0       	rjmp	.+14     	; 0x270 <Wait_For_Busy+0x18>
	uint32_t loopcnt;

	loopcnt = 0;
	while((Chip_Busy_Status()&0x01))
     262:	21 96       	adiw	r28, 0x01	; 1
	{
		DelayUsec(50);
		if(loopcnt++>5000)
     264:	83 e1       	ldi	r24, 0x13	; 19
     266:	ca 38       	cpi	r28, 0x8A	; 138
     268:	d8 07       	cpc	r29, r24
     26a:	11 f4       	brne	.+4      	; 0x270 <Wait_For_Busy+0x18>
     26c:	81 e3       	ldi	r24, 0x31	; 49
     26e:	04 c0       	rjmp	.+8      	; 0x278 <Wait_For_Busy+0x20>
unsigned char Wait_For_Busy(void)
{
	uint32_t loopcnt;

	loopcnt = 0;
	while((Chip_Busy_Status()&0x01))
     270:	eb df       	rcall	.-42     	; 0x248 <Chip_Busy_Status>
     272:	80 fd       	sbrc	r24, 0
     274:	f6 cf       	rjmp	.-20     	; 0x262 <Wait_For_Busy+0xa>
     276:	80 e3       	ldi	r24, 0x30	; 48
		{
			return '1';
		}
	}
	return '0';
}
     278:	df 91       	pop	r29
     27a:	cf 91       	pop	r28
     27c:	08 95       	ret

0000027e <ReconfigureUSART>:
		Buffer_StoreElementOnTop(&Tx_Buffer, UDR1);
	}
}

void ReconfigureUSART(void)
{
     27e:	80 91 17 01 	lds	r24, 0x0117
     282:	81 30       	cpi	r24, 0x01	; 1
     284:	11 f4       	brne	.+4      	; 0x28a <ReconfigureUSART+0xc>
     286:	90 e3       	ldi	r25, 0x30	; 48
     288:	05 c0       	rjmp	.+10     	; 0x294 <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)
     28a:	82 30       	cpi	r24, 0x02	; 2
     28c:	11 f4       	brne	.+4      	; 0x292 <ReconfigureUSART+0x14>
     28e:	90 e2       	ldi	r25, 0x20	; 32
     290:	01 c0       	rjmp	.+2      	; 0x294 <ReconfigureUSART+0x16>
     292:	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)
     294:	80 91 16 01 	lds	r24, 0x0116
     298:	82 30       	cpi	r24, 0x02	; 2
     29a:	09 f4       	brne	.+2      	; 0x29e <ReconfigureUSART+0x20>
	  ConfigMask |= (1 << USBS1);
     29c:	98 60       	ori	r25, 0x08	; 8

	/* Determine data size - 5, 6, 7, or 8 bits are supported */
	if (LineCoding.DataBits == 6)
     29e:	80 91 18 01 	lds	r24, 0x0118
     2a2:	86 30       	cpi	r24, 0x06	; 6
     2a4:	11 f4       	brne	.+4      	; 0x2aa <ReconfigureUSART+0x2c>
	  ConfigMask |= (1 << UCSZ10);
     2a6:	92 60       	ori	r25, 0x02	; 2
     2a8:	07 c0       	rjmp	.+14     	; 0x2b8 <ReconfigureUSART+0x3a>
	else if (LineCoding.DataBits == 7)
     2aa:	87 30       	cpi	r24, 0x07	; 7
     2ac:	11 f4       	brne	.+4      	; 0x2b2 <ReconfigureUSART+0x34>
	  ConfigMask |= (1 << UCSZ11);
     2ae:	94 60       	ori	r25, 0x04	; 4
     2b0:	03 c0       	rjmp	.+6      	; 0x2b8 <ReconfigureUSART+0x3a>
	else if (LineCoding.DataBits == 8)
     2b2:	88 30       	cpi	r24, 0x08	; 8
     2b4:	09 f4       	brne	.+2      	; 0x2b8 <ReconfigureUSART+0x3a>
	  ConfigMask |= ((1 << UCSZ11) | (1 << UCSZ10));
     2b6:	96 60       	ori	r25, 0x06	; 6

	/* Enable double speed, gives better error percentages at 8MHz */
	UCSR1A = (1 << U2X1);
     2b8:	82 e0       	ldi	r24, 0x02	; 2
     2ba:	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)
     2be:	88 ed       	ldi	r24, 0xD8	; 216
     2c0:	80 93 c9 00 	sts	0x00C9, r24

	/* Set the USART mode to the mask generated by the Line Coding options */
	UCSR1C = ConfigMask;
     2c4:	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);
     2c8:	20 91 12 01 	lds	r18, 0x0112
     2cc:	30 91 13 01 	lds	r19, 0x0113
     2d0:	40 e0       	ldi	r20, 0x00	; 0
     2d2:	50 e0       	ldi	r21, 0x00	; 0
     2d4:	60 e4       	ldi	r22, 0x40	; 64
     2d6:	72 e4       	ldi	r23, 0x42	; 66
     2d8:	8f e0       	ldi	r24, 0x0F	; 15
     2da:	90 e0       	ldi	r25, 0x00	; 0
     2dc:	0e 94 65 0e 	call	0x1cca	; 0x1cca <__udivmodsi4>
     2e0:	21 50       	subi	r18, 0x01	; 1
     2e2:	30 40       	sbci	r19, 0x00	; 0
     2e4:	30 93 cd 00 	sts	0x00CD, r19
     2e8:	20 93 cc 00 	sts	0x00CC, r18
}
     2ec:	08 95       	ret

000002ee <__vector_25>:
		Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
	}
}

ISR(USART1_TX_vect)
{
     2ee:	1f 92       	push	r1
     2f0:	0f 92       	push	r0
     2f2:	0f b6       	in	r0, 0x3f	; 63
     2f4:	0f 92       	push	r0
     2f6:	11 24       	eor	r1, r1
     2f8:	2f 93       	push	r18
     2fa:	3f 93       	push	r19
     2fc:	4f 93       	push	r20
     2fe:	5f 93       	push	r21
     300:	6f 93       	push	r22
     302:	7f 93       	push	r23
     304:	8f 93       	push	r24
     306:	9f 93       	push	r25
     308:	af 93       	push	r26
     30a:	bf 93       	push	r27
     30c:	ef 93       	push	r30
     30e:	ff 93       	push	r31
	/* Send next character if avaliable */
	if (Rx_Buffer.Elements != 0 && mode == SERIAL)
     310:	80 91 be 01 	lds	r24, 0x01BE
     314:	88 23       	and	r24, r24
     316:	51 f0       	breq	.+20     	; 0x32c <__stack+0x2d>
     318:	80 91 1e 01 	lds	r24, 0x011E
     31c:	81 30       	cpi	r24, 0x01	; 1
     31e:	31 f4       	brne	.+12     	; 0x32c <__stack+0x2d>
	{
		UDR1 = Buffer_GetElementFromBottom(&Rx_Buffer);
     320:	80 e7       	ldi	r24, 0x70	; 112
     322:	91 e0       	ldi	r25, 0x01	; 1
     324:	bf d5       	rcall	.+2942   	; 0xea4 <Buffer_GetElementFromBottom>
     326:	80 93 ce 00 	sts	0x00CE, r24
     32a:	02 c0       	rjmp	.+4      	; 0x330 <__stack+0x31>
	}
	else
	{
		Transmitting = false;
     32c:	10 92 1c 01 	sts	0x011C, r1
	}
	  
}
     330:	ff 91       	pop	r31
     332:	ef 91       	pop	r30
     334:	bf 91       	pop	r27
     336:	af 91       	pop	r26
     338:	9f 91       	pop	r25
     33a:	8f 91       	pop	r24
     33c:	7f 91       	pop	r23
     33e:	6f 91       	pop	r22
     340:	5f 91       	pop	r21
     342:	4f 91       	pop	r20
     344:	3f 91       	pop	r19
     346:	2f 91       	pop	r18
     348:	0f 90       	pop	r0
     34a:	0f be       	out	0x3f, r0	; 63
     34c:	0f 90       	pop	r0
     34e:	1f 90       	pop	r1
     350:	18 95       	reti

00000352 <RemoveWhiteSpace>:
	return number;

}

void RemoveWhiteSpace(void)
{
     352:	80 e7       	ldi	r24, 0x70	; 112
     354:	91 e0       	ldi	r25, 0x01	; 1
     356:	a6 d5       	rcall	.+2892   	; 0xea4 <Buffer_GetElementFromBottom>
     358:	68 2f       	mov	r22, r24
	uint8_t temp;

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
	//remove white space
	while(temp == ' ' || temp == '\t' || temp == ',')
     35a:	80 32       	cpi	r24, 0x20	; 32
     35c:	d1 f3       	breq	.-12     	; 0x352 <RemoveWhiteSpace>
     35e:	89 30       	cpi	r24, 0x09	; 9
     360:	c1 f3       	breq	.-16     	; 0x352 <RemoveWhiteSpace>
     362:	8c 32       	cpi	r24, 0x2C	; 44
     364:	b1 f3       	breq	.-20     	; 0x352 <RemoveWhiteSpace>
	{
		temp = Buffer_GetElementFromBottom(&Rx_Buffer);
	}
	Buffer_StoreElementOnBottom(&Rx_Buffer, temp);
     366:	80 e7       	ldi	r24, 0x70	; 112
     368:	91 e0       	ldi	r25, 0x01	; 1
}
     36a:	cc c5       	rjmp	.+2968   	; 0xf04 <Buffer_StoreElementOnBottom>

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


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

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     36e:	80 e7       	ldi	r24, 0x70	; 112
     370:	91 e0       	ldi	r25, 0x01	; 1
     372:	98 d5       	rcall	.+2864   	; 0xea4 <Buffer_GetElementFromBottom>
     374:	68 2f       	mov	r22, r24

	if(temp >= 'a' && temp <= 'f')
     376:	81 56       	subi	r24, 0x61	; 97
     378:	86 30       	cpi	r24, 0x06	; 6
     37a:	18 f4       	brcc	.+6      	; 0x382 <GetHexNumber+0x16>
	{
		number = temp -'a' + 0xA;
     37c:	16 2f       	mov	r17, r22
     37e:	17 55       	subi	r17, 0x57	; 87
     380:	10 c0       	rjmp	.+32     	; 0x3a2 <GetHexNumber+0x36>
	}
	else if(temp >= 'A' && temp <= 'F')
     382:	86 2f       	mov	r24, r22
     384:	81 54       	subi	r24, 0x41	; 65
     386:	86 30       	cpi	r24, 0x06	; 6
     388:	18 f4       	brcc	.+6      	; 0x390 <GetHexNumber+0x24>
	{
		number = temp -'A' + 0xA;
     38a:	16 2f       	mov	r17, r22
     38c:	17 53       	subi	r17, 0x37	; 55
     38e:	09 c0       	rjmp	.+18     	; 0x3a2 <GetHexNumber+0x36>
	}
	else if(temp >= '0' && temp <= '9')
     390:	16 2f       	mov	r17, r22
     392:	10 53       	subi	r17, 0x30	; 48
     394:	1a 30       	cpi	r17, 0x0A	; 10
     396:	28 f0       	brcs	.+10     	; 0x3a2 <GetHexNumber+0x36>
	{
		number = temp -'0';
	}
	else
	{
		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     398:	80 e7       	ldi	r24, 0x70	; 112
     39a:	91 e0       	ldi	r25, 0x01	; 1
     39c:	b3 d5       	rcall	.+2918   	; 0xf04 <Buffer_StoreElementOnBottom>
     39e:	10 e0       	ldi	r17, 0x00	; 0
     3a0:	1b c0       	rjmp	.+54     	; 0x3d8 <GetHexNumber+0x6c>
		return 0;
	}

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     3a2:	80 e7       	ldi	r24, 0x70	; 112
     3a4:	91 e0       	ldi	r25, 0x01	; 1
     3a6:	7e d5       	rcall	.+2812   	; 0xea4 <Buffer_GetElementFromBottom>
     3a8:	68 2f       	mov	r22, r24


	number <<=4;//scale the number up 4 bits
     3aa:	12 95       	swap	r17
     3ac:	10 7f       	andi	r17, 0xF0	; 240

	if(temp >= 'a' && temp <= 'f')
     3ae:	81 56       	subi	r24, 0x61	; 97
     3b0:	86 30       	cpi	r24, 0x06	; 6
     3b2:	10 f4       	brcc	.+4      	; 0x3b8 <GetHexNumber+0x4c>
	{
		number += temp -'a' + 0xA;
     3b4:	67 55       	subi	r22, 0x57	; 87
     3b6:	05 c0       	rjmp	.+10     	; 0x3c2 <GetHexNumber+0x56>
	}
	else if(temp >= 'A' && temp <= 'F')
     3b8:	86 2f       	mov	r24, r22
     3ba:	81 54       	subi	r24, 0x41	; 65
     3bc:	86 30       	cpi	r24, 0x06	; 6
     3be:	18 f4       	brcc	.+6      	; 0x3c6 <GetHexNumber+0x5a>
	{
		number += temp -'A' + 0xA;
     3c0:	67 53       	subi	r22, 0x37	; 55
     3c2:	16 0f       	add	r17, r22
     3c4:	09 c0       	rjmp	.+18     	; 0x3d8 <GetHexNumber+0x6c>
	}
	else if(temp >= '0' && temp <= '9')
     3c6:	86 2f       	mov	r24, r22
     3c8:	80 53       	subi	r24, 0x30	; 48
     3ca:	8a 30       	cpi	r24, 0x0A	; 10
     3cc:	10 f4       	brcc	.+4      	; 0x3d2 <GetHexNumber+0x66>
	{
		number += temp -'0';
     3ce:	18 0f       	add	r17, r24
     3d0:	03 c0       	rjmp	.+6      	; 0x3d8 <GetHexNumber+0x6c>
	}
	else
	{
		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if the character is no good to us, return it back to the buffer
     3d2:	80 e7       	ldi	r24, 0x70	; 112
     3d4:	91 e0       	ldi	r25, 0x01	; 1
     3d6:	96 d5       	rcall	.+2860   	; 0xf04 <Buffer_StoreElementOnBottom>
	}


	return number;

}
     3d8:	81 2f       	mov	r24, r17
     3da:	1f 91       	pop	r17
     3dc:	08 95       	ret

000003de <ParseNumber>:


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

	
	RemoveWhiteSpace();
     3e0:	b8 df       	rcall	.-144    	; 0x352 <RemoveWhiteSpace>

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     3e2:	80 e7       	ldi	r24, 0x70	; 112
     3e4:	91 e0       	ldi	r25, 0x01	; 1
     3e6:	5e d5       	rcall	.+2748   	; 0xea4 <Buffer_GetElementFromBottom>
     3e8:	28 2f       	mov	r18, r24

	if(temp == '\\')
     3ea:	8c 35       	cpi	r24, 0x5C	; 92
     3ec:	81 f4       	brne	.+32     	; 0x40e <ParseNumber+0x30>
	{
		temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     3ee:	80 e7       	ldi	r24, 0x70	; 112
     3f0:	91 e0       	ldi	r25, 0x01	; 1
     3f2:	58 d5       	rcall	.+2736   	; 0xea4 <Buffer_GetElementFromBottom>
     3f4:	68 2f       	mov	r22, r24
		if(temp == 'x' || temp == 'X')
     3f6:	88 37       	cpi	r24, 0x78	; 120
     3f8:	11 f0       	breq	.+4      	; 0x3fe <ParseNumber+0x20>
     3fa:	88 35       	cpi	r24, 0x58	; 88
     3fc:	19 f4       	brne	.+6      	; 0x404 <ParseNumber+0x26>
		{
			number = GetHexNumber();
     3fe:	b6 df       	rcall	.-148    	; 0x36c <GetHexNumber>
     400:	18 2f       	mov	r17, r24
     402:	1f c0       	rjmp	.+62     	; 0x442 <ParseNumber+0x64>
		}
		else
		{
			Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     404:	80 e7       	ldi	r24, 0x70	; 112
     406:	91 e0       	ldi	r25, 0x01	; 1
     408:	7d d5       	rcall	.+2810   	; 0xf04 <Buffer_StoreElementOnBottom>
     40a:	10 e0       	ldi	r17, 0x00	; 0
     40c:	1a c0       	rjmp	.+52     	; 0x442 <ParseNumber+0x64>
			return 0;
		}	
	}
	else if(temp >= '0' && temp <= '9' )
     40e:	80 53       	subi	r24, 0x30	; 48
     410:	8a 30       	cpi	r24, 0x0A	; 10
     412:	10 f0       	brcs	.+4      	; 0x418 <ParseNumber+0x3a>
     414:	12 2f       	mov	r17, r18
     416:	15 c0       	rjmp	.+42     	; 0x442 <ParseNumber+0x64>
     418:	10 e0       	ldi	r17, 0x00	; 0
	{
		do
		{
			number *= 10;
     41a:	81 2f       	mov	r24, r17
     41c:	90 e0       	ldi	r25, 0x00	; 0
     41e:	6a e0       	ldi	r22, 0x0A	; 10
     420:	70 e0       	ldi	r23, 0x00	; 0
     422:	0e 94 3f 0e 	call	0x1c7e	; 0x1c7e <__mulhi3>
			number += temp - '0';
     426:	12 2f       	mov	r17, r18
     428:	10 53       	subi	r17, 0x30	; 48
     42a:	18 0f       	add	r17, r24
			temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     42c:	80 e7       	ldi	r24, 0x70	; 112
     42e:	91 e0       	ldi	r25, 0x01	; 1
     430:	39 d5       	rcall	.+2674   	; 0xea4 <Buffer_GetElementFromBottom>
     432:	28 2f       	mov	r18, r24
		} while (temp >= '0' && temp <= '9' );
     434:	80 53       	subi	r24, 0x30	; 48
     436:	8a 30       	cpi	r24, 0x0A	; 10
     438:	80 f3       	brcs	.-32     	; 0x41a <ParseNumber+0x3c>

		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     43a:	62 2f       	mov	r22, r18
     43c:	80 e7       	ldi	r24, 0x70	; 112
     43e:	91 e0       	ldi	r25, 0x01	; 1
     440:	61 d5       	rcall	.+2754   	; 0xf04 <Buffer_StoreElementOnBottom>
	}
	

	return number;

}
     442:	81 2f       	mov	r24, r17
     444:	1f 91       	pop	r17
     446:	08 95       	ret

00000448 <__vector_23>:

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

ISR(USART1_RX_vect)
{
     448:	1f 92       	push	r1
     44a:	0f 92       	push	r0
     44c:	0f b6       	in	r0, 0x3f	; 63
     44e:	0f 92       	push	r0
     450:	11 24       	eor	r1, r1
     452:	2f 93       	push	r18
     454:	3f 93       	push	r19
     456:	4f 93       	push	r20
     458:	5f 93       	push	r21
     45a:	6f 93       	push	r22
     45c:	7f 93       	push	r23
     45e:	8f 93       	push	r24
     460:	9f 93       	push	r25
     462:	af 93       	push	r26
     464:	bf 93       	push	r27
     466:	ef 93       	push	r30
     468:	ff 93       	push	r31
	if(mode == SERIAL)
     46a:	80 91 1e 01 	lds	r24, 0x011E
     46e:	81 30       	cpi	r24, 0x01	; 1
     470:	29 f4       	brne	.+10     	; 0x47c <__vector_23+0x34>
	{
		/* Character recieved, store it into the buffer */
		Buffer_StoreElementOnTop(&Tx_Buffer, UDR1);
     472:	60 91 ce 00 	lds	r22, 0x00CE
     476:	81 e2       	ldi	r24, 0x21	; 33
     478:	91 e0       	ldi	r25, 0x01	; 1
     47a:	b0 d4       	rcall	.+2400   	; 0xddc <Buffer_StoreElementOnTop>
	}
}
     47c:	ff 91       	pop	r31
     47e:	ef 91       	pop	r30
     480:	bf 91       	pop	r27
     482:	af 91       	pop	r26
     484:	9f 91       	pop	r25
     486:	8f 91       	pop	r24
     488:	7f 91       	pop	r23
     48a:	6f 91       	pop	r22
     48c:	5f 91       	pop	r21
     48e:	4f 91       	pop	r20
     490:	3f 91       	pop	r19
     492:	2f 91       	pop	r18
     494:	0f 90       	pop	r0
     496:	0f be       	out	0x3f, r0	; 63
     498:	0f 90       	pop	r0
     49a:	1f 90       	pop	r1
     49c:	18 95       	reti

0000049e <ISP_Update_Buffers>:

}


void ISP_Update_Buffers(void)
{
     49e:	80 91 c6 01 	lds	r24, 0x01C6
     4a2:	88 23       	and	r24, r24
     4a4:	e1 f1       	breq	.+120    	; 0x51e <ISP_Update_Buffers+0x80>
	if (USB_IsConnected)
	{
		/* Select the Serial Rx Endpoint */
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);
     4a6:	84 e0       	ldi	r24, 0x04	; 4
     4a8:	80 93 e9 00 	sts	0x00E9, r24

		if (Endpoint_ReadWriteAllowed())
     4ac:	80 91 e8 00 	lds	r24, 0x00E8
     4b0:	85 fd       	sbrc	r24, 5
     4b2:	06 c0       	rjmp	.+12     	; 0x4c0 <ISP_Update_Buffers+0x22>
     4b4:	0e c0       	rjmp	.+28     	; 0x4d2 <ISP_Update_Buffers+0x34>
		/* 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;
     4b6:	60 91 f1 00 	lds	r22, 0x00F1
		{
			/* Read the recieved data endpoint into the transmission buffer */
			while (Endpoint_BytesInEndpoint())
			{
				Buffer_StoreElementOnTop(&Rx_Buffer, Endpoint_Read_Byte());
     4ba:	80 e7       	ldi	r24, 0x70	; 112
     4bc:	91 e0       	ldi	r25, 0x01	; 1
     4be:	8e d4       	rcall	.+2332   	; 0xddc <Buffer_StoreElementOnTop>
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);

		if (Endpoint_ReadWriteAllowed())
		{
			/* Read the recieved data endpoint into the transmission buffer */
			while (Endpoint_BytesInEndpoint())
     4c0:	80 91 f2 00 	lds	r24, 0x00F2
     4c4:	88 23       	and	r24, r24
     4c6:	b9 f7       	brne	.-18     	; 0x4b6 <ISP_Update_Buffers+0x18>
			{
				Buffer_StoreElementOnTop(&Rx_Buffer, Endpoint_Read_Byte());
			}

			/* Clear the endpoint buffer */
			Endpoint_ClearCurrentBank();
     4c8:	80 91 e8 00 	lds	r24, 0x00E8
     4cc:	8f 77       	andi	r24, 0x7F	; 127
     4ce:	80 93 e8 00 	sts	0x00E8, r24
		}
		
		/* Select the Serial Tx Endpoint */
		Endpoint_SelectEndpoint(CDC_TX_EPNUM);
     4d2:	83 e0       	ldi	r24, 0x03	; 3
     4d4:	80 93 e9 00 	sts	0x00E9, r24

		/* Write the Data to the Endpoint */
		if(Tx_Buffer.Elements != 0)
     4d8:	80 91 6f 01 	lds	r24, 0x016F
     4dc:	88 23       	and	r24, r24
     4de:	f9 f0       	breq	.+62     	; 0x51e <ISP_Update_Buffers+0x80>
		{

			do{
				/* Wait until Serial Tx Endpoint Ready for Read/Write */
				while (!(Endpoint_ReadWriteAllowed()));
     4e0:	80 91 e8 00 	lds	r24, 0x00E8
     4e4:	85 ff       	sbrs	r24, 5
     4e6:	fc cf       	rjmp	.-8      	; 0x4e0 <ISP_Update_Buffers+0x42>

				Endpoint_Write_Byte(Buffer_GetElementFromBottom(&Tx_Buffer));
     4e8:	81 e2       	ldi	r24, 0x21	; 33
     4ea:	91 e0       	ldi	r25, 0x01	; 1
     4ec:	db d4       	rcall	.+2486   	; 0xea4 <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;
     4ee:	80 93 f1 00 	sts	0x00F1, r24

				/* Check if the endpoint is full */
				if (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE)
     4f2:	80 91 f2 00 	lds	r24, 0x00F2
     4f6:	80 31       	cpi	r24, 0x10	; 16
     4f8:	49 f4       	brne	.+18     	; 0x50c <ISP_Update_Buffers+0x6e>
				{
					/* Send the data */
					Endpoint_ClearCurrentBank();
     4fa:	80 91 e8 00 	lds	r24, 0x00E8
     4fe:	8f 77       	andi	r24, 0x7F	; 127
     500:	80 93 e8 00 	sts	0x00E8, r24

					/* Wait until Serial Tx Endpoint Ready for Read/Write */
					while (!(Endpoint_ReadWriteAllowed()));
     504:	80 91 e8 00 	lds	r24, 0x00E8
     508:	85 ff       	sbrs	r24, 5
     50a:	fc cf       	rjmp	.-8      	; 0x504 <ISP_Update_Buffers+0x66>
				}
			}while (Tx_Buffer.Elements != 0);
     50c:	80 91 6f 01 	lds	r24, 0x016F
     510:	88 23       	and	r24, r24
     512:	31 f7       	brne	.-52     	; 0x4e0 <ISP_Update_Buffers+0x42>

			/* Send the last packet of the transfer to the host */
			Endpoint_ClearCurrentBank();
     514:	80 91 e8 00 	lds	r24, 0x00E8
     518:	8f 77       	andi	r24, 0x7F	; 127
     51a:	80 93 e8 00 	sts	0x00E8, r24
     51e:	08 95       	ret

00000520 <StringToBuffer_P>:
			break;
	}
}

void StringToBuffer_P(const char *data)
{
     520:	cf 93       	push	r28
     522:	df 93       	push	r29
     524:	ec 01       	movw	r28, r24
     526:	06 c0       	rjmp	.+12     	; 0x534 <StringToBuffer_P+0x14>
	while (pgm_read_byte(data) != 0x00)
	{
		Buffer_StoreElementOnTop(&Tx_Buffer, pgm_read_byte(data++));
     528:	21 96       	adiw	r28, 0x01	; 1
     52a:	f9 01       	movw	r30, r18
     52c:	64 91       	lpm	r22, Z+
     52e:	81 e2       	ldi	r24, 0x21	; 33
     530:	91 e0       	ldi	r25, 0x01	; 1
     532:	54 d4       	rcall	.+2216   	; 0xddc <Buffer_StoreElementOnTop>
     534:	9e 01       	movw	r18, r28
	}
}

void StringToBuffer_P(const char *data)
{
	while (pgm_read_byte(data) != 0x00)
     536:	fe 01       	movw	r30, r28
     538:	84 91       	lpm	r24, Z+
     53a:	88 23       	and	r24, r24
     53c:	a9 f7       	brne	.-22     	; 0x528 <StringToBuffer_P+0x8>
	{
		Buffer_StoreElementOnTop(&Tx_Buffer, pgm_read_byte(data++));
	}

}
     53e:	df 91       	pop	r29
     540:	cf 91       	pop	r28
     542:	08 95       	ret

00000544 <PROG_Task>:




TASK(PROG_Task)
{
     544:	ac df       	rcall	.-168    	; 0x49e <ISP_Update_Buffers>

	do
	{
		repeat = 0;

		if(Rx_Buffer.Elements != 0)
     546:	80 91 be 01 	lds	r24, 0x01BE
     54a:	88 23       	and	r24, r24
     54c:	09 f4       	brne	.+2      	; 0x550 <PROG_Task+0xc>
     54e:	9a c0       	rjmp	.+308    	; 0x684 <PROG_Task+0x140>
		{
			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     550:	80 e7       	ldi	r24, 0x70	; 112
     552:	91 e0       	ldi	r25, 0x01	; 1
     554:	a7 d4       	rcall	.+2382   	; 0xea4 <Buffer_GetElementFromBottom>
     556:	82 36       	cpi	r24, 0x62	; 98
     558:	09 f4       	brne	.+2      	; 0x55c <PROG_Task+0x18>
     55a:	70 c0       	rjmp	.+224    	; 0x63c <PROG_Task+0xf8>
     55c:	83 36       	cpi	r24, 0x63	; 99
     55e:	38 f4       	brcc	.+14     	; 0x56e <PROG_Task+0x2a>
     560:	83 33       	cpi	r24, 0x33	; 51
     562:	09 f4       	brne	.+2      	; 0x566 <PROG_Task+0x22>
     564:	38 c0       	rjmp	.+112    	; 0x5d6 <PROG_Task+0x92>
     566:	84 33       	cpi	r24, 0x34	; 52
     568:	09 f0       	breq	.+2      	; 0x56c <PROG_Task+0x28>
     56a:	8c c0       	rjmp	.+280    	; 0x684 <PROG_Task+0x140>
     56c:	4e c0       	rjmp	.+156    	; 0x60a <PROG_Task+0xc6>
     56e:	82 37       	cpi	r24, 0x72	; 114
     570:	31 f0       	breq	.+12     	; 0x57e <PROG_Task+0x3a>
     572:	87 37       	cpi	r24, 0x77	; 119
     574:	c9 f0       	breq	.+50     	; 0x5a8 <PROG_Task+0x64>
     576:	85 36       	cpi	r24, 0x65	; 101
     578:	09 f0       	breq	.+2      	; 0x57c <PROG_Task+0x38>
     57a:	84 c0       	rjmp	.+264    	; 0x684 <PROG_Task+0x140>
     57c:	64 c0       	rjmp	.+200    	; 0x646 <PROG_Task+0x102>
			{
				case 'r':
					if (Rx_Buffer.Elements)//ensure we have received enough data
     57e:	80 91 be 01 	lds	r24, 0x01BE
     582:	88 23       	and	r24, r24
     584:	79 f0       	breq	.+30     	; 0x5a4 <PROG_Task+0x60>
					{
						if(Buffer_GetElementFromBottom(&Rx_Buffer) == 'l')//set reset low on target board
     586:	80 e7       	ldi	r24, 0x70	; 112
     588:	91 e0       	ldi	r25, 0x01	; 1
     58a:	8c d4       	rcall	.+2328   	; 0xea4 <Buffer_GetElementFromBottom>
     58c:	90 91 1e 01 	lds	r25, 0x011E
     590:	8c 36       	cpi	r24, 0x6C	; 108
     592:	21 f4       	brne	.+8      	; 0x59c <PROG_Task+0x58>
						{
							if(mode == ISP2)
     594:	93 30       	cpi	r25, 0x03	; 3
     596:	b9 f6       	brne	.-82     	; 0x546 <PROG_Task+0x2>

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     598:	42 98       	cbi	0x08, 2	; 8
     59a:	d5 cf       	rjmp	.-86     	; 0x546 <PROG_Task+0x2>
								;
							}
						}
						else//set reset high
						{
							if(mode == ISP2)
     59c:	93 30       	cpi	r25, 0x03	; 3
     59e:	99 f6       	brne	.-90     	; 0x546 <PROG_Task+0x2>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     5a0:	42 9a       	sbi	0x08, 2	; 8
     5a2:	d1 cf       	rjmp	.-94     	; 0x546 <PROG_Task+0x2>
						repeat = 1;//in case we have more commands in the buffer

					}
					else
					{
						Buffer_StoreElementOnBottom(&Rx_Buffer, 'r');//not enough data received yet
     5a4:	62 e7       	ldi	r22, 0x72	; 114
     5a6:	47 c0       	rjmp	.+142    	; 0x636 <PROG_Task+0xf2>
					}

					break;

				case 'w':
					if (Rx_Buffer.Elements >= 4)//ensure we have received enough data
     5a8:	80 91 be 01 	lds	r24, 0x01BE
     5ac:	84 30       	cpi	r24, 0x04	; 4
     5ae:	88 f0       	brcs	.+34     	; 0x5d2 <PROG_Task+0x8e>
						{
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5b0:	80 e7       	ldi	r24, 0x70	; 112
     5b2:	91 e0       	ldi	r25, 0x01	; 1
     5b4:	77 d4       	rcall	.+2286   	; 0xea4 <Buffer_GetElementFromBottom>
     5b6:	1e de       	rcall	.-964    	; 0x1f4 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5b8:	80 e7       	ldi	r24, 0x70	; 112
     5ba:	91 e0       	ldi	r25, 0x01	; 1
     5bc:	73 d4       	rcall	.+2278   	; 0xea4 <Buffer_GetElementFromBottom>
     5be:	1a de       	rcall	.-972    	; 0x1f4 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5c0:	80 e7       	ldi	r24, 0x70	; 112
     5c2:	91 e0       	ldi	r25, 0x01	; 1
     5c4:	6f d4       	rcall	.+2270   	; 0xea4 <Buffer_GetElementFromBottom>
     5c6:	16 de       	rcall	.-980    	; 0x1f4 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5c8:	80 e7       	ldi	r24, 0x70	; 112
     5ca:	91 e0       	ldi	r25, 0x01	; 1
     5cc:	6b d4       	rcall	.+2262   	; 0xea4 <Buffer_GetElementFromBottom>
     5ce:	12 de       	rcall	.-988    	; 0x1f4 <Write_ISP_Byte>
     5d0:	ba cf       	rjmp	.-140    	; 0x546 <PROG_Task+0x2>
							repeat = 1;//in case we have more commands in the buffer
						}
						else
						{
							Buffer_StoreElementOnBottom(&Rx_Buffer, 'w');//not enough data received yet
     5d2:	67 e7       	ldi	r22, 0x77	; 119
     5d4:	30 c0       	rjmp	.+96     	; 0x636 <PROG_Task+0xf2>
						}

					break;
				case '3':
					if (Rx_Buffer.Elements >= 4)//ensure we have received enough data
     5d6:	80 91 be 01 	lds	r24, 0x01BE
     5da:	84 30       	cpi	r24, 0x04	; 4
     5dc:	a0 f0       	brcs	.+40     	; 0x606 <PROG_Task+0xc2>
					{
						Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5de:	80 e7       	ldi	r24, 0x70	; 112
     5e0:	91 e0       	ldi	r25, 0x01	; 1
     5e2:	60 d4       	rcall	.+2240   	; 0xea4 <Buffer_GetElementFromBottom>
     5e4:	07 de       	rcall	.-1010   	; 0x1f4 <Write_ISP_Byte>
						Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5e6:	80 e7       	ldi	r24, 0x70	; 112
     5e8:	91 e0       	ldi	r25, 0x01	; 1
     5ea:	5c d4       	rcall	.+2232   	; 0xea4 <Buffer_GetElementFromBottom>
     5ec:	03 de       	rcall	.-1018   	; 0x1f4 <Write_ISP_Byte>
						Buffer_StoreElementOnTop(&Tx_Buffer, Write_Read_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer)) );
     5ee:	80 e7       	ldi	r24, 0x70	; 112
     5f0:	91 e0       	ldi	r25, 0x01	; 1
     5f2:	58 d4       	rcall	.+2224   	; 0xea4 <Buffer_GetElementFromBottom>
     5f4:	11 de       	rcall	.-990    	; 0x218 <Write_Read_ISP_Byte>
     5f6:	68 2f       	mov	r22, r24
     5f8:	81 e2       	ldi	r24, 0x21	; 33
     5fa:	91 e0       	ldi	r25, 0x01	; 1
     5fc:	ef d3       	rcall	.+2014   	; 0xddc <Buffer_StoreElementOnTop>
						Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5fe:	80 e7       	ldi	r24, 0x70	; 112
     600:	91 e0       	ldi	r25, 0x01	; 1
     602:	50 d4       	rcall	.+2208   	; 0xea4 <Buffer_GetElementFromBottom>
     604:	f7 cd       	rjmp	.-1042   	; 0x1f4 <Write_ISP_Byte>
					}
					else
					{
						Buffer_StoreElementOnBottom(&Rx_Buffer, '3');//not enough data received yet
     606:	63 e3       	ldi	r22, 0x33	; 51
     608:	16 c0       	rjmp	.+44     	; 0x636 <PROG_Task+0xf2>
					}

					break;
				case '4':
					if (Rx_Buffer.Elements >= 4)//ensure we have received enough data
     60a:	80 91 be 01 	lds	r24, 0x01BE
     60e:	84 30       	cpi	r24, 0x04	; 4
     610:	88 f0       	brcs	.+34     	; 0x634 <PROG_Task+0xf0>
						{
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     612:	80 e7       	ldi	r24, 0x70	; 112
     614:	91 e0       	ldi	r25, 0x01	; 1
     616:	46 d4       	rcall	.+2188   	; 0xea4 <Buffer_GetElementFromBottom>
     618:	ed dd       	rcall	.-1062   	; 0x1f4 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     61a:	80 e7       	ldi	r24, 0x70	; 112
     61c:	91 e0       	ldi	r25, 0x01	; 1
     61e:	42 d4       	rcall	.+2180   	; 0xea4 <Buffer_GetElementFromBottom>
     620:	e9 dd       	rcall	.-1070   	; 0x1f4 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     622:	80 e7       	ldi	r24, 0x70	; 112
     624:	91 e0       	ldi	r25, 0x01	; 1
     626:	3e d4       	rcall	.+2172   	; 0xea4 <Buffer_GetElementFromBottom>
     628:	e5 dd       	rcall	.-1078   	; 0x1f4 <Write_ISP_Byte>
							Buffer_StoreElementOnTop(&Tx_Buffer, Write_Read_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer)) );	
     62a:	80 e7       	ldi	r24, 0x70	; 112
     62c:	91 e0       	ldi	r25, 0x01	; 1
     62e:	3a d4       	rcall	.+2164   	; 0xea4 <Buffer_GetElementFromBottom>
     630:	f3 dd       	rcall	.-1050   	; 0x218 <Write_Read_ISP_Byte>
     632:	05 c0       	rjmp	.+10     	; 0x63e <PROG_Task+0xfa>
						}
						else
						{
							Buffer_StoreElementOnBottom(&Rx_Buffer, '4');//not enough data received yet
     634:	64 e3       	ldi	r22, 0x34	; 52
     636:	80 e7       	ldi	r24, 0x70	; 112
     638:	91 e0       	ldi	r25, 0x01	; 1
     63a:	64 c4       	rjmp	.+2248   	; 0xf04 <Buffer_StoreElementOnBottom>
						}

					break;
				case 'b':

					Buffer_StoreElementOnTop(&Tx_Buffer, Wait_For_Busy());
     63c:	0d de       	rcall	.-998    	; 0x258 <Wait_For_Busy>
     63e:	68 2f       	mov	r22, r24
     640:	81 e2       	ldi	r24, 0x21	; 33
     642:	91 e0       	ldi	r25, 0x01	; 1
     644:	cb c3       	rjmp	.+1942   	; 0xddc <Buffer_StoreElementOnTop>

					break;
				case 'e':

					DDRC &= ~( (1<<RES_2) | (1<<MOSI_2) | (1<<SCK_2) );
     646:	87 b1       	in	r24, 0x07	; 7
     648:	8b 7c       	andi	r24, 0xCB	; 203
     64a:	87 b9       	out	0x07, r24	; 7

					Buffer_Initialize(&Rx_Buffer);//dump any unused data
     64c:	80 e7       	ldi	r24, 0x70	; 112
     64e:	91 e0       	ldi	r25, 0x01	; 1
     650:	b1 d3       	rcall	.+1890   	; 0xdb4 <Buffer_Initialize>
					Buffer_Initialize(&Tx_Buffer);//dump any unused data
     652:	81 e2       	ldi	r24, 0x21	; 33
     654:	91 e0       	ldi	r25, 0x01	; 1
     656:	ae d3       	rcall	.+1884   	; 0xdb4 <Buffer_Initialize>

					Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     658:	6d e0       	ldi	r22, 0x0D	; 13
     65a:	81 e2       	ldi	r24, 0x21	; 33
     65c:	91 e0       	ldi	r25, 0x01	; 1
     65e:	be d3       	rcall	.+1916   	; 0xddc <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     660:	6a e0       	ldi	r22, 0x0A	; 10
     662:	81 e2       	ldi	r24, 0x21	; 33
     664:	91 e0       	ldi	r25, 0x01	; 1
     666:	ba d3       	rcall	.+1908   	; 0xddc <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     668:	6e e3       	ldi	r22, 0x3E	; 62
     66a:	81 e2       	ldi	r24, 0x21	; 33
     66c:	91 e0       	ldi	r25, 0x01	; 1
     66e:	b6 d3       	rcall	.+1900   	; 0xddc <Buffer_StoreElementOnTop>
					mode = COMMAND;
     670:	10 92 1e 01 	sts	0x011E, r1
					Scheduler_SetTaskMode(PROG_Task, TASK_STOP);		
     674:	60 e0       	ldi	r22, 0x00	; 0
     676:	82 ea       	ldi	r24, 0xA2	; 162
     678:	92 e0       	ldi	r25, 0x02	; 2
     67a:	6a d7       	rcall	.+3796   	; 0x1550 <Scheduler_SetTaskMode>
					Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     67c:	61 e0       	ldi	r22, 0x01	; 1
     67e:	86 e1       	ldi	r24, 0x16	; 22
     680:	95 e0       	ldi	r25, 0x05	; 5
     682:	66 c7       	rjmp	.+3788   	; 0x1550 <Scheduler_SetTaskMode>
     684:	08 95       	ret

00000686 <Event_USB_Disconnect>:
	Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);

}

EVENT_HANDLER(USB_Disconnect)
{
     686:	60 e0       	ldi	r22, 0x00	; 0
     688:	86 e1       	ldi	r24, 0x16	; 22
     68a:	95 e0       	ldi	r25, 0x05	; 5
     68c:	61 d7       	rcall	.+3778   	; 0x1550 <Scheduler_SetTaskMode>
	/* Stop running CDC and USB management tasks */
	Scheduler_SetTaskMode(CDC_Task, TASK_STOP);
	Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
     68e:	60 e0       	ldi	r22, 0x00	; 0
     690:	81 e9       	ldi	r24, 0x91	; 145
     692:	9d e0       	ldi	r25, 0x0D	; 13

}
     694:	5d c7       	rjmp	.+3770   	; 0x1550 <Scheduler_SetTaskMode>

00000696 <Event_USB_Connect>:
	Scheduler_Start();
}


EVENT_HANDLER(USB_Connect)
{
     696:	61 e0       	ldi	r22, 0x01	; 1
     698:	81 e9       	ldi	r24, 0x91	; 145
     69a:	9d e0       	ldi	r25, 0x0D	; 13
	/* Start USB management task */
	Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);

}
     69c:	59 c7       	rjmp	.+3762   	; 0x1550 <Scheduler_SetTaskMode>

0000069e <Command_Task>:
}



TASK(Command_Task)
{
     69e:	9f 92       	push	r9
     6a0:	af 92       	push	r10
     6a2:	bf 92       	push	r11
     6a4:	cf 92       	push	r12
     6a6:	df 92       	push	r13
     6a8:	ef 92       	push	r14
     6aa:	ff 92       	push	r15
     6ac:	0f 93       	push	r16
     6ae:	1f 93       	push	r17
     6b0:	df 93       	push	r29
     6b2:	cf 93       	push	r28
     6b4:	cd b7       	in	r28, 0x3d	; 61
     6b6:	de b7       	in	r29, 0x3e	; 62
     6b8:	c0 54       	subi	r28, 0x40	; 64
     6ba:	d0 40       	sbci	r29, 0x00	; 0
     6bc:	0f b6       	in	r0, 0x3f	; 63
     6be:	f8 94       	cli
     6c0:	de bf       	out	0x3e, r29	; 62
     6c2:	0f be       	out	0x3f, r0	; 63
     6c4:	cd bf       	out	0x3d, r28	; 61
	uint8_t i, address = 0, lenght = 0, axis, oldValue;
	uint8_t temp[64];


	RemoveWhiteSpace();
     6c6:	45 de       	rcall	.-886    	; 0x352 <RemoveWhiteSpace>


	switch (Buffer_GetElementFromBottom(&Rx_Buffer))
     6c8:	80 e7       	ldi	r24, 0x70	; 112
     6ca:	91 e0       	ldi	r25, 0x01	; 1
     6cc:	eb d3       	rcall	.+2006   	; 0xea4 <Buffer_GetElementFromBottom>
     6ce:	82 36       	cpi	r24, 0x62	; 98
     6d0:	09 f4       	brne	.+2      	; 0x6d4 <Command_Task+0x36>
     6d2:	1e c1       	rjmp	.+572    	; 0x910 <Command_Task+0x272>
     6d4:	83 36       	cpi	r24, 0x63	; 99
     6d6:	e0 f4       	brcc	.+56     	; 0x710 <Command_Task+0x72>
     6d8:	8c 34       	cpi	r24, 0x4C	; 76
     6da:	09 f4       	brne	.+2      	; 0x6de <Command_Task+0x40>
     6dc:	1f c1       	rjmp	.+574    	; 0x91c <Command_Task+0x27e>
     6de:	8d 34       	cpi	r24, 0x4D	; 77
     6e0:	80 f4       	brcc	.+32     	; 0x702 <Command_Task+0x64>
     6e2:	82 34       	cpi	r24, 0x42	; 66
     6e4:	09 f4       	brne	.+2      	; 0x6e8 <Command_Task+0x4a>
     6e6:	14 c1       	rjmp	.+552    	; 0x910 <Command_Task+0x272>
     6e8:	83 34       	cpi	r24, 0x43	; 67
     6ea:	38 f4       	brcc	.+14     	; 0x6fa <Command_Task+0x5c>
     6ec:	88 23       	and	r24, r24
     6ee:	09 f4       	brne	.+2      	; 0x6f2 <Command_Task+0x54>
     6f0:	63 c1       	rjmp	.+710    	; 0x9b8 <Command_Task+0x31a>
     6f2:	8f 33       	cpi	r24, 0x3F	; 63
     6f4:	09 f0       	breq	.+2      	; 0x6f8 <Command_Task+0x5a>
     6f6:	54 c1       	rjmp	.+680    	; 0x9a0 <Command_Task+0x302>
     6f8:	b5 c0       	rjmp	.+362    	; 0x864 <Command_Task+0x1c6>
     6fa:	83 34       	cpi	r24, 0x43	; 67
     6fc:	09 f0       	breq	.+2      	; 0x700 <Command_Task+0x62>
     6fe:	50 c1       	rjmp	.+672    	; 0x9a0 <Command_Task+0x302>
     700:	24 c0       	rjmp	.+72     	; 0x74a <Command_Task+0xac>
     702:	8d 34       	cpi	r24, 0x4D	; 77
     704:	09 f4       	brne	.+2      	; 0x708 <Command_Task+0x6a>
     706:	b5 c0       	rjmp	.+362    	; 0x872 <Command_Task+0x1d4>
     708:	83 35       	cpi	r24, 0x53	; 83
     70a:	09 f0       	breq	.+2      	; 0x70e <Command_Task+0x70>
     70c:	49 c1       	rjmp	.+658    	; 0x9a0 <Command_Task+0x302>
     70e:	eb c0       	rjmp	.+470    	; 0x8e6 <Command_Task+0x248>
     710:	8d 36       	cpi	r24, 0x6D	; 109
     712:	09 f4       	brne	.+2      	; 0x716 <Command_Task+0x78>
     714:	ae c0       	rjmp	.+348    	; 0x872 <Command_Task+0x1d4>
     716:	8e 36       	cpi	r24, 0x6E	; 110
     718:	30 f4       	brcc	.+12     	; 0x726 <Command_Task+0x88>
     71a:	83 36       	cpi	r24, 0x63	; 99
     71c:	b1 f0       	breq	.+44     	; 0x74a <Command_Task+0xac>
     71e:	8c 36       	cpi	r24, 0x6C	; 108
     720:	09 f0       	breq	.+2      	; 0x724 <Command_Task+0x86>
     722:	3e c1       	rjmp	.+636    	; 0x9a0 <Command_Task+0x302>
     724:	fb c0       	rjmp	.+502    	; 0x91c <Command_Task+0x27e>
     726:	80 37       	cpi	r24, 0x70	; 112
     728:	21 f0       	breq	.+8      	; 0x732 <Command_Task+0x94>
     72a:	83 37       	cpi	r24, 0x73	; 115
     72c:	09 f0       	breq	.+2      	; 0x730 <Command_Task+0x92>
     72e:	38 c1       	rjmp	.+624    	; 0x9a0 <Command_Task+0x302>
     730:	da c0       	rjmp	.+436    	; 0x8e6 <Command_Task+0x248>
	{		
		case 'p':

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     732:	80 e7       	ldi	r24, 0x70	; 112
     734:	91 e0       	ldi	r25, 0x01	; 1
     736:	b6 d3       	rcall	.+1900   	; 0xea4 <Buffer_GetElementFromBottom>
			
			if(oldValue == '1')
     738:	81 33       	cpi	r24, 0x31	; 49
     73a:	11 f4       	brne	.+4      	; 0x740 <Command_Task+0xa2>
			{
				mode = ISP1;
     73c:	82 e0       	ldi	r24, 0x02	; 2
     73e:	01 c0       	rjmp	.+2      	; 0x742 <Command_Task+0xa4>
				
			}
			else
			{
				mode = ISP2;
     740:	83 e0       	ldi	r24, 0x03	; 3
     742:	80 93 1e 01 	sts	0x011E, r24
			}
			
			ISP_Int();
     746:	4a dd       	rcall	.-1388   	; 0x1dc <ISP_Int>
     748:	dc c0       	rjmp	.+440    	; 0x902 <Command_Task+0x264>
		
		
		case 'c':
		case 'C':
			
			I2C_Port = Buffer_GetElementFromBottom(&Rx_Buffer);
     74a:	80 e7       	ldi	r24, 0x70	; 112
     74c:	91 e0       	ldi	r25, 0x01	; 1
     74e:	aa d3       	rcall	.+1876   	; 0xea4 <Buffer_GetElementFromBottom>
     750:	80 93 19 01 	sts	0x0119, r24
			//should check to ensure val ok!
			
			I2C_Init();
     754:	18 d4       	rcall	.+2096   	; 0xf86 <I2C_Init>

			RemoveWhiteSpace();
     756:	fd dd       	rcall	.-1030   	; 0x352 <RemoveWhiteSpace>

			address = ParseNumber();
     758:	42 de       	rcall	.-892    	; 0x3de <ParseNumber>
     75a:	98 2e       	mov	r9, r24
			RemoveWhiteSpace();
     75c:	fa dd       	rcall	.-1036   	; 0x352 <RemoveWhiteSpace>

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     75e:	80 e7       	ldi	r24, 0x70	; 112
     760:	91 e0       	ldi	r25, 0x01	; 1
     762:	a0 d3       	rcall	.+1856   	; 0xea4 <Buffer_GetElementFromBottom>

			if(oldValue == 'w' || oldValue == 'W')
     764:	87 37       	cpi	r24, 0x77	; 119
     766:	19 f0       	breq	.+6      	; 0x76e <Command_Task+0xd0>
     768:	87 35       	cpi	r24, 0x57	; 87
     76a:	09 f0       	breq	.+2      	; 0x76e <Command_Task+0xd0>
     76c:	49 c0       	rjmp	.+146    	; 0x800 <Command_Task+0x162>
			{
						
				lenght = ParseNumber();
     76e:	37 de       	rcall	.-914    	; 0x3de <ParseNumber>
     770:	e8 2e       	mov	r14, r24

				oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     772:	80 e7       	ldi	r24, 0x70	; 112
     774:	91 e0       	ldi	r25, 0x01	; 1
     776:	96 d3       	rcall	.+1836   	; 0xea4 <Buffer_GetElementFromBottom>
     778:	68 2f       	mov	r22, r24
				if(oldValue != ' ' && oldValue != ',')
     77a:	80 32       	cpi	r24, 0x20	; 32
     77c:	29 f0       	breq	.+10     	; 0x788 <Command_Task+0xea>
     77e:	8c 32       	cpi	r24, 0x2C	; 44
     780:	19 f0       	breq	.+6      	; 0x788 <Command_Task+0xea>
				{
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     782:	80 e7       	ldi	r24, 0x70	; 112
     784:	91 e0       	ldi	r25, 0x01	; 1
     786:	be d3       	rcall	.+1916   	; 0xf04 <Buffer_StoreElementOnBottom>
     788:	ff 24       	eor	r15, r15
     78a:	5e 01       	movw	r10, r28
     78c:	08 94       	sec
     78e:	a1 1c       	adc	r10, r1
     790:	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
     792:	ce 2c       	mov	r12, r14
     794:	dd 24       	eor	r13, r13
     796:	08 94       	sec
     798:	c1 08       	sbc	r12, r1
     79a:	d1 08       	sbc	r13, r1
     79c:	26 c0       	rjmp	.+76     	; 0x7ea <Command_Task+0x14c>
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
				}
						
				for (i = 0; i < lenght; i++)
				{
					temp[i] = Buffer_GetElementFromBottom(&Rx_Buffer);
     79e:	0f 2d       	mov	r16, r15
     7a0:	10 e0       	ldi	r17, 0x00	; 0
     7a2:	80 e7       	ldi	r24, 0x70	; 112
     7a4:	91 e0       	ldi	r25, 0x01	; 1
     7a6:	7e d3       	rcall	.+1788   	; 0xea4 <Buffer_GetElementFromBottom>
     7a8:	f5 01       	movw	r30, r10
     7aa:	e0 0f       	add	r30, r16
     7ac:	f1 1f       	adc	r31, r17
     7ae:	80 83       	st	Z, r24
					if(temp[i] == '\\')
     7b0:	8c 35       	cpi	r24, 0x5C	; 92
     7b2:	d1 f4       	brne	.+52     	; 0x7e8 <Command_Task+0x14a>
					{	
						oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     7b4:	80 e7       	ldi	r24, 0x70	; 112
     7b6:	91 e0       	ldi	r25, 0x01	; 1
     7b8:	75 d3       	rcall	.+1770   	; 0xea4 <Buffer_GetElementFromBottom>
     7ba:	68 2f       	mov	r22, r24

						if(oldValue == 'x' || oldValue == 'X')
     7bc:	88 37       	cpi	r24, 0x78	; 120
     7be:	11 f0       	breq	.+4      	; 0x7c4 <Command_Task+0x126>
     7c0:	88 35       	cpi	r24, 0x58	; 88
     7c2:	31 f4       	brne	.+12     	; 0x7d0 <Command_Task+0x132>
						{
							temp[i] = GetHexNumber();
     7c4:	d3 dd       	rcall	.-1114   	; 0x36c <GetHexNumber>
     7c6:	0a 0d       	add	r16, r10
     7c8:	1b 1d       	adc	r17, r11
     7ca:	f8 01       	movw	r30, r16
     7cc:	80 83       	st	Z, r24
     7ce:	0c c0       	rjmp	.+24     	; 0x7e8 <Command_Task+0x14a>
						}
						else
						{
							if(i < lenght-1)//will we even get a chance to send it.  If so write it
     7d0:	0c 15       	cp	r16, r12
     7d2:	1d 05       	cpc	r17, r13
     7d4:	34 f4       	brge	.+12     	; 0x7e2 <Command_Task+0x144>
							{
								temp[++i] = oldValue;
     7d6:	f3 94       	inc	r15
     7d8:	f5 01       	movw	r30, r10
     7da:	ef 0d       	add	r30, r15
     7dc:	f1 1d       	adc	r31, r1
     7de:	80 83       	st	Z, r24
     7e0:	03 c0       	rjmp	.+6      	; 0x7e8 <Command_Task+0x14a>
							}
							else//put the data back.  This is not needed though as we will dump the data latter
							{
								Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     7e2:	80 e7       	ldi	r24, 0x70	; 112
     7e4:	91 e0       	ldi	r25, 0x01	; 1
     7e6:	8e d3       	rcall	.+1820   	; 0xf04 <Buffer_StoreElementOnBottom>
				if(oldValue != ' ' && oldValue != ',')
				{
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
				}
						
				for (i = 0; i < lenght; i++)
     7e8:	f3 94       	inc	r15
     7ea:	fe 14       	cp	r15, r14
     7ec:	c0 f2       	brcs	.-80     	; 0x79e <Command_Task+0x100>
							} 
						}	
					}
				}

				if(I2C_Write(address, temp, lenght) != lenght)
     7ee:	4e 2d       	mov	r20, r14
     7f0:	50 e0       	ldi	r21, 0x00	; 0
     7f2:	b5 01       	movw	r22, r10
     7f4:	89 2d       	mov	r24, r9
     7f6:	98 d5       	rcall	.+2864   	; 0x1328 <I2C_Write>
     7f8:	8e 15       	cp	r24, r14
     7fa:	09 f4       	brne	.+2      	; 0x7fe <Command_Task+0x160>
     7fc:	dd c0       	rjmp	.+442    	; 0x9b8 <Command_Task+0x31a>
     7fe:	28 c0       	rjmp	.+80     	; 0x850 <Command_Task+0x1b2>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
					Buffer_StoreElementOnTop(&Tx_Buffer, '-');
				}					
						 
			}
			else if(oldValue == 'r' || oldValue == 'R')
     800:	82 37       	cpi	r24, 0x72	; 114
     802:	19 f0       	breq	.+6      	; 0x80a <Command_Task+0x16c>
     804:	82 35       	cpi	r24, 0x52	; 82
     806:	09 f0       	breq	.+2      	; 0x80a <Command_Task+0x16c>
     808:	d7 c0       	rjmp	.+430    	; 0x9b8 <Command_Task+0x31a>
			{
				Buffer_StoreElementOnTop(&Tx_Buffer, '\r');//so the data read back will be printed on a new line
     80a:	6d e0       	ldi	r22, 0x0D	; 13
     80c:	81 e2       	ldi	r24, 0x21	; 33
     80e:	91 e0       	ldi	r25, 0x01	; 1
     810:	e5 d2       	rcall	.+1482   	; 0xddc <Buffer_StoreElementOnTop>
				Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     812:	6a e0       	ldi	r22, 0x0A	; 10
     814:	81 e2       	ldi	r24, 0x21	; 33
     816:	91 e0       	ldi	r25, 0x01	; 1
     818:	e1 d2       	rcall	.+1474   	; 0xddc <Buffer_StoreElementOnTop>

				lenght = ParseNumber();
     81a:	e1 dd       	rcall	.-1086   	; 0x3de <ParseNumber>
     81c:	18 2f       	mov	r17, r24

				if(I2C_Read(address, temp, lenght) == lenght)
     81e:	48 2f       	mov	r20, r24
     820:	50 e0       	ldi	r21, 0x00	; 0
     822:	7e 01       	movw	r14, r28
     824:	08 94       	sec
     826:	e1 1c       	adc	r14, r1
     828:	f1 1c       	adc	r15, r1
     82a:	b7 01       	movw	r22, r14
     82c:	89 2d       	mov	r24, r9
     82e:	44 d5       	rcall	.+2696   	; 0x12b8 <I2C_Read>
     830:	d8 2e       	mov	r13, r24
     832:	81 17       	cp	r24, r17
     834:	69 f4       	brne	.+26     	; 0x850 <Command_Task+0x1b2>
     836:	87 01       	movw	r16, r14
     838:	06 c0       	rjmp	.+12     	; 0x846 <Command_Task+0x1a8>
				{
					for (i = 0; i < lenght; i++)
					{
						Buffer_StoreElementOnTop(&Tx_Buffer, temp[i]);
     83a:	f8 01       	movw	r30, r16
     83c:	61 91       	ld	r22, Z+
     83e:	8f 01       	movw	r16, r30
     840:	81 e2       	ldi	r24, 0x21	; 33
     842:	91 e0       	ldi	r25, 0x01	; 1
     844:	cb d2       	rcall	.+1430   	; 0xddc <Buffer_StoreElementOnTop>

				lenght = ParseNumber();

				if(I2C_Read(address, temp, lenght) == lenght)
				{
					for (i = 0; i < lenght; i++)
     846:	80 2f       	mov	r24, r16
     848:	8e 19       	sub	r24, r14
     84a:	8d 15       	cp	r24, r13
     84c:	b0 f3       	brcs	.-20     	; 0x83a <Command_Task+0x19c>
     84e:	b4 c0       	rjmp	.+360    	; 0x9b8 <Command_Task+0x31a>
						Buffer_StoreElementOnTop(&Tx_Buffer, temp[i]);
					}
				}
				else
				{
					Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     850:	6d e0       	ldi	r22, 0x0D	; 13
     852:	81 e2       	ldi	r24, 0x21	; 33
     854:	91 e0       	ldi	r25, 0x01	; 1
     856:	c2 d2       	rcall	.+1412   	; 0xddc <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     858:	6a e0       	ldi	r22, 0x0A	; 10
     85a:	81 e2       	ldi	r24, 0x21	; 33
     85c:	91 e0       	ldi	r25, 0x01	; 1
     85e:	be d2       	rcall	.+1404   	; 0xddc <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '-');
     860:	6d e2       	ldi	r22, 0x2D	; 45
     862:	a7 c0       	rjmp	.+334    	; 0x9b2 <Command_Task+0x314>
				}			
			}
			
			break;
		case '?':
			StringToBuffer_P(PSTR("\r\nUSB10 Command Summary\r\n"));
     864:	8b ea       	ldi	r24, 0xAB	; 171
     866:	90 e0       	ldi	r25, 0x00	; 0
     868:	5b de       	rcall	.-842    	; 0x520 <StringToBuffer_P>
			StringToBuffer_P(PSTR(" s-serial, c-I2C, p-prog, l-led, b-boot\r\n"));
     86a:	81 e8       	ldi	r24, 0x81	; 129
     86c:	90 e0       	ldi	r25, 0x00	; 0
     86e:	58 de       	rcall	.-848    	; 0x520 <StringToBuffer_P>
     870:	a3 c0       	rjmp	.+326    	; 0x9b8 <Command_Task+0x31a>
			break;
		case 'm':
		case 'M':

			if(setUpM == 0)
     872:	80 91 1f 01 	lds	r24, 0x011F
     876:	88 23       	and	r24, r24
     878:	21 f4       	brne	.+8      	; 0x882 <Command_Task+0x1e4>
			{
				StepDirLineCoding_Init();
     87a:	8c d5       	rcall	.+2840   	; 0x1394 <StepDirLineCoding_Init>
				setUpM = 1;
     87c:	81 e0       	ldi	r24, 0x01	; 1
     87e:	80 93 1f 01 	sts	0x011F, r24
			}	
			RemoveWhiteSpace();
     882:	67 dd       	rcall	.-1330   	; 0x352 <RemoveWhiteSpace>

			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     884:	80 e7       	ldi	r24, 0x70	; 112
     886:	91 e0       	ldi	r25, 0x01	; 1
     888:	0d d3       	rcall	.+1562   	; 0xea4 <Buffer_GetElementFromBottom>
     88a:	8a 35       	cpi	r24, 0x5A	; 90
     88c:	49 f0       	breq	.+18     	; 0x8a0 <Command_Task+0x202>
     88e:	8b 35       	cpi	r24, 0x5B	; 91
     890:	18 f4       	brcc	.+6      	; 0x898 <Command_Task+0x1fa>
     892:	89 35       	cpi	r24, 0x59	; 89
     894:	49 f4       	brne	.+18     	; 0x8a8 <Command_Task+0x20a>
     896:	06 c0       	rjmp	.+12     	; 0x8a4 <Command_Task+0x206>
     898:	89 37       	cpi	r24, 0x79	; 121
     89a:	21 f0       	breq	.+8      	; 0x8a4 <Command_Task+0x206>
     89c:	8a 37       	cpi	r24, 0x7A	; 122
     89e:	21 f4       	brne	.+8      	; 0x8a8 <Command_Task+0x20a>
     8a0:	02 e0       	ldi	r16, 0x02	; 2
     8a2:	03 c0       	rjmp	.+6      	; 0x8aa <Command_Task+0x20c>
     8a4:	01 e0       	ldi	r16, 0x01	; 1
     8a6:	01 c0       	rjmp	.+2      	; 0x8aa <Command_Task+0x20c>
     8a8:	00 e0       	ldi	r16, 0x00	; 0
					axis = X_AXIS;
					break;
				
			}

			RemoveWhiteSpace();
     8aa:	53 dd       	rcall	.-1370   	; 0x352 <RemoveWhiteSpace>

			lenght = ParseNumber();
     8ac:	98 dd       	rcall	.-1232   	; 0x3de <ParseNumber>
     8ae:	f8 2e       	mov	r15, r24

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     8b0:	80 e7       	ldi	r24, 0x70	; 112
     8b2:	91 e0       	ldi	r25, 0x01	; 1
     8b4:	f7 d2       	rcall	.+1518   	; 0xea4 <Buffer_GetElementFromBottom>
     8b6:	68 2f       	mov	r22, r24

			if(oldValue != ' ' && oldValue != ',')//allow for 1 peice of white space
     8b8:	80 32       	cpi	r24, 0x20	; 32
     8ba:	29 f0       	breq	.+10     	; 0x8c6 <Command_Task+0x228>
     8bc:	8c 32       	cpi	r24, 0x2C	; 44
     8be:	19 f0       	breq	.+6      	; 0x8c6 <Command_Task+0x228>
			{
				Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     8c0:	80 e7       	ldi	r24, 0x70	; 112
     8c2:	91 e0       	ldi	r25, 0x01	; 1
     8c4:	1f d3       	rcall	.+1598   	; 0xf04 <Buffer_StoreElementOnBottom>
     8c6:	10 e0       	ldi	r17, 0x00	; 0
     8c8:	06 c0       	rjmp	.+12     	; 0x8d6 <Command_Task+0x238>
			}
						
			for (i = 0; i < lenght && Rx_Buffer.Elements != 0; i++)
			{
				SendByte(Buffer_GetElementFromBottom(&Rx_Buffer),axis);
     8ca:	80 e7       	ldi	r24, 0x70	; 112
     8cc:	91 e0       	ldi	r25, 0x01	; 1
     8ce:	ea d2       	rcall	.+1492   	; 0xea4 <Buffer_GetElementFromBottom>
     8d0:	60 2f       	mov	r22, r16
     8d2:	b0 d5       	rcall	.+2912   	; 0x1434 <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++)
     8d4:	1f 5f       	subi	r17, 0xFF	; 255
     8d6:	1f 15       	cp	r17, r15
     8d8:	08 f0       	brcs	.+2      	; 0x8dc <Command_Task+0x23e>
     8da:	6e c0       	rjmp	.+220    	; 0x9b8 <Command_Task+0x31a>
     8dc:	80 91 be 01 	lds	r24, 0x01BE
     8e0:	88 23       	and	r24, r24
     8e2:	99 f7       	brne	.-26     	; 0x8ca <Command_Task+0x22c>
     8e4:	69 c0       	rjmp	.+210    	; 0x9b8 <Command_Task+0x31a>
			break;

		case 's':  // Enter serial mode
		case 'S':
			
			mode = SERIAL;
     8e6:	81 e0       	ldi	r24, 0x01	; 1
     8e8:	80 93 1e 01 	sts	0x011E, r24

			// Release PB0 - make input
			DDRB &= ~(1<<0);
     8ec:	20 98       	cbi	0x04, 0	; 4
			// Set Reset High - PC2
			DDRC |= (1<<2);
     8ee:	3a 9a       	sbi	0x07, 2	; 7
			PORTC |= (1<<2);
     8f0:	42 9a       	sbi	0x08, 2	; 8

			if(Buffer_GetElementFromBottom(&Rx_Buffer) == 'b')//bang the reset line
     8f2:	80 e7       	ldi	r24, 0x70	; 112
     8f4:	91 e0       	ldi	r25, 0x01	; 1
     8f6:	d6 d2       	rcall	.+1452   	; 0xea4 <Buffer_GetElementFromBottom>
     8f8:	82 36       	cpi	r24, 0x62	; 98
     8fa:	19 f4       	brne	.+6      	; 0x902 <Command_Task+0x264>
			{

				DDRC |= (1<<RES_2);
     8fc:	3a 9a       	sbi	0x07, 2	; 7

				PORTC &= ~(1<<RES_2);
     8fe:	42 98       	cbi	0x08, 2	; 8
				DelayUsec(100);
				PORTC |= (1<<RES_2);
     900:	42 9a       	sbi	0x08, 2	; 8
			}
			Buffer_Initialize(&Rx_Buffer);//dump any unused data
     902:	80 e7       	ldi	r24, 0x70	; 112
     904:	91 e0       	ldi	r25, 0x01	; 1
     906:	56 d2       	rcall	.+1196   	; 0xdb4 <Buffer_Initialize>
			Buffer_Initialize(&Tx_Buffer);//dump any unused data
     908:	81 e2       	ldi	r24, 0x21	; 33
     90a:	91 e0       	ldi	r25, 0x01	; 1
     90c:	53 d2       	rcall	.+1190   	; 0xdb4 <Buffer_Initialize>
     90e:	54 c0       	rjmp	.+168    	; 0x9b8 <Command_Task+0x31a>
		case 0://empty command
			break;

		case 'b'://start the bootloader
		case 'B':
			(*bootloader)();//will not return
     910:	e0 91 00 01 	lds	r30, 0x0100
     914:	f0 91 01 01 	lds	r31, 0x0101
     918:	09 95       	icall
     91a:	4e c0       	rjmp	.+156    	; 0x9b8 <Command_Task+0x31a>

		case 'l':
		case 'L':

			// Setup LED port pins and turn leds off
			if(setUpLed == 0) {
     91c:	80 91 20 01 	lds	r24, 0x0120
     920:	88 23       	and	r24, r24
     922:	39 f4       	brne	.+14     	; 0x932 <Command_Task+0x294>
				setUpLed = 1;
     924:	81 e0       	ldi	r24, 0x01	; 1
     926:	80 93 20 01 	sts	0x0120, r24
				DDRC |= (1<<2);
     92a:	3a 9a       	sbi	0x07, 2	; 7
				PORTC |= (1<<2);
     92c:	42 9a       	sbi	0x08, 2	; 8
				DDRB |= (1<<5);
     92e:	25 9a       	sbi	0x04, 5	; 4
				PORTB |= (1<<5);
     930:	2d 9a       	sbi	0x05, 5	; 5
				}

			RemoveWhiteSpace();
     932:	0f dd       	rcall	.-1506   	; 0x352 <RemoveWhiteSpace>

			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     934:	80 e7       	ldi	r24, 0x70	; 112
     936:	91 e0       	ldi	r25, 0x01	; 1
     938:	b5 d2       	rcall	.+1386   	; 0xea4 <Buffer_GetElementFromBottom>
     93a:	82 35       	cpi	r24, 0x52	; 82
     93c:	f1 f0       	breq	.+60     	; 0x97a <Command_Task+0x2dc>
     93e:	83 35       	cpi	r24, 0x53	; 83
     940:	20 f4       	brcc	.+8      	; 0x94a <Command_Task+0x2ac>
     942:	87 34       	cpi	r24, 0x47	; 71
     944:	09 f0       	breq	.+2      	; 0x948 <Command_Task+0x2aa>
     946:	38 c0       	rjmp	.+112    	; 0x9b8 <Command_Task+0x31a>
     948:	05 c0       	rjmp	.+10     	; 0x954 <Command_Task+0x2b6>
     94a:	87 36       	cpi	r24, 0x67	; 103
     94c:	19 f0       	breq	.+6      	; 0x954 <Command_Task+0x2b6>
     94e:	82 37       	cpi	r24, 0x72	; 114
     950:	99 f5       	brne	.+102    	; 0x9b8 <Command_Task+0x31a>
     952:	13 c0       	rjmp	.+38     	; 0x97a <Command_Task+0x2dc>
			{
				case 'g':
				case 'G':
						
					RemoveWhiteSpace();
     954:	fe dc       	rcall	.-1540   	; 0x352 <RemoveWhiteSpace>

					switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     956:	80 e7       	ldi	r24, 0x70	; 112
     958:	91 e0       	ldi	r25, 0x01	; 1
     95a:	a4 d2       	rcall	.+1352   	; 0xea4 <Buffer_GetElementFromBottom>
     95c:	8f 34       	cpi	r24, 0x4F	; 79
     95e:	49 f0       	breq	.+18     	; 0x972 <Command_Task+0x2d4>
     960:	80 35       	cpi	r24, 0x50	; 80
     962:	18 f4       	brcc	.+6      	; 0x96a <Command_Task+0x2cc>
     964:	86 34       	cpi	r24, 0x46	; 70
     966:	41 f5       	brne	.+80     	; 0x9b8 <Command_Task+0x31a>
     968:	06 c0       	rjmp	.+12     	; 0x976 <Command_Task+0x2d8>
     96a:	86 36       	cpi	r24, 0x66	; 102
     96c:	21 f0       	breq	.+8      	; 0x976 <Command_Task+0x2d8>
     96e:	8f 36       	cpi	r24, 0x6F	; 111
     970:	19 f5       	brne	.+70     	; 0x9b8 <Command_Task+0x31a>
					{
						case 'o':
						case 'O':
							greenLedOn();
     972:	2d 98       	cbi	0x05, 5	; 5
     974:	21 c0       	rjmp	.+66     	; 0x9b8 <Command_Task+0x31a>
							break;

						case 'f':
						case 'F':
							greenLedOff();				
     976:	2d 9a       	sbi	0x05, 5	; 5
     978:	1f c0       	rjmp	.+62     	; 0x9b8 <Command_Task+0x31a>

				case 'r':
				case 'R':


					RemoveWhiteSpace();
     97a:	eb dc       	rcall	.-1578   	; 0x352 <RemoveWhiteSpace>

					switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     97c:	80 e7       	ldi	r24, 0x70	; 112
     97e:	91 e0       	ldi	r25, 0x01	; 1
     980:	91 d2       	rcall	.+1314   	; 0xea4 <Buffer_GetElementFromBottom>
     982:	8f 34       	cpi	r24, 0x4F	; 79
     984:	49 f0       	breq	.+18     	; 0x998 <Command_Task+0x2fa>
     986:	80 35       	cpi	r24, 0x50	; 80
     988:	18 f4       	brcc	.+6      	; 0x990 <Command_Task+0x2f2>
     98a:	86 34       	cpi	r24, 0x46	; 70
     98c:	a9 f4       	brne	.+42     	; 0x9b8 <Command_Task+0x31a>
     98e:	06 c0       	rjmp	.+12     	; 0x99c <Command_Task+0x2fe>
     990:	86 36       	cpi	r24, 0x66	; 102
     992:	21 f0       	breq	.+8      	; 0x99c <Command_Task+0x2fe>
     994:	8f 36       	cpi	r24, 0x6F	; 111
     996:	81 f4       	brne	.+32     	; 0x9b8 <Command_Task+0x31a>
					{
						case 'o':
						case 'O':
							redLedOn();
     998:	42 98       	cbi	0x08, 2	; 8
     99a:	0e c0       	rjmp	.+28     	; 0x9b8 <Command_Task+0x31a>
							break;

						case 'f':
						case 'F':
							redLedOff();				
     99c:	42 9a       	sbi	0x08, 2	; 8
     99e:	0c c0       	rjmp	.+24     	; 0x9b8 <Command_Task+0x31a>
			}

			break;

		default:
			Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     9a0:	6d e0       	ldi	r22, 0x0D	; 13
     9a2:	81 e2       	ldi	r24, 0x21	; 33
     9a4:	91 e0       	ldi	r25, 0x01	; 1
     9a6:	1a d2       	rcall	.+1076   	; 0xddc <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     9a8:	6a e0       	ldi	r22, 0x0A	; 10
     9aa:	81 e2       	ldi	r24, 0x21	; 33
     9ac:	91 e0       	ldi	r25, 0x01	; 1
     9ae:	16 d2       	rcall	.+1068   	; 0xddc <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '?');			
     9b0:	6f e3       	ldi	r22, 0x3F	; 63
     9b2:	81 e2       	ldi	r24, 0x21	; 33
     9b4:	91 e0       	ldi	r25, 0x01	; 1
     9b6:	12 d2       	rcall	.+1060   	; 0xddc <Buffer_StoreElementOnTop>
	}
	


	
	switch(mode)
     9b8:	80 91 1e 01 	lds	r24, 0x011E
     9bc:	81 30       	cpi	r24, 0x01	; 1
     9be:	d9 f0       	breq	.+54     	; 0x9f6 <Command_Task+0x358>
     9c0:	81 30       	cpi	r24, 0x01	; 1
     9c2:	50 f0       	brcs	.+20     	; 0x9d8 <Command_Task+0x33a>
     9c4:	84 30       	cpi	r24, 0x04	; 4
     9c6:	40 f4       	brcc	.+16     	; 0x9d8 <Command_Task+0x33a>
	{
		case ISP1:
		case ISP2:	
			Buffer_StoreElementOnTop(&Tx_Buffer, 'a');
     9c8:	61 e6       	ldi	r22, 0x61	; 97
     9ca:	81 e2       	ldi	r24, 0x21	; 33
     9cc:	91 e0       	ldi	r25, 0x01	; 1
     9ce:	06 d2       	rcall	.+1036   	; 0xddc <Buffer_StoreElementOnTop>
			Scheduler_SetTaskMode(PROG_Task, TASK_RUN);
     9d0:	61 e0       	ldi	r22, 0x01	; 1
     9d2:	82 ea       	ldi	r24, 0xA2	; 162
     9d4:	92 e0       	ldi	r25, 0x02	; 2
     9d6:	12 c0       	rjmp	.+36     	; 0x9fc <Command_Task+0x35e>
		case SERIAL:
			Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
			break;

		default://Return a <CR>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     9d8:	6d e0       	ldi	r22, 0x0D	; 13
     9da:	81 e2       	ldi	r24, 0x21	; 33
     9dc:	91 e0       	ldi	r25, 0x01	; 1
     9de:	fe d1       	rcall	.+1020   	; 0xddc <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     9e0:	6a e0       	ldi	r22, 0x0A	; 10
     9e2:	81 e2       	ldi	r24, 0x21	; 33
     9e4:	91 e0       	ldi	r25, 0x01	; 1
     9e6:	fa d1       	rcall	.+1012   	; 0xddc <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     9e8:	6e e3       	ldi	r22, 0x3E	; 62
     9ea:	81 e2       	ldi	r24, 0x21	; 33
     9ec:	91 e0       	ldi	r25, 0x01	; 1
     9ee:	f6 d1       	rcall	.+1004   	; 0xddc <Buffer_StoreElementOnTop>
					
			Buffer_Initialize(&Rx_Buffer);//dump any unused data
     9f0:	80 e7       	ldi	r24, 0x70	; 112
     9f2:	91 e0       	ldi	r25, 0x01	; 1
     9f4:	df d1       	rcall	.+958    	; 0xdb4 <Buffer_Initialize>
			Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     9f6:	61 e0       	ldi	r22, 0x01	; 1
     9f8:	86 e1       	ldi	r24, 0x16	; 22
     9fa:	95 e0       	ldi	r25, 0x05	; 5
     9fc:	a9 d5       	rcall	.+2898   	; 0x1550 <Scheduler_SetTaskMode>
	}

	Scheduler_SetTaskMode(Command_Task, TASK_STOP);
     9fe:	60 e0       	ldi	r22, 0x00	; 0
     a00:	8f e4       	ldi	r24, 0x4F	; 79
     a02:	93 e0       	ldi	r25, 0x03	; 3
     a04:	a5 d5       	rcall	.+2890   	; 0x1550 <Scheduler_SetTaskMode>

}
     a06:	c0 5c       	subi	r28, 0xC0	; 192
     a08:	df 4f       	sbci	r29, 0xFF	; 255
     a0a:	0f b6       	in	r0, 0x3f	; 63
     a0c:	f8 94       	cli
     a0e:	de bf       	out	0x3e, r29	; 62
     a10:	0f be       	out	0x3f, r0	; 63
     a12:	cd bf       	out	0x3d, r28	; 61
     a14:	cf 91       	pop	r28
     a16:	df 91       	pop	r29
     a18:	1f 91       	pop	r17
     a1a:	0f 91       	pop	r16
     a1c:	ff 90       	pop	r15
     a1e:	ef 90       	pop	r14
     a20:	df 90       	pop	r13
     a22:	cf 90       	pop	r12
     a24:	bf 90       	pop	r11
     a26:	af 90       	pop	r10
     a28:	9f 90       	pop	r9
     a2a:	08 95       	ret

00000a2c <CDC_Task>:

}


TASK(CDC_Task)
{
     a2c:	0f 93       	push	r16
     a2e:	1f 93       	push	r17
	uint8_t temp;
	
	if (USB_IsConnected)
     a30:	80 91 c6 01 	lds	r24, 0x01C6
     a34:	88 23       	and	r24, r24
     a36:	09 f4       	brne	.+2      	; 0xa3a <CDC_Task+0xe>
     a38:	dd c0       	rjmp	.+442    	; 0xbf4 <CDC_Task+0x1c8>
	{
		/* Select the Serial Rx Endpoint */
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);
     a3a:	84 e0       	ldi	r24, 0x04	; 4
     a3c:	80 93 e9 00 	sts	0x00E9, r24

		if (Endpoint_ReadWriteAllowed())
     a40:	80 91 e8 00 	lds	r24, 0x00E8
     a44:	85 fd       	sbrc	r24, 5
     a46:	8d c0       	rjmp	.+282    	; 0xb62 <CDC_Task+0x136>
     a48:	97 c0       	rjmp	.+302    	; 0xb78 <CDC_Task+0x14c>
		{
			/* Read the recieved data endpoint into the transmission buffer */
			while (Endpoint_BytesInEndpoint())
			{
				if(mode == COMMAND)
     a4a:	90 91 1e 01 	lds	r25, 0x011E
     a4e:	99 23       	and	r25, r25
     a50:	69 f5       	brne	.+90     	; 0xaac <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;
     a52:	10 91 f1 00 	lds	r17, 0x00F1
				{
					temp =  Endpoint_Read_Byte();

					Buffer_StoreElementOnTop(&Tx_Buffer, temp);//echo the character back
     a56:	61 2f       	mov	r22, r17
     a58:	81 e2       	ldi	r24, 0x21	; 33
     a5a:	91 e0       	ldi	r25, 0x01	; 1
     a5c:	bf d1       	rcall	.+894    	; 0xddc <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Rx_Buffer, temp);//save it to our buffer
     a5e:	61 2f       	mov	r22, r17
     a60:	80 e7       	ldi	r24, 0x70	; 112
     a62:	91 e0       	ldi	r25, 0x01	; 1
     a64:	bb d1       	rcall	.+886    	; 0xddc <Buffer_StoreElementOnTop>

					if(temp == '\b')
     a66:	18 30       	cpi	r17, 0x08	; 8
     a68:	79 f4       	brne	.+30     	; 0xa88 <CDC_Task+0x5c>
					{
						Buffer_StoreElementOnTop(&Tx_Buffer, ' ');//clear the mistake
     a6a:	60 e2       	ldi	r22, 0x20	; 32
     a6c:	81 e2       	ldi	r24, 0x21	; 33
     a6e:	91 e0       	ldi	r25, 0x01	; 1
     a70:	b5 d1       	rcall	.+874    	; 0xddc <Buffer_StoreElementOnTop>
						Buffer_StoreElementOnTop(&Tx_Buffer, '\b');
     a72:	68 e0       	ldi	r22, 0x08	; 8
     a74:	81 e2       	ldi	r24, 0x21	; 33
     a76:	91 e0       	ldi	r25, 0x01	; 1
     a78:	b1 d1       	rcall	.+866    	; 0xddc <Buffer_StoreElementOnTop>
					
						Buffer_GetElementFromTop(&Rx_Buffer);//remove the \b and the character sent from our buffer
     a7a:	80 e7       	ldi	r24, 0x70	; 112
     a7c:	91 e0       	ldi	r25, 0x01	; 1
     a7e:	e5 d1       	rcall	.+970    	; 0xe4a <Buffer_GetElementFromTop>
						Buffer_GetElementFromTop(&Rx_Buffer);
     a80:	80 e7       	ldi	r24, 0x70	; 112
     a82:	91 e0       	ldi	r25, 0x01	; 1
     a84:	e2 d1       	rcall	.+964    	; 0xe4a <Buffer_GetElementFromTop>
     a86:	6e c0       	rjmp	.+220    	; 0xb64 <CDC_Task+0x138>
					}
					else if(temp == '\r')
     a88:	1d 30       	cpi	r17, 0x0D	; 13
     a8a:	09 f0       	breq	.+2      	; 0xa8e <CDC_Task+0x62>
     a8c:	6b c0       	rjmp	.+214    	; 0xb64 <CDC_Task+0x138>
					{
					//	Buffer_StoreElementOnTop(&Tx_Buffer, '\n');//ensure \r\n is sent back
						Buffer_GetElementFromTop(&Tx_Buffer);//remove the \r
     a8e:	81 e2       	ldi	r24, 0x21	; 33
     a90:	91 e0       	ldi	r25, 0x01	; 1
     a92:	db d1       	rcall	.+950    	; 0xe4a <Buffer_GetElementFromTop>
						Buffer_GetElementFromTop(&Rx_Buffer);//remove the \r
     a94:	80 e7       	ldi	r24, 0x70	; 112
     a96:	91 e0       	ldi	r25, 0x01	; 1
     a98:	d8 d1       	rcall	.+944    	; 0xe4a <Buffer_GetElementFromTop>

					
						Scheduler_SetTaskMode(CDC_Task, TASK_STOP);//stop it for a while
     a9a:	60 e0       	ldi	r22, 0x00	; 0
     a9c:	86 e1       	ldi	r24, 0x16	; 22
     a9e:	95 e0       	ldi	r25, 0x05	; 5
     aa0:	57 d5       	rcall	.+2734   	; 0x1550 <Scheduler_SetTaskMode>


						Scheduler_SetTaskMode(Command_Task, TASK_RUN);//process the data
     aa2:	61 e0       	ldi	r22, 0x01	; 1
     aa4:	8f e4       	ldi	r24, 0x4F	; 79
     aa6:	93 e0       	ldi	r25, 0x03	; 3
     aa8:	53 d5       	rcall	.+2726   	; 0x1550 <Scheduler_SetTaskMode>
     aaa:	61 c0       	rjmp	.+194    	; 0xb6e <CDC_Task+0x142>

						break;//don't care about any other data
					}
				}
				else if(mode == SERIAL)
     aac:	91 30       	cpi	r25, 0x01	; 1
     aae:	09 f0       	breq	.+2      	; 0xab2 <CDC_Task+0x86>
     ab0:	59 c0       	rjmp	.+178    	; 0xb64 <CDC_Task+0x138>
     ab2:	10 91 f1 00 	lds	r17, 0x00F1
				{
					temp = Endpoint_Read_Byte();
					if(temp == '\\')
     ab6:	1c 35       	cpi	r17, 0x5C	; 92
     ab8:	79 f4       	brne	.+30     	; 0xad8 <CDC_Task+0xac>
					{
						if (escapeCharReceived == true)
     aba:	80 91 1d 01 	lds	r24, 0x011D
     abe:	88 23       	and	r24, r24
     ac0:	41 f0       	breq	.+16     	; 0xad2 <CDC_Task+0xa6>
						{

							escapeCharReceived = false;
     ac2:	10 92 1d 01 	sts	0x011D, r1
							Buffer_StoreElementOnTop(&Rx_Buffer, '\\');//pass on the old one
     ac6:	6c e5       	ldi	r22, 0x5C	; 92
     ac8:	80 e7       	ldi	r24, 0x70	; 112
     aca:	91 e0       	ldi	r25, 0x01	; 1
     acc:	87 d1       	rcall	.+782    	; 0xddc <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Rx_Buffer, temp);//pass on the new one
     ace:	6c e5       	ldi	r22, 0x5C	; 92
     ad0:	44 c0       	rjmp	.+136    	; 0xb5a <CDC_Task+0x12e>
						}
						else
						{
							escapeCharReceived = true;
     ad2:	90 93 1d 01 	sts	0x011D, r25
     ad6:	46 c0       	rjmp	.+140    	; 0xb64 <CDC_Task+0x138>
						}
					}
					else if( escapeCharReceived == true)
     ad8:	80 91 1d 01 	lds	r24, 0x011D
     adc:	88 23       	and	r24, r24
     ade:	09 f4       	brne	.+2      	; 0xae2 <CDC_Task+0xb6>
     ae0:	3b c0       	rjmp	.+118    	; 0xb58 <CDC_Task+0x12c>
					{
					
						if(temp == 'c' || temp == 'C')
     ae2:	13 36       	cpi	r17, 0x63	; 99
     ae4:	11 f0       	breq	.+4      	; 0xaea <CDC_Task+0xbe>
     ae6:	13 34       	cpi	r17, 0x43	; 67
     ae8:	61 f5       	brne	.+88     	; 0xb42 <CDC_Task+0x116>
						{
							/* Initiate the transmission of the buffer contents if USART idle */
							if (Transmitting == false && Rx_Buffer.Elements != 0)
     aea:	80 91 1c 01 	lds	r24, 0x011C
     aee:	88 23       	and	r24, r24
     af0:	81 f4       	brne	.+32     	; 0xb12 <CDC_Task+0xe6>
     af2:	80 91 be 01 	lds	r24, 0x01BE
     af6:	88 23       	and	r24, r24
     af8:	61 f0       	breq	.+24     	; 0xb12 <CDC_Task+0xe6>
							{
								Transmitting = true;
     afa:	00 93 1c 01 	sts	0x011C, r16
								Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
     afe:	80 e7       	ldi	r24, 0x70	; 112
     b00:	91 e0       	ldi	r25, 0x01	; 1
     b02:	d0 d1       	rcall	.+928    	; 0xea4 <Buffer_GetElementFromBottom>
     b04:	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)));
     b06:	80 91 c8 00 	lds	r24, 0x00C8
     b0a:	85 ff       	sbrs	r24, 5
     b0c:	fc cf       	rjmp	.-8      	; 0xb06 <CDC_Task+0xda>
				UDR1 = DataByte;
     b0e:	90 93 ce 00 	sts	0x00CE, r25
							}
							while(Transmitting == true)//wait until we finish
     b12:	80 91 1c 01 	lds	r24, 0x011C
     b16:	88 23       	and	r24, r24
     b18:	e1 f7       	brne	.-8      	; 0xb12 <CDC_Task+0xe6>
							{
								;
							}
							mode = COMMAND;
     b1a:	10 92 1e 01 	sts	0x011E, r1
							Buffer_Initialize(&Rx_Buffer);//clear out all data
     b1e:	80 e7       	ldi	r24, 0x70	; 112
     b20:	91 e0       	ldi	r25, 0x01	; 1
     b22:	48 d1       	rcall	.+656    	; 0xdb4 <Buffer_Initialize>
							Buffer_Initialize(&Tx_Buffer);
     b24:	81 e2       	ldi	r24, 0x21	; 33
     b26:	91 e0       	ldi	r25, 0x01	; 1
     b28:	45 d1       	rcall	.+650    	; 0xdb4 <Buffer_Initialize>

							Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     b2a:	6d e0       	ldi	r22, 0x0D	; 13
     b2c:	81 e2       	ldi	r24, 0x21	; 33
     b2e:	91 e0       	ldi	r25, 0x01	; 1
     b30:	55 d1       	rcall	.+682    	; 0xddc <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     b32:	6a e0       	ldi	r22, 0x0A	; 10
     b34:	81 e2       	ldi	r24, 0x21	; 33
     b36:	91 e0       	ldi	r25, 0x01	; 1
     b38:	51 d1       	rcall	.+674    	; 0xddc <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     b3a:	6e e3       	ldi	r22, 0x3E	; 62
     b3c:	81 e2       	ldi	r24, 0x21	; 33
     b3e:	91 e0       	ldi	r25, 0x01	; 1
     b40:	07 c0       	rjmp	.+14     	; 0xb50 <CDC_Task+0x124>

						}
						else
						{
							Buffer_StoreElementOnTop(&Rx_Buffer, '\\');//pass on all the data
     b42:	6c e5       	ldi	r22, 0x5C	; 92
     b44:	80 e7       	ldi	r24, 0x70	; 112
     b46:	91 e0       	ldi	r25, 0x01	; 1
     b48:	49 d1       	rcall	.+658    	; 0xddc <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Rx_Buffer, temp);
     b4a:	61 2f       	mov	r22, r17
     b4c:	80 e7       	ldi	r24, 0x70	; 112
     b4e:	91 e0       	ldi	r25, 0x01	; 1
     b50:	45 d1       	rcall	.+650    	; 0xddc <Buffer_StoreElementOnTop>
						}

						escapeCharReceived = false;
     b52:	10 92 1d 01 	sts	0x011D, r1
     b56:	06 c0       	rjmp	.+12     	; 0xb64 <CDC_Task+0x138>
					}
					else
					{
						Buffer_StoreElementOnTop(&Rx_Buffer, temp);
     b58:	61 2f       	mov	r22, r17
     b5a:	80 e7       	ldi	r24, 0x70	; 112
     b5c:	91 e0       	ldi	r25, 0x01	; 1
     b5e:	3e d1       	rcall	.+636    	; 0xddc <Buffer_StoreElementOnTop>
     b60:	01 c0       	rjmp	.+2      	; 0xb64 <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;
     b62:	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())
     b64:	80 91 f2 00 	lds	r24, 0x00F2
     b68:	88 23       	and	r24, r24
     b6a:	09 f0       	breq	.+2      	; 0xb6e <CDC_Task+0x142>
     b6c:	6e cf       	rjmp	.-292    	; 0xa4a <CDC_Task+0x1e>
					}	
				}
			}

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

		/* Select the Serial Tx Endpoint */
		Endpoint_SelectEndpoint(CDC_TX_EPNUM);
     b78:	83 e0       	ldi	r24, 0x03	; 3
     b7a:	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)
     b7e:	80 91 1c 01 	lds	r24, 0x011C
     b82:	88 23       	and	r24, r24
     b84:	a1 f4       	brne	.+40     	; 0xbae <CDC_Task+0x182>
     b86:	90 91 1e 01 	lds	r25, 0x011E
     b8a:	91 30       	cpi	r25, 0x01	; 1
     b8c:	81 f4       	brne	.+32     	; 0xbae <CDC_Task+0x182>
     b8e:	80 91 be 01 	lds	r24, 0x01BE
     b92:	88 23       	and	r24, r24
     b94:	61 f0       	breq	.+24     	; 0xbae <CDC_Task+0x182>
		{
				Transmitting = true;
     b96:	90 93 1c 01 	sts	0x011C, r25
				Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
     b9a:	80 e7       	ldi	r24, 0x70	; 112
     b9c:	91 e0       	ldi	r25, 0x01	; 1
     b9e:	82 d1       	rcall	.+772    	; 0xea4 <Buffer_GetElementFromBottom>
     ba0:	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)));
     ba2:	80 91 c8 00 	lds	r24, 0x00C8
     ba6:	85 ff       	sbrs	r24, 5
     ba8:	fc cf       	rjmp	.-8      	; 0xba2 <CDC_Task+0x176>
				UDR1 = DataByte;
     baa:	90 93 ce 00 	sts	0x00CE, r25
		}


		/* Write the Data to the Endpoint */
		if(Tx_Buffer.Elements != 0)
     bae:	80 91 6f 01 	lds	r24, 0x016F
     bb2:	88 23       	and	r24, r24
     bb4:	f9 f0       	breq	.+62     	; 0xbf4 <CDC_Task+0x1c8>
		{

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

				Endpoint_Write_Byte(Buffer_GetElementFromBottom(&Tx_Buffer));
     bbe:	81 e2       	ldi	r24, 0x21	; 33
     bc0:	91 e0       	ldi	r25, 0x01	; 1
     bc2:	70 d1       	rcall	.+736    	; 0xea4 <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;
     bc4:	80 93 f1 00 	sts	0x00F1, r24

				/* Check if the endpoint is full */
				if (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE)
     bc8:	80 91 f2 00 	lds	r24, 0x00F2
     bcc:	80 31       	cpi	r24, 0x10	; 16
     bce:	49 f4       	brne	.+18     	; 0xbe2 <CDC_Task+0x1b6>
				{
					/* Send the data */
					Endpoint_ClearCurrentBank();
     bd0:	80 91 e8 00 	lds	r24, 0x00E8
     bd4:	8f 77       	andi	r24, 0x7F	; 127
     bd6:	80 93 e8 00 	sts	0x00E8, r24

					/* Wait until Serial Tx Endpoint Ready for Read/Write */
					while (!(Endpoint_ReadWriteAllowed()));
     bda:	80 91 e8 00 	lds	r24, 0x00E8
     bde:	85 ff       	sbrs	r24, 5
     be0:	fc cf       	rjmp	.-8      	; 0xbda <CDC_Task+0x1ae>
				}
			}while (Tx_Buffer.Elements != 0);
     be2:	80 91 6f 01 	lds	r24, 0x016F
     be6:	88 23       	and	r24, r24
     be8:	31 f7       	brne	.-52     	; 0xbb6 <CDC_Task+0x18a>

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

		}
	}
}
     bf4:	1f 91       	pop	r17
     bf6:	0f 91       	pop	r16
     bf8:	08 95       	ret

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

EVENT_HANDLER(USB_UnhandledControlPacket)
{
     bfa:	81 32       	cpi	r24, 0x21	; 33
     bfc:	31 f0       	breq	.+12     	; 0xc0a <Event_USB_UnhandledControlPacket+0x10>
     bfe:	82 32       	cpi	r24, 0x22	; 34
     c00:	51 f1       	breq	.+84     	; 0xc56 <Event_USB_UnhandledControlPacket+0x5c>
     c02:	80 32       	cpi	r24, 0x20	; 32
     c04:	09 f0       	breq	.+2      	; 0xc08 <Event_USB_UnhandledControlPacket+0xe>
     c06:	52 c0       	rjmp	.+164    	; 0xcac <Event_USB_UnhandledControlPacket+0xb2>
     c08:	13 c0       	rjmp	.+38     	; 0xc30 <Event_USB_UnhandledControlPacket+0x36>

	/* Process CDC specific control requests */
	switch (bRequest) 	{

		case GET_LINE_CODING:
			if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) {
     c0a:	61 3a       	cpi	r22, 0xA1	; 161
     c0c:	09 f0       	breq	.+2      	; 0xc10 <Event_USB_UnhandledControlPacket+0x16>
     c0e:	4e c0       	rjmp	.+156    	; 0xcac <Event_USB_UnhandledControlPacket+0xb2>
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     c10:	80 91 e8 00 	lds	r24, 0x00E8
     c14:	87 7f       	andi	r24, 0xF7	; 247
     c16:	80 93 e8 00 	sts	0x00E8, r24

				/* Write the line coding data to the control endpoint */
				Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
     c1a:	67 e0       	ldi	r22, 0x07	; 7
     c1c:	70 e0       	ldi	r23, 0x00	; 0
     c1e:	82 e1       	ldi	r24, 0x12	; 18
     c20:	91 e0       	ldi	r25, 0x01	; 1
     c22:	48 d5       	rcall	.+2704   	; 0x16b4 <Endpoint_Write_Control_Stream_LE>

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

		case SET_LINE_CODING:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) {
     c30:	61 32       	cpi	r22, 0x21	; 33
     c32:	09 f0       	breq	.+2      	; 0xc36 <Event_USB_UnhandledControlPacket+0x3c>
     c34:	3b c0       	rjmp	.+118    	; 0xcac <Event_USB_UnhandledControlPacket+0xb2>
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     c36:	80 91 e8 00 	lds	r24, 0x00E8
     c3a:	87 7f       	andi	r24, 0xF7	; 247
     c3c:	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));
     c40:	67 e0       	ldi	r22, 0x07	; 7
     c42:	70 e0       	ldi	r23, 0x00	; 0
     c44:	82 e1       	ldi	r24, 0x12	; 18
     c46:	91 e0       	ldi	r25, 0x01	; 1
     c48:	79 d5       	rcall	.+2802   	; 0x173c <Endpoint_Read_Control_Stream_LE>

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

				/* Reconfigure the USART with the new settings */
				ReconfigureUSART();
     c54:	14 cb       	rjmp	.-2520   	; 0x27e <ReconfigureUSART>
			    }
			break;

		case SET_CONTROL_LINE_STATE:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) {
     c56:	61 32       	cpi	r22, 0x21	; 33
     c58:	49 f5       	brne	.+82     	; 0xcac <Event_USB_UnhandledControlPacket+0xb2>
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     c5a:	80 91 e8 00 	lds	r24, 0x00E8
     c5e:	87 7f       	andi	r24, 0xF7	; 247
     c60:	80 93 e8 00 	sts	0x00E8, r24

				/* Send an empty packet to acknowedge the command (currently unused) */
				Endpoint_ClearSetupIN();
     c64:	80 91 e8 00 	lds	r24, 0x00E8
     c68:	8e 7f       	andi	r24, 0xFE	; 254
     c6a:	80 93 e8 00 	sts	0x00E8, r24
				if (mode != SERIAL)    {//in case we were in SPI mode
     c6e:	80 91 1e 01 	lds	r24, 0x011E
     c72:	81 30       	cpi	r24, 0x01	; 1
     c74:	81 f0       	breq	.+32     	; 0xc96 <Event_USB_UnhandledControlPacket+0x9c>
					mode = COMMAND;
     c76:	10 92 1e 01 	sts	0x011E, r1
					Buffer_Initialize(&Rx_Buffer);//clear my buffers
     c7a:	80 e7       	ldi	r24, 0x70	; 112
     c7c:	91 e0       	ldi	r25, 0x01	; 1
     c7e:	9a d0       	rcall	.+308    	; 0xdb4 <Buffer_Initialize>
					Buffer_Initialize(&Tx_Buffer);
     c80:	81 e2       	ldi	r24, 0x21	; 33
     c82:	91 e0       	ldi	r25, 0x01	; 1
     c84:	97 d0       	rcall	.+302    	; 0xdb4 <Buffer_Initialize>
					
					Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     c86:	61 e0       	ldi	r22, 0x01	; 1
     c88:	86 e1       	ldi	r24, 0x16	; 22
     c8a:	95 e0       	ldi	r25, 0x05	; 5
     c8c:	61 d4       	rcall	.+2242   	; 0x1550 <Scheduler_SetTaskMode>
					Scheduler_SetTaskMode(PROG_Task, TASK_STOP);
     c8e:	60 e0       	ldi	r22, 0x00	; 0
     c90:	82 ea       	ldi	r24, 0xA2	; 162
     c92:	92 e0       	ldi	r25, 0x02	; 2
     c94:	5d d4       	rcall	.+2234   	; 0x1550 <Scheduler_SetTaskMode>
				    }

				if(mode == COMMAND) {
     c96:	80 91 1e 01 	lds	r24, 0x011E
     c9a:	88 23       	and	r24, r24
     c9c:	39 f4       	brne	.+14     	; 0xcac <Event_USB_UnhandledControlPacket+0xb2>
					StringToBuffer_P(PSTR("\r\nUSB10 Ferret Utility V1.0\n\r(c) 2008 SOC Robotics, Inc.\r\n\r\n"));
     c9e:	85 ec       	ldi	r24, 0xC5	; 197
     ca0:	90 e0       	ldi	r25, 0x00	; 0
     ca2:	3e dc       	rcall	.-1924   	; 0x520 <StringToBuffer_P>
					Buffer_StoreElementOnTop(&Tx_Buffer, '>');//prompt character
     ca4:	6e e3       	ldi	r22, 0x3E	; 62
     ca6:	81 e2       	ldi	r24, 0x21	; 33
     ca8:	91 e0       	ldi	r25, 0x01	; 1
     caa:	98 c0       	rjmp	.+304    	; 0xddc <Buffer_StoreElementOnTop>
     cac:	08 95       	ret

00000cae <Event_USB_ConfigurationChanged>:
	Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);

}

EVENT_HANDLER(USB_ConfigurationChanged)
{
     cae:	20 e0       	ldi	r18, 0x00	; 0
     cb0:	41 ec       	ldi	r20, 0xC1	; 193
     cb2:	68 e0       	ldi	r22, 0x08	; 8
     cb4:	70 e0       	ldi	r23, 0x00	; 0
     cb6:	82 e0       	ldi	r24, 0x02	; 2
     cb8:	d6 d4       	rcall	.+2476   	; 0x1666 <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,
     cba:	24 e0       	ldi	r18, 0x04	; 4
     cbc:	41 e8       	ldi	r20, 0x81	; 129
     cbe:	60 e1       	ldi	r22, 0x10	; 16
     cc0:	70 e0       	ldi	r23, 0x00	; 0
     cc2:	83 e0       	ldi	r24, 0x03	; 3
     cc4:	d0 d4       	rcall	.+2464   	; 0x1666 <Endpoint_ConfigureEndpoint_P>
		                       ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
	                           ENDPOINT_BANK_DOUBLE);

	Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
     cc6:	24 e0       	ldi	r18, 0x04	; 4
     cc8:	40 e8       	ldi	r20, 0x80	; 128
     cca:	60 e1       	ldi	r22, 0x10	; 16
     ccc:	70 e0       	ldi	r23, 0x00	; 0
     cce:	84 e0       	ldi	r24, 0x04	; 4
     cd0:	ca d4       	rcall	.+2452   	; 0x1666 <Endpoint_ConfigureEndpoint_P>
		                       ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
	                           ENDPOINT_BANK_DOUBLE);


	/* Start CDC task */
	Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     cd2:	61 e0       	ldi	r22, 0x01	; 1
     cd4:	86 e1       	ldi	r24, 0x16	; 22
     cd6:	95 e0       	ldi	r25, 0x05	; 5
}
     cd8:	3b c4       	rjmp	.+2166   	; 0x1550 <Scheduler_SetTaskMode>

00000cda <main>:

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


int main(void)
{
     cda:	1f 93       	push	r17
     cdc:	cf 93       	push	r28
     cde:	df 93       	push	r29
	/* Disable watchdog if enabled by bootloader/fuses */
	MCUSR &= ~(1 << WDRF);
     ce0:	84 b7       	in	r24, 0x34	; 52
     ce2:	87 7f       	andi	r24, 0xF7	; 247
     ce4:	84 bf       	out	0x34, r24	; 52
	wdt_disable();
     ce6:	88 e1       	ldi	r24, 0x18	; 24
     ce8:	0f b6       	in	r0, 0x3f	; 63
     cea:	f8 94       	cli
     cec:	80 93 60 00 	sts	0x0060, r24
     cf0:	10 92 60 00 	sts	0x0060, r1
     cf4:	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__ (
     cf6:	91 e0       	ldi	r25, 0x01	; 1
     cf8:	80 e8       	ldi	r24, 0x80	; 128
     cfa:	0f b6       	in	r0, 0x3f	; 63
     cfc:	f8 94       	cli
     cfe:	80 93 61 00 	sts	0x0061, r24
     d02:	90 93 61 00 	sts	0x0061, r25
     d06:	0f be       	out	0x3f, r0	; 63

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

	/* Ringbuffer Initialization */
	Buffer_Initialize(&Rx_Buffer);
     d08:	80 e7       	ldi	r24, 0x70	; 112
     d0a:	91 e0       	ldi	r25, 0x01	; 1
     d0c:	53 d0       	rcall	.+166    	; 0xdb4 <Buffer_Initialize>
	Buffer_Initialize(&Tx_Buffer);
     d0e:	81 e2       	ldi	r24, 0x21	; 33
     d10:	91 e0       	ldi	r25, 0x01	; 1
     d12:	50 d0       	rcall	.+160    	; 0xdb4 <Buffer_Initialize>
			#define MAX_DELAYCTR_COUNT                0xFFFF

		/* Inline Functions: */
			static inline void Scheduler_InitScheduler(const uint8_t TotalTasks)
			{
				Scheduler_TotalTasks = TotalTasks;
     d14:	14 e0       	ldi	r17, 0x04	; 4
     d16:	10 93 bf 01 	sts	0x01BF, r17

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

	/* Initialize USB Subsystem */
	USB_Init();
     d1a:	9a d4       	rcall	.+2356   	; 0x1650 <USB_Init>
     d1c:	10 93 bf 01 	sts	0x01BF, r17
     d20:	c2 e0       	ldi	r28, 0x02	; 2
     d22:	d1 e0       	ldi	r29, 0x01	; 1
     d24:	07 c0       	rjmp	.+14     	; 0xd34 <main+0x5a>
				{
					TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
					while (CurrTask != &Scheduler_TaskList[TotalTasks])
					{
						if (CurrTask->TaskStatus == TASK_RUN)
     d26:	8a 81       	ldd	r24, Y+2	; 0x02
     d28:	88 23       	and	r24, r24
     d2a:	19 f0       	breq	.+6      	; 0xd32 <main+0x58>
						  CurrTask->Task();
     d2c:	e8 81       	ld	r30, Y
     d2e:	f9 81       	ldd	r31, Y+1	; 0x01
     d30:	09 95       	icall

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

				for (;;)
				{
					TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
					while (CurrTask != &Scheduler_TaskList[TotalTasks])
     d34:	81 e0       	ldi	r24, 0x01	; 1
     d36:	c2 31       	cpi	r28, 0x12	; 18
     d38:	d8 07       	cpc	r29, r24
     d3a:	a9 f7       	brne	.-22     	; 0xd26 <main+0x4c>
     d3c:	60 97       	sbiw	r28, 0x10	; 16
     d3e:	fa cf       	rjmp	.-12     	; 0xd34 <main+0x5a>

00000d40 <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)
{
     d40:	cf 93       	push	r28
     d42:	df 93       	push	r29
     d44:	da 01       	movw	r26, r20
     d46:	e9 01       	movw	r28, r18
	void*    Address = NULL;
	uint16_t Size    = 0;

	switch (wValue >> 8)
     d48:	29 2f       	mov	r18, r25
     d4a:	33 27       	eor	r19, r19
     d4c:	22 30       	cpi	r18, 0x02	; 2
     d4e:	31 05       	cpc	r19, r1
     d50:	39 f0       	breq	.+14     	; 0xd60 <USB_GetDescriptor+0x20>
     d52:	23 30       	cpi	r18, 0x03	; 3
     d54:	31 05       	cpc	r19, r1
     d56:	49 f0       	breq	.+18     	; 0xd6a <USB_GetDescriptor+0x2a>
     d58:	21 30       	cpi	r18, 0x01	; 1
     d5a:	31 05       	cpc	r19, r1
     d5c:	e9 f4       	brne	.+58     	; 0xd98 <USB_GetDescriptor+0x58>
     d5e:	20 c0       	rjmp	.+64     	; 0xda0 <USB_GetDescriptor+0x60>
     d60:	e4 e1       	ldi	r30, 0x14	; 20
     d62:	f1 e0       	ldi	r31, 0x01	; 1
     d64:	83 e4       	ldi	r24, 0x43	; 67
     d66:	90 e0       	ldi	r25, 0x00	; 0
     d68:	1f c0       	rjmp	.+62     	; 0xda8 <USB_GetDescriptor+0x68>
		case DTYPE_Configuration:
			Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
			Size    = sizeof(USB_Descriptor_Configuration_t);
			break;
		case DTYPE_String:
			switch (wValue & 0xFF)
     d6a:	90 70       	andi	r25, 0x00	; 0
     d6c:	81 30       	cpi	r24, 0x01	; 1
     d6e:	91 05       	cpc	r25, r1
     d70:	51 f0       	breq	.+20     	; 0xd86 <USB_GetDescriptor+0x46>
     d72:	81 30       	cpi	r24, 0x01	; 1
     d74:	91 05       	cpc	r25, r1
     d76:	18 f0       	brcs	.+6      	; 0xd7e <USB_GetDescriptor+0x3e>
     d78:	02 97       	sbiw	r24, 0x02	; 2
     d7a:	71 f4       	brne	.+28     	; 0xd98 <USB_GetDescriptor+0x58>
     d7c:	08 c0       	rjmp	.+16     	; 0xd8e <USB_GetDescriptor+0x4e>
			{
				case 0x00:
					Address = DESCRIPTOR_ADDRESS(LanguageString);
					Size    = pgm_read_byte(&LanguageString.Header.Size);
     d7e:	e7 e5       	ldi	r30, 0x57	; 87
     d80:	f1 e0       	ldi	r31, 0x01	; 1
     d82:	84 91       	lpm	r24, Z+
     d84:	07 c0       	rjmp	.+14     	; 0xd94 <USB_GetDescriptor+0x54>
					break;
				case 0x01:
					Address = DESCRIPTOR_ADDRESS(ManufacturerString);
					Size    = pgm_read_byte(&ManufacturerString.Header.Size);
     d86:	eb e5       	ldi	r30, 0x5B	; 91
     d88:	f1 e0       	ldi	r31, 0x01	; 1
     d8a:	84 91       	lpm	r24, Z+
     d8c:	03 c0       	rjmp	.+6      	; 0xd94 <USB_GetDescriptor+0x54>
					break;
				case 0x02:
					Address = DESCRIPTOR_ADDRESS(ProductString);
					Size    = pgm_read_byte(&ProductString.Header.Size);
     d8e:	e5 e7       	ldi	r30, 0x75	; 117
     d90:	f1 e0       	ldi	r31, 0x01	; 1
     d92:	84 91       	lpm	r24, Z+
     d94:	90 e0       	ldi	r25, 0x00	; 0
     d96:	08 c0       	rjmp	.+16     	; 0xda8 <USB_GetDescriptor+0x68>
     d98:	80 e0       	ldi	r24, 0x00	; 0

		return true;
	}
		
	return false;
}
     d9a:	df 91       	pop	r29
     d9c:	cf 91       	pop	r28
     d9e:	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);
     da0:	e2 e0       	ldi	r30, 0x02	; 2
     da2:	f1 e0       	ldi	r31, 0x01	; 1
     da4:	82 e1       	ldi	r24, 0x12	; 18
     da6:	90 e0       	ldi	r25, 0x00	; 0
			break;
	}
	
	if (Address != NULL)
	{
		*DescriptorAddress = Address;
     da8:	ed 93       	st	X+, r30
     daa:	fc 93       	st	X, r31
		*DescriptorSize    = Size;
     dac:	99 83       	std	Y+1, r25	; 0x01
     dae:	88 83       	st	Y, r24
     db0:	81 e0       	ldi	r24, 0x01	; 1
     db2:	f3 cf       	rjmp	.-26     	; 0xd9a <USB_GetDescriptor+0x5a>

00000db4 <Buffer_Initialize>:
*/

#include "RingBuff.h"

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     db8:	f8 94       	cli
	{
		Buffer->TopPtr    = (RingBuff_Data_t*)&Buffer->Buffer;
     dba:	df 01       	movw	r26, r30
     dbc:	a6 5b       	subi	r26, 0xB6	; 182
     dbe:	bf 4f       	sbci	r27, 0xFF	; 255
     dc0:	11 96       	adiw	r26, 0x01	; 1
     dc2:	fc 93       	st	X, r31
     dc4:	ee 93       	st	-X, r30
		Buffer->BottomPtr   = (RingBuff_Data_t*)&Buffer->Buffer;
     dc6:	df 01       	movw	r26, r30
     dc8:	a4 5b       	subi	r26, 0xB4	; 180
     dca:	bf 4f       	sbci	r27, 0xFF	; 255
     dcc:	11 96       	adiw	r26, 0x01	; 1
     dce:	fc 93       	st	X, r31
     dd0:	ee 93       	st	-X, r30
		Buffer->Elements = 0;
     dd2:	e2 5b       	subi	r30, 0xB2	; 178
     dd4:	ff 4f       	sbci	r31, 0xFF	; 255
     dd6:	10 82       	st	Z, r1
    (void)__s;
}

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

00000ddc <Buffer_StoreElementOnTop>:
	}
}

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     de0:	f8 94       	cli
	{
		if (Buffer->Elements == BUFF_LENGTH)//i.e. buffer is full.  So we will remove our oldest data
     de2:	fc 01       	movw	r30, r24
     de4:	e2 5b       	subi	r30, 0xB2	; 178
     de6:	ff 4f       	sbci	r31, 0xFF	; 255
     de8:	80 81       	ld	r24, Z
     dea:	8a 34       	cpi	r24, 0x4A	; 74
     dec:	99 f4       	brne	.+38     	; 0xe14 <Buffer_StoreElementOnTop+0x38>
		{
			Buffer->BottomPtr++;
     dee:	fa 01       	movw	r30, r20
     df0:	e4 5b       	subi	r30, 0xB4	; 180
     df2:	ff 4f       	sbci	r31, 0xFF	; 255
     df4:	80 81       	ld	r24, Z
     df6:	91 81       	ldd	r25, Z+1	; 0x01
     df8:	01 96       	adiw	r24, 0x01	; 1
     dfa:	91 83       	std	Z+1, r25	; 0x01
     dfc:	80 83       	st	Z, r24

			if (Buffer->BottomPtr == &Buffer->Buffer[BUFF_LENGTH])
     dfe:	20 81       	ld	r18, Z
     e00:	31 81       	ldd	r19, Z+1	; 0x01
     e02:	ca 01       	movw	r24, r20
     e04:	86 5b       	subi	r24, 0xB6	; 182
     e06:	9f 4f       	sbci	r25, 0xFF	; 255
     e08:	28 17       	cp	r18, r24
     e0a:	39 07       	cpc	r19, r25
     e0c:	31 f4       	brne	.+12     	; 0xe1a <Buffer_StoreElementOnTop+0x3e>
			{
				Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     e0e:	51 83       	std	Z+1, r21	; 0x01
     e10:	40 83       	st	Z, r20
     e12:	03 c0       	rjmp	.+6      	; 0xe1a <Buffer_StoreElementOnTop+0x3e>
			}
		}
		else
		{
			Buffer->Elements++;
     e14:	80 81       	ld	r24, Z
     e16:	8f 5f       	subi	r24, 0xFF	; 255
     e18:	80 83       	st	Z, r24
		}


		*(Buffer->TopPtr) = Data;
     e1a:	da 01       	movw	r26, r20
     e1c:	a6 5b       	subi	r26, 0xB6	; 182
     e1e:	bf 4f       	sbci	r27, 0xFF	; 255
     e20:	ed 91       	ld	r30, X+
     e22:	fc 91       	ld	r31, X
     e24:	11 97       	sbiw	r26, 0x01	; 1
     e26:	60 83       	st	Z, r22
		Buffer->TopPtr++;
     e28:	8d 91       	ld	r24, X+
     e2a:	9c 91       	ld	r25, X
     e2c:	11 97       	sbiw	r26, 0x01	; 1
     e2e:	01 96       	adiw	r24, 0x01	; 1
     e30:	11 96       	adiw	r26, 0x01	; 1
     e32:	9c 93       	st	X, r25
     e34:	8e 93       	st	-X, r24

		if (Buffer->TopPtr == &Buffer->Buffer[BUFF_LENGTH])
     e36:	ed 91       	ld	r30, X+
     e38:	fc 91       	ld	r31, X
     e3a:	11 97       	sbiw	r26, 0x01	; 1
     e3c:	ea 17       	cp	r30, r26
     e3e:	fb 07       	cpc	r31, r27
     e40:	11 f4       	brne	.+4      	; 0xe46 <Buffer_StoreElementOnTop+0x6a>
		{
			Buffer->TopPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     e42:	51 83       	std	Z+1, r21	; 0x01
     e44:	40 83       	st	Z, r20
    (void)__s;
}

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

00000e4a <Buffer_GetElementFromTop>:
		}
	}
}

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

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     e4e:	f8 94       	cli
	{
		if (!(Buffer->Elements))
     e50:	a2 5b       	subi	r26, 0xB2	; 178
     e52:	bf 4f       	sbci	r27, 0xFF	; 255
     e54:	8c 91       	ld	r24, X
     e56:	ae 54       	subi	r26, 0x4E	; 78
     e58:	b0 40       	sbci	r27, 0x00	; 0
     e5a:	88 23       	and	r24, r24
     e5c:	11 f4       	brne	.+4      	; 0xe62 <Buffer_GetElementFromTop+0x18>
    (void)__s;
}

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

		if(Buffer->TopPtr == (RingBuff_Data_t*)&Buffer->Buffer)//at index 0
     e62:	fd 01       	movw	r30, r26
     e64:	e6 5b       	subi	r30, 0xB6	; 182
     e66:	ff 4f       	sbci	r31, 0xFF	; 255
     e68:	80 81       	ld	r24, Z
     e6a:	91 81       	ldd	r25, Z+1	; 0x01
     e6c:	8a 17       	cp	r24, r26
     e6e:	9b 07       	cpc	r25, r27
     e70:	39 f4       	brne	.+14     	; 0xe80 <Buffer_GetElementFromTop+0x36>
		{
			Buffer->TopPtr = (RingBuff_Data_t*)&Buffer->Buffer[BUFF_LENGTH-1];//now at the top of the array
     e72:	a7 5b       	subi	r26, 0xB7	; 183
     e74:	bf 4f       	sbci	r27, 0xFF	; 255
     e76:	b1 83       	std	Z+1, r27	; 0x01
     e78:	a0 83       	st	Z, r26
     e7a:	a9 54       	subi	r26, 0x49	; 73
     e7c:	b0 40       	sbci	r27, 0x00	; 0
     e7e:	05 c0       	rjmp	.+10     	; 0xe8a <Buffer_GetElementFromTop+0x40>
		}
		else
		{
			Buffer->TopPtr--;
     e80:	80 81       	ld	r24, Z
     e82:	91 81       	ldd	r25, Z+1	; 0x01
     e84:	01 97       	sbiw	r24, 0x01	; 1
     e86:	91 83       	std	Z+1, r25	; 0x01
     e88:	80 83       	st	Z, r24
		}

		Buffer->Elements--;
     e8a:	fd 01       	movw	r30, r26
     e8c:	e2 5b       	subi	r30, 0xB2	; 178
     e8e:	ff 4f       	sbci	r31, 0xFF	; 255
     e90:	80 81       	ld	r24, Z
     e92:	81 50       	subi	r24, 0x01	; 1
     e94:	80 83       	st	Z, r24

		BuffData = *(Buffer->TopPtr);
     e96:	a6 5b       	subi	r26, 0xB6	; 182
     e98:	bf 4f       	sbci	r27, 0xFF	; 255
     e9a:	ed 91       	ld	r30, X+
     e9c:	fc 91       	ld	r31, X
     e9e:	80 81       	ld	r24, Z
    (void)__s;
}

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

00000ea4 <Buffer_GetElementFromBottom>:
	return BuffData;
}

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

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     eac:	f8 94       	cli
	{
		if (!(Buffer->Elements))
     eae:	ec 01       	movw	r28, r24
     eb0:	c2 5b       	subi	r28, 0xB2	; 178
     eb2:	df 4f       	sbci	r29, 0xFF	; 255
     eb4:	88 81       	ld	r24, Y
     eb6:	88 23       	and	r24, r24
     eb8:	19 f4       	brne	.+6      	; 0xec0 <Buffer_GetElementFromBottom+0x1c>
    (void)__s;
}

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

		BuffData = *(Buffer->BottomPtr);
     ec0:	da 01       	movw	r26, r20
     ec2:	a4 5b       	subi	r26, 0xB4	; 180
     ec4:	bf 4f       	sbci	r27, 0xFF	; 255
     ec6:	ed 91       	ld	r30, X+
     ec8:	fc 91       	ld	r31, X
     eca:	11 97       	sbiw	r26, 0x01	; 1
     ecc:	e0 81       	ld	r30, Z

		Buffer->BottomPtr++;
     ece:	8d 91       	ld	r24, X+
     ed0:	9c 91       	ld	r25, X
     ed2:	11 97       	sbiw	r26, 0x01	; 1
     ed4:	01 96       	adiw	r24, 0x01	; 1
     ed6:	11 96       	adiw	r26, 0x01	; 1
     ed8:	9c 93       	st	X, r25
     eda:	8e 93       	st	-X, r24
		Buffer->Elements--;
     edc:	88 81       	ld	r24, Y
     ede:	81 50       	subi	r24, 0x01	; 1
     ee0:	88 83       	st	Y, r24

		if (Buffer->BottomPtr == &Buffer->Buffer[BUFF_LENGTH])
     ee2:	2d 91       	ld	r18, X+
     ee4:	3c 91       	ld	r19, X
     ee6:	11 97       	sbiw	r26, 0x01	; 1
     ee8:	ca 01       	movw	r24, r20
     eea:	86 5b       	subi	r24, 0xB6	; 182
     eec:	9f 4f       	sbci	r25, 0xFF	; 255
     eee:	28 17       	cp	r18, r24
     ef0:	39 07       	cpc	r19, r25
     ef2:	19 f4       	brne	.+6      	; 0xefa <Buffer_GetElementFromBottom+0x56>
		  Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     ef4:	11 96       	adiw	r26, 0x01	; 1
     ef6:	5c 93       	st	X, r21
     ef8:	4e 93       	st	-X, r20
    (void)__s;
}

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

00000f04 <Buffer_StoreElementOnBottom>:

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     f08:	f8 94       	cli
	{
		if(Buffer->Elements == BUFF_LENGTH)//i.e. buffer is full.  So we have no room
     f0a:	a2 5b       	subi	r26, 0xB2	; 178
     f0c:	bf 4f       	sbci	r27, 0xFF	; 255
     f0e:	8c 91       	ld	r24, X
     f10:	ae 54       	subi	r26, 0x4E	; 78
     f12:	b0 40       	sbci	r27, 0x00	; 0
     f14:	8a 34       	cpi	r24, 0x4A	; 74
     f16:	e9 f0       	breq	.+58     	; 0xf52 <Buffer_StoreElementOnBottom+0x4e>
		{
			return;
		}
		if(Buffer->BottomPtr == (RingBuff_Data_t*)&Buffer->Buffer)
     f18:	fd 01       	movw	r30, r26
     f1a:	e4 5b       	subi	r30, 0xB4	; 180
     f1c:	ff 4f       	sbci	r31, 0xFF	; 255
     f1e:	80 81       	ld	r24, Z
     f20:	91 81       	ldd	r25, Z+1	; 0x01
     f22:	8a 17       	cp	r24, r26
     f24:	9b 07       	cpc	r25, r27
     f26:	39 f4       	brne	.+14     	; 0xf36 <Buffer_StoreElementOnBottom+0x32>
		{
			Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer[BUFF_LENGTH-1];
     f28:	a7 5b       	subi	r26, 0xB7	; 183
     f2a:	bf 4f       	sbci	r27, 0xFF	; 255
     f2c:	b1 83       	std	Z+1, r27	; 0x01
     f2e:	a0 83       	st	Z, r26
     f30:	a9 54       	subi	r26, 0x49	; 73
     f32:	b0 40       	sbci	r27, 0x00	; 0
     f34:	05 c0       	rjmp	.+10     	; 0xf40 <Buffer_StoreElementOnBottom+0x3c>
		}
		else
		{
			Buffer->BottomPtr--;
     f36:	80 81       	ld	r24, Z
     f38:	91 81       	ldd	r25, Z+1	; 0x01
     f3a:	01 97       	sbiw	r24, 0x01	; 1
     f3c:	91 83       	std	Z+1, r25	; 0x01
     f3e:	80 83       	st	Z, r24
		}

		*(Buffer->BottomPtr) = Data;
     f40:	a4 5b       	subi	r26, 0xB4	; 180
     f42:	bf 4f       	sbci	r27, 0xFF	; 255
     f44:	ed 91       	ld	r30, X+
     f46:	fd 91       	ld	r31, X+
     f48:	60 83       	st	Z, r22
		Buffer->Elements++;
     f4a:	fd 01       	movw	r30, r26
     f4c:	80 81       	ld	r24, Z
     f4e:	8f 5f       	subi	r24, 0xFF	; 255
     f50:	80 83       	st	Z, r24
    (void)__s;
}

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

00000f56 <Set_High>:
}



void Set_High(uint8_t x)
{
     f56:	90 91 19 01 	lds	r25, 0x0119
     f5a:	92 33       	cpi	r25, 0x32	; 50
     f5c:	41 f0       	breq	.+16     	; 0xf6e <Set_High+0x18>
     f5e:	93 33       	cpi	r25, 0x33	; 51
     f60:	61 f0       	breq	.+24     	; 0xf7a <Set_High+0x24>
     f62:	91 33       	cpi	r25, 0x31	; 49
     f64:	79 f4       	brne	.+30     	; 0xf84 <Set_High+0x2e>
	switch(I2C_Port)
	{
		case '1':
			if(x == SCL)
     f66:	88 23       	and	r24, r24
     f68:	31 f0       	breq	.+12     	; 0xf76 <Set_High+0x20>
			{
				DDRD &= ~(1<<5);
			}
			else
			{
				DDRD &= ~(1<<6);
     f6a:	56 98       	cbi	0x0a, 6	; 10
     f6c:	08 95       	ret
			}
			break;
		case '2':
			if(x == SCL)
     f6e:	88 23       	and	r24, r24
     f70:	11 f4       	brne	.+4      	; 0xf76 <Set_High+0x20>
			{
				DDRD &= ~(1<<4);
     f72:	54 98       	cbi	0x0a, 4	; 10
     f74:	08 95       	ret
			}
			else
			{
				DDRD &= ~(1<<5);
     f76:	55 98       	cbi	0x0a, 5	; 10
     f78:	08 95       	ret
			}
			break;
		case '3':
			if(x == SCL)
     f7a:	88 23       	and	r24, r24
     f7c:	11 f4       	brne	.+4      	; 0xf82 <Set_High+0x2c>
			{
				DDRB &= ~(1<<3);
     f7e:	23 98       	cbi	0x04, 3	; 4
     f80:	08 95       	ret
			}
			else
			{
				DDRB &= ~(1<<0);
     f82:	20 98       	cbi	0x04, 0	; 4
     f84:	08 95       	ret

00000f86 <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)
{
     f86:	80 91 19 01 	lds	r24, 0x0119
     f8a:	82 33       	cpi	r24, 0x32	; 50
     f8c:	39 f0       	breq	.+14     	; 0xf9c <I2C_Init+0x16>
     f8e:	83 33       	cpi	r24, 0x33	; 51
     f90:	49 f0       	breq	.+18     	; 0xfa4 <I2C_Init+0x1e>
     f92:	81 33       	cpi	r24, 0x31	; 49
     f94:	51 f4       	brne	.+20     	; 0xfaa <I2C_Init+0x24>
	
	switch(I2C_Port)
	{
		case '1':
			PORTD &= ~((1<<5) | (1<<6));
     f96:	8b b1       	in	r24, 0x0b	; 11
     f98:	8f 79       	andi	r24, 0x9F	; 159
     f9a:	02 c0       	rjmp	.+4      	; 0xfa0 <I2C_Init+0x1a>
			break;
		case '2':
			PORTD &= ~((1<<4) | (1<<5));
     f9c:	8b b1       	in	r24, 0x0b	; 11
     f9e:	8f 7c       	andi	r24, 0xCF	; 207
     fa0:	8b b9       	out	0x0b, r24	; 11
     fa2:	03 c0       	rjmp	.+6      	; 0xfaa <I2C_Init+0x24>
			break;
		case '3':
			PORTB &= ~((1<<0) | (1<<3));
     fa4:	85 b1       	in	r24, 0x05	; 5
     fa6:	86 7f       	andi	r24, 0xF6	; 246
     fa8:	85 b9       	out	0x05, r24	; 5
			break;
	}	
	
	Set_High(SDA);
     faa:	81 e0       	ldi	r24, 0x01	; 1
     fac:	d4 df       	rcall	.-88     	; 0xf56 <Set_High>
	Set_High(SCL);//ensure that the I2C lines are released
     fae:	80 e0       	ldi	r24, 0x00	; 0
}
     fb0:	d2 cf       	rjmp	.-92     	; 0xf56 <Set_High>

00000fb2 <Set_Low>:
			break;
	}

} 
void Set_Low(uint8_t x)
{
     fb2:	90 91 19 01 	lds	r25, 0x0119
     fb6:	92 33       	cpi	r25, 0x32	; 50
     fb8:	41 f0       	breq	.+16     	; 0xfca <Set_Low+0x18>
     fba:	93 33       	cpi	r25, 0x33	; 51
     fbc:	61 f0       	breq	.+24     	; 0xfd6 <Set_Low+0x24>
     fbe:	91 33       	cpi	r25, 0x31	; 49
     fc0:	79 f4       	brne	.+30     	; 0xfe0 <Set_Low+0x2e>
	switch(I2C_Port)
	{
		case '1'://to molex
			if(x == SCL)
     fc2:	88 23       	and	r24, r24
     fc4:	31 f0       	breq	.+12     	; 0xfd2 <Set_Low+0x20>
			{
				DDRD |= (1<<5);
			}
			else
			{
				DDRD |= (1<<6);
     fc6:	56 9a       	sbi	0x0a, 6	; 10
     fc8:	08 95       	ret
			}
			break;
		case '2'://to pins
			if(x == SCL)
     fca:	88 23       	and	r24, r24
     fcc:	11 f4       	brne	.+4      	; 0xfd2 <Set_Low+0x20>
			{
				DDRD |= (1<<4);
     fce:	54 9a       	sbi	0x0a, 4	; 10
     fd0:	08 95       	ret
			}
			else
			{
				DDRD |= (1<<5);
     fd2:	55 9a       	sbi	0x0a, 5	; 10
     fd4:	08 95       	ret
			}
			break;
		case '3'://to motor
			if(x == SCL)
     fd6:	88 23       	and	r24, r24
     fd8:	11 f4       	brne	.+4      	; 0xfde <Set_Low+0x2c>
			{
				DDRB |= (1<<3);
     fda:	23 9a       	sbi	0x04, 3	; 4
     fdc:	08 95       	ret
			}
			else
			{
				DDRB |= (1<<0);
     fde:	20 9a       	sbi	0x04, 0	; 4
     fe0:	08 95       	ret

00000fe2 <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)
{	
     fe2:	df 93       	push	r29
     fe4:	cf 93       	push	r28
     fe6:	0f 92       	push	r0
     fe8:	cd b7       	in	r28, 0x3d	; 61
     fea:	de b7       	in	r29, 0x3e	; 62
	//  Set SCL high
	Set_High(SCL);
     fec:	80 e0       	ldi	r24, 0x00	; 0
     fee:	b3 df       	rcall	.-154    	; 0xf56 <Set_High>
     ff0:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     ff2:	21 e0       	ldi	r18, 0x01	; 1
     ff4:	29 83       	std	Y+1, r18	; 0x01
     ff6:	03 c0       	rjmp	.+6      	; 0xffe <I2C_Pulse_SCL+0x1c>
     ff8:	89 81       	ldd	r24, Y+1	; 0x01
     ffa:	8f 5f       	subi	r24, 0xFF	; 255
     ffc:	89 83       	std	Y+1, r24	; 0x01
     ffe:	89 81       	ldd	r24, Y+1	; 0x01
    1000:	8a 30       	cpi	r24, 0x0A	; 10
    1002:	d0 f3       	brcs	.-12     	; 0xff8 <I2C_Pulse_SCL+0x16>
		{
		
				;
			
		}
		delay--;
    1004:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1006:	b1 f7       	brne	.-20     	; 0xff4 <I2C_Pulse_SCL+0x12>
	
	//  Delay
	Delay(I2C_PERIOD);
	
	// Set SCL Low
	Set_Low(SCL);
    1008:	80 e0       	ldi	r24, 0x00	; 0
    100a:	d3 df       	rcall	.-90     	; 0xfb2 <Set_Low>
    100c:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    100e:	21 e0       	ldi	r18, 0x01	; 1
    1010:	29 83       	std	Y+1, r18	; 0x01
    1012:	03 c0       	rjmp	.+6      	; 0x101a <I2C_Pulse_SCL+0x38>
    1014:	89 81       	ldd	r24, Y+1	; 0x01
    1016:	8f 5f       	subi	r24, 0xFF	; 255
    1018:	89 83       	std	Y+1, r24	; 0x01
    101a:	89 81       	ldd	r24, Y+1	; 0x01
    101c:	8a 30       	cpi	r24, 0x0A	; 10
    101e:	d0 f3       	brcs	.-12     	; 0x1014 <I2C_Pulse_SCL+0x32>
		{
		
				;
			
		}
		delay--;
    1020:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1022:	b1 f7       	brne	.-20     	; 0x1010 <I2C_Pulse_SCL+0x2e>
	
	// Set SCL Low
	Set_Low(SCL);
	
	Delay(I2C_PERIOD);
}
    1024:	0f 90       	pop	r0
    1026:	cf 91       	pop	r28
    1028:	df 91       	pop	r29
    102a:	08 95       	ret

0000102c <I2C_Send_NACK>:
	I2C_Pulse_SCL()	;
	Set_High(SDA);//release the line
}

void I2C_Send_NACK(void)
{
    102c:	81 e0       	ldi	r24, 0x01	; 1
    102e:	93 df       	rcall	.-218    	; 0xf56 <Set_High>
	Set_High(SDA);
	//may want a bit of a delay here?
	I2C_Pulse_SCL();
    1030:	d8 cf       	rjmp	.-80     	; 0xfe2 <I2C_Pulse_SCL>

00001032 <I2C_Start>:
	
/*
 * This places a start condition onto the I2C lines
 */
void I2C_Start(void)
{
    1032:	df 93       	push	r29
    1034:	cf 93       	push	r28
    1036:	0f 92       	push	r0
    1038:	cd b7       	in	r28, 0x3d	; 61
    103a:	de b7       	in	r29, 0x3e	; 62
	Set_Low(SDA);
    103c:	81 e0       	ldi	r24, 0x01	; 1
    103e:	b9 df       	rcall	.-142    	; 0xfb2 <Set_Low>
    1040:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1042:	21 e0       	ldi	r18, 0x01	; 1
    1044:	29 83       	std	Y+1, r18	; 0x01
    1046:	03 c0       	rjmp	.+6      	; 0x104e <I2C_Start+0x1c>
    1048:	89 81       	ldd	r24, Y+1	; 0x01
    104a:	8f 5f       	subi	r24, 0xFF	; 255
    104c:	89 83       	std	Y+1, r24	; 0x01
    104e:	89 81       	ldd	r24, Y+1	; 0x01
    1050:	8a 30       	cpi	r24, 0x0A	; 10
    1052:	d0 f3       	brcs	.-12     	; 0x1048 <I2C_Start+0x16>
		{
		
				;
			
		}
		delay--;
    1054:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1056:	b1 f7       	brne	.-20     	; 0x1044 <I2C_Start+0x12>
 */
void I2C_Start(void)
{
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_Low(SCL);
    1058:	80 e0       	ldi	r24, 0x00	; 0
    105a:	ab df       	rcall	.-170    	; 0xfb2 <Set_Low>
    105c:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    105e:	21 e0       	ldi	r18, 0x01	; 1
    1060:	29 83       	std	Y+1, r18	; 0x01
    1062:	03 c0       	rjmp	.+6      	; 0x106a <I2C_Start+0x38>
    1064:	89 81       	ldd	r24, Y+1	; 0x01
    1066:	8f 5f       	subi	r24, 0xFF	; 255
    1068:	89 83       	std	Y+1, r24	; 0x01
    106a:	89 81       	ldd	r24, Y+1	; 0x01
    106c:	8a 30       	cpi	r24, 0x0A	; 10
    106e:	d0 f3       	brcs	.-12     	; 0x1064 <I2C_Start+0x32>
		{
		
				;
			
		}
		delay--;
    1070:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1072:	b1 f7       	brne	.-20     	; 0x1060 <I2C_Start+0x2e>
{
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_Low(SCL);
	Delay(I2C_PERIOD);
}
    1074:	0f 90       	pop	r0
    1076:	cf 91       	pop	r28
    1078:	df 91       	pop	r29
    107a:	08 95       	ret

0000107c <I2C_Send_ACK>:

/*
 * This function will place an ACK on the bus for the slave to read
 */
void I2C_Send_ACK(void)
{
    107c:	81 e0       	ldi	r24, 0x01	; 1
    107e:	99 df       	rcall	.-206    	; 0xfb2 <Set_Low>
	Set_Low(SDA);
	//may want a bit of a delay here?
	I2C_Pulse_SCL()	;
    1080:	b0 df       	rcall	.-160    	; 0xfe2 <I2C_Pulse_SCL>
	Set_High(SDA);//release the line
    1082:	81 e0       	ldi	r24, 0x01	; 1
}
    1084:	68 cf       	rjmp	.-304    	; 0xf56 <Set_High>

00001086 <Wait_On_SCL_Low>:
			break;
	}
}

void Wait_On_SCL_Low(void)
{
    1086:	80 91 19 01 	lds	r24, 0x0119
    108a:	82 33       	cpi	r24, 0x32	; 50
    108c:	39 f0       	breq	.+14     	; 0x109c <Wait_On_SCL_Low+0x16>
    108e:	83 33       	cpi	r24, 0x33	; 51
    1090:	41 f0       	breq	.+16     	; 0x10a2 <Wait_On_SCL_Low+0x1c>
    1092:	81 33       	cpi	r24, 0x31	; 49
    1094:	41 f4       	brne	.+16     	; 0x10a6 <Wait_On_SCL_Low+0x20>
	switch(I2C_Port)
	{
		case '1'://to molex
			while( !(PIND & (1<<5)) );	
    1096:	4d 9b       	sbis	0x09, 5	; 9
    1098:	fe cf       	rjmp	.-4      	; 0x1096 <Wait_On_SCL_Low+0x10>
    109a:	08 95       	ret
			break;
		case '2'://to pins
			while( !(PIND & (1<<4)) );	
    109c:	4c 9b       	sbis	0x09, 4	; 9
    109e:	fe cf       	rjmp	.-4      	; 0x109c <Wait_On_SCL_Low+0x16>
    10a0:	08 95       	ret
			break;
		case '3'://to motor
			while( !(PINB & (1<<3)) );	
    10a2:	1b 9b       	sbis	0x03, 3	; 3
    10a4:	fe cf       	rjmp	.-4      	; 0x10a2 <Wait_On_SCL_Low+0x1c>
    10a6:	08 95       	ret

000010a8 <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)
{	
    10a8:	df 93       	push	r29
    10aa:	cf 93       	push	r28
    10ac:	0f 92       	push	r0
    10ae:	cd b7       	in	r28, 0x3d	; 61
    10b0:	de b7       	in	r29, 0x3e	; 62
	//  Set SCL high
	Set_High(SCL);
    10b2:	80 e0       	ldi	r24, 0x00	; 0
    10b4:	50 df       	rcall	.-352    	; 0xf56 <Set_High>
	
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
    10b6:	e7 df       	rcall	.-50     	; 0x1086 <Wait_On_SCL_Low>
    10b8:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    10ba:	21 e0       	ldi	r18, 0x01	; 1
    10bc:	29 83       	std	Y+1, r18	; 0x01
    10be:	03 c0       	rjmp	.+6      	; 0x10c6 <I2C_Pulse_SCL_After_ACK+0x1e>
    10c0:	89 81       	ldd	r24, Y+1	; 0x01
    10c2:	8f 5f       	subi	r24, 0xFF	; 255
    10c4:	89 83       	std	Y+1, r24	; 0x01
    10c6:	89 81       	ldd	r24, Y+1	; 0x01
    10c8:	8a 30       	cpi	r24, 0x0A	; 10
    10ca:	d0 f3       	brcs	.-12     	; 0x10c0 <I2C_Pulse_SCL_After_ACK+0x18>
		{
		
				;
			
		}
		delay--;
    10cc:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    10ce:	b1 f7       	brne	.-20     	; 0x10bc <I2C_Pulse_SCL_After_ACK+0x14>
	
	//  Delay
	Delay(I2C_PERIOD);
	
	// Set SCL Low
	Set_Low(SCL);
    10d0:	80 e0       	ldi	r24, 0x00	; 0
    10d2:	6f df       	rcall	.-290    	; 0xfb2 <Set_Low>
    10d4:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    10d6:	21 e0       	ldi	r18, 0x01	; 1
    10d8:	29 83       	std	Y+1, r18	; 0x01
    10da:	03 c0       	rjmp	.+6      	; 0x10e2 <I2C_Pulse_SCL_After_ACK+0x3a>
    10dc:	89 81       	ldd	r24, Y+1	; 0x01
    10de:	8f 5f       	subi	r24, 0xFF	; 255
    10e0:	89 83       	std	Y+1, r24	; 0x01
    10e2:	89 81       	ldd	r24, Y+1	; 0x01
    10e4:	8a 30       	cpi	r24, 0x0A	; 10
    10e6:	d0 f3       	brcs	.-12     	; 0x10dc <I2C_Pulse_SCL_After_ACK+0x34>
		{
		
				;
			
		}
		delay--;
    10e8:	91 50       	subi	r25, 0x01	; 1

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

	return 0;
}
    10ec:	80 e0       	ldi	r24, 0x00	; 0
    10ee:	0f 90       	pop	r0
    10f0:	cf 91       	pop	r28
    10f2:	df 91       	pop	r29
    10f4:	08 95       	ret

000010f6 <I2C_Send_Byte>:
 *
 * Returns:	1 if there was a timeout
 *			0 otherwise
 */
uint8_t I2C_Send_Byte(uint8_t data)
{
    10f6:	0f 93       	push	r16
    10f8:	1f 93       	push	r17
    10fa:	18 2f       	mov	r17, r24
	uint8_t i;

	
	if( data & 0x80)
    10fc:	87 ff       	sbrs	r24, 7
    10fe:	03 c0       	rjmp	.+6      	; 0x1106 <I2C_Send_Byte+0x10>
	{
		Set_High(SDA);
    1100:	81 e0       	ldi	r24, 0x01	; 1
    1102:	29 df       	rcall	.-430    	; 0xf56 <Set_High>
    1104:	02 c0       	rjmp	.+4      	; 0x110a <I2C_Send_Byte+0x14>
	}
	else
	{
		Set_Low(SDA);
    1106:	81 e0       	ldi	r24, 0x01	; 1
    1108:	54 df       	rcall	.-344    	; 0xfb2 <Set_Low>
	}
		
	if(I2C_Pulse_SCL_After_ACK())//ensure that the slave is not holding the SCL line to force us to wait
    110a:	ce df       	rcall	.-100    	; 0x10a8 <I2C_Pulse_SCL_After_ACK>
    110c:	88 23       	and	r24, r24
    110e:	11 f0       	breq	.+4      	; 0x1114 <I2C_Send_Byte+0x1e>
    1110:	81 e0       	ldi	r24, 0x01	; 1
    1112:	13 c0       	rjmp	.+38     	; 0x113a <I2C_Send_Byte+0x44>
	{
		return 1;
	}
	data <<= 1;//shift the next data bit up
    1114:	01 2f       	mov	r16, r17
    1116:	00 0f       	add	r16, r16
    1118:	11 e0       	ldi	r17, 0x01	; 1
	
	for(i = 1; i < 8; i++)//write out each data bit, MSB first
	{
		if( data & 0x80)
    111a:	07 ff       	sbrs	r16, 7
    111c:	03 c0       	rjmp	.+6      	; 0x1124 <I2C_Send_Byte+0x2e>
		{
			Set_High(SDA);
    111e:	81 e0       	ldi	r24, 0x01	; 1
    1120:	1a df       	rcall	.-460    	; 0xf56 <Set_High>
    1122:	02 c0       	rjmp	.+4      	; 0x1128 <I2C_Send_Byte+0x32>
		}
		else
		{
			Set_Low(SDA);
    1124:	81 e0       	ldi	r24, 0x01	; 1
    1126:	45 df       	rcall	.-374    	; 0xfb2 <Set_Low>
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SL line down
    1128:	5c df       	rcall	.-328    	; 0xfe2 <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
    112a:	1f 5f       	subi	r17, 0xFF	; 255
    112c:	18 30       	cpi	r17, 0x08	; 8
    112e:	11 f0       	breq	.+4      	; 0x1134 <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
    1130:	00 0f       	add	r16, r16
    1132:	f3 cf       	rjmp	.-26     	; 0x111a <I2C_Send_Byte+0x24>
	}

	Set_High(SDA);//release line
    1134:	81 e0       	ldi	r24, 0x01	; 1
    1136:	0f df       	rcall	.-482    	; 0xf56 <Set_High>
    1138:	80 e0       	ldi	r24, 0x00	; 0

	return 0;

}
    113a:	1f 91       	pop	r17
    113c:	0f 91       	pop	r16
    113e:	08 95       	ret

00001140 <I2C_Stop>:

/*
 * This function places a stop condition onto the I2C bus
 */
void I2C_Stop(void)
{
    1140:	df 93       	push	r29
    1142:	cf 93       	push	r28
    1144:	0f 92       	push	r0
    1146:	cd b7       	in	r28, 0x3d	; 61
    1148:	de b7       	in	r29, 0x3e	; 62
	
	Set_Low(SDA);
    114a:	81 e0       	ldi	r24, 0x01	; 1
    114c:	32 df       	rcall	.-412    	; 0xfb2 <Set_Low>
    114e:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1150:	21 e0       	ldi	r18, 0x01	; 1
    1152:	29 83       	std	Y+1, r18	; 0x01
    1154:	03 c0       	rjmp	.+6      	; 0x115c <I2C_Stop+0x1c>
    1156:	89 81       	ldd	r24, Y+1	; 0x01
    1158:	8f 5f       	subi	r24, 0xFF	; 255
    115a:	89 83       	std	Y+1, r24	; 0x01
    115c:	89 81       	ldd	r24, Y+1	; 0x01
    115e:	8a 30       	cpi	r24, 0x0A	; 10
    1160:	d0 f3       	brcs	.-12     	; 0x1156 <I2C_Stop+0x16>
		{
		
				;
			
		}
		delay--;
    1162:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1164:	b1 f7       	brne	.-20     	; 0x1152 <I2C_Stop+0x12>
void I2C_Stop(void)
{
	
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_High(SCL);
    1166:	80 e0       	ldi	r24, 0x00	; 0
    1168:	f6 de       	rcall	.-532    	; 0xf56 <Set_High>
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
    116a:	8d df       	rcall	.-230    	; 0x1086 <Wait_On_SCL_Low>
    116c:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    116e:	21 e0       	ldi	r18, 0x01	; 1
    1170:	29 83       	std	Y+1, r18	; 0x01
    1172:	03 c0       	rjmp	.+6      	; 0x117a <I2C_Stop+0x3a>
    1174:	89 81       	ldd	r24, Y+1	; 0x01
    1176:	8f 5f       	subi	r24, 0xFF	; 255
    1178:	89 83       	std	Y+1, r24	; 0x01
    117a:	89 81       	ldd	r24, Y+1	; 0x01
    117c:	8a 30       	cpi	r24, 0x0A	; 10
    117e:	d0 f3       	brcs	.-12     	; 0x1174 <I2C_Stop+0x34>
		{
		
				;
			
		}
		delay--;
    1180:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1182:	b1 f7       	brne	.-20     	; 0x1170 <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);
    1184:	81 e0       	ldi	r24, 0x01	; 1
    1186:	e7 de       	rcall	.-562    	; 0xf56 <Set_High>
    1188:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    118a:	21 e0       	ldi	r18, 0x01	; 1
    118c:	29 83       	std	Y+1, r18	; 0x01
    118e:	03 c0       	rjmp	.+6      	; 0x1196 <I2C_Stop+0x56>
    1190:	89 81       	ldd	r24, Y+1	; 0x01
    1192:	8f 5f       	subi	r24, 0xFF	; 255
    1194:	89 83       	std	Y+1, r24	; 0x01
    1196:	89 81       	ldd	r24, Y+1	; 0x01
    1198:	8a 30       	cpi	r24, 0x0A	; 10
    119a:	d0 f3       	brcs	.-12     	; 0x1190 <I2C_Stop+0x50>
		{
		
				;
			
		}
		delay--;
    119c:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    119e:	b1 f7       	brne	.-20     	; 0x118c <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);
}
    11a0:	0f 90       	pop	r0
    11a2:	cf 91       	pop	r28
    11a4:	df 91       	pop	r29
    11a6:	08 95       	ret

000011a8 <I2C_Pin_Value>:
	}
}


uint8_t I2C_Pin_Value(uint8_t x)
{
    11a8:	90 91 19 01 	lds	r25, 0x0119
    11ac:	92 33       	cpi	r25, 0x32	; 50
    11ae:	59 f0       	breq	.+22     	; 0x11c6 <I2C_Pin_Value+0x1e>
    11b0:	93 33       	cpi	r25, 0x33	; 51
    11b2:	89 f0       	breq	.+34     	; 0x11d6 <I2C_Pin_Value+0x2e>
    11b4:	91 33       	cpi	r25, 0x31	; 49
    11b6:	11 f0       	breq	.+4      	; 0x11bc <I2C_Pin_Value+0x14>
    11b8:	80 e0       	ldi	r24, 0x00	; 0
    11ba:	08 95       	ret
	switch(I2C_Port)
	{
		case '1'://to molex
			if(x == SCL)
    11bc:	88 23       	and	r24, r24
    11be:	41 f0       	breq	.+16     	; 0x11d0 <I2C_Pin_Value+0x28>
			{
				return (PIND & (1<<5));
			}
			else
			{
				return (PIND & (1<<6));
    11c0:	89 b1       	in	r24, 0x09	; 9
    11c2:	80 74       	andi	r24, 0x40	; 64
    11c4:	08 95       	ret
			}
			break;
		case '2'://to pins
			if(x == SCL)
    11c6:	88 23       	and	r24, r24
    11c8:	19 f4       	brne	.+6      	; 0x11d0 <I2C_Pin_Value+0x28>
			{
				return (PIND & (1<<4));
    11ca:	89 b1       	in	r24, 0x09	; 9
    11cc:	80 71       	andi	r24, 0x10	; 16
    11ce:	08 95       	ret
			}
			else
			{
				return (PIND & (1<<5));
    11d0:	89 b1       	in	r24, 0x09	; 9
    11d2:	80 72       	andi	r24, 0x20	; 32
    11d4:	08 95       	ret
			}
			break;
		case '3'://to motor
			if(x == SCL)
    11d6:	88 23       	and	r24, r24
    11d8:	19 f4       	brne	.+6      	; 0x11e0 <I2C_Pin_Value+0x38>
			{
				return (PINB & (1<<3));
    11da:	83 b1       	in	r24, 0x03	; 3
    11dc:	88 70       	andi	r24, 0x08	; 8
    11de:	08 95       	ret
			}
			else
			{
				return (PINB & (1<<0));
    11e0:	83 b1       	in	r24, 0x03	; 3
    11e2:	81 70       	andi	r24, 0x01	; 1
			}
			break;
	}
	return 0;
}
    11e4:	08 95       	ret

000011e6 <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)
{
    11e6:	0f 93       	push	r16
    11e8:	1f 93       	push	r17
    11ea:	df 93       	push	r29
    11ec:	cf 93       	push	r28
    11ee:	0f 92       	push	r0
    11f0:	cd b7       	in	r28, 0x3d	; 61
    11f2:	de b7       	in	r29, 0x3e	; 62
	uint8_t i;
	uint8_t received = 0x00;
	
	Set_High(SCL);
    11f4:	80 e0       	ldi	r24, 0x00	; 0
    11f6:	af de       	rcall	.-674    	; 0xf56 <Set_High>
	
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
    11f8:	46 df       	rcall	.-372    	; 0x1086 <Wait_On_SCL_Low>
    11fa:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    11fc:	21 e0       	ldi	r18, 0x01	; 1
    11fe:	29 83       	std	Y+1, r18	; 0x01
    1200:	03 c0       	rjmp	.+6      	; 0x1208 <I2C_Receive_Byte+0x22>
    1202:	89 81       	ldd	r24, Y+1	; 0x01
    1204:	8f 5f       	subi	r24, 0xFF	; 255
    1206:	89 83       	std	Y+1, r24	; 0x01
    1208:	89 81       	ldd	r24, Y+1	; 0x01
    120a:	8a 30       	cpi	r24, 0x0A	; 10
    120c:	d0 f3       	brcs	.-12     	; 0x1202 <I2C_Receive_Byte+0x1c>
		{
		
				;
			
		}
		delay--;
    120e:	91 50       	subi	r25, 0x01	; 1

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

	//  Delay
	Delay(I2C_PERIOD);

	if(I2C_Pin_Value(SDA))
    1212:	81 e0       	ldi	r24, 0x01	; 1
    1214:	c9 df       	rcall	.-110    	; 0x11a8 <I2C_Pin_Value>
    1216:	18 2f       	mov	r17, r24
	{
		received |= 1;//append 1 to our databyte
	}
	// Set SCL Low
	Set_Low(SCL);
    1218:	80 e0       	ldi	r24, 0x00	; 0
    121a:	cb de       	rcall	.-618    	; 0xfb2 <Set_Low>
    121c:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    121e:	21 e0       	ldi	r18, 0x01	; 1
    1220:	29 83       	std	Y+1, r18	; 0x01
    1222:	03 c0       	rjmp	.+6      	; 0x122a <I2C_Receive_Byte+0x44>
    1224:	89 81       	ldd	r24, Y+1	; 0x01
    1226:	8f 5f       	subi	r24, 0xFF	; 255
    1228:	89 83       	std	Y+1, r24	; 0x01
    122a:	89 81       	ldd	r24, Y+1	; 0x01
    122c:	8a 30       	cpi	r24, 0x0A	; 10
    122e:	d0 f3       	brcs	.-12     	; 0x1224 <I2C_Receive_Byte+0x3e>
		{
		
				;
			
		}
		delay--;
    1230:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1232:	b1 f7       	brne	.-20     	; 0x1220 <I2C_Receive_Byte+0x3a>
    1234:	81 2f       	mov	r24, r17
    1236:	11 11       	cpse	r17, r1
    1238:	81 e0       	ldi	r24, 0x01	; 1
    123a:	18 2f       	mov	r17, r24
    123c:	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
    123e:	11 0f       	add	r17, r17
		if(I2C_Pin_Value(SDA))
    1240:	81 e0       	ldi	r24, 0x01	; 1
    1242:	b2 df       	rcall	.-156    	; 0x11a8 <I2C_Pin_Value>
    1244:	81 11       	cpse	r24, r1
		{
			received |= 1;//append 1 to our databyte
    1246:	11 60       	ori	r17, 0x01	; 1
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SCL line down
    1248:	cc de       	rcall	.-616    	; 0xfe2 <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
    124a:	0f 5f       	subi	r16, 0xFF	; 255
    124c:	08 30       	cpi	r16, 0x08	; 8
    124e:	b9 f7       	brne	.-18     	; 0x123e <I2C_Receive_Byte+0x58>
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SCL line down
	}

	return received;

}
    1250:	81 2f       	mov	r24, r17
    1252:	0f 90       	pop	r0
    1254:	cf 91       	pop	r28
    1256:	df 91       	pop	r29
    1258:	1f 91       	pop	r17
    125a:	0f 91       	pop	r16
    125c:	08 95       	ret

0000125e <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)
{
    125e:	1f 93       	push	r17
    1260:	df 93       	push	r29
    1262:	cf 93       	push	r28
    1264:	0f 92       	push	r0
    1266:	cd b7       	in	r28, 0x3d	; 61
    1268:	de b7       	in	r29, 0x3e	; 62
	uint8_t value = ACK;	
	
	//  Set SCL high
	Set_High(SCL);
    126a:	80 e0       	ldi	r24, 0x00	; 0
    126c:	74 de       	rcall	.-792    	; 0xf56 <Set_High>
    126e:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1270:	21 e0       	ldi	r18, 0x01	; 1
    1272:	29 83       	std	Y+1, r18	; 0x01
    1274:	03 c0       	rjmp	.+6      	; 0x127c <I2C_Get_ACK+0x1e>
    1276:	89 81       	ldd	r24, Y+1	; 0x01
    1278:	8f 5f       	subi	r24, 0xFF	; 255
    127a:	89 83       	std	Y+1, r24	; 0x01
    127c:	89 81       	ldd	r24, Y+1	; 0x01
    127e:	8a 30       	cpi	r24, 0x0A	; 10
    1280:	d0 f3       	brcs	.-12     	; 0x1276 <I2C_Get_ACK+0x18>
		{
		
				;
			
		}
		delay--;
    1282:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1284:	b1 f7       	brne	.-20     	; 0x1272 <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)
    1286:	81 e0       	ldi	r24, 0x01	; 1
    1288:	8f df       	rcall	.-226    	; 0x11a8 <I2C_Pin_Value>
    128a:	18 2f       	mov	r17, r24
		value = NACK;
	}
	
	
	// Set SCL Low
	Set_Low(SCL);
    128c:	80 e0       	ldi	r24, 0x00	; 0
    128e:	91 de       	rcall	.-734    	; 0xfb2 <Set_Low>
    1290:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1292:	21 e0       	ldi	r18, 0x01	; 1
    1294:	29 83       	std	Y+1, r18	; 0x01
    1296:	03 c0       	rjmp	.+6      	; 0x129e <I2C_Get_ACK+0x40>
    1298:	89 81       	ldd	r24, Y+1	; 0x01
    129a:	8f 5f       	subi	r24, 0xFF	; 255
    129c:	89 83       	std	Y+1, r24	; 0x01
    129e:	89 81       	ldd	r24, Y+1	; 0x01
    12a0:	8a 30       	cpi	r24, 0x0A	; 10
    12a2:	d0 f3       	brcs	.-12     	; 0x1298 <I2C_Get_ACK+0x3a>
		{
		
				;
			
		}
		delay--;
    12a4:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    12a6:	b1 f7       	brne	.-20     	; 0x1294 <I2C_Get_ACK+0x36>
    12a8:	81 2f       	mov	r24, r17
    12aa:	11 11       	cpse	r17, r1
    12ac:	81 e0       	ldi	r24, 0x01	; 1
	
	Delay(I2C_PERIOD);	

	
	return value;
}
    12ae:	0f 90       	pop	r0
    12b0:	cf 91       	pop	r28
    12b2:	df 91       	pop	r29
    12b4:	1f 91       	pop	r17
    12b6:	08 95       	ret

000012b8 <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)
{
    12b8:	cf 92       	push	r12
    12ba:	df 92       	push	r13
    12bc:	ef 92       	push	r14
    12be:	ff 92       	push	r15
    12c0:	0f 93       	push	r16
    12c2:	1f 93       	push	r17
    12c4:	cf 93       	push	r28
    12c6:	df 93       	push	r29
    12c8:	18 2f       	mov	r17, r24
    12ca:	6b 01       	movw	r12, r22
    12cc:	7a 01       	movw	r14, r20
	uint16_t i;

	I2C_Start();//place a start condition on the I2C lines
    12ce:	b1 de       	rcall	.-670    	; 0x1032 <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
    12d0:	11 0f       	add	r17, r17
    12d2:	81 2f       	mov	r24, r17
    12d4:	81 60       	ori	r24, 0x01	; 1
    12d6:	0f df       	rcall	.-482    	; 0x10f6 <I2C_Send_Byte>
    12d8:	88 23       	and	r24, r24
    12da:	49 f4       	brne	.+18     	; 0x12ee <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
    12dc:	c0 df       	rcall	.-128    	; 0x125e <I2C_Get_ACK>
    12de:	81 30       	cpi	r24, 0x01	; 1
    12e0:	31 f0       	breq	.+12     	; 0x12ee <I2C_Read+0x36>
    12e2:	c0 e0       	ldi	r28, 0x00	; 0
    12e4:	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
    12e6:	87 01       	movw	r16, r14
    12e8:	01 50       	subi	r16, 0x01	; 1
    12ea:	10 40       	sbci	r17, 0x00	; 0
    12ec:	0f c0       	rjmp	.+30     	; 0x130c <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
    12ee:	28 df       	rcall	.-432    	; 0x1140 <I2C_Stop>
    12f0:	80 e0       	ldi	r24, 0x00	; 0
    12f2:	11 c0       	rjmp	.+34     	; 0x1316 <I2C_Read+0x5e>
	}
	
	//read the data
	for(i = 0; i < lenght; i++)
	{
		data[i] = I2C_Receive_Byte();
    12f4:	78 df       	rcall	.-272    	; 0x11e6 <I2C_Receive_Byte>
    12f6:	f6 01       	movw	r30, r12
    12f8:	ec 0f       	add	r30, r28
    12fa:	fd 1f       	adc	r31, r29
    12fc:	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
    12fe:	c0 17       	cp	r28, r16
    1300:	d1 07       	cpc	r29, r17
    1302:	10 f4       	brcc	.+4      	; 0x1308 <I2C_Read+0x50>
		{
			I2C_Send_ACK();	
    1304:	bb de       	rcall	.-650    	; 0x107c <I2C_Send_ACK>
    1306:	01 c0       	rjmp	.+2      	; 0x130a <I2C_Read+0x52>
		}
		else
		{
			I2C_Send_NACK();//Nack the last byte
    1308:	91 de       	rcall	.-734    	; 0x102c <I2C_Send_NACK>
		return 0;
		
	}
	
	//read the data
	for(i = 0; i < lenght; i++)
    130a:	21 96       	adiw	r28, 0x01	; 1
    130c:	ce 15       	cp	r28, r14
    130e:	df 05       	cpc	r29, r15
    1310:	88 f3       	brcs	.-30     	; 0x12f4 <I2C_Read+0x3c>
		{
			I2C_Send_NACK();//Nack the last byte
		}
	}

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

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

}
    1316:	df 91       	pop	r29
    1318:	cf 91       	pop	r28
    131a:	1f 91       	pop	r17
    131c:	0f 91       	pop	r16
    131e:	ff 90       	pop	r15
    1320:	ef 90       	pop	r14
    1322:	df 90       	pop	r13
    1324:	cf 90       	pop	r12
    1326:	08 95       	ret

00001328 <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)
{
    1328:	cf 92       	push	r12
    132a:	df 92       	push	r13
    132c:	ef 92       	push	r14
    132e:	ff 92       	push	r15
    1330:	1f 93       	push	r17
    1332:	cf 93       	push	r28
    1334:	df 93       	push	r29
    1336:	18 2f       	mov	r17, r24
    1338:	6b 01       	movw	r12, r22
    133a:	7a 01       	movw	r14, r20
	uint16_t i;

	I2C_Start();//place a start condition on the I2C lines
    133c:	7a de       	rcall	.-780    	; 0x1032 <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
    133e:	81 2f       	mov	r24, r17
    1340:	88 0f       	add	r24, r24
    1342:	d9 de       	rcall	.-590    	; 0x10f6 <I2C_Send_Byte>
    1344:	88 23       	and	r24, r24
    1346:	69 f4       	brne	.+26     	; 0x1362 <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
    1348:	8a df       	rcall	.-236    	; 0x125e <I2C_Get_ACK>
    134a:	81 30       	cpi	r24, 0x01	; 1
    134c:	51 f0       	breq	.+20     	; 0x1362 <I2C_Write+0x3a>
    134e:	c0 e0       	ldi	r28, 0x00	; 0
    1350:	d0 e0       	ldi	r29, 0x00	; 0
    1352:	13 c0       	rjmp	.+38     	; 0x137a <I2C_Write+0x52>
	}
	
	//send the data
	for(i = 0; i < lenght; i++)
	{
		if( I2C_Send_Byte(data[i]) )
    1354:	f6 01       	movw	r30, r12
    1356:	ec 0f       	add	r30, r28
    1358:	fd 1f       	adc	r31, r29
    135a:	80 81       	ld	r24, Z
    135c:	cc de       	rcall	.-616    	; 0x10f6 <I2C_Send_Byte>
    135e:	88 23       	and	r24, r24
    1360:	19 f0       	breq	.+6      	; 0x1368 <I2C_Write+0x40>
		{
			I2C_Stop();//release the lines
    1362:	ee de       	rcall	.-548    	; 0x1140 <I2C_Stop>
    1364:	80 e0       	ldi	r24, 0x00	; 0
    1366:	0e c0       	rjmp	.+28     	; 0x1384 <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
    1368:	7a df       	rcall	.-268    	; 0x125e <I2C_Get_ACK>
    136a:	81 30       	cpi	r24, 0x01	; 1
    136c:	29 f4       	brne	.+10     	; 0x1378 <I2C_Write+0x50>
		{
			I2C_Stop();//release the lines
    136e:	e8 de       	rcall	.-560    	; 0x1140 <I2C_Stop>
			return i+1;
    1370:	9e 01       	movw	r18, r28
    1372:	2f 5f       	subi	r18, 0xFF	; 255
    1374:	82 2f       	mov	r24, r18
    1376:	06 c0       	rjmp	.+12     	; 0x1384 <I2C_Write+0x5c>
		return 0;
		
	}
	
	//send the data
	for(i = 0; i < lenght; i++)
    1378:	21 96       	adiw	r28, 0x01	; 1
    137a:	ce 15       	cp	r28, r14
    137c:	df 05       	cpc	r29, r15
    137e:	50 f3       	brcs	.-44     	; 0x1354 <I2C_Write+0x2c>
			return i+1;
		
		}
	}

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

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

}
    1384:	df 91       	pop	r29
    1386:	cf 91       	pop	r28
    1388:	1f 91       	pop	r17
    138a:	ff 90       	pop	r15
    138c:	ef 90       	pop	r14
    138e:	df 90       	pop	r13
    1390:	cf 90       	pop	r12
    1392:	08 95       	ret

00001394 <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)
{
    1394:	85 b1       	in	r24, 0x05	; 5
    1396:	80 7c       	andi	r24, 0xC0	; 192
    1398:	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) );
    139a:	84 b1       	in	r24, 0x04	; 4
    139c:	8f 63       	ori	r24, 0x3F	; 63
    139e:	84 b9       	out	0x04, r24	; 4

}
    13a0:	08 95       	ret

000013a2 <StartCodition>:


void StartCodition(uint8_t step, uint8_t dir)
{
    13a2:	95 b1       	in	r25, 0x05	; 5
    13a4:	21 e0       	ldi	r18, 0x01	; 1
    13a6:	30 e0       	ldi	r19, 0x00	; 0
    13a8:	a9 01       	movw	r20, r18
    13aa:	02 c0       	rjmp	.+4      	; 0x13b0 <StartCodition+0xe>
    13ac:	44 0f       	add	r20, r20
    13ae:	55 1f       	adc	r21, r21
    13b0:	6a 95       	dec	r22
    13b2:	e2 f7       	brpl	.-8      	; 0x13ac <StartCodition+0xa>
    13b4:	ba 01       	movw	r22, r20
    13b6:	94 2b       	or	r25, r20
    13b8:	95 b9       	out	0x05, r25	; 5
	Set_High(dir);
	Set_High(step);
    13ba:	95 b1       	in	r25, 0x05	; 5
    13bc:	02 c0       	rjmp	.+4      	; 0x13c2 <StartCodition+0x20>
    13be:	22 0f       	add	r18, r18
    13c0:	33 1f       	adc	r19, r19
    13c2:	8a 95       	dec	r24
    13c4:	e2 f7       	brpl	.-8      	; 0x13be <StartCodition+0x1c>
    13c6:	92 2b       	or	r25, r18
    13c8:	95 b9       	out	0x05, r25	; 5
	DelayUsec();
    13ca:	00 00       	nop
    13cc:	00 00       	nop
    13ce:	00 00       	nop
    13d0:	00 00       	nop
    13d2:	00 00       	nop
    13d4:	00 00       	nop
    13d6:	00 00       	nop
    13d8:	00 00       	nop
	DelayUsec();
    13da:	00 00       	nop
    13dc:	00 00       	nop
    13de:	00 00       	nop
    13e0:	00 00       	nop
    13e2:	00 00       	nop
    13e4:	00 00       	nop
    13e6:	00 00       	nop
    13e8:	00 00       	nop
	DelayUsec();
    13ea:	00 00       	nop
    13ec:	00 00       	nop
    13ee:	00 00       	nop
    13f0:	00 00       	nop
    13f2:	00 00       	nop
    13f4:	00 00       	nop
    13f6:	00 00       	nop
    13f8:	00 00       	nop
	DelayUsec();
    13fa:	00 00       	nop
    13fc:	00 00       	nop
    13fe:	00 00       	nop
    1400:	00 00       	nop
    1402:	00 00       	nop
    1404:	00 00       	nop
    1406:	00 00       	nop
    1408:	00 00       	nop
	DelayUsec();
    140a:	00 00       	nop
    140c:	00 00       	nop
    140e:	00 00       	nop
    1410:	00 00       	nop
    1412:	00 00       	nop
    1414:	00 00       	nop
    1416:	00 00       	nop
    1418:	00 00       	nop
	Set_Low(dir);
    141a:	85 b1       	in	r24, 0x05	; 5
    141c:	60 95       	com	r22
    141e:	68 23       	and	r22, r24
    1420:	65 b9       	out	0x05, r22	; 5
	DelayUsec();
    1422:	00 00       	nop
    1424:	00 00       	nop
    1426:	00 00       	nop
    1428:	00 00       	nop
    142a:	00 00       	nop
    142c:	00 00       	nop
    142e:	00 00       	nop
    1430:	00 00       	nop
}
    1432:	08 95       	ret

00001434 <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)
{
    1434:	ff 92       	push	r15
    1436:	0f 93       	push	r16
    1438:	1f 93       	push	r17
    143a:	f8 2e       	mov	r15, r24
	uint8_t axisdir,axisstep;
	uint8_t i;
	
	switch(axisselect)
    143c:	61 30       	cpi	r22, 0x01	; 1
    143e:	29 f0       	breq	.+10     	; 0x144a <SendByte+0x16>
    1440:	62 30       	cpi	r22, 0x02	; 2
    1442:	31 f4       	brne	.+12     	; 0x1450 <SendByte+0x1c>
    1444:	02 e0       	ldi	r16, 0x02	; 2
    1446:	11 e0       	ldi	r17, 0x01	; 1
    1448:	05 c0       	rjmp	.+10     	; 0x1454 <SendByte+0x20>
    144a:	00 e0       	ldi	r16, 0x00	; 0
    144c:	13 e0       	ldi	r17, 0x03	; 3
    144e:	02 c0       	rjmp	.+4      	; 0x1454 <SendByte+0x20>
    1450:	04 e0       	ldi	r16, 0x04	; 4
    1452:	15 e0       	ldi	r17, 0x05	; 5
			break;
	}		
	


	StartCodition(axisstep,axisdir);
    1454:	60 2f       	mov	r22, r16
    1456:	81 2f       	mov	r24, r17
    1458:	a4 df       	rcall	.-184    	; 0x13a2 <StartCodition>
	
	for(i=0; i<8; i++)
	{
		Set_Low(axisstep);
    145a:	81 e0       	ldi	r24, 0x01	; 1
    145c:	90 e0       	ldi	r25, 0x00	; 0
    145e:	38 2f       	mov	r19, r24
    1460:	01 c0       	rjmp	.+2      	; 0x1464 <SendByte+0x30>
    1462:	33 0f       	add	r19, r19
    1464:	1a 95       	dec	r17
    1466:	ea f7       	brpl	.-6      	; 0x1462 <SendByte+0x2e>
    1468:	93 2f       	mov	r25, r19
    146a:	90 95       	com	r25
		DelayUsec();
		DelayUsec();

		if(inchar&0x01)
		{
			Set_High(axisdir);
    146c:	68 2f       	mov	r22, r24
    146e:	01 c0       	rjmp	.+2      	; 0x1472 <SendByte+0x3e>
    1470:	66 0f       	add	r22, r22
    1472:	0a 95       	dec	r16
    1474:	ea f7       	brpl	.-6      	; 0x1470 <SendByte+0x3c>
		}
		else
		{
			Set_Low(axisdir);
    1476:	46 2f       	mov	r20, r22
    1478:	40 95       	com	r20
    147a:	20 e0       	ldi	r18, 0x00	; 0

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

		DelayUsec();//may be better to move this delay to after we modify 
    1482:	00 00       	nop
    1484:	00 00       	nop
    1486:	00 00       	nop
    1488:	00 00       	nop
    148a:	00 00       	nop
    148c:	00 00       	nop
    148e:	00 00       	nop
    1490:	00 00       	nop
		DelayUsec();
    1492:	00 00       	nop
    1494:	00 00       	nop
    1496:	00 00       	nop
    1498:	00 00       	nop
    149a:	00 00       	nop
    149c:	00 00       	nop
    149e:	00 00       	nop
    14a0:	00 00       	nop
		DelayUsec();
    14a2:	00 00       	nop
    14a4:	00 00       	nop
    14a6:	00 00       	nop
    14a8:	00 00       	nop
    14aa:	00 00       	nop
    14ac:	00 00       	nop
    14ae:	00 00       	nop
    14b0:	00 00       	nop
		DelayUsec();
    14b2:	00 00       	nop
    14b4:	00 00       	nop
    14b6:	00 00       	nop
    14b8:	00 00       	nop
    14ba:	00 00       	nop
    14bc:	00 00       	nop
    14be:	00 00       	nop
    14c0:	00 00       	nop
		DelayUsec();
    14c2:	00 00       	nop
    14c4:	00 00       	nop
    14c6:	00 00       	nop
    14c8:	00 00       	nop
    14ca:	00 00       	nop
    14cc:	00 00       	nop
    14ce:	00 00       	nop
    14d0:	00 00       	nop

		if(inchar&0x01)
    14d2:	f0 fe       	sbrs	r15, 0
    14d4:	03 c0       	rjmp	.+6      	; 0x14dc <SendByte+0xa8>
		{
			Set_High(axisdir);
    14d6:	85 b1       	in	r24, 0x05	; 5
    14d8:	86 2b       	or	r24, r22
    14da:	02 c0       	rjmp	.+4      	; 0x14e0 <SendByte+0xac>
		}
		else
		{
			Set_Low(axisdir);
    14dc:	85 b1       	in	r24, 0x05	; 5
    14de:	84 23       	and	r24, r20
    14e0:	85 b9       	out	0x05, r24	; 5
		}

		Set_High(axisstep);
    14e2:	85 b1       	in	r24, 0x05	; 5
    14e4:	83 2b       	or	r24, r19
    14e6:	85 b9       	out	0x05, r24	; 5

		DelayUsec();
    14e8:	00 00       	nop
    14ea:	00 00       	nop
    14ec:	00 00       	nop
    14ee:	00 00       	nop
    14f0:	00 00       	nop
    14f2:	00 00       	nop
    14f4:	00 00       	nop
    14f6:	00 00       	nop
		DelayUsec();
    14f8:	00 00       	nop
    14fa:	00 00       	nop
    14fc:	00 00       	nop
    14fe:	00 00       	nop
    1500:	00 00       	nop
    1502:	00 00       	nop
    1504:	00 00       	nop
    1506:	00 00       	nop
		DelayUsec();
    1508:	00 00       	nop
    150a:	00 00       	nop
    150c:	00 00       	nop
    150e:	00 00       	nop
    1510:	00 00       	nop
    1512:	00 00       	nop
    1514:	00 00       	nop
    1516:	00 00       	nop
		DelayUsec();
    1518:	00 00       	nop
    151a:	00 00       	nop
    151c:	00 00       	nop
    151e:	00 00       	nop
    1520:	00 00       	nop
    1522:	00 00       	nop
    1524:	00 00       	nop
    1526:	00 00       	nop
		DelayUsec();
    1528:	00 00       	nop
    152a:	00 00       	nop
    152c:	00 00       	nop
    152e:	00 00       	nop
    1530:	00 00       	nop
    1532:	00 00       	nop
    1534:	00 00       	nop
    1536:	00 00       	nop
	


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

	Set_Low(axisstep);
    1542:	85 b1       	in	r24, 0x05	; 5
    1544:	98 23       	and	r25, r24
    1546:	95 b9       	out	0x05, r25	; 5
}
    1548:	1f 91       	pop	r17
    154a:	0f 91       	pop	r16
    154c:	ff 90       	pop	r15
    154e:	08 95       	ret

00001550 <Scheduler_SetTaskMode>:
	
	return false;
}

void Scheduler_SetTaskMode(const TaskPtr_t Task, const bool TaskStatus)
{
    1550:	9c 01       	movw	r18, r24
    1552:	e2 e0       	ldi	r30, 0x02	; 2
    1554:	f1 e0       	ldi	r31, 0x01	; 1
    1556:	08 c0       	rjmp	.+16     	; 0x1568 <Scheduler_SetTaskMode+0x18>
	TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
	while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
	{
		if (CurrTask->Task == Task)
    1558:	80 81       	ld	r24, Z
    155a:	91 81       	ldd	r25, Z+1	; 0x01
    155c:	82 17       	cp	r24, r18
    155e:	93 07       	cpc	r25, r19
    1560:	11 f4       	brne	.+4      	; 0x1566 <Scheduler_SetTaskMode+0x16>
		{
			CurrTask->TaskStatus = TaskStatus;
    1562:	62 83       	std	Z+2, r22	; 0x02
    1564:	08 95       	ret
			break;
		}
		
		CurrTask++;
    1566:	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])
    1568:	80 91 bf 01 	lds	r24, 0x01BF
    156c:	90 e0       	ldi	r25, 0x00	; 0
    156e:	88 0f       	add	r24, r24
    1570:	99 1f       	adc	r25, r25
    1572:	88 0f       	add	r24, r24
    1574:	99 1f       	adc	r25, r25
    1576:	8e 5f       	subi	r24, 0xFE	; 254
    1578:	9e 4f       	sbci	r25, 0xFE	; 254
    157a:	e8 17       	cp	r30, r24
    157c:	f9 07       	cpc	r31, r25
    157e:	61 f7       	brne	.-40     	; 0x1558 <Scheduler_SetTaskMode+0x8>
    1580:	08 95       	ret

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

void USB_SetupInterface(void)
{
    1582:	df 93       	push	r29
    1584:	cf 93       	push	r28
    1586:	00 d0       	rcall	.+0      	; 0x1588 <USB_SetupInterface+0x6>
    1588:	00 d0       	rcall	.+0      	; 0x158a <USB_SetupInterface+0x8>
    158a:	cd b7       	in	r28, 0x3d	; 61
    158c:	de b7       	in	r29, 0x3e	; 62
	USB_INT_DisableAllInterrupts();
    158e:	dc d2       	rcall	.+1464   	; 0x1b48 <USB_INT_DisableAllInterrupts>
	USB_INT_ClearAllInterrupts();
    1590:	de d2       	rcall	.+1468   	; 0x1b4e <USB_INT_ClearAllInterrupts>

	USB_IsConnected         = false;
    1592:	10 92 c6 01 	sts	0x01C6, r1
	#if defined(USB_CAN_BE_HOST)
	USB_HostState           = HOST_STATE_Unattached;
	#endif

	#if defined(USB_CAN_BE_DEVICE)
	USB_ConfigurationNumber  = 0;
    1596:	10 92 c4 01 	sts	0x01C4, r1
	USB_RemoteWakeupEnabled  = false;
    159a:	10 92 c3 01 	sts	0x01C3, r1
	USB_CurrentlySelfPowered = false;
    159e:	10 92 c2 01 	sts	0x01C2, 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();
    15a2:	84 e0       	ldi	r24, 0x04	; 4
    15a4:	89 bd       	out	0x29, r24	; 41
    15a6:	89 b5       	in	r24, 0x29	; 41
    15a8:	82 60       	ori	r24, 0x02	; 2
    15aa:	89 bd       	out	0x29, r24	; 41
	#endif

	while (!(USB_PLL_IsReady()));
    15ac:	09 b4       	in	r0, 0x29	; 41
    15ae:	00 fe       	sbrs	r0, 0
    15b0:	fd cf       	rjmp	.-6      	; 0x15ac <USB_SetupInterface+0x2a>
		
	USB_Interface_Reset();
    15b2:	80 91 d8 00 	lds	r24, 0x00D8
    15b6:	98 2f       	mov	r25, r24
    15b8:	9f 77       	andi	r25, 0x7F	; 127
    15ba:	90 93 d8 00 	sts	0x00D8, r25
    15be:	80 68       	ori	r24, 0x80	; 128
    15c0:	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();
    15c4:	80 91 63 00 	lds	r24, 0x0063
    15c8:	8e 7f       	andi	r24, 0xFE	; 254
    15ca:	80 93 63 00 	sts	0x0063, r24
	
	USB_CLK_Unfreeze();
    15ce:	80 91 d8 00 	lds	r24, 0x00D8
    15d2:	8f 7d       	andi	r24, 0xDF	; 223
    15d4:	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)
    15d8:	9e 01       	movw	r18, r28
    15da:	2d 5f       	subi	r18, 0xFD	; 253
    15dc:	3f 4f       	sbci	r19, 0xFF	; 255
    15de:	ae 01       	movw	r20, r28
    15e0:	4f 5f       	subi	r20, 0xFF	; 255
    15e2:	5f 4f       	sbci	r21, 0xFF	; 255
    15e4:	60 e0       	ldi	r22, 0x00	; 0
    15e6:	80 e0       	ldi	r24, 0x00	; 0
    15e8:	91 e0       	ldi	r25, 0x01	; 1
    15ea:	aa db       	rcall	.-2220   	; 0xd40 <USB_GetDescriptor>
    15ec:	88 23       	and	r24, r24
    15ee:	31 f0       	breq	.+12     	; 0x15fc <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);
    15f0:	e9 81       	ldd	r30, Y+1	; 0x01
    15f2:	fa 81       	ldd	r31, Y+2	; 0x02
    15f4:	37 96       	adiw	r30, 0x07	; 7
    15f6:	e4 91       	lpm	r30, Z+
    15f8:	e0 93 1a 01 	sts	0x011A, r30
		#endif
	}
	#endif

	USB_Attach();
    15fc:	80 91 e0 00 	lds	r24, 0x00E0
    1600:	8e 7f       	andi	r24, 0xFE	; 254
    1602:	80 93 e0 00 	sts	0x00E0, r24
	
	#if defined(USB_DEVICE_ONLY)	
	USB_INT_Enable(USB_INT_SUSPEND);
    1606:	80 91 e2 00 	lds	r24, 0x00E2
    160a:	81 60       	ori	r24, 0x01	; 1
    160c:	80 93 e2 00 	sts	0x00E2, r24
	USB_INT_Enable(USB_INT_EORSTI);	
    1610:	80 91 e2 00 	lds	r24, 0x00E2
    1614:	88 60       	ori	r24, 0x08	; 8
    1616:	80 93 e2 00 	sts	0x00E2, r24
	#endif
	
	#if defined(USB_CAN_BE_BOTH)
	USB_InitTaskPointer();
	#endif
}
    161a:	0f 90       	pop	r0
    161c:	0f 90       	pop	r0
    161e:	0f 90       	pop	r0
    1620:	0f 90       	pop	r0
    1622:	cf 91       	pop	r28
    1624:	df 91       	pop	r29
    1626:	08 95       	ret

00001628 <USB_ShutDown>:
	
	sei();
}

void USB_ShutDown(void)
{
    1628:	80 91 c6 01 	lds	r24, 0x01C6
    162c:	88 23       	and	r24, r24
    162e:	09 f0       	breq	.+2      	; 0x1632 <USB_ShutDown+0xa>
	if (USB_IsConnected)
	  RAISE_EVENT(USB_Disconnect);
    1630:	2a d8       	rcall	.-4012   	; 0x686 <Event_USB_Disconnect>

	USB_INT_DisableAllInterrupts();
    1632:	8a d2       	rcall	.+1300   	; 0x1b48 <USB_INT_DisableAllInterrupts>
	USB_INT_ClearAllInterrupts();
    1634:	8c d2       	rcall	.+1304   	; 0x1b4e <USB_INT_ClearAllInterrupts>

	USB_IsConnected         = false;
    1636:	10 92 c6 01 	sts	0x01C6, r1
	USB_IsInitialized       = false;
    163a:	10 92 c5 01 	sts	0x01C5, r1
	#if defined(USB_CAN_BE_HOST)
	USB_HostState           = HOST_STATE_Unattached;
	#endif

	#if defined(USB_CAN_BE_DEVICE)
	USB_ConfigurationNumber = 0;
    163e:	10 92 c4 01 	sts	0x01C4, r1
	
	#if !defined(USE_STATIC_OPTIONS)
	USB_Options     = 0;
	#endif

	USB_Interface_Disable();
    1642:	80 91 d8 00 	lds	r24, 0x00D8
    1646:	8f 77       	andi	r24, 0x7F	; 127
    1648:	80 93 d8 00 	sts	0x00D8, r24
	USB_PLL_Off();
    164c:	19 bc       	out	0x29, r1	; 41
	#endif

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

00001650 <USB_Init>:
			   
               #if !defined(USE_STATIC_OPTIONS)
               const uint8_t Options
               #endif
               )
{
    1650:	80 91 c5 01 	lds	r24, 0x01C5
    1654:	88 23       	and	r24, r24
    1656:	09 f0       	breq	.+2      	; 0x165a <USB_Init+0xa>
	if (USB_IsInitialized)
	  USB_ShutDown();
    1658:	e7 df       	rcall	.-50     	; 0x1628 <USB_ShutDown>
	#endif

	#if defined(USB_CAN_BE_BOTH)
	USB_InitTaskPointer();
	#else
	USB_IsInitialized = true;
    165a:	81 e0       	ldi	r24, 0x01	; 1
    165c:	80 93 c5 01 	sts	0x01C5, 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();
    1660:	90 df       	rcall	.-224    	; 0x1582 <USB_SetupInterface>
	  USB_INT_Enable(USB_INT_VBUS);
	else
	  USB_SetupInterface();
	#endif
	
	sei();
    1662:	78 94       	sei
}
    1664:	08 95       	ret

00001666 <Endpoint_ConfigureEndpoint_P>:

void Endpoint_ConfigureEndpoint_P(const uint8_t  EndpointNum,
                                  const uint16_t EndpointSize,
                                  const uint8_t  UECFG0Xdata,
                                  const uint8_t  UECFG1Xdata)
{
    1666:	80 93 e9 00 	sts	0x00E9, r24
	Endpoint_SelectEndpoint(EndpointNum);
	Endpoint_EnableEndpoint();
    166a:	80 91 eb 00 	lds	r24, 0x00EB
    166e:	81 60       	ori	r24, 0x01	; 1
    1670:	80 93 eb 00 	sts	0x00EB, r24
	
	UECFG0X = UECFG0Xdata;
    1674:	40 93 ec 00 	sts	0x00EC, r20
	UECFG1X = ((UECFG1X & (1 << ALLOC)) | UECFG1Xdata | Endpoint_BytesToEPSizeMask(EndpointSize));
    1678:	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;
    167c:	77 70       	andi	r23, 0x07	; 7
			
				if (Bytes <= 8)
    167e:	69 30       	cpi	r22, 0x09	; 9
    1680:	71 05       	cpc	r23, r1
    1682:	10 f4       	brcc	.+4      	; 0x1688 <Endpoint_ConfigureEndpoint_P+0x22>
    1684:	80 e0       	ldi	r24, 0x00	; 0
    1686:	0b c0       	rjmp	.+22     	; 0x169e <Endpoint_ConfigureEndpoint_P+0x38>
				  return (0 << EPSIZE0);
				else if (Bytes <= 16)
    1688:	61 31       	cpi	r22, 0x11	; 17
    168a:	71 05       	cpc	r23, r1
    168c:	10 f4       	brcc	.+4      	; 0x1692 <Endpoint_ConfigureEndpoint_P+0x2c>
    168e:	80 e1       	ldi	r24, 0x10	; 16
    1690:	06 c0       	rjmp	.+12     	; 0x169e <Endpoint_ConfigureEndpoint_P+0x38>
				  return (1 << EPSIZE0);
				else if (Bytes <= 32)
    1692:	61 32       	cpi	r22, 0x21	; 33
    1694:	71 05       	cpc	r23, r1
    1696:	10 f0       	brcs	.+4      	; 0x169c <Endpoint_ConfigureEndpoint_P+0x36>
    1698:	80 e3       	ldi	r24, 0x30	; 48
    169a:	01 c0       	rjmp	.+2      	; 0x169e <Endpoint_ConfigureEndpoint_P+0x38>
    169c:	80 e2       	ldi	r24, 0x20	; 32
    169e:	92 70       	andi	r25, 0x02	; 2
    16a0:	92 2b       	or	r25, r18
    16a2:	89 2b       	or	r24, r25
    16a4:	80 93 ed 00 	sts	0x00ED, r24
	
	Endpoint_AllocateMemory();
    16a8:	80 91 ed 00 	lds	r24, 0x00ED
    16ac:	82 60       	ori	r24, 0x02	; 2
    16ae:	80 93 ed 00 	sts	0x00ED, r24
}
    16b2:	08 95       	ret

000016b4 <Endpoint_Write_Control_Stream_LE>:
	
	return ENDPOINT_RWSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
{
    16b4:	1f 93       	push	r17
    16b6:	9c 01       	movw	r18, r24
    16b8:	fb 01       	movw	r30, r22
	uint8_t* DataStream = (uint8_t*)Buffer;
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
    16ba:	10 91 1a 01 	lds	r17, 0x011A
    16be:	cb 01       	movw	r24, r22
    16c0:	61 2f       	mov	r22, r17
    16c2:	70 e0       	ldi	r23, 0x00	; 0
    16c4:	ee d2       	rcall	.+1500   	; 0x1ca2 <__udivmodhi4>
    16c6:	89 2b       	or	r24, r25
    16c8:	21 f0       	breq	.+8      	; 0x16d2 <Endpoint_Write_Control_Stream_LE+0x1e>
    16ca:	40 e0       	ldi	r20, 0x00	; 0
    16cc:	50 e0       	ldi	r21, 0x00	; 0
    16ce:	30 97       	sbiw	r30, 0x00	; 0
    16d0:	11 f4       	brne	.+4      	; 0x16d6 <Endpoint_Write_Control_Stream_LE+0x22>
    16d2:	41 e0       	ldi	r20, 0x01	; 1
    16d4:	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;
    16d6:	d9 01       	movw	r26, r18
    16d8:	13 c0       	rjmp	.+38     	; 0x1700 <Endpoint_Write_Control_Stream_LE+0x4c>
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
	{
		while (!(Endpoint_IsSetupINReady()));
    16da:	80 91 e8 00 	lds	r24, 0x00E8
    16de:	80 ff       	sbrs	r24, 0
    16e0:	fc cf       	rjmp	.-8      	; 0x16da <Endpoint_Write_Control_Stream_LE+0x26>
    16e2:	05 c0       	rjmp	.+10     	; 0x16ee <Endpoint_Write_Control_Stream_LE+0x3a>
		
		while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
		{
			Endpoint_Write_Byte(*(DataStream++));
    16e4:	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;
    16e6:	80 93 f1 00 	sts	0x00F1, r24
			
			Length--;
    16ea:	31 97       	sbiw	r30, 0x01	; 1
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
	{
		while (!(Endpoint_IsSetupINReady()));
		
		while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
    16ec:	21 f0       	breq	.+8      	; 0x16f6 <Endpoint_Write_Control_Stream_LE+0x42>
    16ee:	80 91 f2 00 	lds	r24, 0x00F2
    16f2:	81 17       	cp	r24, r17
    16f4:	b8 f3       	brcs	.-18     	; 0x16e4 <Endpoint_Write_Control_Stream_LE+0x30>
			Endpoint_Write_Byte(*(DataStream++));
			
			Length--;
		}
		
		Endpoint_ClearSetupIN();
    16f6:	80 91 e8 00 	lds	r24, 0x00E8
    16fa:	8e 7f       	andi	r24, 0xFE	; 254
    16fc:	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()))
    1700:	30 97       	sbiw	r30, 0x00	; 0
    1702:	21 f0       	breq	.+8      	; 0x170c <Endpoint_Write_Control_Stream_LE+0x58>
    1704:	80 91 e8 00 	lds	r24, 0x00E8
    1708:	82 ff       	sbrs	r24, 2
    170a:	e7 cf       	rjmp	.-50     	; 0x16da <Endpoint_Write_Control_Stream_LE+0x26>
		}
		
		Endpoint_ClearSetupIN();
	}
	
	if (Endpoint_IsSetupOUTReceived())
    170c:	80 91 e8 00 	lds	r24, 0x00E8
    1710:	82 ff       	sbrs	r24, 2
    1712:	02 c0       	rjmp	.+4      	; 0x1718 <Endpoint_Write_Control_Stream_LE+0x64>
    1714:	81 e0       	ldi	r24, 0x01	; 1
    1716:	10 c0       	rjmp	.+32     	; 0x1738 <Endpoint_Write_Control_Stream_LE+0x84>
	  return ENDPOINT_RWCSTREAM_ERROR_HostAborted;
	
	if (SendZLP)
    1718:	45 2b       	or	r20, r21
    171a:	49 f0       	breq	.+18     	; 0x172e <Endpoint_Write_Control_Stream_LE+0x7a>
	{
		while (!(Endpoint_IsSetupINReady()));
    171c:	80 91 e8 00 	lds	r24, 0x00E8
    1720:	80 ff       	sbrs	r24, 0
    1722:	fc cf       	rjmp	.-8      	; 0x171c <Endpoint_Write_Control_Stream_LE+0x68>
		Endpoint_ClearSetupIN();
    1724:	80 91 e8 00 	lds	r24, 0x00E8
    1728:	8e 7f       	andi	r24, 0xFE	; 254
    172a:	80 93 e8 00 	sts	0x00E8, r24
	}
	
	while (!(Endpoint_IsSetupOUTReceived()));
    172e:	80 91 e8 00 	lds	r24, 0x00E8
    1732:	82 ff       	sbrs	r24, 2
    1734:	fc cf       	rjmp	.-8      	; 0x172e <Endpoint_Write_Control_Stream_LE+0x7a>
    1736:	80 e0       	ldi	r24, 0x00	; 0

	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}
    1738:	1f 91       	pop	r17
    173a:	08 95       	ret

0000173c <Endpoint_Read_Control_Stream_LE>:

	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)
{
    173c:	fc 01       	movw	r30, r24
    173e:	14 c0       	rjmp	.+40     	; 0x1768 <Endpoint_Read_Control_Stream_LE+0x2c>
	uint8_t* DataStream = (uint8_t*)Buffer;
	
	while (Length)
	{
		while (!(Endpoint_IsSetupOUTReceived()));
    1740:	80 91 e8 00 	lds	r24, 0x00E8
    1744:	82 ff       	sbrs	r24, 2
    1746:	fc cf       	rjmp	.-8      	; 0x1740 <Endpoint_Read_Control_Stream_LE+0x4>
    1748:	06 c0       	rjmp	.+12     	; 0x1756 <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;
    174a:	80 91 f1 00 	lds	r24, 0x00F1
		
		while (Length && Endpoint_BytesInEndpoint())
		{
			*(DataStream++) = Endpoint_Read_Byte();
    174e:	81 93       	st	Z+, r24
			
			Length--;
    1750:	61 50       	subi	r22, 0x01	; 1
    1752:	70 40       	sbci	r23, 0x00	; 0
	
	while (Length)
	{
		while (!(Endpoint_IsSetupOUTReceived()));
		
		while (Length && Endpoint_BytesInEndpoint())
    1754:	21 f0       	breq	.+8      	; 0x175e <Endpoint_Read_Control_Stream_LE+0x22>
    1756:	80 91 f2 00 	lds	r24, 0x00F2
    175a:	88 23       	and	r24, r24
    175c:	b1 f7       	brne	.-20     	; 0x174a <Endpoint_Read_Control_Stream_LE+0xe>
			*(DataStream++) = Endpoint_Read_Byte();
			
			Length--;
		}
		
		Endpoint_ClearSetupOUT();
    175e:	80 91 e8 00 	lds	r24, 0x00E8
    1762:	8b 7f       	andi	r24, 0xFB	; 251
    1764:	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)
    1768:	61 15       	cp	r22, r1
    176a:	71 05       	cpc	r23, r1
    176c:	49 f7       	brne	.-46     	; 0x1740 <Endpoint_Read_Control_Stream_LE+0x4>
		}
		
		Endpoint_ClearSetupOUT();
	}
	
	while (!(Endpoint_IsSetupINReady()));
    176e:	80 91 e8 00 	lds	r24, 0x00E8
    1772:	80 ff       	sbrs	r24, 0
    1774:	fc cf       	rjmp	.-8      	; 0x176e <Endpoint_Read_Control_Stream_LE+0x32>
	
	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}
    1776:	80 e0       	ldi	r24, 0x00	; 0
    1778:	08 95       	ret

0000177a <USB_Device_ProcessControlPacket>:
uint8_t USB_ConfigurationNumber;
bool    USB_RemoteWakeupEnabled;
bool    USB_CurrentlySelfPowered;

void USB_Device_ProcessControlPacket(void)
{
    177a:	ff 92       	push	r15
    177c:	0f 93       	push	r16
    177e:	1f 93       	push	r17
    1780:	df 93       	push	r29
    1782:	cf 93       	push	r28
    1784:	cd b7       	in	r28, 0x3d	; 61
    1786:	de b7       	in	r29, 0x3e	; 62
    1788:	28 97       	sbiw	r28, 0x08	; 8
    178a:	0f b6       	in	r0, 0x3f	; 63
    178c:	f8 94       	cli
    178e:	de bf       	out	0x3e, r29	; 62
    1790:	0f be       	out	0x3f, r0	; 63
    1792:	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;
    1794:	60 91 f1 00 	lds	r22, 0x00F1
	uint8_t bmRequestType  = Endpoint_Read_Byte();
	uint8_t bRequest       = Endpoint_Read_Byte();
	bool    RequestHandled = false;
	
	switch (bRequest)
    1798:	40 91 f1 00 	lds	r20, 0x00F1
    179c:	45 30       	cpi	r20, 0x05	; 5
    179e:	09 f4       	brne	.+2      	; 0x17a2 <USB_Device_ProcessControlPacket+0x28>
    17a0:	cb c0       	rjmp	.+406    	; 0x1938 <USB_Device_ProcessControlPacket+0x1be>
    17a2:	46 30       	cpi	r20, 0x06	; 6
    17a4:	48 f4       	brcc	.+18     	; 0x17b8 <USB_Device_ProcessControlPacket+0x3e>
    17a6:	41 30       	cpi	r20, 0x01	; 1
    17a8:	09 f4       	brne	.+2      	; 0x17ac <USB_Device_ProcessControlPacket+0x32>
    17aa:	74 c0       	rjmp	.+232    	; 0x1894 <USB_Device_ProcessControlPacket+0x11a>
    17ac:	41 30       	cpi	r20, 0x01	; 1
    17ae:	70 f0       	brcs	.+28     	; 0x17cc <USB_Device_ProcessControlPacket+0x52>
    17b0:	43 30       	cpi	r20, 0x03	; 3
    17b2:	09 f0       	breq	.+2      	; 0x17b6 <USB_Device_ProcessControlPacket+0x3c>
    17b4:	9a c1       	rjmp	.+820    	; 0x1aea <USB_Device_ProcessControlPacket+0x370>
    17b6:	6e c0       	rjmp	.+220    	; 0x1894 <USB_Device_ProcessControlPacket+0x11a>
    17b8:	48 30       	cpi	r20, 0x08	; 8
    17ba:	09 f4       	brne	.+2      	; 0x17be <USB_Device_ProcessControlPacket+0x44>
    17bc:	48 c1       	rjmp	.+656    	; 0x1a4e <USB_Device_ProcessControlPacket+0x2d4>
    17be:	49 30       	cpi	r20, 0x09	; 9
    17c0:	09 f4       	brne	.+2      	; 0x17c4 <USB_Device_ProcessControlPacket+0x4a>
    17c2:	60 c1       	rjmp	.+704    	; 0x1a84 <USB_Device_ProcessControlPacket+0x30a>
    17c4:	46 30       	cpi	r20, 0x06	; 6
    17c6:	09 f0       	breq	.+2      	; 0x17ca <USB_Device_ProcessControlPacket+0x50>
    17c8:	90 c1       	rjmp	.+800    	; 0x1aea <USB_Device_ProcessControlPacket+0x370>
    17ca:	d6 c0       	rjmp	.+428    	; 0x1978 <USB_Device_ProcessControlPacket+0x1fe>
	{
		case REQ_GetStatus:
			if (((bmRequestType & (CONTROL_REQTYPE_DIRECTION | CONTROL_REQTYPE_TYPE)) ==
    17cc:	26 2f       	mov	r18, r22
    17ce:	30 e0       	ldi	r19, 0x00	; 0
    17d0:	c9 01       	movw	r24, r18
    17d2:	80 7e       	andi	r24, 0xE0	; 224
    17d4:	90 70       	andi	r25, 0x00	; 0
    17d6:	80 38       	cpi	r24, 0x80	; 128
    17d8:	91 05       	cpc	r25, r1
    17da:	09 f0       	breq	.+2      	; 0x17de <USB_Device_ProcessControlPacket+0x64>
    17dc:	86 c1       	rjmp	.+780    	; 0x1aea <USB_Device_ProcessControlPacket+0x370>
    17de:	c9 01       	movw	r24, r18
    17e0:	8f 71       	andi	r24, 0x1F	; 31
    17e2:	90 70       	andi	r25, 0x00	; 0
    17e4:	83 30       	cpi	r24, 0x03	; 3
    17e6:	91 05       	cpc	r25, r1
    17e8:	09 f4       	brne	.+2      	; 0x17ec <USB_Device_ProcessControlPacket+0x72>
    17ea:	7f c1       	rjmp	.+766    	; 0x1aea <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;
    17ec:	20 91 f1 00 	lds	r18, 0x00F1
				Dummy = UEDATX;
    17f0:	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;
    17f4:	20 91 f1 00 	lds	r18, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    17f8:	40 91 f1 00 	lds	r20, 0x00F1

	Endpoint_Discard_Word();

	uint16_t wIndex = Endpoint_Read_Word_LE();
	
	switch (bmRequestType & CONTROL_REQTYPE_RECIPIENT)
    17fc:	81 30       	cpi	r24, 0x01	; 1
    17fe:	91 05       	cpc	r25, r1
    1800:	31 f0       	breq	.+12     	; 0x180e <USB_Device_ProcessControlPacket+0x94>
    1802:	82 30       	cpi	r24, 0x02	; 2
    1804:	91 05       	cpc	r25, r1
    1806:	f9 f0       	breq	.+62     	; 0x1846 <USB_Device_ProcessControlPacket+0xcc>
    1808:	89 2b       	or	r24, r25
    180a:	21 f0       	breq	.+8      	; 0x1814 <USB_Device_ProcessControlPacket+0x9a>
    180c:	70 c1       	rjmp	.+736    	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
    180e:	20 e0       	ldi	r18, 0x00	; 0
    1810:	30 e0       	ldi	r19, 0x00	; 0
    1812:	2d c0       	rjmp	.+90     	; 0x186e <USB_Device_ProcessControlPacket+0xf4>
	{
		case REQREC_DEVICE:
			if (USB_GetDescriptor(((DTYPE_Configuration << 8) | USB_ConfigurationNumber), 0,
    1814:	80 91 c4 01 	lds	r24, 0x01C4
    1818:	90 e0       	ldi	r25, 0x00	; 0
    181a:	9e 01       	movw	r18, r28
    181c:	29 5f       	subi	r18, 0xF9	; 249
    181e:	3f 4f       	sbci	r19, 0xFF	; 255
    1820:	ae 01       	movw	r20, r28
    1822:	4f 5f       	subi	r20, 0xFF	; 255
    1824:	5f 4f       	sbci	r21, 0xFF	; 255
    1826:	60 e0       	ldi	r22, 0x00	; 0
    1828:	92 60       	ori	r25, 0x02	; 2
    182a:	8a da       	rcall	.-2796   	; 0xd40 <USB_GetDescriptor>
    182c:	88 23       	and	r24, r24
    182e:	09 f4       	brne	.+2      	; 0x1832 <USB_Device_ProcessControlPacket+0xb8>
    1830:	5e c1       	rjmp	.+700    	; 0x1aee <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);
    1832:	80 91 c2 01 	lds	r24, 0x01C2
    1836:	28 2f       	mov	r18, r24
    1838:	30 e0       	ldi	r19, 0x00	; 0
#endif

			if (USB_CurrentlySelfPowered)
			  CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
			
			if (USB_RemoteWakeupEnabled)
    183a:	80 91 c3 01 	lds	r24, 0x01C3
    183e:	88 23       	and	r24, r24
    1840:	b1 f0       	breq	.+44     	; 0x186e <USB_Device_ProcessControlPacket+0xf4>
			  CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
    1842:	22 60       	ori	r18, 0x02	; 2
    1844:	14 c0       	rjmp	.+40     	; 0x186e <USB_Device_ProcessControlPacket+0xf4>
		case REQREC_INTERFACE:
			// No bits set, all bits currently reserved
				
			break;
		case REQREC_ENDPOINT:
			Endpoint_SelectEndpoint(wIndex);
    1846:	94 2f       	mov	r25, r20
    1848:	80 e0       	ldi	r24, 0x00	; 0
    184a:	30 e0       	ldi	r19, 0x00	; 0
    184c:	82 2b       	or	r24, r18
    184e:	93 2b       	or	r25, r19
    1850:	80 93 e9 00 	sts	0x00E9, r24

			CurrentStatus = Endpoint_IsStalled();
    1854:	80 91 eb 00 	lds	r24, 0x00EB
    1858:	28 2f       	mov	r18, r24
    185a:	30 e0       	ldi	r19, 0x00	; 0
    185c:	85 e0       	ldi	r24, 0x05	; 5
    185e:	36 95       	lsr	r19
    1860:	27 95       	ror	r18
    1862:	8a 95       	dec	r24
    1864:	e1 f7       	brne	.-8      	; 0x185e <USB_Device_ProcessControlPacket+0xe4>
    1866:	21 70       	andi	r18, 0x01	; 1
    1868:	30 70       	andi	r19, 0x00	; 0

			Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);			  
    186a:	10 92 e9 00 	sts	0x00E9, r1
			break;
		default:
			return;
	}
	
	Endpoint_ClearSetupReceived();
    186e:	80 91 e8 00 	lds	r24, 0x00E8
    1872:	87 7f       	andi	r24, 0xF7	; 247
    1874:	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);
    1878:	20 93 f1 00 	sts	0x00F1, r18
				UEDATX = (Word >> 8);
    187c:	30 93 f1 00 	sts	0x00F1, r19
	
	Endpoint_Write_Word_LE(CurrentStatus);

	Endpoint_ClearSetupIN();
    1880:	80 91 e8 00 	lds	r24, 0x00E8
    1884:	8e 7f       	andi	r24, 0xFE	; 254
    1886:	80 93 e8 00 	sts	0x00E8, r24
	
	while (!(Endpoint_IsSetupOUTReceived()));
    188a:	80 91 e8 00 	lds	r24, 0x00E8
    188e:	82 ff       	sbrs	r24, 2
    1890:	fc cf       	rjmp	.-8      	; 0x188a <USB_Device_ProcessControlPacket+0x110>
    1892:	f2 c0       	rjmp	.+484    	; 0x1a78 <USB_Device_ProcessControlPacket+0x2fe>
			}

			break;
		case REQ_ClearFeature:
		case REQ_SetFeature:
			if (((bmRequestType & (CONTROL_REQTYPE_DIRECTION | CONTROL_REQTYPE_TYPE)) ==
    1894:	26 2f       	mov	r18, r22
    1896:	30 e0       	ldi	r19, 0x00	; 0
    1898:	86 2f       	mov	r24, r22
    189a:	80 7e       	andi	r24, 0xE0	; 224
    189c:	09 f0       	breq	.+2      	; 0x18a0 <USB_Device_ProcessControlPacket+0x126>
    189e:	25 c1       	rjmp	.+586    	; 0x1aea <USB_Device_ProcessControlPacket+0x370>
    18a0:	c9 01       	movw	r24, r18
    18a2:	8f 71       	andi	r24, 0x1F	; 31
    18a4:	90 70       	andi	r25, 0x00	; 0
    18a6:	83 30       	cpi	r24, 0x03	; 3
    18a8:	91 05       	cpc	r25, r1
    18aa:	09 f4       	brne	.+2      	; 0x18ae <USB_Device_ProcessControlPacket+0x134>
    18ac:	1e c1       	rjmp	.+572    	; 0x1aea <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;
    18ae:	20 91 f1 00 	lds	r18, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    18b2:	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;
    18b6:	70 91 f1 00 	lds	r23, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    18ba:	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)
    18be:	02 97       	sbiw	r24, 0x02	; 2
    18c0:	09 f0       	breq	.+2      	; 0x18c4 <USB_Device_ProcessControlPacket+0x14a>
    18c2:	15 c1       	rjmp	.+554    	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
	{
		case REQREC_ENDPOINT:
			if (wValue == FEATURE_ENDPOINT_HALT)
    18c4:	95 2f       	mov	r25, r21
    18c6:	80 e0       	ldi	r24, 0x00	; 0
    18c8:	30 e0       	ldi	r19, 0x00	; 0
    18ca:	82 2b       	or	r24, r18
    18cc:	93 2b       	or	r25, r19
    18ce:	89 2b       	or	r24, r25
    18d0:	09 f0       	breq	.+2      	; 0x18d4 <USB_Device_ProcessControlPacket+0x15a>
    18d2:	0d c1       	rjmp	.+538    	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
			{
				uint8_t EndpointIndex = (wIndex & ENDPOINT_EPNUM_MASK);
    18d4:	80 e0       	ldi	r24, 0x00	; 0
    18d6:	27 2f       	mov	r18, r23
    18d8:	28 2b       	or	r18, r24
    18da:	27 70       	andi	r18, 0x07	; 7
				
				if (EndpointIndex != ENDPOINT_CONTROLEP)
    18dc:	09 f4       	brne	.+2      	; 0x18e0 <USB_Device_ProcessControlPacket+0x166>
    18de:	07 c1       	rjmp	.+526    	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
				{
					Endpoint_SelectEndpoint(EndpointIndex);
    18e0:	20 93 e9 00 	sts	0x00E9, r18

					if (Endpoint_IsEnabled())
    18e4:	80 91 eb 00 	lds	r24, 0x00EB
    18e8:	80 ff       	sbrs	r24, 0
    18ea:	1b c0       	rjmp	.+54     	; 0x1922 <USB_Device_ProcessControlPacket+0x1a8>
					{				
						if (bRequest == REQ_ClearFeature)
    18ec:	41 30       	cpi	r20, 0x01	; 1
    18ee:	a1 f4       	brne	.+40     	; 0x1918 <USB_Device_ProcessControlPacket+0x19e>
						{
							Endpoint_ClearStall();
    18f0:	80 91 eb 00 	lds	r24, 0x00EB
    18f4:	80 61       	ori	r24, 0x10	; 16
    18f6:	80 93 eb 00 	sts	0x00EB, r24
							Endpoint_ResetFIFO(EndpointIndex);
    18fa:	81 e0       	ldi	r24, 0x01	; 1
    18fc:	90 e0       	ldi	r25, 0x00	; 0
    18fe:	02 c0       	rjmp	.+4      	; 0x1904 <USB_Device_ProcessControlPacket+0x18a>
    1900:	88 0f       	add	r24, r24
    1902:	99 1f       	adc	r25, r25
    1904:	2a 95       	dec	r18
    1906:	e2 f7       	brpl	.-8      	; 0x1900 <USB_Device_ProcessControlPacket+0x186>
    1908:	80 93 ea 00 	sts	0x00EA, r24
    190c:	10 92 ea 00 	sts	0x00EA, r1
							Endpoint_ResetDataToggle();
    1910:	80 91 eb 00 	lds	r24, 0x00EB
    1914:	88 60       	ori	r24, 0x08	; 8
    1916:	03 c0       	rjmp	.+6      	; 0x191e <USB_Device_ProcessControlPacket+0x1a4>
						}
						else
						{
							Endpoint_StallTransaction();						
    1918:	80 91 eb 00 	lds	r24, 0x00EB
    191c:	80 62       	ori	r24, 0x20	; 32
    191e:	80 93 eb 00 	sts	0x00EB, r24
						}
					}

					Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
    1922:	10 92 e9 00 	sts	0x00E9, r1
					Endpoint_ClearSetupReceived();
    1926:	80 91 e8 00 	lds	r24, 0x00E8
    192a:	87 7f       	andi	r24, 0xF7	; 247
    192c:	80 93 e8 00 	sts	0x00E8, r24
					Endpoint_ClearSetupIN();
    1930:	80 91 e8 00 	lds	r24, 0x00E8
    1934:	8e 7f       	andi	r24, 0xFE	; 254
    1936:	a3 c0       	rjmp	.+326    	; 0x1a7e <USB_Device_ProcessControlPacket+0x304>
				RequestHandled = true;
			}

			break;
		case REQ_SetAddress:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
    1938:	66 23       	and	r22, r22
    193a:	09 f0       	breq	.+2      	; 0x193e <USB_Device_ProcessControlPacket+0x1c4>
    193c:	d6 c0       	rjmp	.+428    	; 0x1aea <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;
    193e:	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));
    1942:	80 91 e3 00 	lds	r24, 0x00E3
    1946:	9f 77       	andi	r25, 0x7F	; 127
    1948:	80 78       	andi	r24, 0x80	; 128
    194a:	98 2b       	or	r25, r24
    194c:	90 93 e3 00 	sts	0x00E3, r25

	Endpoint_ClearSetupReceived();
    1950:	80 91 e8 00 	lds	r24, 0x00E8
    1954:	87 7f       	andi	r24, 0xF7	; 247
    1956:	80 93 e8 00 	sts	0x00E8, r24

	Endpoint_ClearSetupIN();
    195a:	80 91 e8 00 	lds	r24, 0x00E8
    195e:	8e 7f       	andi	r24, 0xFE	; 254
    1960:	80 93 e8 00 	sts	0x00E8, r24
	while (!(Endpoint_IsSetupINReady()));
    1964:	80 91 e8 00 	lds	r24, 0x00E8
    1968:	80 ff       	sbrs	r24, 0
    196a:	fc cf       	rjmp	.-8      	; 0x1964 <USB_Device_ProcessControlPacket+0x1ea>
	
	UDADDR |= (1 << ADDEN);
    196c:	80 91 e3 00 	lds	r24, 0x00E3
    1970:	80 68       	ori	r24, 0x80	; 128
    1972:	80 93 e3 00 	sts	0x00E3, r24
    1976:	bb c0       	rjmp	.+374    	; 0x1aee <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;
    1978:	e0 91 f1 00 	lds	r30, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    197c:	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;
    1980:	80 91 f1 00 	lds	r24, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1984:	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;
    1988:	00 91 f1 00 	lds	r16, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    198c:	10 91 f1 00 	lds	r17, 0x00F1
	void*    DescriptorPointer;
	uint16_t DescriptorSize;
	
	bool     SendZLP;
	
	if (!(USB_GetDescriptor(wValue, wIndex, &DescriptorPointer, &DescriptorSize)))
    1990:	72 2f       	mov	r23, r18
    1992:	60 e0       	ldi	r22, 0x00	; 0
    1994:	90 e0       	ldi	r25, 0x00	; 0
    1996:	68 2b       	or	r22, r24
    1998:	79 2b       	or	r23, r25
    199a:	93 2f       	mov	r25, r19
    199c:	80 e0       	ldi	r24, 0x00	; 0
    199e:	f0 e0       	ldi	r31, 0x00	; 0
    19a0:	9e 01       	movw	r18, r28
    19a2:	29 5f       	subi	r18, 0xF9	; 249
    19a4:	3f 4f       	sbci	r19, 0xFF	; 255
    19a6:	ae 01       	movw	r20, r28
    19a8:	4d 5f       	subi	r20, 0xFD	; 253
    19aa:	5f 4f       	sbci	r21, 0xFF	; 255
    19ac:	8e 2b       	or	r24, r30
    19ae:	9f 2b       	or	r25, r31
    19b0:	c7 d9       	rcall	.-3186   	; 0xd40 <USB_GetDescriptor>
    19b2:	88 23       	and	r24, r24
    19b4:	09 f4       	brne	.+2      	; 0x19b8 <USB_Device_ProcessControlPacket+0x23e>
    19b6:	9b c0       	rjmp	.+310    	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
	  return;
	
	Endpoint_ClearSetupReceived();
    19b8:	80 91 e8 00 	lds	r24, 0x00E8
    19bc:	87 7f       	andi	r24, 0xF7	; 247
    19be:	80 93 e8 00 	sts	0x00E8, r24
    19c2:	91 2f       	mov	r25, r17
    19c4:	80 e0       	ldi	r24, 0x00	; 0
    19c6:	40 2f       	mov	r20, r16
    19c8:	50 e0       	ldi	r21, 0x00	; 0
    19ca:	2f 81       	ldd	r18, Y+7	; 0x07
    19cc:	38 85       	ldd	r19, Y+8	; 0x08
    19ce:	48 2b       	or	r20, r24
    19d0:	59 2b       	or	r21, r25
    19d2:	24 17       	cp	r18, r20
    19d4:	35 07       	cpc	r19, r21
    19d6:	08 f4       	brcc	.+2      	; 0x19da <USB_Device_ProcessControlPacket+0x260>
    19d8:	a9 01       	movw	r20, r18
	
	if (wLength > DescriptorSize)
	  wLength = DescriptorSize;
	  
	SendZLP = !(wLength % USB_ControlEndpointSize);
    19da:	60 91 1a 01 	lds	r22, 0x011A
    19de:	ab 81       	ldd	r26, Y+3	; 0x03
    19e0:	bc 81       	ldd	r27, Y+4	; 0x04
    19e2:	9a 01       	movw	r18, r20
    19e4:	16 c0       	rjmp	.+44     	; 0x1a12 <USB_Device_ProcessControlPacket+0x298>
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
	{
		while (!(Endpoint_IsSetupINReady()));
    19e6:	80 91 e8 00 	lds	r24, 0x00E8
    19ea:	80 ff       	sbrs	r24, 0
    19ec:	fc cf       	rjmp	.-8      	; 0x19e6 <USB_Device_ProcessControlPacket+0x26c>
    19ee:	08 c0       	rjmp	.+16     	; 0x1a00 <USB_Device_ProcessControlPacket+0x286>
    19f0:	fd 01       	movw	r30, r26
    19f2:	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++));
    19f4:	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;
    19f6:	e0 93 f1 00 	sts	0x00F1, r30
			#endif
			
			wLength--;
    19fa:	21 50       	subi	r18, 0x01	; 1
    19fc:	30 40       	sbci	r19, 0x00	; 0
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
	{
		while (!(Endpoint_IsSetupINReady()));
		
		while (wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
    19fe:	21 f0       	breq	.+8      	; 0x1a08 <USB_Device_ProcessControlPacket+0x28e>
    1a00:	80 91 f2 00 	lds	r24, 0x00F2
    1a04:	86 17       	cp	r24, r22
    1a06:	a0 f3       	brcs	.-24     	; 0x19f0 <USB_Device_ProcessControlPacket+0x276>
			#endif
			
			wLength--;
		}
		
		Endpoint_ClearSetupIN();
    1a08:	80 91 e8 00 	lds	r24, 0x00E8
    1a0c:	8e 7f       	andi	r24, 0xFE	; 254
    1a0e:	80 93 e8 00 	sts	0x00E8, r24
	if (wLength > DescriptorSize)
	  wLength = DescriptorSize;
	  
	SendZLP = !(wLength % USB_ControlEndpointSize);
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
    1a12:	21 15       	cp	r18, r1
    1a14:	31 05       	cpc	r19, r1
    1a16:	21 f0       	breq	.+8      	; 0x1a20 <USB_Device_ProcessControlPacket+0x2a6>
    1a18:	80 91 e8 00 	lds	r24, 0x00E8
    1a1c:	82 ff       	sbrs	r24, 2
    1a1e:	e3 cf       	rjmp	.-58     	; 0x19e6 <USB_Device_ProcessControlPacket+0x26c>
		}
		
		Endpoint_ClearSetupIN();
	}
	
	if (Endpoint_IsSetupOUTReceived())
    1a20:	80 91 e8 00 	lds	r24, 0x00E8
    1a24:	82 fd       	sbrc	r24, 2
    1a26:	28 c0       	rjmp	.+80     	; 0x1a78 <USB_Device_ProcessControlPacket+0x2fe>
	{
		Endpoint_ClearSetupOUT();
		return;
	}
	
	if (SendZLP)
    1a28:	ca 01       	movw	r24, r20
    1a2a:	70 e0       	ldi	r23, 0x00	; 0
    1a2c:	3a d1       	rcall	.+628    	; 0x1ca2 <__udivmodhi4>
    1a2e:	89 2b       	or	r24, r25
    1a30:	49 f4       	brne	.+18     	; 0x1a44 <USB_Device_ProcessControlPacket+0x2ca>
	{
		while (!(Endpoint_IsSetupINReady()));
    1a32:	80 91 e8 00 	lds	r24, 0x00E8
    1a36:	80 ff       	sbrs	r24, 0
    1a38:	fc cf       	rjmp	.-8      	; 0x1a32 <USB_Device_ProcessControlPacket+0x2b8>
		Endpoint_ClearSetupIN();
    1a3a:	80 91 e8 00 	lds	r24, 0x00E8
    1a3e:	8e 7f       	andi	r24, 0xFE	; 254
    1a40:	80 93 e8 00 	sts	0x00E8, r24
	}

	while (!(Endpoint_IsSetupOUTReceived()));
    1a44:	80 91 e8 00 	lds	r24, 0x00E8
    1a48:	82 ff       	sbrs	r24, 2
    1a4a:	fc cf       	rjmp	.-8      	; 0x1a44 <USB_Device_ProcessControlPacket+0x2ca>
    1a4c:	15 c0       	rjmp	.+42     	; 0x1a78 <USB_Device_ProcessControlPacket+0x2fe>
			USB_Device_GetDescriptor();
			RequestHandled = true;
			
			break;
		case REQ_GetConfiguration:
			if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
    1a4e:	60 38       	cpi	r22, 0x80	; 128
    1a50:	09 f0       	breq	.+2      	; 0x1a54 <USB_Device_ProcessControlPacket+0x2da>
    1a52:	4b c0       	rjmp	.+150    	; 0x1aea <USB_Device_ProcessControlPacket+0x370>
	RAISE_EVENT(USB_ConfigurationChanged);
}

void USB_Device_GetConfiguration(void)
{
	Endpoint_ClearSetupReceived();	
    1a54:	80 91 e8 00 	lds	r24, 0x00E8
    1a58:	87 7f       	andi	r24, 0xF7	; 247
    1a5a:	80 93 e8 00 	sts	0x00E8, r24

	Endpoint_Write_Byte(USB_ConfigurationNumber);
    1a5e:	80 91 c4 01 	lds	r24, 0x01C4
    1a62:	80 93 f1 00 	sts	0x00F1, r24
	
	Endpoint_ClearSetupIN();
    1a66:	80 91 e8 00 	lds	r24, 0x00E8
    1a6a:	8e 7f       	andi	r24, 0xFE	; 254
    1a6c:	80 93 e8 00 	sts	0x00E8, r24

	while (!(Endpoint_IsSetupOUTReceived()));
    1a70:	80 91 e8 00 	lds	r24, 0x00E8
    1a74:	82 ff       	sbrs	r24, 2
    1a76:	fc cf       	rjmp	.-8      	; 0x1a70 <USB_Device_ProcessControlPacket+0x2f6>
	Endpoint_ClearSetupOUT();
    1a78:	80 91 e8 00 	lds	r24, 0x00E8
    1a7c:	8b 7f       	andi	r24, 0xFB	; 251
    1a7e:	80 93 e8 00 	sts	0x00E8, r24
    1a82:	35 c0       	rjmp	.+106    	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
				RequestHandled = true;
			}

			break;
		case REQ_SetConfiguration:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
    1a84:	66 23       	and	r22, r22
    1a86:	89 f5       	brne	.+98     	; 0x1aea <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;
    1a88:	00 91 f1 00 	lds	r16, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1a8c:	10 91 f1 00 	lds	r17, 0x00F1
}

static void USB_Device_SetConfiguration(void)
{
	uint16_t                 wValue               = Endpoint_Read_Word_LE();
	bool                     NotAlreadyConfigured = !(USB_ConfigurationNumber);
    1a90:	f0 90 c4 01 	lds	r15, 0x01C4
	USB_Descriptor_Device_t* DevDescriptorPtr;
	uint16_t                 DevDescriptorSize;

	if ((USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr, &DevDescriptorSize) == false) ||
    1a94:	9e 01       	movw	r18, r28
    1a96:	29 5f       	subi	r18, 0xF9	; 249
    1a98:	3f 4f       	sbci	r19, 0xFF	; 255
    1a9a:	ae 01       	movw	r20, r28
    1a9c:	4b 5f       	subi	r20, 0xFB	; 251
    1a9e:	5f 4f       	sbci	r21, 0xFF	; 255
    1aa0:	80 e0       	ldi	r24, 0x00	; 0
    1aa2:	91 e0       	ldi	r25, 0x01	; 1
    1aa4:	4d d9       	rcall	.-3430   	; 0xd40 <USB_GetDescriptor>
    1aa6:	88 23       	and	r24, r24
    1aa8:	11 f1       	breq	.+68     	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
    1aaa:	91 2f       	mov	r25, r17
    1aac:	80 e0       	ldi	r24, 0x00	; 0
    1aae:	20 2f       	mov	r18, r16
    1ab0:	30 e0       	ldi	r19, 0x00	; 0
    1ab2:	28 2b       	or	r18, r24
    1ab4:	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)))
    1ab6:	ed 81       	ldd	r30, Y+5	; 0x05
    1ab8:	fe 81       	ldd	r31, Y+6	; 0x06
    1aba:	71 96       	adiw	r30, 0x11	; 17
    1abc:	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) ||
    1abe:	8e 2f       	mov	r24, r30
    1ac0:	90 e0       	ldi	r25, 0x00	; 0
    1ac2:	82 17       	cp	r24, r18
    1ac4:	93 07       	cpc	r25, r19
    1ac6:	98 f0       	brcs	.+38     	; 0x1aee <USB_Device_ProcessControlPacket+0x374>
#endif
	{
		return;
	}
	
	Endpoint_ClearSetupReceived();
    1ac8:	80 91 e8 00 	lds	r24, 0x00E8
    1acc:	87 7f       	andi	r24, 0xF7	; 247
    1ace:	80 93 e8 00 	sts	0x00E8, r24

	USB_ConfigurationNumber = wValue;
    1ad2:	20 93 c4 01 	sts	0x01C4, r18

	Endpoint_ClearSetupIN();
    1ad6:	80 91 e8 00 	lds	r24, 0x00E8
    1ada:	8e 7f       	andi	r24, 0xFE	; 254
    1adc:	80 93 e8 00 	sts	0x00E8, r24

	if (NotAlreadyConfigured)
    1ae0:	ff 20       	and	r15, r15
    1ae2:	09 f4       	brne	.+2      	; 0x1ae6 <USB_Device_ProcessControlPacket+0x36c>
	  RAISE_EVENT(USB_DeviceEnumerationComplete);
    1ae4:	cb d0       	rcall	.+406    	; 0x1c7c <Event_USB_DeviceEnumerationComplete>

	RAISE_EVENT(USB_ConfigurationChanged);
    1ae6:	e3 d8       	rcall	.-3642   	; 0xcae <Event_USB_ConfigurationChanged>
    1ae8:	02 c0       	rjmp	.+4      	; 0x1aee <USB_Device_ProcessControlPacket+0x374>

			break;
	}

	if (!(RequestHandled))
	  RAISE_EVENT(USB_UnhandledControlPacket, bRequest, bmRequestType);
    1aea:	84 2f       	mov	r24, r20
    1aec:	86 d8       	rcall	.-3828   	; 0xbfa <Event_USB_UnhandledControlPacket>
	  
	if (Endpoint_IsSetupReceived())
    1aee:	80 91 e8 00 	lds	r24, 0x00E8
    1af2:	83 ff       	sbrs	r24, 3
    1af4:	0a c0       	rjmp	.+20     	; 0x1b0a <USB_Device_ProcessControlPacket+0x390>
	{
		Endpoint_StallTransaction();
    1af6:	80 91 eb 00 	lds	r24, 0x00EB
    1afa:	80 62       	ori	r24, 0x20	; 32
    1afc:	80 93 eb 00 	sts	0x00EB, r24
		Endpoint_ClearSetupReceived();		
    1b00:	80 91 e8 00 	lds	r24, 0x00E8
    1b04:	87 7f       	andi	r24, 0xF7	; 247
    1b06:	80 93 e8 00 	sts	0x00E8, r24
	}
}
    1b0a:	28 96       	adiw	r28, 0x08	; 8
    1b0c:	0f b6       	in	r0, 0x3f	; 63
    1b0e:	f8 94       	cli
    1b10:	de bf       	out	0x3e, r29	; 62
    1b12:	0f be       	out	0x3f, r0	; 63
    1b14:	cd bf       	out	0x3d, r28	; 61
    1b16:	cf 91       	pop	r28
    1b18:	df 91       	pop	r29
    1b1a:	1f 91       	pop	r17
    1b1c:	0f 91       	pop	r16
    1b1e:	ff 90       	pop	r15
    1b20:	08 95       	ret

00001b22 <USB_USBTask>:
#if defined(USB_CAN_BE_HOST)
volatile uint8_t   USB_HostState;
#endif

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

#if defined(USB_CAN_BE_DEVICE)
static void USB_DeviceTask(void)
{
	if (USB_IsConnected)
    1b24:	80 91 c6 01 	lds	r24, 0x01C6
    1b28:	88 23       	and	r24, r24
    1b2a:	61 f0       	breq	.+24     	; 0x1b44 <USB_USBTask+0x22>
	{
		uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
    1b2c:	10 91 e9 00 	lds	r17, 0x00E9
	
		Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
    1b30:	10 92 e9 00 	sts	0x00E9, r1

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

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

00001b48 <USB_INT_DisableAllInterrupts>:

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

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

00001b4e <USB_INT_ClearAllInterrupts>:

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

00001b54 <__vector_11>:

ISR(USB_GEN_vect)
{
    1b54:	1f 92       	push	r1
    1b56:	0f 92       	push	r0
    1b58:	0f b6       	in	r0, 0x3f	; 63
    1b5a:	0f 92       	push	r0
    1b5c:	11 24       	eor	r1, r1
    1b5e:	2f 93       	push	r18
    1b60:	3f 93       	push	r19
    1b62:	4f 93       	push	r20
    1b64:	5f 93       	push	r21
    1b66:	6f 93       	push	r22
    1b68:	7f 93       	push	r23
    1b6a:	8f 93       	push	r24
    1b6c:	9f 93       	push	r25
    1b6e:	af 93       	push	r26
    1b70:	bf 93       	push	r27
    1b72:	ef 93       	push	r30
    1b74:	ff 93       	push	r31
			USB_IsConnected = false;
		}
	}
	#endif

	if (USB_INT_HasOccurred(USB_INT_SUSPEND) && USB_INT_IsEnabled(USB_INT_SUSPEND))
    1b76:	80 91 e1 00 	lds	r24, 0x00E1
    1b7a:	80 ff       	sbrs	r24, 0
    1b7c:	1e c0       	rjmp	.+60     	; 0x1bba <__vector_11+0x66>
    1b7e:	80 91 e2 00 	lds	r24, 0x00E2
    1b82:	80 ff       	sbrs	r24, 0
    1b84:	1a c0       	rjmp	.+52     	; 0x1bba <__vector_11+0x66>
	{
		USB_INT_Clear(USB_INT_SUSPEND);
    1b86:	80 91 e1 00 	lds	r24, 0x00E1
    1b8a:	8e 7f       	andi	r24, 0xFE	; 254
    1b8c:	80 93 e1 00 	sts	0x00E1, r24

		USB_INT_Disable(USB_INT_SUSPEND);
    1b90:	80 91 e2 00 	lds	r24, 0x00E2
    1b94:	8e 7f       	andi	r24, 0xFE	; 254
    1b96:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_WAKEUP);
    1b9a:	80 91 e2 00 	lds	r24, 0x00E2
    1b9e:	80 61       	ori	r24, 0x10	; 16
    1ba0:	80 93 e2 00 	sts	0x00E2, r24
		
		USB_CLK_Freeze();
    1ba4:	80 91 d8 00 	lds	r24, 0x00D8
    1ba8:	80 62       	ori	r24, 0x20	; 32
    1baa:	80 93 d8 00 	sts	0x00D8, r24
		#if !defined(MANUAL_PLL_CONTROL)
		USB_PLL_Off();
    1bae:	19 bc       	out	0x29, r1	; 41
		#endif

		RAISE_EVENT(USB_Suspend);
    1bb0:	65 d0       	rcall	.+202    	; 0x1c7c <Event_USB_DeviceEnumerationComplete>

		#if defined(USB_LIMITED_CONTROLLER)
		USB_IsConnected = false;
    1bb2:	10 92 c6 01 	sts	0x01C6, r1
		RAISE_EVENT(USB_Disconnect);
    1bb6:	0e 94 43 03 	call	0x686	; 0x686 <Event_USB_Disconnect>
		#endif
	}

	if (USB_INT_HasOccurred(USB_INT_WAKEUP) && USB_INT_IsEnabled(USB_INT_WAKEUP))
    1bba:	80 91 e1 00 	lds	r24, 0x00E1
    1bbe:	84 ff       	sbrs	r24, 4
    1bc0:	26 c0       	rjmp	.+76     	; 0x1c0e <__vector_11+0xba>
    1bc2:	80 91 e2 00 	lds	r24, 0x00E2
    1bc6:	84 ff       	sbrs	r24, 4
    1bc8:	22 c0       	rjmp	.+68     	; 0x1c0e <__vector_11+0xba>
	{
		#if !defined(MANUAL_PLL_CONTROL)
		USB_PLL_On();
    1bca:	84 e0       	ldi	r24, 0x04	; 4
    1bcc:	89 bd       	out	0x29, r24	; 41
    1bce:	89 b5       	in	r24, 0x29	; 41
    1bd0:	82 60       	ori	r24, 0x02	; 2
    1bd2:	89 bd       	out	0x29, r24	; 41
		#endif
		while (!(USB_PLL_IsReady()));
    1bd4:	09 b4       	in	r0, 0x29	; 41
    1bd6:	00 fe       	sbrs	r0, 0
    1bd8:	fd cf       	rjmp	.-6      	; 0x1bd4 <__vector_11+0x80>

		USB_CLK_Unfreeze();
    1bda:	80 91 d8 00 	lds	r24, 0x00D8
    1bde:	8f 7d       	andi	r24, 0xDF	; 223
    1be0:	80 93 d8 00 	sts	0x00D8, r24

		USB_INT_Clear(USB_INT_WAKEUP);
    1be4:	80 91 e1 00 	lds	r24, 0x00E1
    1be8:	8f 7e       	andi	r24, 0xEF	; 239
    1bea:	80 93 e1 00 	sts	0x00E1, r24

		USB_INT_Disable(USB_INT_WAKEUP);
    1bee:	80 91 e2 00 	lds	r24, 0x00E2
    1bf2:	8f 7e       	andi	r24, 0xEF	; 239
    1bf4:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_SUSPEND);
    1bf8:	80 91 e2 00 	lds	r24, 0x00E2
    1bfc:	81 60       	ori	r24, 0x01	; 1
    1bfe:	80 93 e2 00 	sts	0x00E2, r24
		
		#if defined(USB_LIMITED_CONTROLLER)
		USB_IsConnected = true;
    1c02:	81 e0       	ldi	r24, 0x01	; 1
    1c04:	80 93 c6 01 	sts	0x01C6, r24
		RAISE_EVENT(USB_Connect);
    1c08:	0e 94 4b 03 	call	0x696	; 0x696 <Event_USB_Connect>
		#endif

		RAISE_EVENT(USB_WakeUp);
    1c0c:	37 d0       	rcall	.+110    	; 0x1c7c <Event_USB_DeviceEnumerationComplete>
	}
   
	if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
    1c0e:	80 91 e1 00 	lds	r24, 0x00E1
    1c12:	83 ff       	sbrs	r24, 3
    1c14:	22 c0       	rjmp	.+68     	; 0x1c5a <__vector_11+0x106>
    1c16:	80 91 e2 00 	lds	r24, 0x00E2
    1c1a:	83 ff       	sbrs	r24, 3
    1c1c:	1e c0       	rjmp	.+60     	; 0x1c5a <__vector_11+0x106>
	{
		USB_INT_Clear(USB_INT_EORSTI);
    1c1e:	80 91 e1 00 	lds	r24, 0x00E1
    1c22:	87 7f       	andi	r24, 0xF7	; 247
    1c24:	80 93 e1 00 	sts	0x00E1, r24

		USB_ConfigurationNumber = 0;
    1c28:	10 92 c4 01 	sts	0x01C4, r1

		USB_INT_Clear(USB_INT_SUSPEND);
    1c2c:	80 91 e1 00 	lds	r24, 0x00E1
    1c30:	8e 7f       	andi	r24, 0xFE	; 254
    1c32:	80 93 e1 00 	sts	0x00E1, r24
		USB_INT_Disable(USB_INT_SUSPEND);
    1c36:	80 91 e2 00 	lds	r24, 0x00E2
    1c3a:	8e 7f       	andi	r24, 0xFE	; 254
    1c3c:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_WAKEUP);
    1c40:	80 91 e2 00 	lds	r24, 0x00E2
    1c44:	80 61       	ori	r24, 0x10	; 16
    1c46:	80 93 e2 00 	sts	0x00E2, r24

		Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
    1c4a:	60 91 1a 01 	lds	r22, 0x011A
    1c4e:	20 e0       	ldi	r18, 0x00	; 0
    1c50:	40 e0       	ldi	r20, 0x00	; 0
    1c52:	70 e0       	ldi	r23, 0x00	; 0
    1c54:	80 e0       	ldi	r24, 0x00	; 0
    1c56:	07 dd       	rcall	.-1522   	; 0x1666 <Endpoint_ConfigureEndpoint_P>
		                           ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
		                           ENDPOINT_BANK_SINGLE);

		RAISE_EVENT(USB_Reset);
    1c58:	11 d0       	rcall	.+34     	; 0x1c7c <Event_USB_DeviceEnumerationComplete>
		USB_OTGPAD_On();

		USB_SetupInterface();	
	}
	#endif
}
    1c5a:	ff 91       	pop	r31
    1c5c:	ef 91       	pop	r30
    1c5e:	bf 91       	pop	r27
    1c60:	af 91       	pop	r26
    1c62:	9f 91       	pop	r25
    1c64:	8f 91       	pop	r24
    1c66:	7f 91       	pop	r23
    1c68:	6f 91       	pop	r22
    1c6a:	5f 91       	pop	r21
    1c6c:	4f 91       	pop	r20
    1c6e:	3f 91       	pop	r19
    1c70:	2f 91       	pop	r18
    1c72:	0f 90       	pop	r0
    1c74:	0f be       	out	0x3f, r0	; 63
    1c76:	0f 90       	pop	r0
    1c78:	1f 90       	pop	r1
    1c7a:	18 95       	reti

00001c7c <Event_USB_DeviceEnumerationComplete>:

#define INCLUDE_FROM_EVENTS_C
#include "Events.h"

static void __stub(void)
{
    1c7c:	08 95       	ret

00001c7e <__mulhi3>:
    1c7e:	55 27       	eor	r21, r21
    1c80:	00 24       	eor	r0, r0

00001c82 <__mulhi3_loop>:
    1c82:	80 ff       	sbrs	r24, 0
    1c84:	02 c0       	rjmp	.+4      	; 0x1c8a <__mulhi3_skip1>
    1c86:	06 0e       	add	r0, r22
    1c88:	57 1f       	adc	r21, r23

00001c8a <__mulhi3_skip1>:
    1c8a:	66 0f       	add	r22, r22
    1c8c:	77 1f       	adc	r23, r23
    1c8e:	61 15       	cp	r22, r1
    1c90:	71 05       	cpc	r23, r1
    1c92:	21 f0       	breq	.+8      	; 0x1c9c <__mulhi3_exit>
    1c94:	96 95       	lsr	r25
    1c96:	87 95       	ror	r24
    1c98:	00 97       	sbiw	r24, 0x00	; 0
    1c9a:	99 f7       	brne	.-26     	; 0x1c82 <__mulhi3_loop>

00001c9c <__mulhi3_exit>:
    1c9c:	95 2f       	mov	r25, r21
    1c9e:	80 2d       	mov	r24, r0
    1ca0:	08 95       	ret

00001ca2 <__udivmodhi4>:
    1ca2:	aa 1b       	sub	r26, r26
    1ca4:	bb 1b       	sub	r27, r27
    1ca6:	51 e1       	ldi	r21, 0x11	; 17
    1ca8:	07 c0       	rjmp	.+14     	; 0x1cb8 <__udivmodhi4_ep>

00001caa <__udivmodhi4_loop>:
    1caa:	aa 1f       	adc	r26, r26
    1cac:	bb 1f       	adc	r27, r27
    1cae:	a6 17       	cp	r26, r22
    1cb0:	b7 07       	cpc	r27, r23
    1cb2:	10 f0       	brcs	.+4      	; 0x1cb8 <__udivmodhi4_ep>
    1cb4:	a6 1b       	sub	r26, r22
    1cb6:	b7 0b       	sbc	r27, r23

00001cb8 <__udivmodhi4_ep>:
    1cb8:	88 1f       	adc	r24, r24
    1cba:	99 1f       	adc	r25, r25
    1cbc:	5a 95       	dec	r21
    1cbe:	a9 f7       	brne	.-22     	; 0x1caa <__udivmodhi4_loop>
    1cc0:	80 95       	com	r24
    1cc2:	90 95       	com	r25
    1cc4:	bc 01       	movw	r22, r24
    1cc6:	cd 01       	movw	r24, r26
    1cc8:	08 95       	ret

00001cca <__udivmodsi4>:
    1cca:	a1 e2       	ldi	r26, 0x21	; 33
    1ccc:	1a 2e       	mov	r1, r26
    1cce:	aa 1b       	sub	r26, r26
    1cd0:	bb 1b       	sub	r27, r27
    1cd2:	fd 01       	movw	r30, r26
    1cd4:	0d c0       	rjmp	.+26     	; 0x1cf0 <__udivmodsi4_ep>

00001cd6 <__udivmodsi4_loop>:
    1cd6:	aa 1f       	adc	r26, r26
    1cd8:	bb 1f       	adc	r27, r27
    1cda:	ee 1f       	adc	r30, r30
    1cdc:	ff 1f       	adc	r31, r31
    1cde:	a2 17       	cp	r26, r18
    1ce0:	b3 07       	cpc	r27, r19
    1ce2:	e4 07       	cpc	r30, r20
    1ce4:	f5 07       	cpc	r31, r21
    1ce6:	20 f0       	brcs	.+8      	; 0x1cf0 <__udivmodsi4_ep>
    1ce8:	a2 1b       	sub	r26, r18
    1cea:	b3 0b       	sbc	r27, r19
    1cec:	e4 0b       	sbc	r30, r20
    1cee:	f5 0b       	sbc	r31, r21

00001cf0 <__udivmodsi4_ep>:
    1cf0:	66 1f       	adc	r22, r22
    1cf2:	77 1f       	adc	r23, r23
    1cf4:	88 1f       	adc	r24, r24
    1cf6:	99 1f       	adc	r25, r25
    1cf8:	1a 94       	dec	r1
    1cfa:	69 f7       	brne	.-38     	; 0x1cd6 <__udivmodsi4_loop>
    1cfc:	60 95       	com	r22
    1cfe:	70 95       	com	r23
    1d00:	80 95       	com	r24
    1d02:	90 95       	com	r25
    1d04:	9b 01       	movw	r18, r22
    1d06:	ac 01       	movw	r20, r24
    1d08:	bd 01       	movw	r22, r26
    1d0a:	cf 01       	movw	r24, r30
    1d0c:	08 95       	ret

00001d0e <_exit>:
    1d0e:	f8 94       	cli

00001d10 <__stop_program>:
    1d10:	ff cf       	rjmp	.-2      	; 0x1d10 <__stop_program>
