
USB10.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .data         0000001c  00800100  00001cb2  00001d26  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  1 .text         00001cb2  00000000  00000000  00000074  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .bss          00000095  0080011c  00001cce  00001d42  2**0
                  ALLOC
  3 .debug_aranges 000003c8  00000000  00000000  00001d42  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_pubnames 00000974  00000000  00000000  0000210a  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_info   00003a70  00000000  00000000  00002a7e  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_abbrev 00001358  00000000  00000000  000064ee  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_line   00003760  00000000  00000000  00007846  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_frame  000005d0  00000000  00000000  0000afa8  2**2
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_str    000015ec  00000000  00000000  0000b578  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_loc    00001448  00000000  00000000  0000cb64  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_ranges 00000430  00000000  00000000  0000dfac  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <__vectors>:




void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
       0:	b7 c0       	rjmp	.+366    	; 0x170 <__ctors_end>
	
	Delay(I2C_PERIOD);
}

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

volatile SchedulerDelayCounter_t Scheduler_TickCounter;
volatile uint8_t                 Scheduler_TotalTasks;

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

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

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

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

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

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

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

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

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

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

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

0000017c <__do_copy_data>:
     17c:	11 e0       	ldi	r17, 0x01	; 1
     17e:	a0 e0       	ldi	r26, 0x00	; 0
     180:	b1 e0       	ldi	r27, 0x01	; 1
     182:	e2 eb       	ldi	r30, 0xB2	; 178
     184:	fc e1       	ldi	r31, 0x1C	; 28
     186:	02 c0       	rjmp	.+4      	; 0x18c <.do_copy_data_start>

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

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

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

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

0000019c <.do_clear_bss_start>:
     19c:	a1 3b       	cpi	r26, 0xB1	; 177
     19e:	b1 07       	cpc	r27, r17
     1a0:	e1 f7       	brne	.-8      	; 0x19a <.do_clear_bss_loop>
     1a2:	69 d5       	rcall	.+2770   	; 0xc76 <main>
     1a4:	0c 94 57 0e 	jmp	0x1cae	; 0x1cae <_exit>

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

000001aa <ISP_Int>:
	}
}


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

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1b4:	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);
     1b6:	45 98       	cbi	0x08, 5	; 8
     1b8:	3f 98       	cbi	0x07, 7	; 7
			DDRC |= (1<<MOSI_2) | (1<<SCK_2) | (1<<RES_2);
     1ba:	87 b1       	in	r24, 0x07	; 7
     1bc:	84 63       	ori	r24, 0x34	; 52
     1be:	87 b9       	out	0x07, r24	; 7
     1c0:	08 95       	ret

000001c2 <Write_ISP_Byte>:
}


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

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1c4:	45 98       	cbi	0x08, 5	; 8
     1c6:	20 e8       	ldi	r18, 0x80	; 128
     1c8:	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))
     1ca:	82 2f       	mov	r24, r18
     1cc:	83 23       	and	r24, r19
     1ce:	11 f0       	breq	.+4      	; 0x1d4 <Write_ISP_Byte+0x12>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     1d0:	44 9a       	sbi	0x08, 4	; 8
     1d2:	01 c0       	rjmp	.+2      	; 0x1d6 <Write_ISP_Byte+0x14>

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

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1d8:	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++)
     1da:	9f 5f       	subi	r25, 0xFF	; 255
     1dc:	98 30       	cpi	r25, 0x08	; 8
     1de:	11 f0       	breq	.+4      	; 0x1e4 <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;
     1e0:	26 95       	lsr	r18
     1e2:	f3 cf       	rjmp	.-26     	; 0x1ca <Write_ISP_Byte+0x8>
     1e4:	08 95       	ret

000001e6 <Write_Read_ISP_Byte>:
	}
}


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

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1e8:	45 98       	cbi	0x08, 5	; 8
     1ea:	30 e8       	ldi	r19, 0x80	; 128
     1ec:	90 e0       	ldi	r25, 0x00	; 0
     1ee:	20 e0       	ldi	r18, 0x00	; 0
//	DelayUsec(5+INTERBITDELAY);
	mask = 0x80;
	inbyte = 0x00;
	for(i=0; i<8; i++)
	{
		if((outbyte&mask))
     1f0:	83 2f       	mov	r24, r19
     1f2:	84 23       	and	r24, r20
     1f4:	11 f0       	breq	.+4      	; 0x1fa <Write_Read_ISP_Byte+0x14>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     1f6:	44 9a       	sbi	0x08, 4	; 8
     1f8:	01 c0       	rjmp	.+2      	; 0x1fc <Write_Read_ISP_Byte+0x16>

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     1fa:	44 98       	cbi	0x08, 4	; 8
	}
	else
	{
		PORTC |= (1<<pinId);
     1fc:	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??
     1fe:	21 11       	cpse	r18, r1
		{
			inbyte = inbyte<<1;
     200:	99 0f       	add	r25, r25
		}	
		if(PINC & (1<<MISO_2))
     202:	37 99       	sbic	0x06, 7	; 6
		{
			inbyte |= 0x01;
     204:	91 60       	ori	r25, 0x01	; 1

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     206:	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++)
     208:	2f 5f       	subi	r18, 0xFF	; 255
     20a:	28 30       	cpi	r18, 0x08	; 8
     20c:	11 f0       	breq	.+4      	; 0x212 <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;	
     20e:	36 95       	lsr	r19
     210:	ef cf       	rjmp	.-34     	; 0x1f0 <Write_Read_ISP_Byte+0xa>
	}
	return inbyte;
}
     212:	89 2f       	mov	r24, r25
     214:	08 95       	ret

00000216 <Chip_Busy_Status>:
		}
	}
	return '0';
}
unsigned char Chip_Busy_Status(void)
{
     216:	80 ef       	ldi	r24, 0xF0	; 240
     218:	d4 df       	rcall	.-88     	; 0x1c2 <Write_ISP_Byte>
	unsigned char busybyte;

	//  Read Fuse Low Byte 0
	Write_ISP_Byte(0xF0);//POLL_RDYBSY
	Write_ISP_Byte(0x00);
     21a:	80 e0       	ldi	r24, 0x00	; 0
     21c:	d2 df       	rcall	.-92     	; 0x1c2 <Write_ISP_Byte>
	Write_ISP_Byte(0x00);
     21e:	80 e0       	ldi	r24, 0x00	; 0
     220:	d0 df       	rcall	.-96     	; 0x1c2 <Write_ISP_Byte>
	busybyte = Write_Read_ISP_Byte(0x00);
     222:	80 e0       	ldi	r24, 0x00	; 0

	return busybyte;
}
     224:	e0 cf       	rjmp	.-64     	; 0x1e6 <Write_Read_ISP_Byte>

00000226 <Wait_For_Busy>:
	}
	return inbyte;
}

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

	loopcnt = 0;
	while((Chip_Busy_Status()&0x01))
     230:	21 96       	adiw	r28, 0x01	; 1
	{
		DelayUsec(100);
		if(loopcnt++>5000)
     232:	83 e1       	ldi	r24, 0x13	; 19
     234:	ca 38       	cpi	r28, 0x8A	; 138
     236:	d8 07       	cpc	r29, r24
     238:	11 f4       	brne	.+4      	; 0x23e <Wait_For_Busy+0x18>
     23a:	81 e3       	ldi	r24, 0x31	; 49
     23c:	04 c0       	rjmp	.+8      	; 0x246 <Wait_For_Busy+0x20>
unsigned char Wait_For_Busy(void)
{
	uint32_t loopcnt;

	loopcnt = 0;
	while((Chip_Busy_Status()&0x01))
     23e:	eb df       	rcall	.-42     	; 0x216 <Chip_Busy_Status>
     240:	80 fd       	sbrc	r24, 0
     242:	f6 cf       	rjmp	.-20     	; 0x230 <Wait_For_Busy+0xa>
     244:	80 e3       	ldi	r24, 0x30	; 48
		{
			return '1';
		}
	}
	return '0';
}
     246:	df 91       	pop	r29
     248:	cf 91       	pop	r28
     24a:	08 95       	ret

0000024c <ReconfigureUSART>:
		Buffer_StoreElementOnTop(&Tx_Buffer, UDR1);
	}
}

void ReconfigureUSART(void)
{
     24c:	80 91 17 01 	lds	r24, 0x0117
     250:	81 30       	cpi	r24, 0x01	; 1
     252:	11 f4       	brne	.+4      	; 0x258 <ReconfigureUSART+0xc>
     254:	90 e3       	ldi	r25, 0x30	; 48
     256:	05 c0       	rjmp	.+10     	; 0x262 <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)
     258:	82 30       	cpi	r24, 0x02	; 2
     25a:	11 f4       	brne	.+4      	; 0x260 <ReconfigureUSART+0x14>
     25c:	90 e2       	ldi	r25, 0x20	; 32
     25e:	01 c0       	rjmp	.+2      	; 0x262 <ReconfigureUSART+0x16>
     260:	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)
     262:	80 91 16 01 	lds	r24, 0x0116
     266:	82 30       	cpi	r24, 0x02	; 2
     268:	09 f4       	brne	.+2      	; 0x26c <ReconfigureUSART+0x20>
	  ConfigMask |= (1 << USBS1);
     26a:	98 60       	ori	r25, 0x08	; 8

	/* Determine data size - 5, 6, 7, or 8 bits are supported */
	if (LineCoding.DataBits == 6)
     26c:	80 91 18 01 	lds	r24, 0x0118
     270:	86 30       	cpi	r24, 0x06	; 6
     272:	11 f4       	brne	.+4      	; 0x278 <ReconfigureUSART+0x2c>
	  ConfigMask |= (1 << UCSZ10);
     274:	92 60       	ori	r25, 0x02	; 2
     276:	07 c0       	rjmp	.+14     	; 0x286 <ReconfigureUSART+0x3a>
	else if (LineCoding.DataBits == 7)
     278:	87 30       	cpi	r24, 0x07	; 7
     27a:	11 f4       	brne	.+4      	; 0x280 <ReconfigureUSART+0x34>
	  ConfigMask |= (1 << UCSZ11);
     27c:	94 60       	ori	r25, 0x04	; 4
     27e:	03 c0       	rjmp	.+6      	; 0x286 <ReconfigureUSART+0x3a>
	else if (LineCoding.DataBits == 8)
     280:	88 30       	cpi	r24, 0x08	; 8
     282:	09 f4       	brne	.+2      	; 0x286 <ReconfigureUSART+0x3a>
	  ConfigMask |= ((1 << UCSZ11) | (1 << UCSZ10));
     284:	96 60       	ori	r25, 0x06	; 6

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

	/* Set the USART mode to the mask generated by the Line Coding options */
	UCSR1C = ConfigMask;
     292:	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);
     296:	20 91 12 01 	lds	r18, 0x0112
     29a:	30 91 13 01 	lds	r19, 0x0113
     29e:	40 e0       	ldi	r20, 0x00	; 0
     2a0:	50 e0       	ldi	r21, 0x00	; 0
     2a2:	60 e4       	ldi	r22, 0x40	; 64
     2a4:	72 e4       	ldi	r23, 0x42	; 66
     2a6:	8f e0       	ldi	r24, 0x0F	; 15
     2a8:	90 e0       	ldi	r25, 0x00	; 0
     2aa:	0e 94 35 0e 	call	0x1c6a	; 0x1c6a <__udivmodsi4>
     2ae:	21 50       	subi	r18, 0x01	; 1
     2b0:	30 40       	sbci	r19, 0x00	; 0
     2b2:	30 93 cd 00 	sts	0x00CD, r19
     2b6:	20 93 cc 00 	sts	0x00CC, r18
}
     2ba:	08 95       	ret

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

ISR(USART1_TX_vect)
{
     2bc:	1f 92       	push	r1
     2be:	0f 92       	push	r0
     2c0:	0f b6       	in	r0, 0x3f	; 63
     2c2:	0f 92       	push	r0
     2c4:	11 24       	eor	r1, r1
     2c6:	2f 93       	push	r18
     2c8:	3f 93       	push	r19
     2ca:	4f 93       	push	r20
     2cc:	5f 93       	push	r21
     2ce:	6f 93       	push	r22
     2d0:	7f 93       	push	r23
     2d2:	8f 93       	push	r24
     2d4:	9f 93       	push	r25
     2d6:	af 93       	push	r26
     2d8:	bf 93       	push	r27
     2da:	ef 93       	push	r30
     2dc:	ff 93       	push	r31
	/* Send next character if avaliable */
	if (Rx_Buffer.Elements != 0 && mode == SERIAL)
     2de:	80 91 a8 01 	lds	r24, 0x01A8
     2e2:	88 23       	and	r24, r24
     2e4:	51 f0       	breq	.+20     	; 0x2fa <__vector_25+0x3e>
     2e6:	80 91 1e 01 	lds	r24, 0x011E
     2ea:	81 30       	cpi	r24, 0x01	; 1
     2ec:	31 f4       	brne	.+12     	; 0x2fa <__vector_25+0x3e>
	{
		UDR1 = Buffer_GetElementFromBottom(&Rx_Buffer);
     2ee:	84 e6       	ldi	r24, 0x64	; 100
     2f0:	91 e0       	ldi	r25, 0x01	; 1
     2f2:	aa d5       	rcall	.+2900   	; 0xe48 <Buffer_GetElementFromBottom>
     2f4:	80 93 ce 00 	sts	0x00CE, r24
     2f8:	02 c0       	rjmp	.+4      	; 0x2fe <__vector_25+0x42>
	}
	else
	{
		Transmitting = false;
     2fa:	10 92 1c 01 	sts	0x011C, r1
	}
	  
}
     2fe:	ff 91       	pop	r31
     300:	ef 91       	pop	r30
     302:	bf 91       	pop	r27
     304:	af 91       	pop	r26
     306:	9f 91       	pop	r25
     308:	8f 91       	pop	r24
     30a:	7f 91       	pop	r23
     30c:	6f 91       	pop	r22
     30e:	5f 91       	pop	r21
     310:	4f 91       	pop	r20
     312:	3f 91       	pop	r19
     314:	2f 91       	pop	r18
     316:	0f 90       	pop	r0
     318:	0f be       	out	0x3f, r0	; 63
     31a:	0f 90       	pop	r0
     31c:	1f 90       	pop	r1
     31e:	18 95       	reti

00000320 <RemoveWhiteSpace>:
	return number;

}

void RemoveWhiteSpace(void)
{
     320:	84 e6       	ldi	r24, 0x64	; 100
     322:	91 e0       	ldi	r25, 0x01	; 1
     324:	91 d5       	rcall	.+2850   	; 0xe48 <Buffer_GetElementFromBottom>
     326:	68 2f       	mov	r22, r24
	uint8_t temp;

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
	//remove white space
	while(temp == ' ' || temp == '\t' || temp == ',')
     328:	80 32       	cpi	r24, 0x20	; 32
     32a:	d1 f3       	breq	.-12     	; 0x320 <RemoveWhiteSpace>
     32c:	89 30       	cpi	r24, 0x09	; 9
     32e:	c1 f3       	breq	.-16     	; 0x320 <RemoveWhiteSpace>
     330:	8c 32       	cpi	r24, 0x2C	; 44
     332:	b1 f3       	breq	.-20     	; 0x320 <RemoveWhiteSpace>
	{
		temp = Buffer_GetElementFromBottom(&Rx_Buffer);
	}
	Buffer_StoreElementOnBottom(&Rx_Buffer, temp);
     334:	84 e6       	ldi	r24, 0x64	; 100
     336:	91 e0       	ldi	r25, 0x01	; 1
}
     338:	b7 c5       	rjmp	.+2926   	; 0xea8 <Buffer_StoreElementOnBottom>

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


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

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     33c:	84 e6       	ldi	r24, 0x64	; 100
     33e:	91 e0       	ldi	r25, 0x01	; 1
     340:	83 d5       	rcall	.+2822   	; 0xe48 <Buffer_GetElementFromBottom>
     342:	68 2f       	mov	r22, r24

	if(temp >= 'a' && temp <= 'f')
     344:	81 56       	subi	r24, 0x61	; 97
     346:	86 30       	cpi	r24, 0x06	; 6
     348:	18 f4       	brcc	.+6      	; 0x350 <GetHexNumber+0x16>
	{
		number = temp -'a' + 0xA;
     34a:	16 2f       	mov	r17, r22
     34c:	17 55       	subi	r17, 0x57	; 87
     34e:	10 c0       	rjmp	.+32     	; 0x370 <GetHexNumber+0x36>
	}
	else if(temp >= 'A' && temp <= 'F')
     350:	86 2f       	mov	r24, r22
     352:	81 54       	subi	r24, 0x41	; 65
     354:	86 30       	cpi	r24, 0x06	; 6
     356:	18 f4       	brcc	.+6      	; 0x35e <GetHexNumber+0x24>
	{
		number = temp -'A' + 0xA;
     358:	16 2f       	mov	r17, r22
     35a:	17 53       	subi	r17, 0x37	; 55
     35c:	09 c0       	rjmp	.+18     	; 0x370 <GetHexNumber+0x36>
	}
	else if(temp >= '0' && temp <= '9')
     35e:	16 2f       	mov	r17, r22
     360:	10 53       	subi	r17, 0x30	; 48
     362:	1a 30       	cpi	r17, 0x0A	; 10
     364:	28 f0       	brcs	.+10     	; 0x370 <GetHexNumber+0x36>
	{
		number = temp -'0';
	}
	else
	{
		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     366:	84 e6       	ldi	r24, 0x64	; 100
     368:	91 e0       	ldi	r25, 0x01	; 1
     36a:	9e d5       	rcall	.+2876   	; 0xea8 <Buffer_StoreElementOnBottom>
     36c:	10 e0       	ldi	r17, 0x00	; 0
     36e:	1b c0       	rjmp	.+54     	; 0x3a6 <GetHexNumber+0x6c>
		return 0;
	}

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     370:	84 e6       	ldi	r24, 0x64	; 100
     372:	91 e0       	ldi	r25, 0x01	; 1
     374:	69 d5       	rcall	.+2770   	; 0xe48 <Buffer_GetElementFromBottom>
     376:	68 2f       	mov	r22, r24


	number <<=4;//scale the number up 4 bits
     378:	12 95       	swap	r17
     37a:	10 7f       	andi	r17, 0xF0	; 240

	if(temp >= 'a' && temp <= 'f')
     37c:	81 56       	subi	r24, 0x61	; 97
     37e:	86 30       	cpi	r24, 0x06	; 6
     380:	10 f4       	brcc	.+4      	; 0x386 <GetHexNumber+0x4c>
	{
		number += temp -'a' + 0xA;
     382:	67 55       	subi	r22, 0x57	; 87
     384:	05 c0       	rjmp	.+10     	; 0x390 <GetHexNumber+0x56>
	}
	else if(temp >= 'A' && temp <= 'F')
     386:	86 2f       	mov	r24, r22
     388:	81 54       	subi	r24, 0x41	; 65
     38a:	86 30       	cpi	r24, 0x06	; 6
     38c:	18 f4       	brcc	.+6      	; 0x394 <GetHexNumber+0x5a>
	{
		number += temp -'A' + 0xA;
     38e:	67 53       	subi	r22, 0x37	; 55
     390:	16 0f       	add	r17, r22
     392:	09 c0       	rjmp	.+18     	; 0x3a6 <GetHexNumber+0x6c>
	}
	else if(temp >= '0' && temp <= '9')
     394:	86 2f       	mov	r24, r22
     396:	80 53       	subi	r24, 0x30	; 48
     398:	8a 30       	cpi	r24, 0x0A	; 10
     39a:	10 f4       	brcc	.+4      	; 0x3a0 <GetHexNumber+0x66>
	{
		number += temp -'0';
     39c:	18 0f       	add	r17, r24
     39e:	03 c0       	rjmp	.+6      	; 0x3a6 <GetHexNumber+0x6c>
	}
	else
	{
		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if the character is no good to us, return it back to the buffer
     3a0:	84 e6       	ldi	r24, 0x64	; 100
     3a2:	91 e0       	ldi	r25, 0x01	; 1
     3a4:	81 d5       	rcall	.+2818   	; 0xea8 <Buffer_StoreElementOnBottom>
	}


	return number;

}
     3a6:	81 2f       	mov	r24, r17
     3a8:	1f 91       	pop	r17
     3aa:	08 95       	ret

000003ac <ParseNumber>:


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

	
	RemoveWhiteSpace();
     3ae:	b8 df       	rcall	.-144    	; 0x320 <RemoveWhiteSpace>

	temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     3b0:	84 e6       	ldi	r24, 0x64	; 100
     3b2:	91 e0       	ldi	r25, 0x01	; 1
     3b4:	49 d5       	rcall	.+2706   	; 0xe48 <Buffer_GetElementFromBottom>
     3b6:	28 2f       	mov	r18, r24

	if(temp == '\\')
     3b8:	8c 35       	cpi	r24, 0x5C	; 92
     3ba:	81 f4       	brne	.+32     	; 0x3dc <ParseNumber+0x30>
	{
		temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     3bc:	84 e6       	ldi	r24, 0x64	; 100
     3be:	91 e0       	ldi	r25, 0x01	; 1
     3c0:	43 d5       	rcall	.+2694   	; 0xe48 <Buffer_GetElementFromBottom>
     3c2:	68 2f       	mov	r22, r24
		if(temp == 'x' || temp == 'X')
     3c4:	88 37       	cpi	r24, 0x78	; 120
     3c6:	11 f0       	breq	.+4      	; 0x3cc <ParseNumber+0x20>
     3c8:	88 35       	cpi	r24, 0x58	; 88
     3ca:	19 f4       	brne	.+6      	; 0x3d2 <ParseNumber+0x26>
		{
			number = GetHexNumber();
     3cc:	b6 df       	rcall	.-148    	; 0x33a <GetHexNumber>
     3ce:	18 2f       	mov	r17, r24
     3d0:	1f c0       	rjmp	.+62     	; 0x410 <ParseNumber+0x64>
		}
		else
		{
			Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     3d2:	84 e6       	ldi	r24, 0x64	; 100
     3d4:	91 e0       	ldi	r25, 0x01	; 1
     3d6:	68 d5       	rcall	.+2768   	; 0xea8 <Buffer_StoreElementOnBottom>
     3d8:	10 e0       	ldi	r17, 0x00	; 0
     3da:	1a c0       	rjmp	.+52     	; 0x410 <ParseNumber+0x64>
			return 0;
		}	
	}
	else if(temp >= '0' && temp <= '9' )
     3dc:	80 53       	subi	r24, 0x30	; 48
     3de:	8a 30       	cpi	r24, 0x0A	; 10
     3e0:	10 f0       	brcs	.+4      	; 0x3e6 <ParseNumber+0x3a>
     3e2:	12 2f       	mov	r17, r18
     3e4:	15 c0       	rjmp	.+42     	; 0x410 <ParseNumber+0x64>
     3e6:	10 e0       	ldi	r17, 0x00	; 0
	{
		do
		{
			number *= 10;
     3e8:	81 2f       	mov	r24, r17
     3ea:	90 e0       	ldi	r25, 0x00	; 0
     3ec:	6a e0       	ldi	r22, 0x0A	; 10
     3ee:	70 e0       	ldi	r23, 0x00	; 0
     3f0:	0e 94 0f 0e 	call	0x1c1e	; 0x1c1e <__mulhi3>
			number += temp - '0';
     3f4:	12 2f       	mov	r17, r18
     3f6:	10 53       	subi	r17, 0x30	; 48
     3f8:	18 0f       	add	r17, r24
			temp = Buffer_GetElementFromBottom(&Rx_Buffer);
     3fa:	84 e6       	ldi	r24, 0x64	; 100
     3fc:	91 e0       	ldi	r25, 0x01	; 1
     3fe:	24 d5       	rcall	.+2632   	; 0xe48 <Buffer_GetElementFromBottom>
     400:	28 2f       	mov	r18, r24
		} while (temp >= '0' && temp <= '9' );
     402:	80 53       	subi	r24, 0x30	; 48
     404:	8a 30       	cpi	r24, 0x0A	; 10
     406:	80 f3       	brcs	.-32     	; 0x3e8 <ParseNumber+0x3c>

		Buffer_StoreElementOnBottom(&Rx_Buffer, temp);//if not a valid character return it to the buffer
     408:	62 2f       	mov	r22, r18
     40a:	84 e6       	ldi	r24, 0x64	; 100
     40c:	91 e0       	ldi	r25, 0x01	; 1
     40e:	4c d5       	rcall	.+2712   	; 0xea8 <Buffer_StoreElementOnBottom>
	}
	

	return number;

}
     410:	81 2f       	mov	r24, r17
     412:	1f 91       	pop	r17
     414:	08 95       	ret

00000416 <__vector_23>:

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

ISR(USART1_RX_vect)
{
     416:	1f 92       	push	r1
     418:	0f 92       	push	r0
     41a:	0f b6       	in	r0, 0x3f	; 63
     41c:	0f 92       	push	r0
     41e:	11 24       	eor	r1, r1
     420:	2f 93       	push	r18
     422:	3f 93       	push	r19
     424:	4f 93       	push	r20
     426:	5f 93       	push	r21
     428:	6f 93       	push	r22
     42a:	7f 93       	push	r23
     42c:	8f 93       	push	r24
     42e:	9f 93       	push	r25
     430:	af 93       	push	r26
     432:	bf 93       	push	r27
     434:	ef 93       	push	r30
     436:	ff 93       	push	r31
	if(mode == SERIAL)
     438:	80 91 1e 01 	lds	r24, 0x011E
     43c:	81 30       	cpi	r24, 0x01	; 1
     43e:	29 f4       	brne	.+10     	; 0x44a <__vector_23+0x34>
	{
		/* Character recieved, store it into the buffer */
		Buffer_StoreElementOnTop(&Tx_Buffer, UDR1);
     440:	60 91 ce 00 	lds	r22, 0x00CE
     444:	8f e1       	ldi	r24, 0x1F	; 31
     446:	91 e0       	ldi	r25, 0x01	; 1
     448:	9d d4       	rcall	.+2362   	; 0xd84 <Buffer_StoreElementOnTop>
	}
}
     44a:	ff 91       	pop	r31
     44c:	ef 91       	pop	r30
     44e:	bf 91       	pop	r27
     450:	af 91       	pop	r26
     452:	9f 91       	pop	r25
     454:	8f 91       	pop	r24
     456:	7f 91       	pop	r23
     458:	6f 91       	pop	r22
     45a:	5f 91       	pop	r21
     45c:	4f 91       	pop	r20
     45e:	3f 91       	pop	r19
     460:	2f 91       	pop	r18
     462:	0f 90       	pop	r0
     464:	0f be       	out	0x3f, r0	; 63
     466:	0f 90       	pop	r0
     468:	1f 90       	pop	r1
     46a:	18 95       	reti

0000046c <ISP_Update_Buffers>:
	}while(repeat);
}


void ISP_Update_Buffers(void)
{
     46c:	80 91 b0 01 	lds	r24, 0x01B0
     470:	88 23       	and	r24, r24
     472:	e1 f1       	breq	.+120    	; 0x4ec <ISP_Update_Buffers+0x80>
	if (USB_IsConnected)
	{
		/* Select the Serial Rx Endpoint */
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);
     474:	84 e0       	ldi	r24, 0x04	; 4
     476:	80 93 e9 00 	sts	0x00E9, r24

		if (Endpoint_ReadWriteAllowed())
     47a:	80 91 e8 00 	lds	r24, 0x00E8
     47e:	85 fd       	sbrc	r24, 5
     480:	06 c0       	rjmp	.+12     	; 0x48e <ISP_Update_Buffers+0x22>
     482:	0e c0       	rjmp	.+28     	; 0x4a0 <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;
     484:	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());
     488:	84 e6       	ldi	r24, 0x64	; 100
     48a:	91 e0       	ldi	r25, 0x01	; 1
     48c:	7b d4       	rcall	.+2294   	; 0xd84 <Buffer_StoreElementOnTop>
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);

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

			/* Clear the endpoint buffer */
			Endpoint_ClearCurrentBank();
     496:	80 91 e8 00 	lds	r24, 0x00E8
     49a:	8f 77       	andi	r24, 0x7F	; 127
     49c:	80 93 e8 00 	sts	0x00E8, r24
		}
		
		/* Select the Serial Tx Endpoint */
		Endpoint_SelectEndpoint(CDC_TX_EPNUM);
     4a0:	83 e0       	ldi	r24, 0x03	; 3
     4a2:	80 93 e9 00 	sts	0x00E9, r24

		/* Write the Data to the Endpoint */
		if(Tx_Buffer.Elements != 0)
     4a6:	80 91 63 01 	lds	r24, 0x0163
     4aa:	88 23       	and	r24, r24
     4ac:	f9 f0       	breq	.+62     	; 0x4ec <ISP_Update_Buffers+0x80>
		{

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

				Endpoint_Write_Byte(Buffer_GetElementFromBottom(&Tx_Buffer));
     4b6:	8f e1       	ldi	r24, 0x1F	; 31
     4b8:	91 e0       	ldi	r25, 0x01	; 1
     4ba:	c6 d4       	rcall	.+2444   	; 0xe48 <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;
     4bc:	80 93 f1 00 	sts	0x00F1, r24

				/* Check if the endpoint is full */
				if (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE)
     4c0:	80 91 f2 00 	lds	r24, 0x00F2
     4c4:	80 31       	cpi	r24, 0x10	; 16
     4c6:	49 f4       	brne	.+18     	; 0x4da <ISP_Update_Buffers+0x6e>
				{
					/* Send the data */
					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

					/* Wait until Serial Tx Endpoint Ready for Read/Write */
					while (!(Endpoint_ReadWriteAllowed()));
     4d2:	80 91 e8 00 	lds	r24, 0x00E8
     4d6:	85 ff       	sbrs	r24, 5
     4d8:	fc cf       	rjmp	.-8      	; 0x4d2 <ISP_Update_Buffers+0x66>
				}
			}while (Tx_Buffer.Elements != 0);
     4da:	80 91 63 01 	lds	r24, 0x0163
     4de:	88 23       	and	r24, r24
     4e0:	31 f7       	brne	.-52     	; 0x4ae <ISP_Update_Buffers+0x42>

			/* Send the last packet of the transfer to the host */
			Endpoint_ClearCurrentBank();
     4e2:	80 91 e8 00 	lds	r24, 0x00E8
     4e6:	8f 77       	andi	r24, 0x7F	; 127
     4e8:	80 93 e8 00 	sts	0x00E8, r24
     4ec:	08 95       	ret

000004ee <StringToBuffer_P>:
			break;
	}
}

void StringToBuffer_P(const char *data)
{
     4ee:	cf 93       	push	r28
     4f0:	df 93       	push	r29
     4f2:	ec 01       	movw	r28, r24
     4f4:	06 c0       	rjmp	.+12     	; 0x502 <StringToBuffer_P+0x14>
	while (pgm_read_byte(data) != 0x00)
	{
		Buffer_StoreElementOnTop(&Tx_Buffer, pgm_read_byte(data++));
     4f6:	21 96       	adiw	r28, 0x01	; 1
     4f8:	f9 01       	movw	r30, r18
     4fa:	64 91       	lpm	r22, Z+
     4fc:	8f e1       	ldi	r24, 0x1F	; 31
     4fe:	91 e0       	ldi	r25, 0x01	; 1
     500:	41 d4       	rcall	.+2178   	; 0xd84 <Buffer_StoreElementOnTop>
     502:	9e 01       	movw	r18, r28
	}
}

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

}
     50c:	df 91       	pop	r29
     50e:	cf 91       	pop	r28
     510:	08 95       	ret

00000512 <PROG_Task>:




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

	do
	{
		repeat = 0;

		if(Rx_Buffer.Elements != 0)
     514:	80 91 a8 01 	lds	r24, 0x01A8
     518:	88 23       	and	r24, r24
     51a:	09 f4       	brne	.+2      	; 0x51e <PROG_Task+0xc>
     51c:	9a c0       	rjmp	.+308    	; 0x652 <PROG_Task+0x140>
		{
			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     51e:	84 e6       	ldi	r24, 0x64	; 100
     520:	91 e0       	ldi	r25, 0x01	; 1
     522:	92 d4       	rcall	.+2340   	; 0xe48 <Buffer_GetElementFromBottom>
     524:	82 36       	cpi	r24, 0x62	; 98
     526:	09 f4       	brne	.+2      	; 0x52a <PROG_Task+0x18>
     528:	70 c0       	rjmp	.+224    	; 0x60a <PROG_Task+0xf8>
     52a:	83 36       	cpi	r24, 0x63	; 99
     52c:	38 f4       	brcc	.+14     	; 0x53c <PROG_Task+0x2a>
     52e:	83 33       	cpi	r24, 0x33	; 51
     530:	09 f4       	brne	.+2      	; 0x534 <PROG_Task+0x22>
     532:	38 c0       	rjmp	.+112    	; 0x5a4 <PROG_Task+0x92>
     534:	84 33       	cpi	r24, 0x34	; 52
     536:	09 f0       	breq	.+2      	; 0x53a <PROG_Task+0x28>
     538:	8c c0       	rjmp	.+280    	; 0x652 <PROG_Task+0x140>
     53a:	4e c0       	rjmp	.+156    	; 0x5d8 <PROG_Task+0xc6>
     53c:	82 37       	cpi	r24, 0x72	; 114
     53e:	31 f0       	breq	.+12     	; 0x54c <PROG_Task+0x3a>
     540:	87 37       	cpi	r24, 0x77	; 119
     542:	c9 f0       	breq	.+50     	; 0x576 <PROG_Task+0x64>
     544:	85 36       	cpi	r24, 0x65	; 101
     546:	09 f0       	breq	.+2      	; 0x54a <PROG_Task+0x38>
     548:	84 c0       	rjmp	.+264    	; 0x652 <PROG_Task+0x140>
     54a:	64 c0       	rjmp	.+200    	; 0x614 <PROG_Task+0x102>
			{
				case 'r':
					if (Rx_Buffer.Elements)//ensure we have received enough data
     54c:	80 91 a8 01 	lds	r24, 0x01A8
     550:	88 23       	and	r24, r24
     552:	79 f0       	breq	.+30     	; 0x572 <PROG_Task+0x60>
					{
						if(Buffer_GetElementFromBottom(&Rx_Buffer) == 'l')//set reset low on target board
     554:	84 e6       	ldi	r24, 0x64	; 100
     556:	91 e0       	ldi	r25, 0x01	; 1
     558:	77 d4       	rcall	.+2286   	; 0xe48 <Buffer_GetElementFromBottom>
     55a:	90 91 1e 01 	lds	r25, 0x011E
     55e:	8c 36       	cpi	r24, 0x6C	; 108
     560:	21 f4       	brne	.+8      	; 0x56a <PROG_Task+0x58>
						{
							if(mode == ISP2)
     562:	93 30       	cpi	r25, 0x03	; 3
     564:	b9 f6       	brne	.-82     	; 0x514 <PROG_Task+0x2>

void Change_ISP_Pin(unsigned char pinId,unsigned char state)
{
	if(state == LOW)
	{
		PORTC &= ~(1<<pinId);
     566:	42 98       	cbi	0x08, 2	; 8
     568:	d5 cf       	rjmp	.-86     	; 0x514 <PROG_Task+0x2>
								;
							}
						}
						else//set reset high
						{
							if(mode == ISP2)
     56a:	93 30       	cpi	r25, 0x03	; 3
     56c:	99 f6       	brne	.-90     	; 0x514 <PROG_Task+0x2>
	{
		PORTC &= ~(1<<pinId);
	}
	else
	{
		PORTC |= (1<<pinId);
     56e:	42 9a       	sbi	0x08, 2	; 8
     570:	d1 cf       	rjmp	.-94     	; 0x514 <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
     572:	62 e7       	ldi	r22, 0x72	; 114
     574:	47 c0       	rjmp	.+142    	; 0x604 <PROG_Task+0xf2>
					}

					break;

				case 'w':
					if (Rx_Buffer.Elements >= 4)//ensure we have received enough data
     576:	80 91 a8 01 	lds	r24, 0x01A8
     57a:	84 30       	cpi	r24, 0x04	; 4
     57c:	88 f0       	brcs	.+34     	; 0x5a0 <PROG_Task+0x8e>
						{
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     57e:	84 e6       	ldi	r24, 0x64	; 100
     580:	91 e0       	ldi	r25, 0x01	; 1
     582:	62 d4       	rcall	.+2244   	; 0xe48 <Buffer_GetElementFromBottom>
     584:	1e de       	rcall	.-964    	; 0x1c2 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     586:	84 e6       	ldi	r24, 0x64	; 100
     588:	91 e0       	ldi	r25, 0x01	; 1
     58a:	5e d4       	rcall	.+2236   	; 0xe48 <Buffer_GetElementFromBottom>
     58c:	1a de       	rcall	.-972    	; 0x1c2 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     58e:	84 e6       	ldi	r24, 0x64	; 100
     590:	91 e0       	ldi	r25, 0x01	; 1
     592:	5a d4       	rcall	.+2228   	; 0xe48 <Buffer_GetElementFromBottom>
     594:	16 de       	rcall	.-980    	; 0x1c2 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     596:	84 e6       	ldi	r24, 0x64	; 100
     598:	91 e0       	ldi	r25, 0x01	; 1
     59a:	56 d4       	rcall	.+2220   	; 0xe48 <Buffer_GetElementFromBottom>
     59c:	12 de       	rcall	.-988    	; 0x1c2 <Write_ISP_Byte>
     59e:	ba cf       	rjmp	.-140    	; 0x514 <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
     5a0:	67 e7       	ldi	r22, 0x77	; 119
     5a2:	30 c0       	rjmp	.+96     	; 0x604 <PROG_Task+0xf2>
						}

					break;
				case '3':
					if (Rx_Buffer.Elements >= 4)//ensure we have received enough data
     5a4:	80 91 a8 01 	lds	r24, 0x01A8
     5a8:	84 30       	cpi	r24, 0x04	; 4
     5aa:	a0 f0       	brcs	.+40     	; 0x5d4 <PROG_Task+0xc2>
					{
						Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5ac:	84 e6       	ldi	r24, 0x64	; 100
     5ae:	91 e0       	ldi	r25, 0x01	; 1
     5b0:	4b d4       	rcall	.+2198   	; 0xe48 <Buffer_GetElementFromBottom>
     5b2:	07 de       	rcall	.-1010   	; 0x1c2 <Write_ISP_Byte>
						Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5b4:	84 e6       	ldi	r24, 0x64	; 100
     5b6:	91 e0       	ldi	r25, 0x01	; 1
     5b8:	47 d4       	rcall	.+2190   	; 0xe48 <Buffer_GetElementFromBottom>
     5ba:	03 de       	rcall	.-1018   	; 0x1c2 <Write_ISP_Byte>
						Buffer_StoreElementOnTop(&Tx_Buffer, Write_Read_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer)) );
     5bc:	84 e6       	ldi	r24, 0x64	; 100
     5be:	91 e0       	ldi	r25, 0x01	; 1
     5c0:	43 d4       	rcall	.+2182   	; 0xe48 <Buffer_GetElementFromBottom>
     5c2:	11 de       	rcall	.-990    	; 0x1e6 <Write_Read_ISP_Byte>
     5c4:	68 2f       	mov	r22, r24
     5c6:	8f e1       	ldi	r24, 0x1F	; 31
     5c8:	91 e0       	ldi	r25, 0x01	; 1
     5ca:	dc d3       	rcall	.+1976   	; 0xd84 <Buffer_StoreElementOnTop>
						Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5cc:	84 e6       	ldi	r24, 0x64	; 100
     5ce:	91 e0       	ldi	r25, 0x01	; 1
     5d0:	3b d4       	rcall	.+2166   	; 0xe48 <Buffer_GetElementFromBottom>
     5d2:	f7 cd       	rjmp	.-1042   	; 0x1c2 <Write_ISP_Byte>
					}
					else
					{
						Buffer_StoreElementOnBottom(&Rx_Buffer, '3');//not enough data received yet
     5d4:	63 e3       	ldi	r22, 0x33	; 51
     5d6:	16 c0       	rjmp	.+44     	; 0x604 <PROG_Task+0xf2>
					}

					break;
				case '4':
					if (Rx_Buffer.Elements >= 4)//ensure we have received enough data
     5d8:	80 91 a8 01 	lds	r24, 0x01A8
     5dc:	84 30       	cpi	r24, 0x04	; 4
     5de:	88 f0       	brcs	.+34     	; 0x602 <PROG_Task+0xf0>
						{
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5e0:	84 e6       	ldi	r24, 0x64	; 100
     5e2:	91 e0       	ldi	r25, 0x01	; 1
     5e4:	31 d4       	rcall	.+2146   	; 0xe48 <Buffer_GetElementFromBottom>
     5e6:	ed dd       	rcall	.-1062   	; 0x1c2 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5e8:	84 e6       	ldi	r24, 0x64	; 100
     5ea:	91 e0       	ldi	r25, 0x01	; 1
     5ec:	2d d4       	rcall	.+2138   	; 0xe48 <Buffer_GetElementFromBottom>
     5ee:	e9 dd       	rcall	.-1070   	; 0x1c2 <Write_ISP_Byte>
							Write_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer));
     5f0:	84 e6       	ldi	r24, 0x64	; 100
     5f2:	91 e0       	ldi	r25, 0x01	; 1
     5f4:	29 d4       	rcall	.+2130   	; 0xe48 <Buffer_GetElementFromBottom>
     5f6:	e5 dd       	rcall	.-1078   	; 0x1c2 <Write_ISP_Byte>
							Buffer_StoreElementOnTop(&Tx_Buffer, Write_Read_ISP_Byte(Buffer_GetElementFromBottom(&Rx_Buffer)) );	
     5f8:	84 e6       	ldi	r24, 0x64	; 100
     5fa:	91 e0       	ldi	r25, 0x01	; 1
     5fc:	25 d4       	rcall	.+2122   	; 0xe48 <Buffer_GetElementFromBottom>
     5fe:	f3 dd       	rcall	.-1050   	; 0x1e6 <Write_Read_ISP_Byte>
     600:	05 c0       	rjmp	.+10     	; 0x60c <PROG_Task+0xfa>
						}
						else
						{
							Buffer_StoreElementOnBottom(&Rx_Buffer, '4');//not enough data received yet
     602:	64 e3       	ldi	r22, 0x34	; 52
     604:	84 e6       	ldi	r24, 0x64	; 100
     606:	91 e0       	ldi	r25, 0x01	; 1
     608:	4f c4       	rjmp	.+2206   	; 0xea8 <Buffer_StoreElementOnBottom>
						}

					break;
				case 'b':

					Buffer_StoreElementOnTop(&Tx_Buffer, Wait_For_Busy());
     60a:	0d de       	rcall	.-998    	; 0x226 <Wait_For_Busy>
     60c:	68 2f       	mov	r22, r24
     60e:	8f e1       	ldi	r24, 0x1F	; 31
     610:	91 e0       	ldi	r25, 0x01	; 1
     612:	b8 c3       	rjmp	.+1904   	; 0xd84 <Buffer_StoreElementOnTop>

					break;
				case 'e':

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

					Buffer_Initialize(&Rx_Buffer);//dump any unused data
     61a:	84 e6       	ldi	r24, 0x64	; 100
     61c:	91 e0       	ldi	r25, 0x01	; 1
     61e:	9e d3       	rcall	.+1852   	; 0xd5c <Buffer_Initialize>
					Buffer_Initialize(&Tx_Buffer);//dump any unused data
     620:	8f e1       	ldi	r24, 0x1F	; 31
     622:	91 e0       	ldi	r25, 0x01	; 1
     624:	9b d3       	rcall	.+1846   	; 0xd5c <Buffer_Initialize>

					Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     626:	6d e0       	ldi	r22, 0x0D	; 13
     628:	8f e1       	ldi	r24, 0x1F	; 31
     62a:	91 e0       	ldi	r25, 0x01	; 1
     62c:	ab d3       	rcall	.+1878   	; 0xd84 <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     62e:	6a e0       	ldi	r22, 0x0A	; 10
     630:	8f e1       	ldi	r24, 0x1F	; 31
     632:	91 e0       	ldi	r25, 0x01	; 1
     634:	a7 d3       	rcall	.+1870   	; 0xd84 <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     636:	6e e3       	ldi	r22, 0x3E	; 62
     638:	8f e1       	ldi	r24, 0x1F	; 31
     63a:	91 e0       	ldi	r25, 0x01	; 1
     63c:	a3 d3       	rcall	.+1862   	; 0xd84 <Buffer_StoreElementOnTop>
					mode = COMMAND;
     63e:	10 92 1e 01 	sts	0x011E, r1
					Scheduler_SetTaskMode(PROG_Task, TASK_STOP);		
     642:	60 e0       	ldi	r22, 0x00	; 0
     644:	89 e8       	ldi	r24, 0x89	; 137
     646:	92 e0       	ldi	r25, 0x02	; 2
     648:	53 d7       	rcall	.+3750   	; 0x14f0 <Scheduler_SetTaskMode>
					Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     64a:	61 e0       	ldi	r22, 0x01	; 1
     64c:	84 ee       	ldi	r24, 0xE4	; 228
     64e:	94 e0       	ldi	r25, 0x04	; 4
     650:	4f c7       	rjmp	.+3742   	; 0x14f0 <Scheduler_SetTaskMode>
     652:	08 95       	ret

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

}

EVENT_HANDLER(USB_Disconnect)
{
     654:	60 e0       	ldi	r22, 0x00	; 0
     656:	84 ee       	ldi	r24, 0xE4	; 228
     658:	94 e0       	ldi	r25, 0x04	; 4
     65a:	4a d7       	rcall	.+3732   	; 0x14f0 <Scheduler_SetTaskMode>
	/* Stop running CDC and USB management tasks */
	Scheduler_SetTaskMode(CDC_Task, TASK_STOP);
	Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
     65c:	60 e0       	ldi	r22, 0x00	; 0
     65e:	81 e6       	ldi	r24, 0x61	; 97
     660:	9d e0       	ldi	r25, 0x0D	; 13

}
     662:	46 c7       	rjmp	.+3724   	; 0x14f0 <Scheduler_SetTaskMode>

00000664 <Event_USB_Connect>:

}
*/

EVENT_HANDLER(USB_Connect)
{
     664:	61 e0       	ldi	r22, 0x01	; 1
     666:	81 e6       	ldi	r24, 0x61	; 97
     668:	9d e0       	ldi	r25, 0x0D	; 13
	/* Start USB management task */
	Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);

}
     66a:	42 c7       	rjmp	.+3716   	; 0x14f0 <Scheduler_SetTaskMode>

0000066c <Command_Task>:
}



TASK(Command_Task)
{
     66c:	9f 92       	push	r9
     66e:	af 92       	push	r10
     670:	bf 92       	push	r11
     672:	cf 92       	push	r12
     674:	df 92       	push	r13
     676:	ef 92       	push	r14
     678:	ff 92       	push	r15
     67a:	0f 93       	push	r16
     67c:	1f 93       	push	r17
     67e:	df 93       	push	r29
     680:	cf 93       	push	r28
     682:	cd b7       	in	r28, 0x3d	; 61
     684:	de b7       	in	r29, 0x3e	; 62
     686:	c0 54       	subi	r28, 0x40	; 64
     688:	d0 40       	sbci	r29, 0x00	; 0
     68a:	0f b6       	in	r0, 0x3f	; 63
     68c:	f8 94       	cli
     68e:	de bf       	out	0x3e, r29	; 62
     690:	0f be       	out	0x3f, r0	; 63
     692:	cd bf       	out	0x3d, r28	; 61
	uint8_t i, address = 0, lenght = 0, axis, oldValue;
	uint8_t temp[64];


	RemoveWhiteSpace();
     694:	45 de       	rcall	.-886    	; 0x320 <RemoveWhiteSpace>


	switch (Buffer_GetElementFromBottom(&Rx_Buffer))
     696:	84 e6       	ldi	r24, 0x64	; 100
     698:	91 e0       	ldi	r25, 0x01	; 1
     69a:	d6 d3       	rcall	.+1964   	; 0xe48 <Buffer_GetElementFromBottom>
     69c:	82 36       	cpi	r24, 0x62	; 98
     69e:	09 f4       	brne	.+2      	; 0x6a2 <Command_Task+0x36>
     6a0:	10 c1       	rjmp	.+544    	; 0x8c2 <Command_Task+0x256>
     6a2:	83 36       	cpi	r24, 0x63	; 99
     6a4:	e0 f4       	brcc	.+56     	; 0x6de <Command_Task+0x72>
     6a6:	8c 34       	cpi	r24, 0x4C	; 76
     6a8:	09 f4       	brne	.+2      	; 0x6ac <Command_Task+0x40>
     6aa:	11 c1       	rjmp	.+546    	; 0x8ce <Command_Task+0x262>
     6ac:	8d 34       	cpi	r24, 0x4D	; 77
     6ae:	80 f4       	brcc	.+32     	; 0x6d0 <Command_Task+0x64>
     6b0:	82 34       	cpi	r24, 0x42	; 66
     6b2:	09 f4       	brne	.+2      	; 0x6b6 <Command_Task+0x4a>
     6b4:	06 c1       	rjmp	.+524    	; 0x8c2 <Command_Task+0x256>
     6b6:	83 34       	cpi	r24, 0x43	; 67
     6b8:	38 f4       	brcc	.+14     	; 0x6c8 <Command_Task+0x5c>
     6ba:	88 23       	and	r24, r24
     6bc:	09 f4       	brne	.+2      	; 0x6c0 <Command_Task+0x54>
     6be:	4a c1       	rjmp	.+660    	; 0x954 <Command_Task+0x2e8>
     6c0:	8f 33       	cpi	r24, 0x3F	; 63
     6c2:	09 f0       	breq	.+2      	; 0x6c6 <Command_Task+0x5a>
     6c4:	3b c1       	rjmp	.+630    	; 0x93c <Command_Task+0x2d0>
     6c6:	b5 c0       	rjmp	.+362    	; 0x832 <Command_Task+0x1c6>
     6c8:	83 34       	cpi	r24, 0x43	; 67
     6ca:	09 f0       	breq	.+2      	; 0x6ce <Command_Task+0x62>
     6cc:	37 c1       	rjmp	.+622    	; 0x93c <Command_Task+0x2d0>
     6ce:	24 c0       	rjmp	.+72     	; 0x718 <Command_Task+0xac>
     6d0:	8d 34       	cpi	r24, 0x4D	; 77
     6d2:	09 f4       	brne	.+2      	; 0x6d6 <Command_Task+0x6a>
     6d4:	b2 c0       	rjmp	.+356    	; 0x83a <Command_Task+0x1ce>
     6d6:	83 35       	cpi	r24, 0x53	; 83
     6d8:	09 f0       	breq	.+2      	; 0x6dc <Command_Task+0x70>
     6da:	30 c1       	rjmp	.+608    	; 0x93c <Command_Task+0x2d0>
     6dc:	e0 c0       	rjmp	.+448    	; 0x89e <Command_Task+0x232>
     6de:	8d 36       	cpi	r24, 0x6D	; 109
     6e0:	09 f4       	brne	.+2      	; 0x6e4 <Command_Task+0x78>
     6e2:	ab c0       	rjmp	.+342    	; 0x83a <Command_Task+0x1ce>
     6e4:	8e 36       	cpi	r24, 0x6E	; 110
     6e6:	30 f4       	brcc	.+12     	; 0x6f4 <Command_Task+0x88>
     6e8:	83 36       	cpi	r24, 0x63	; 99
     6ea:	b1 f0       	breq	.+44     	; 0x718 <Command_Task+0xac>
     6ec:	8c 36       	cpi	r24, 0x6C	; 108
     6ee:	09 f0       	breq	.+2      	; 0x6f2 <Command_Task+0x86>
     6f0:	25 c1       	rjmp	.+586    	; 0x93c <Command_Task+0x2d0>
     6f2:	ed c0       	rjmp	.+474    	; 0x8ce <Command_Task+0x262>
     6f4:	80 37       	cpi	r24, 0x70	; 112
     6f6:	21 f0       	breq	.+8      	; 0x700 <Command_Task+0x94>
     6f8:	83 37       	cpi	r24, 0x73	; 115
     6fa:	09 f0       	breq	.+2      	; 0x6fe <Command_Task+0x92>
     6fc:	1f c1       	rjmp	.+574    	; 0x93c <Command_Task+0x2d0>
     6fe:	cf c0       	rjmp	.+414    	; 0x89e <Command_Task+0x232>
		
		
		
		case 'p':

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     700:	84 e6       	ldi	r24, 0x64	; 100
     702:	91 e0       	ldi	r25, 0x01	; 1
     704:	a1 d3       	rcall	.+1858   	; 0xe48 <Buffer_GetElementFromBottom>
			
			if(oldValue == '1')
     706:	81 33       	cpi	r24, 0x31	; 49
     708:	11 f4       	brne	.+4      	; 0x70e <Command_Task+0xa2>
			{
				mode = ISP1;
     70a:	82 e0       	ldi	r24, 0x02	; 2
     70c:	01 c0       	rjmp	.+2      	; 0x710 <Command_Task+0xa4>
				
			}
			else
			{
				mode = ISP2;
     70e:	83 e0       	ldi	r24, 0x03	; 3
     710:	80 93 1e 01 	sts	0x011E, r24
			}
			
			ISP_Int();
     714:	4a dd       	rcall	.-1388   	; 0x1aa <ISP_Int>
     716:	ce c0       	rjmp	.+412    	; 0x8b4 <Command_Task+0x248>
		
		
		case 'c':
		case 'C':
			
			I2C_Port = Buffer_GetElementFromBottom(&Rx_Buffer);
     718:	84 e6       	ldi	r24, 0x64	; 100
     71a:	91 e0       	ldi	r25, 0x01	; 1
     71c:	95 d3       	rcall	.+1834   	; 0xe48 <Buffer_GetElementFromBottom>
     71e:	80 93 19 01 	sts	0x0119, r24
			//should check to ensure val ok!
			
			I2C_Init();
     722:	01 d4       	rcall	.+2050   	; 0xf26 <I2C_Init>
						
			RemoveWhiteSpace();
     724:	fd dd       	rcall	.-1030   	; 0x320 <RemoveWhiteSpace>

			address = ParseNumber();
     726:	42 de       	rcall	.-892    	; 0x3ac <ParseNumber>
     728:	98 2e       	mov	r9, r24
			RemoveWhiteSpace();
     72a:	fa dd       	rcall	.-1036   	; 0x320 <RemoveWhiteSpace>

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     72c:	84 e6       	ldi	r24, 0x64	; 100
     72e:	91 e0       	ldi	r25, 0x01	; 1
     730:	8b d3       	rcall	.+1814   	; 0xe48 <Buffer_GetElementFromBottom>

			if(oldValue == 'w' || oldValue == 'W')
     732:	87 37       	cpi	r24, 0x77	; 119
     734:	19 f0       	breq	.+6      	; 0x73c <Command_Task+0xd0>
     736:	87 35       	cpi	r24, 0x57	; 87
     738:	09 f0       	breq	.+2      	; 0x73c <Command_Task+0xd0>
     73a:	49 c0       	rjmp	.+146    	; 0x7ce <Command_Task+0x162>
			{
						
				lenght = ParseNumber();
     73c:	37 de       	rcall	.-914    	; 0x3ac <ParseNumber>
     73e:	e8 2e       	mov	r14, r24

				oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     740:	84 e6       	ldi	r24, 0x64	; 100
     742:	91 e0       	ldi	r25, 0x01	; 1
     744:	81 d3       	rcall	.+1794   	; 0xe48 <Buffer_GetElementFromBottom>
     746:	68 2f       	mov	r22, r24
				if(oldValue != ' ' && oldValue != ',')
     748:	80 32       	cpi	r24, 0x20	; 32
     74a:	29 f0       	breq	.+10     	; 0x756 <Command_Task+0xea>
     74c:	8c 32       	cpi	r24, 0x2C	; 44
     74e:	19 f0       	breq	.+6      	; 0x756 <Command_Task+0xea>
				{
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     750:	84 e6       	ldi	r24, 0x64	; 100
     752:	91 e0       	ldi	r25, 0x01	; 1
     754:	a9 d3       	rcall	.+1874   	; 0xea8 <Buffer_StoreElementOnBottom>
     756:	ff 24       	eor	r15, r15
     758:	5e 01       	movw	r10, r28
     75a:	08 94       	sec
     75c:	a1 1c       	adc	r10, r1
     75e:	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
     760:	ce 2c       	mov	r12, r14
     762:	dd 24       	eor	r13, r13
     764:	08 94       	sec
     766:	c1 08       	sbc	r12, r1
     768:	d1 08       	sbc	r13, r1
     76a:	26 c0       	rjmp	.+76     	; 0x7b8 <Command_Task+0x14c>
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
				}
						
				for (i = 0; i < lenght; i++)
				{
					temp[i] = Buffer_GetElementFromBottom(&Rx_Buffer);
     76c:	0f 2d       	mov	r16, r15
     76e:	10 e0       	ldi	r17, 0x00	; 0
     770:	84 e6       	ldi	r24, 0x64	; 100
     772:	91 e0       	ldi	r25, 0x01	; 1
     774:	69 d3       	rcall	.+1746   	; 0xe48 <Buffer_GetElementFromBottom>
     776:	f5 01       	movw	r30, r10
     778:	e0 0f       	add	r30, r16
     77a:	f1 1f       	adc	r31, r17
     77c:	80 83       	st	Z, r24
					if(temp[i] == '\\')
     77e:	8c 35       	cpi	r24, 0x5C	; 92
     780:	d1 f4       	brne	.+52     	; 0x7b6 <Command_Task+0x14a>
					{	
						oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     782:	84 e6       	ldi	r24, 0x64	; 100
     784:	91 e0       	ldi	r25, 0x01	; 1
     786:	60 d3       	rcall	.+1728   	; 0xe48 <Buffer_GetElementFromBottom>
     788:	68 2f       	mov	r22, r24

						if(oldValue == 'x' || oldValue == 'X')
     78a:	88 37       	cpi	r24, 0x78	; 120
     78c:	11 f0       	breq	.+4      	; 0x792 <Command_Task+0x126>
     78e:	88 35       	cpi	r24, 0x58	; 88
     790:	31 f4       	brne	.+12     	; 0x79e <Command_Task+0x132>
						{
							temp[i] = GetHexNumber();
     792:	d3 dd       	rcall	.-1114   	; 0x33a <GetHexNumber>
     794:	0a 0d       	add	r16, r10
     796:	1b 1d       	adc	r17, r11
     798:	f8 01       	movw	r30, r16
     79a:	80 83       	st	Z, r24
     79c:	0c c0       	rjmp	.+24     	; 0x7b6 <Command_Task+0x14a>
						}
						else
						{
							if(i < lenght-1)//will we even get a chance to send it.  If so write it
     79e:	0c 15       	cp	r16, r12
     7a0:	1d 05       	cpc	r17, r13
     7a2:	34 f4       	brge	.+12     	; 0x7b0 <Command_Task+0x144>
							{
								temp[++i] = oldValue;
     7a4:	f3 94       	inc	r15
     7a6:	f5 01       	movw	r30, r10
     7a8:	ef 0d       	add	r30, r15
     7aa:	f1 1d       	adc	r31, r1
     7ac:	80 83       	st	Z, r24
     7ae:	03 c0       	rjmp	.+6      	; 0x7b6 <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);
     7b0:	84 e6       	ldi	r24, 0x64	; 100
     7b2:	91 e0       	ldi	r25, 0x01	; 1
     7b4:	79 d3       	rcall	.+1778   	; 0xea8 <Buffer_StoreElementOnBottom>
				if(oldValue != ' ' && oldValue != ',')
				{
					Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
				}
						
				for (i = 0; i < lenght; i++)
     7b6:	f3 94       	inc	r15
     7b8:	fe 14       	cp	r15, r14
     7ba:	c0 f2       	brcs	.-80     	; 0x76c <Command_Task+0x100>
							} 
						}	
					}
				}

				if(I2C_Write(address, temp, lenght) != lenght)
     7bc:	4e 2d       	mov	r20, r14
     7be:	50 e0       	ldi	r21, 0x00	; 0
     7c0:	b5 01       	movw	r22, r10
     7c2:	89 2d       	mov	r24, r9
     7c4:	81 d5       	rcall	.+2818   	; 0x12c8 <I2C_Write>
     7c6:	8e 15       	cp	r24, r14
     7c8:	09 f4       	brne	.+2      	; 0x7cc <Command_Task+0x160>
     7ca:	c4 c0       	rjmp	.+392    	; 0x954 <Command_Task+0x2e8>
     7cc:	28 c0       	rjmp	.+80     	; 0x81e <Command_Task+0x1b2>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
					Buffer_StoreElementOnTop(&Tx_Buffer, '-');
				}					
						 
			}
			else if(oldValue == 'r' || oldValue == 'R')
     7ce:	82 37       	cpi	r24, 0x72	; 114
     7d0:	19 f0       	breq	.+6      	; 0x7d8 <Command_Task+0x16c>
     7d2:	82 35       	cpi	r24, 0x52	; 82
     7d4:	09 f0       	breq	.+2      	; 0x7d8 <Command_Task+0x16c>
     7d6:	be c0       	rjmp	.+380    	; 0x954 <Command_Task+0x2e8>
			{
				Buffer_StoreElementOnTop(&Tx_Buffer, '\r');//so the data read back will be printed on a new line
     7d8:	6d e0       	ldi	r22, 0x0D	; 13
     7da:	8f e1       	ldi	r24, 0x1F	; 31
     7dc:	91 e0       	ldi	r25, 0x01	; 1
     7de:	d2 d2       	rcall	.+1444   	; 0xd84 <Buffer_StoreElementOnTop>
				Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     7e0:	6a e0       	ldi	r22, 0x0A	; 10
     7e2:	8f e1       	ldi	r24, 0x1F	; 31
     7e4:	91 e0       	ldi	r25, 0x01	; 1
     7e6:	ce d2       	rcall	.+1436   	; 0xd84 <Buffer_StoreElementOnTop>

				lenght = ParseNumber();
     7e8:	e1 dd       	rcall	.-1086   	; 0x3ac <ParseNumber>
     7ea:	18 2f       	mov	r17, r24

				if(I2C_Read(address, temp, lenght) == lenght)
     7ec:	48 2f       	mov	r20, r24
     7ee:	50 e0       	ldi	r21, 0x00	; 0
     7f0:	7e 01       	movw	r14, r28
     7f2:	08 94       	sec
     7f4:	e1 1c       	adc	r14, r1
     7f6:	f1 1c       	adc	r15, r1
     7f8:	b7 01       	movw	r22, r14
     7fa:	89 2d       	mov	r24, r9
     7fc:	2d d5       	rcall	.+2650   	; 0x1258 <I2C_Read>
     7fe:	d8 2e       	mov	r13, r24
     800:	81 17       	cp	r24, r17
     802:	69 f4       	brne	.+26     	; 0x81e <Command_Task+0x1b2>
     804:	87 01       	movw	r16, r14
     806:	06 c0       	rjmp	.+12     	; 0x814 <Command_Task+0x1a8>
				{
					for (i = 0; i < lenght; i++)
					{
						Buffer_StoreElementOnTop(&Tx_Buffer, temp[i]);
     808:	f8 01       	movw	r30, r16
     80a:	61 91       	ld	r22, Z+
     80c:	8f 01       	movw	r16, r30
     80e:	8f e1       	ldi	r24, 0x1F	; 31
     810:	91 e0       	ldi	r25, 0x01	; 1
     812:	b8 d2       	rcall	.+1392   	; 0xd84 <Buffer_StoreElementOnTop>

				lenght = ParseNumber();

				if(I2C_Read(address, temp, lenght) == lenght)
				{
					for (i = 0; i < lenght; i++)
     814:	80 2f       	mov	r24, r16
     816:	8e 19       	sub	r24, r14
     818:	8d 15       	cp	r24, r13
     81a:	b0 f3       	brcs	.-20     	; 0x808 <Command_Task+0x19c>
     81c:	9b c0       	rjmp	.+310    	; 0x954 <Command_Task+0x2e8>
						Buffer_StoreElementOnTop(&Tx_Buffer, temp[i]);
					}
				}
				else
				{
					Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     81e:	6d e0       	ldi	r22, 0x0D	; 13
     820:	8f e1       	ldi	r24, 0x1F	; 31
     822:	91 e0       	ldi	r25, 0x01	; 1
     824:	af d2       	rcall	.+1374   	; 0xd84 <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     826:	6a e0       	ldi	r22, 0x0A	; 10
     828:	8f e1       	ldi	r24, 0x1F	; 31
     82a:	91 e0       	ldi	r25, 0x01	; 1
     82c:	ab d2       	rcall	.+1366   	; 0xd84 <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Tx_Buffer, '-');
     82e:	6d e2       	ldi	r22, 0x2D	; 45
     830:	8e c0       	rjmp	.+284    	; 0x94e <Command_Task+0x2e2>
				}			
			}
			
			break;
		case '?':
			StringToBuffer_P(PSTR("\r\nSOC Robotics Help Guide.\r\n........Ask Steve?"));
     832:	81 e8       	ldi	r24, 0x81	; 129
     834:	90 e0       	ldi	r25, 0x00	; 0
     836:	5b de       	rcall	.-842    	; 0x4ee <StringToBuffer_P>
     838:	8d c0       	rjmp	.+282    	; 0x954 <Command_Task+0x2e8>
			break;
		case 'm':
		case 'M':
					
			RemoveWhiteSpace();
     83a:	72 dd       	rcall	.-1308   	; 0x320 <RemoveWhiteSpace>

			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     83c:	84 e6       	ldi	r24, 0x64	; 100
     83e:	91 e0       	ldi	r25, 0x01	; 1
     840:	03 d3       	rcall	.+1542   	; 0xe48 <Buffer_GetElementFromBottom>
     842:	8a 35       	cpi	r24, 0x5A	; 90
     844:	49 f0       	breq	.+18     	; 0x858 <Command_Task+0x1ec>
     846:	8b 35       	cpi	r24, 0x5B	; 91
     848:	18 f4       	brcc	.+6      	; 0x850 <Command_Task+0x1e4>
     84a:	89 35       	cpi	r24, 0x59	; 89
     84c:	49 f4       	brne	.+18     	; 0x860 <Command_Task+0x1f4>
     84e:	06 c0       	rjmp	.+12     	; 0x85c <Command_Task+0x1f0>
     850:	89 37       	cpi	r24, 0x79	; 121
     852:	21 f0       	breq	.+8      	; 0x85c <Command_Task+0x1f0>
     854:	8a 37       	cpi	r24, 0x7A	; 122
     856:	21 f4       	brne	.+8      	; 0x860 <Command_Task+0x1f4>
     858:	02 e0       	ldi	r16, 0x02	; 2
     85a:	03 c0       	rjmp	.+6      	; 0x862 <Command_Task+0x1f6>
     85c:	01 e0       	ldi	r16, 0x01	; 1
     85e:	01 c0       	rjmp	.+2      	; 0x862 <Command_Task+0x1f6>
     860:	00 e0       	ldi	r16, 0x00	; 0
					axis = X_AXIS;
					break;
				
			}

			RemoveWhiteSpace();
     862:	5e dd       	rcall	.-1348   	; 0x320 <RemoveWhiteSpace>

			lenght = ParseNumber();
     864:	a3 dd       	rcall	.-1210   	; 0x3ac <ParseNumber>
     866:	f8 2e       	mov	r15, r24

			oldValue = Buffer_GetElementFromBottom(&Rx_Buffer);
     868:	84 e6       	ldi	r24, 0x64	; 100
     86a:	91 e0       	ldi	r25, 0x01	; 1
     86c:	ed d2       	rcall	.+1498   	; 0xe48 <Buffer_GetElementFromBottom>
     86e:	68 2f       	mov	r22, r24

			if(oldValue != ' ' && oldValue != ',')//allow for 1 peice of white space
     870:	80 32       	cpi	r24, 0x20	; 32
     872:	29 f0       	breq	.+10     	; 0x87e <Command_Task+0x212>
     874:	8c 32       	cpi	r24, 0x2C	; 44
     876:	19 f0       	breq	.+6      	; 0x87e <Command_Task+0x212>
			{
				Buffer_StoreElementOnBottom(&Rx_Buffer, oldValue);
     878:	84 e6       	ldi	r24, 0x64	; 100
     87a:	91 e0       	ldi	r25, 0x01	; 1
     87c:	15 d3       	rcall	.+1578   	; 0xea8 <Buffer_StoreElementOnBottom>
     87e:	10 e0       	ldi	r17, 0x00	; 0
     880:	06 c0       	rjmp	.+12     	; 0x88e <Command_Task+0x222>
			}
						
			for (i = 0; i < lenght && Rx_Buffer.Elements != 0; i++)
			{
				SendByte(Buffer_GetElementFromBottom(&Rx_Buffer),axis);
     882:	84 e6       	ldi	r24, 0x64	; 100
     884:	91 e0       	ldi	r25, 0x01	; 1
     886:	e0 d2       	rcall	.+1472   	; 0xe48 <Buffer_GetElementFromBottom>
     888:	60 2f       	mov	r22, r16
     88a:	a4 d5       	rcall	.+2888   	; 0x13d4 <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++)
     88c:	1f 5f       	subi	r17, 0xFF	; 255
     88e:	1f 15       	cp	r17, r15
     890:	08 f0       	brcs	.+2      	; 0x894 <Command_Task+0x228>
     892:	60 c0       	rjmp	.+192    	; 0x954 <Command_Task+0x2e8>
     894:	80 91 a8 01 	lds	r24, 0x01A8
     898:	88 23       	and	r24, r24
     89a:	99 f7       	brne	.-26     	; 0x882 <Command_Task+0x216>
     89c:	5b c0       	rjmp	.+182    	; 0x954 <Command_Task+0x2e8>
			break;

		case 's'://enter serial mode
		case 'S':
			
			mode = SERIAL;
     89e:	81 e0       	ldi	r24, 0x01	; 1
     8a0:	80 93 1e 01 	sts	0x011E, r24
			if(Buffer_GetElementFromBottom(&Rx_Buffer) == 'b')//bang the reset line
     8a4:	84 e6       	ldi	r24, 0x64	; 100
     8a6:	91 e0       	ldi	r25, 0x01	; 1
     8a8:	cf d2       	rcall	.+1438   	; 0xe48 <Buffer_GetElementFromBottom>
     8aa:	82 36       	cpi	r24, 0x62	; 98
     8ac:	19 f4       	brne	.+6      	; 0x8b4 <Command_Task+0x248>
			{

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

				PORTC &= ~(1<<RES_2);
     8b0:	42 98       	cbi	0x08, 2	; 8
				DelayUsec(100);
				PORTC |= (1<<RES_2);
     8b2:	42 9a       	sbi	0x08, 2	; 8
			}
			Buffer_Initialize(&Rx_Buffer);//dump any unused data
     8b4:	84 e6       	ldi	r24, 0x64	; 100
     8b6:	91 e0       	ldi	r25, 0x01	; 1
     8b8:	51 d2       	rcall	.+1186   	; 0xd5c <Buffer_Initialize>
			Buffer_Initialize(&Tx_Buffer);//dump any unused data
     8ba:	8f e1       	ldi	r24, 0x1F	; 31
     8bc:	91 e0       	ldi	r25, 0x01	; 1
     8be:	4e d2       	rcall	.+1180   	; 0xd5c <Buffer_Initialize>
     8c0:	49 c0       	rjmp	.+146    	; 0x954 <Command_Task+0x2e8>
		case 0://empty command
			break;

		case 'b'://start the bootloader
		case 'B':
			(*bootloader)();//will not return
     8c2:	e0 91 00 01 	lds	r30, 0x0100
     8c6:	f0 91 01 01 	lds	r31, 0x0101
     8ca:	09 95       	icall
     8cc:	43 c0       	rjmp	.+134    	; 0x954 <Command_Task+0x2e8>
			break;

		case 'l':
		case 'L':

			RemoveWhiteSpace();
     8ce:	28 dd       	rcall	.-1456   	; 0x320 <RemoveWhiteSpace>

			switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     8d0:	84 e6       	ldi	r24, 0x64	; 100
     8d2:	91 e0       	ldi	r25, 0x01	; 1
     8d4:	b9 d2       	rcall	.+1394   	; 0xe48 <Buffer_GetElementFromBottom>
     8d6:	82 35       	cpi	r24, 0x52	; 82
     8d8:	f1 f0       	breq	.+60     	; 0x916 <Command_Task+0x2aa>
     8da:	83 35       	cpi	r24, 0x53	; 83
     8dc:	20 f4       	brcc	.+8      	; 0x8e6 <Command_Task+0x27a>
     8de:	87 34       	cpi	r24, 0x47	; 71
     8e0:	09 f0       	breq	.+2      	; 0x8e4 <Command_Task+0x278>
     8e2:	38 c0       	rjmp	.+112    	; 0x954 <Command_Task+0x2e8>
     8e4:	05 c0       	rjmp	.+10     	; 0x8f0 <Command_Task+0x284>
     8e6:	87 36       	cpi	r24, 0x67	; 103
     8e8:	19 f0       	breq	.+6      	; 0x8f0 <Command_Task+0x284>
     8ea:	82 37       	cpi	r24, 0x72	; 114
     8ec:	99 f5       	brne	.+102    	; 0x954 <Command_Task+0x2e8>
     8ee:	13 c0       	rjmp	.+38     	; 0x916 <Command_Task+0x2aa>
			{
				case 'g':
				case 'G':
						
					RemoveWhiteSpace();
     8f0:	17 dd       	rcall	.-1490   	; 0x320 <RemoveWhiteSpace>

					switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     8f2:	84 e6       	ldi	r24, 0x64	; 100
     8f4:	91 e0       	ldi	r25, 0x01	; 1
     8f6:	a8 d2       	rcall	.+1360   	; 0xe48 <Buffer_GetElementFromBottom>
     8f8:	8f 34       	cpi	r24, 0x4F	; 79
     8fa:	49 f0       	breq	.+18     	; 0x90e <Command_Task+0x2a2>
     8fc:	80 35       	cpi	r24, 0x50	; 80
     8fe:	18 f4       	brcc	.+6      	; 0x906 <Command_Task+0x29a>
     900:	86 34       	cpi	r24, 0x46	; 70
     902:	41 f5       	brne	.+80     	; 0x954 <Command_Task+0x2e8>
     904:	06 c0       	rjmp	.+12     	; 0x912 <Command_Task+0x2a6>
     906:	86 36       	cpi	r24, 0x66	; 102
     908:	21 f0       	breq	.+8      	; 0x912 <Command_Task+0x2a6>
     90a:	8f 36       	cpi	r24, 0x6F	; 111
     90c:	19 f5       	brne	.+70     	; 0x954 <Command_Task+0x2e8>
					{
						case 'o':
						case 'O':
							greenLedOn();
     90e:	2d 98       	cbi	0x05, 5	; 5
     910:	21 c0       	rjmp	.+66     	; 0x954 <Command_Task+0x2e8>
							break;

						case 'f':
						case 'F':
							greenLedOff();				
     912:	2d 9a       	sbi	0x05, 5	; 5
     914:	1f c0       	rjmp	.+62     	; 0x954 <Command_Task+0x2e8>
					break;

				case 'r':
				case 'R':

					RemoveWhiteSpace();
     916:	04 dd       	rcall	.-1528   	; 0x320 <RemoveWhiteSpace>

					switch(Buffer_GetElementFromBottom(&Rx_Buffer))
     918:	84 e6       	ldi	r24, 0x64	; 100
     91a:	91 e0       	ldi	r25, 0x01	; 1
     91c:	95 d2       	rcall	.+1322   	; 0xe48 <Buffer_GetElementFromBottom>
     91e:	8f 34       	cpi	r24, 0x4F	; 79
     920:	49 f0       	breq	.+18     	; 0x934 <Command_Task+0x2c8>
     922:	80 35       	cpi	r24, 0x50	; 80
     924:	18 f4       	brcc	.+6      	; 0x92c <Command_Task+0x2c0>
     926:	86 34       	cpi	r24, 0x46	; 70
     928:	a9 f4       	brne	.+42     	; 0x954 <Command_Task+0x2e8>
     92a:	06 c0       	rjmp	.+12     	; 0x938 <Command_Task+0x2cc>
     92c:	86 36       	cpi	r24, 0x66	; 102
     92e:	21 f0       	breq	.+8      	; 0x938 <Command_Task+0x2cc>
     930:	8f 36       	cpi	r24, 0x6F	; 111
     932:	81 f4       	brne	.+32     	; 0x954 <Command_Task+0x2e8>
					{
						case 'o':
						case 'O':
							redLedOn();
     934:	42 98       	cbi	0x08, 2	; 8
     936:	0e c0       	rjmp	.+28     	; 0x954 <Command_Task+0x2e8>
							break;

						case 'f':
						case 'F':
							redLedOff();				
     938:	42 9a       	sbi	0x08, 2	; 8
     93a:	0c c0       	rjmp	.+24     	; 0x954 <Command_Task+0x2e8>
			}

			break;

		default:
			Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     93c:	6d e0       	ldi	r22, 0x0D	; 13
     93e:	8f e1       	ldi	r24, 0x1F	; 31
     940:	91 e0       	ldi	r25, 0x01	; 1
     942:	20 d2       	rcall	.+1088   	; 0xd84 <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     944:	6a e0       	ldi	r22, 0x0A	; 10
     946:	8f e1       	ldi	r24, 0x1F	; 31
     948:	91 e0       	ldi	r25, 0x01	; 1
     94a:	1c d2       	rcall	.+1080   	; 0xd84 <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '?');			
     94c:	6f e3       	ldi	r22, 0x3F	; 63
     94e:	8f e1       	ldi	r24, 0x1F	; 31
     950:	91 e0       	ldi	r25, 0x01	; 1
     952:	18 d2       	rcall	.+1072   	; 0xd84 <Buffer_StoreElementOnTop>
	}
	


	
	switch(mode)
     954:	80 91 1e 01 	lds	r24, 0x011E
     958:	81 30       	cpi	r24, 0x01	; 1
     95a:	d9 f0       	breq	.+54     	; 0x992 <Command_Task+0x326>
     95c:	81 30       	cpi	r24, 0x01	; 1
     95e:	50 f0       	brcs	.+20     	; 0x974 <Command_Task+0x308>
     960:	84 30       	cpi	r24, 0x04	; 4
     962:	40 f4       	brcc	.+16     	; 0x974 <Command_Task+0x308>
	{
		case ISP1:
		case ISP2:	
			Buffer_StoreElementOnTop(&Tx_Buffer, 'a');
     964:	61 e6       	ldi	r22, 0x61	; 97
     966:	8f e1       	ldi	r24, 0x1F	; 31
     968:	91 e0       	ldi	r25, 0x01	; 1
     96a:	0c d2       	rcall	.+1048   	; 0xd84 <Buffer_StoreElementOnTop>
			Scheduler_SetTaskMode(PROG_Task, TASK_RUN);
     96c:	61 e0       	ldi	r22, 0x01	; 1
     96e:	89 e8       	ldi	r24, 0x89	; 137
     970:	92 e0       	ldi	r25, 0x02	; 2
     972:	12 c0       	rjmp	.+36     	; 0x998 <Command_Task+0x32c>
		case SERIAL:
			Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
			break;

		default://Return a <CR>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     974:	6d e0       	ldi	r22, 0x0D	; 13
     976:	8f e1       	ldi	r24, 0x1F	; 31
     978:	91 e0       	ldi	r25, 0x01	; 1
     97a:	04 d2       	rcall	.+1032   	; 0xd84 <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     97c:	6a e0       	ldi	r22, 0x0A	; 10
     97e:	8f e1       	ldi	r24, 0x1F	; 31
     980:	91 e0       	ldi	r25, 0x01	; 1
     982:	00 d2       	rcall	.+1024   	; 0xd84 <Buffer_StoreElementOnTop>
			Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     984:	6e e3       	ldi	r22, 0x3E	; 62
     986:	8f e1       	ldi	r24, 0x1F	; 31
     988:	91 e0       	ldi	r25, 0x01	; 1
     98a:	fc d1       	rcall	.+1016   	; 0xd84 <Buffer_StoreElementOnTop>
					
			Buffer_Initialize(&Rx_Buffer);//dump any unused data
     98c:	84 e6       	ldi	r24, 0x64	; 100
     98e:	91 e0       	ldi	r25, 0x01	; 1
     990:	e5 d1       	rcall	.+970    	; 0xd5c <Buffer_Initialize>
			Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     992:	61 e0       	ldi	r22, 0x01	; 1
     994:	84 ee       	ldi	r24, 0xE4	; 228
     996:	94 e0       	ldi	r25, 0x04	; 4
     998:	ab d5       	rcall	.+2902   	; 0x14f0 <Scheduler_SetTaskMode>
	}

	Scheduler_SetTaskMode(Command_Task, TASK_STOP);
     99a:	60 e0       	ldi	r22, 0x00	; 0
     99c:	86 e3       	ldi	r24, 0x36	; 54
     99e:	93 e0       	ldi	r25, 0x03	; 3
     9a0:	a7 d5       	rcall	.+2894   	; 0x14f0 <Scheduler_SetTaskMode>

}
     9a2:	c0 5c       	subi	r28, 0xC0	; 192
     9a4:	df 4f       	sbci	r29, 0xFF	; 255
     9a6:	0f b6       	in	r0, 0x3f	; 63
     9a8:	f8 94       	cli
     9aa:	de bf       	out	0x3e, r29	; 62
     9ac:	0f be       	out	0x3f, r0	; 63
     9ae:	cd bf       	out	0x3d, r28	; 61
     9b0:	cf 91       	pop	r28
     9b2:	df 91       	pop	r29
     9b4:	1f 91       	pop	r17
     9b6:	0f 91       	pop	r16
     9b8:	ff 90       	pop	r15
     9ba:	ef 90       	pop	r14
     9bc:	df 90       	pop	r13
     9be:	cf 90       	pop	r12
     9c0:	bf 90       	pop	r11
     9c2:	af 90       	pop	r10
     9c4:	9f 90       	pop	r9
     9c6:	08 95       	ret

000009c8 <CDC_Task>:

}


TASK(CDC_Task)
{
     9c8:	0f 93       	push	r16
     9ca:	1f 93       	push	r17
	uint8_t temp;
	
	if (USB_IsConnected)
     9cc:	80 91 b0 01 	lds	r24, 0x01B0
     9d0:	88 23       	and	r24, r24
     9d2:	09 f4       	brne	.+2      	; 0x9d6 <CDC_Task+0xe>
     9d4:	dd c0       	rjmp	.+442    	; 0xb90 <CDC_Task+0x1c8>
	{
		/* Select the Serial Rx Endpoint */
		Endpoint_SelectEndpoint(CDC_RX_EPNUM);
     9d6:	84 e0       	ldi	r24, 0x04	; 4
     9d8:	80 93 e9 00 	sts	0x00E9, r24

		if (Endpoint_ReadWriteAllowed())
     9dc:	80 91 e8 00 	lds	r24, 0x00E8
     9e0:	85 fd       	sbrc	r24, 5
     9e2:	8d c0       	rjmp	.+282    	; 0xafe <CDC_Task+0x136>
     9e4:	97 c0       	rjmp	.+302    	; 0xb14 <CDC_Task+0x14c>
		{
			/* Read the recieved data endpoint into the transmission buffer */
			while (Endpoint_BytesInEndpoint())
			{
				if(mode == COMMAND)
     9e6:	90 91 1e 01 	lds	r25, 0x011E
     9ea:	99 23       	and	r25, r25
     9ec:	69 f5       	brne	.+90     	; 0xa48 <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;
     9ee:	10 91 f1 00 	lds	r17, 0x00F1
				{
					temp =  Endpoint_Read_Byte();

					Buffer_StoreElementOnTop(&Tx_Buffer, temp);//echo the character back
     9f2:	61 2f       	mov	r22, r17
     9f4:	8f e1       	ldi	r24, 0x1F	; 31
     9f6:	91 e0       	ldi	r25, 0x01	; 1
     9f8:	c5 d1       	rcall	.+906    	; 0xd84 <Buffer_StoreElementOnTop>
					Buffer_StoreElementOnTop(&Rx_Buffer, temp);//save it to our buffer
     9fa:	61 2f       	mov	r22, r17
     9fc:	84 e6       	ldi	r24, 0x64	; 100
     9fe:	91 e0       	ldi	r25, 0x01	; 1
     a00:	c1 d1       	rcall	.+898    	; 0xd84 <Buffer_StoreElementOnTop>

					if(temp == '\b')
     a02:	18 30       	cpi	r17, 0x08	; 8
     a04:	79 f4       	brne	.+30     	; 0xa24 <CDC_Task+0x5c>
					{
						Buffer_StoreElementOnTop(&Tx_Buffer, ' ');//clear the mistake
     a06:	60 e2       	ldi	r22, 0x20	; 32
     a08:	8f e1       	ldi	r24, 0x1F	; 31
     a0a:	91 e0       	ldi	r25, 0x01	; 1
     a0c:	bb d1       	rcall	.+886    	; 0xd84 <Buffer_StoreElementOnTop>
						Buffer_StoreElementOnTop(&Tx_Buffer, '\b');
     a0e:	68 e0       	ldi	r22, 0x08	; 8
     a10:	8f e1       	ldi	r24, 0x1F	; 31
     a12:	91 e0       	ldi	r25, 0x01	; 1
     a14:	b7 d1       	rcall	.+878    	; 0xd84 <Buffer_StoreElementOnTop>
					
						Buffer_GetElementFromTop(&Rx_Buffer);//remove the \b and the character sent from our buffer
     a16:	84 e6       	ldi	r24, 0x64	; 100
     a18:	91 e0       	ldi	r25, 0x01	; 1
     a1a:	eb d1       	rcall	.+982    	; 0xdf2 <Buffer_GetElementFromTop>
						Buffer_GetElementFromTop(&Rx_Buffer);
     a1c:	84 e6       	ldi	r24, 0x64	; 100
     a1e:	91 e0       	ldi	r25, 0x01	; 1
     a20:	e8 d1       	rcall	.+976    	; 0xdf2 <Buffer_GetElementFromTop>
     a22:	6e c0       	rjmp	.+220    	; 0xb00 <CDC_Task+0x138>
					}
					else if(temp == '\r')
     a24:	1d 30       	cpi	r17, 0x0D	; 13
     a26:	09 f0       	breq	.+2      	; 0xa2a <CDC_Task+0x62>
     a28:	6b c0       	rjmp	.+214    	; 0xb00 <CDC_Task+0x138>
					{
					//	Buffer_StoreElementOnTop(&Tx_Buffer, '\n');//ensure \r\n is sent back
						Buffer_GetElementFromTop(&Tx_Buffer);//remove the \r
     a2a:	8f e1       	ldi	r24, 0x1F	; 31
     a2c:	91 e0       	ldi	r25, 0x01	; 1
     a2e:	e1 d1       	rcall	.+962    	; 0xdf2 <Buffer_GetElementFromTop>
						Buffer_GetElementFromTop(&Rx_Buffer);//remove the \r
     a30:	84 e6       	ldi	r24, 0x64	; 100
     a32:	91 e0       	ldi	r25, 0x01	; 1
     a34:	de d1       	rcall	.+956    	; 0xdf2 <Buffer_GetElementFromTop>

					
						Scheduler_SetTaskMode(CDC_Task, TASK_STOP);//stop it for a while
     a36:	60 e0       	ldi	r22, 0x00	; 0
     a38:	84 ee       	ldi	r24, 0xE4	; 228
     a3a:	94 e0       	ldi	r25, 0x04	; 4
     a3c:	59 d5       	rcall	.+2738   	; 0x14f0 <Scheduler_SetTaskMode>


						Scheduler_SetTaskMode(Command_Task, TASK_RUN);//process the data
     a3e:	61 e0       	ldi	r22, 0x01	; 1
     a40:	86 e3       	ldi	r24, 0x36	; 54
     a42:	93 e0       	ldi	r25, 0x03	; 3
     a44:	55 d5       	rcall	.+2730   	; 0x14f0 <Scheduler_SetTaskMode>
     a46:	61 c0       	rjmp	.+194    	; 0xb0a <CDC_Task+0x142>

						break;//don't care about any other data
					}
				}
				else if(mode == SERIAL)
     a48:	91 30       	cpi	r25, 0x01	; 1
     a4a:	09 f0       	breq	.+2      	; 0xa4e <CDC_Task+0x86>
     a4c:	59 c0       	rjmp	.+178    	; 0xb00 <CDC_Task+0x138>
     a4e:	10 91 f1 00 	lds	r17, 0x00F1
				{
					temp = Endpoint_Read_Byte();
					if(temp == '\\')
     a52:	1c 35       	cpi	r17, 0x5C	; 92
     a54:	79 f4       	brne	.+30     	; 0xa74 <CDC_Task+0xac>
					{
						if (escapeCharReceived == true)
     a56:	80 91 1d 01 	lds	r24, 0x011D
     a5a:	88 23       	and	r24, r24
     a5c:	41 f0       	breq	.+16     	; 0xa6e <CDC_Task+0xa6>
						{

							escapeCharReceived = false;
     a5e:	10 92 1d 01 	sts	0x011D, r1
							Buffer_StoreElementOnTop(&Rx_Buffer, '\\');//pass on the old one
     a62:	6c e5       	ldi	r22, 0x5C	; 92
     a64:	84 e6       	ldi	r24, 0x64	; 100
     a66:	91 e0       	ldi	r25, 0x01	; 1
     a68:	8d d1       	rcall	.+794    	; 0xd84 <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Rx_Buffer, temp);//pass on the new one
     a6a:	6c e5       	ldi	r22, 0x5C	; 92
     a6c:	44 c0       	rjmp	.+136    	; 0xaf6 <CDC_Task+0x12e>
						}
						else
						{
							escapeCharReceived = true;
     a6e:	90 93 1d 01 	sts	0x011D, r25
     a72:	46 c0       	rjmp	.+140    	; 0xb00 <CDC_Task+0x138>
						}
					}
					else if( escapeCharReceived == true)
     a74:	80 91 1d 01 	lds	r24, 0x011D
     a78:	88 23       	and	r24, r24
     a7a:	09 f4       	brne	.+2      	; 0xa7e <CDC_Task+0xb6>
     a7c:	3b c0       	rjmp	.+118    	; 0xaf4 <CDC_Task+0x12c>
					{
					
						if(temp == 'c' || temp == 'C')
     a7e:	13 36       	cpi	r17, 0x63	; 99
     a80:	11 f0       	breq	.+4      	; 0xa86 <CDC_Task+0xbe>
     a82:	13 34       	cpi	r17, 0x43	; 67
     a84:	61 f5       	brne	.+88     	; 0xade <CDC_Task+0x116>
						{
							/* Initiate the transmission of the buffer contents if USART idle */
							if (Transmitting == false && Rx_Buffer.Elements != 0)
     a86:	80 91 1c 01 	lds	r24, 0x011C
     a8a:	88 23       	and	r24, r24
     a8c:	81 f4       	brne	.+32     	; 0xaae <CDC_Task+0xe6>
     a8e:	80 91 a8 01 	lds	r24, 0x01A8
     a92:	88 23       	and	r24, r24
     a94:	61 f0       	breq	.+24     	; 0xaae <CDC_Task+0xe6>
							{
								Transmitting = true;
     a96:	00 93 1c 01 	sts	0x011C, r16
								Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
     a9a:	84 e6       	ldi	r24, 0x64	; 100
     a9c:	91 e0       	ldi	r25, 0x01	; 1
     a9e:	d4 d1       	rcall	.+936    	; 0xe48 <Buffer_GetElementFromBottom>
     aa0:	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)));
     aa2:	80 91 c8 00 	lds	r24, 0x00C8
     aa6:	85 ff       	sbrs	r24, 5
     aa8:	fc cf       	rjmp	.-8      	; 0xaa2 <CDC_Task+0xda>
				UDR1 = DataByte;
     aaa:	90 93 ce 00 	sts	0x00CE, r25
							}
							while(Transmitting == true)//wait until we finish
     aae:	80 91 1c 01 	lds	r24, 0x011C
     ab2:	88 23       	and	r24, r24
     ab4:	e1 f7       	brne	.-8      	; 0xaae <CDC_Task+0xe6>
							{
								;
							}
							mode = COMMAND;
     ab6:	10 92 1e 01 	sts	0x011E, r1
							Buffer_Initialize(&Rx_Buffer);//clear out all data
     aba:	84 e6       	ldi	r24, 0x64	; 100
     abc:	91 e0       	ldi	r25, 0x01	; 1
     abe:	4e d1       	rcall	.+668    	; 0xd5c <Buffer_Initialize>
							Buffer_Initialize(&Tx_Buffer);
     ac0:	8f e1       	ldi	r24, 0x1F	; 31
     ac2:	91 e0       	ldi	r25, 0x01	; 1
     ac4:	4b d1       	rcall	.+662    	; 0xd5c <Buffer_Initialize>

							Buffer_StoreElementOnTop(&Tx_Buffer, '\r');
     ac6:	6d e0       	ldi	r22, 0x0D	; 13
     ac8:	8f e1       	ldi	r24, 0x1F	; 31
     aca:	91 e0       	ldi	r25, 0x01	; 1
     acc:	5b d1       	rcall	.+694    	; 0xd84 <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Tx_Buffer, '\n');
     ace:	6a e0       	ldi	r22, 0x0A	; 10
     ad0:	8f e1       	ldi	r24, 0x1F	; 31
     ad2:	91 e0       	ldi	r25, 0x01	; 1
     ad4:	57 d1       	rcall	.+686    	; 0xd84 <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Tx_Buffer, '>');
     ad6:	6e e3       	ldi	r22, 0x3E	; 62
     ad8:	8f e1       	ldi	r24, 0x1F	; 31
     ada:	91 e0       	ldi	r25, 0x01	; 1
     adc:	07 c0       	rjmp	.+14     	; 0xaec <CDC_Task+0x124>

						}
						else
						{
							Buffer_StoreElementOnTop(&Rx_Buffer, '\\');//pass on all the data
     ade:	6c e5       	ldi	r22, 0x5C	; 92
     ae0:	84 e6       	ldi	r24, 0x64	; 100
     ae2:	91 e0       	ldi	r25, 0x01	; 1
     ae4:	4f d1       	rcall	.+670    	; 0xd84 <Buffer_StoreElementOnTop>
							Buffer_StoreElementOnTop(&Rx_Buffer, temp);
     ae6:	61 2f       	mov	r22, r17
     ae8:	84 e6       	ldi	r24, 0x64	; 100
     aea:	91 e0       	ldi	r25, 0x01	; 1
     aec:	4b d1       	rcall	.+662    	; 0xd84 <Buffer_StoreElementOnTop>
						}

						escapeCharReceived = false;
     aee:	10 92 1d 01 	sts	0x011D, r1
     af2:	06 c0       	rjmp	.+12     	; 0xb00 <CDC_Task+0x138>
					}
					else
					{
						Buffer_StoreElementOnTop(&Rx_Buffer, temp);
     af4:	61 2f       	mov	r22, r17
     af6:	84 e6       	ldi	r24, 0x64	; 100
     af8:	91 e0       	ldi	r25, 0x01	; 1
     afa:	44 d1       	rcall	.+648    	; 0xd84 <Buffer_StoreElementOnTop>
     afc:	01 c0       	rjmp	.+2      	; 0xb00 <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;
     afe:	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())
     b00:	80 91 f2 00 	lds	r24, 0x00F2
     b04:	88 23       	and	r24, r24
     b06:	09 f0       	breq	.+2      	; 0xb0a <CDC_Task+0x142>
     b08:	6e cf       	rjmp	.-292    	; 0x9e6 <CDC_Task+0x1e>
					}	
				}
			}

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

		/* Select the Serial Tx Endpoint */
		Endpoint_SelectEndpoint(CDC_TX_EPNUM);
     b14:	83 e0       	ldi	r24, 0x03	; 3
     b16:	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)
     b1a:	80 91 1c 01 	lds	r24, 0x011C
     b1e:	88 23       	and	r24, r24
     b20:	a1 f4       	brne	.+40     	; 0xb4a <CDC_Task+0x182>
     b22:	90 91 1e 01 	lds	r25, 0x011E
     b26:	91 30       	cpi	r25, 0x01	; 1
     b28:	81 f4       	brne	.+32     	; 0xb4a <CDC_Task+0x182>
     b2a:	80 91 a8 01 	lds	r24, 0x01A8
     b2e:	88 23       	and	r24, r24
     b30:	61 f0       	breq	.+24     	; 0xb4a <CDC_Task+0x182>
		{
				Transmitting = true;
     b32:	90 93 1c 01 	sts	0x011C, r25
				Serial_TxByte(Buffer_GetElementFromBottom(&Rx_Buffer));
     b36:	84 e6       	ldi	r24, 0x64	; 100
     b38:	91 e0       	ldi	r25, 0x01	; 1
     b3a:	86 d1       	rcall	.+780    	; 0xe48 <Buffer_GetElementFromBottom>
     b3c:	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)));
     b3e:	80 91 c8 00 	lds	r24, 0x00C8
     b42:	85 ff       	sbrs	r24, 5
     b44:	fc cf       	rjmp	.-8      	; 0xb3e <CDC_Task+0x176>
				UDR1 = DataByte;
     b46:	90 93 ce 00 	sts	0x00CE, r25
		}


		/* Write the Data to the Endpoint */
		if(Tx_Buffer.Elements != 0)
     b4a:	80 91 63 01 	lds	r24, 0x0163
     b4e:	88 23       	and	r24, r24
     b50:	f9 f0       	breq	.+62     	; 0xb90 <CDC_Task+0x1c8>
		{

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

				Endpoint_Write_Byte(Buffer_GetElementFromBottom(&Tx_Buffer));
     b5a:	8f e1       	ldi	r24, 0x1F	; 31
     b5c:	91 e0       	ldi	r25, 0x01	; 1
     b5e:	74 d1       	rcall	.+744    	; 0xe48 <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;
     b60:	80 93 f1 00 	sts	0x00F1, r24

				/* Check if the endpoint is full */
				if (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE)
     b64:	80 91 f2 00 	lds	r24, 0x00F2
     b68:	80 31       	cpi	r24, 0x10	; 16
     b6a:	49 f4       	brne	.+18     	; 0xb7e <CDC_Task+0x1b6>
				{
					/* Send the data */
					Endpoint_ClearCurrentBank();
     b6c:	80 91 e8 00 	lds	r24, 0x00E8
     b70:	8f 77       	andi	r24, 0x7F	; 127
     b72:	80 93 e8 00 	sts	0x00E8, r24

					/* Wait until Serial Tx Endpoint Ready for Read/Write */
					while (!(Endpoint_ReadWriteAllowed()));
     b76:	80 91 e8 00 	lds	r24, 0x00E8
     b7a:	85 ff       	sbrs	r24, 5
     b7c:	fc cf       	rjmp	.-8      	; 0xb76 <CDC_Task+0x1ae>
				}
			}while (Tx_Buffer.Elements != 0);
     b7e:	80 91 63 01 	lds	r24, 0x0163
     b82:	88 23       	and	r24, r24
     b84:	31 f7       	brne	.-52     	; 0xb52 <CDC_Task+0x18a>

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

		}
	}
}
     b90:	1f 91       	pop	r17
     b92:	0f 91       	pop	r16
     b94:	08 95       	ret

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

EVENT_HANDLER(USB_UnhandledControlPacket)
{
     b96:	81 32       	cpi	r24, 0x21	; 33
     b98:	31 f0       	breq	.+12     	; 0xba6 <Event_USB_UnhandledControlPacket+0x10>
     b9a:	82 32       	cpi	r24, 0x22	; 34
     b9c:	51 f1       	breq	.+84     	; 0xbf2 <Event_USB_UnhandledControlPacket+0x5c>
     b9e:	80 32       	cpi	r24, 0x20	; 32
     ba0:	09 f0       	breq	.+2      	; 0xba4 <Event_USB_UnhandledControlPacket+0xe>
     ba2:	52 c0       	rjmp	.+164    	; 0xc48 <Event_USB_UnhandledControlPacket+0xb2>
     ba4:	13 c0       	rjmp	.+38     	; 0xbcc <Event_USB_UnhandledControlPacket+0x36>

	/* Process CDC specific control requests */
	switch (bRequest)
	{
		case GET_LINE_CODING:
			if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
     ba6:	61 3a       	cpi	r22, 0xA1	; 161
     ba8:	09 f0       	breq	.+2      	; 0xbac <Event_USB_UnhandledControlPacket+0x16>
     baa:	4e c0       	rjmp	.+156    	; 0xc48 <Event_USB_UnhandledControlPacket+0xb2>
			{
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     bac:	80 91 e8 00 	lds	r24, 0x00E8
     bb0:	87 7f       	andi	r24, 0xF7	; 247
     bb2:	80 93 e8 00 	sts	0x00E8, r24

				/* Write the line coding data to the control endpoint */
				Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(LineCoding));
     bb6:	67 e0       	ldi	r22, 0x07	; 7
     bb8:	70 e0       	ldi	r23, 0x00	; 0
     bba:	82 e1       	ldi	r24, 0x12	; 18
     bbc:	91 e0       	ldi	r25, 0x01	; 1
     bbe:	4a d5       	rcall	.+2708   	; 0x1654 <Endpoint_Write_Control_Stream_LE>

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

			break;
		case SET_LINE_CODING:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
     bcc:	61 32       	cpi	r22, 0x21	; 33
     bce:	09 f0       	breq	.+2      	; 0xbd2 <Event_USB_UnhandledControlPacket+0x3c>
     bd0:	3b c0       	rjmp	.+118    	; 0xc48 <Event_USB_UnhandledControlPacket+0xb2>
			{
				/* Acknowedge the SETUP packet, ready for data transfer */
				Endpoint_ClearSetupReceived();
     bd2:	80 91 e8 00 	lds	r24, 0x00E8
     bd6:	87 7f       	andi	r24, 0xF7	; 247
     bd8:	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));
     bdc:	67 e0       	ldi	r22, 0x07	; 7
     bde:	70 e0       	ldi	r23, 0x00	; 0
     be0:	82 e1       	ldi	r24, 0x12	; 18
     be2:	91 e0       	ldi	r25, 0x01	; 1
     be4:	7b d5       	rcall	.+2806   	; 0x16dc <Endpoint_Read_Control_Stream_LE>

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

				/* Reconfigure the USART with the new settings */
				ReconfigureUSART();
     bf0:	2d cb       	rjmp	.-2470   	; 0x24c <ReconfigureUSART>
			}

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

				/* Send an empty packet to acknowedge the command (currently unused) */
				Endpoint_ClearSetupIN();
     c00:	80 91 e8 00 	lds	r24, 0x00E8
     c04:	8e 7f       	andi	r24, 0xFE	; 254
     c06:	80 93 e8 00 	sts	0x00E8, r24
				if (mode != SERIAL)//in case we were in SPI mode
     c0a:	80 91 1e 01 	lds	r24, 0x011E
     c0e:	81 30       	cpi	r24, 0x01	; 1
     c10:	81 f0       	breq	.+32     	; 0xc32 <Event_USB_UnhandledControlPacket+0x9c>
				{
					mode = COMMAND;
     c12:	10 92 1e 01 	sts	0x011E, r1
					Buffer_Initialize(&Rx_Buffer);//clear my buffers
     c16:	84 e6       	ldi	r24, 0x64	; 100
     c18:	91 e0       	ldi	r25, 0x01	; 1
     c1a:	a0 d0       	rcall	.+320    	; 0xd5c <Buffer_Initialize>
					Buffer_Initialize(&Tx_Buffer);
     c1c:	8f e1       	ldi	r24, 0x1F	; 31
     c1e:	91 e0       	ldi	r25, 0x01	; 1
     c20:	9d d0       	rcall	.+314    	; 0xd5c <Buffer_Initialize>
					
					Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     c22:	61 e0       	ldi	r22, 0x01	; 1
     c24:	84 ee       	ldi	r24, 0xE4	; 228
     c26:	94 e0       	ldi	r25, 0x04	; 4
     c28:	63 d4       	rcall	.+2246   	; 0x14f0 <Scheduler_SetTaskMode>
					Scheduler_SetTaskMode(PROG_Task, TASK_STOP);
     c2a:	60 e0       	ldi	r22, 0x00	; 0
     c2c:	89 e8       	ldi	r24, 0x89	; 137
     c2e:	92 e0       	ldi	r25, 0x02	; 2
     c30:	5f d4       	rcall	.+2238   	; 0x14f0 <Scheduler_SetTaskMode>

				}
				if(mode == COMMAND)
     c32:	80 91 1e 01 	lds	r24, 0x011E
     c36:	88 23       	and	r24, r24
     c38:	39 f4       	brne	.+14     	; 0xc48 <Event_USB_UnhandledControlPacket+0xb2>
				{
					
					StringToBuffer_P(PSTR("SOC Robotics USB10, (c) 2008\r\n\r\n"));
     c3a:	80 eb       	ldi	r24, 0xB0	; 176
     c3c:	90 e0       	ldi	r25, 0x00	; 0
     c3e:	57 dc       	rcall	.-1874   	; 0x4ee <StringToBuffer_P>
					Buffer_StoreElementOnTop(&Tx_Buffer, '>');//prompt character
     c40:	6e e3       	ldi	r22, 0x3E	; 62
     c42:	8f e1       	ldi	r24, 0x1F	; 31
     c44:	91 e0       	ldi	r25, 0x01	; 1
     c46:	9e c0       	rjmp	.+316    	; 0xd84 <Buffer_StoreElementOnTop>
     c48:	08 95       	ret

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

}

EVENT_HANDLER(USB_ConfigurationChanged)
{
     c4a:	20 e0       	ldi	r18, 0x00	; 0
     c4c:	41 ec       	ldi	r20, 0xC1	; 193
     c4e:	68 e0       	ldi	r22, 0x08	; 8
     c50:	70 e0       	ldi	r23, 0x00	; 0
     c52:	82 e0       	ldi	r24, 0x02	; 2
     c54:	d8 d4       	rcall	.+2480   	; 0x1606 <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,
     c56:	24 e0       	ldi	r18, 0x04	; 4
     c58:	41 e8       	ldi	r20, 0x81	; 129
     c5a:	60 e1       	ldi	r22, 0x10	; 16
     c5c:	70 e0       	ldi	r23, 0x00	; 0
     c5e:	83 e0       	ldi	r24, 0x03	; 3
     c60:	d2 d4       	rcall	.+2468   	; 0x1606 <Endpoint_ConfigureEndpoint_P>
		                       ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
	                           ENDPOINT_BANK_DOUBLE);

	Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK,
     c62:	24 e0       	ldi	r18, 0x04	; 4
     c64:	40 e8       	ldi	r20, 0x80	; 128
     c66:	60 e1       	ldi	r22, 0x10	; 16
     c68:	70 e0       	ldi	r23, 0x00	; 0
     c6a:	84 e0       	ldi	r24, 0x04	; 4
     c6c:	cc d4       	rcall	.+2456   	; 0x1606 <Endpoint_ConfigureEndpoint_P>
		                       ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
	                           ENDPOINT_BANK_DOUBLE);


	/* Start CDC task */
	Scheduler_SetTaskMode(CDC_Task, TASK_RUN);
     c6e:	61 e0       	ldi	r22, 0x01	; 1
     c70:	84 ee       	ldi	r24, 0xE4	; 228
     c72:	94 e0       	ldi	r25, 0x04	; 4
}
     c74:	3d c4       	rjmp	.+2170   	; 0x14f0 <Scheduler_SetTaskMode>

00000c76 <main>:

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


int main(void)
{
     c76:	1f 93       	push	r17
     c78:	cf 93       	push	r28
     c7a:	df 93       	push	r29
	/* Disable watchdog if enabled by bootloader/fuses */
	MCUSR &= ~(1 << WDRF);
     c7c:	84 b7       	in	r24, 0x34	; 52
     c7e:	87 7f       	andi	r24, 0xF7	; 247
     c80:	84 bf       	out	0x34, r24	; 52
	wdt_disable();
     c82:	88 e1       	ldi	r24, 0x18	; 24
     c84:	0f b6       	in	r0, 0x3f	; 63
     c86:	f8 94       	cli
     c88:	80 93 60 00 	sts	0x0060, r24
     c8c:	10 92 60 00 	sts	0x0060, r1
     c90:	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__ (
     c92:	91 e0       	ldi	r25, 0x01	; 1
     c94:	80 e8       	ldi	r24, 0x80	; 128
     c96:	0f b6       	in	r0, 0x3f	; 63
     c98:	f8 94       	cli
     c9a:	80 93 61 00 	sts	0x0061, r24
     c9e:	90 93 61 00 	sts	0x0061, r25
     ca2:	0f be       	out	0x3f, r0	; 63

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

	I2C_Init();
     ca4:	40 d1       	rcall	.+640    	; 0xf26 <I2C_Init>
	StepDirLineCoding_Init();
     ca6:	46 d3       	rcall	.+1676   	; 0x1334 <StepDirLineCoding_Init>

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

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


	/* Ringbuffer Initialization */
	Buffer_Initialize(&Rx_Buffer);
     cb0:	84 e6       	ldi	r24, 0x64	; 100
     cb2:	91 e0       	ldi	r25, 0x01	; 1
     cb4:	53 d0       	rcall	.+166    	; 0xd5c <Buffer_Initialize>
	Buffer_Initialize(&Tx_Buffer);
     cb6:	8f e1       	ldi	r24, 0x1F	; 31
     cb8:	91 e0       	ldi	r25, 0x01	; 1
     cba:	50 d0       	rcall	.+160    	; 0xd5c <Buffer_Initialize>
			#define MAX_DELAYCTR_COUNT                0xFFFF

		/* Inline Functions: */
			static inline void Scheduler_InitScheduler(const uint8_t TotalTasks)
			{
				Scheduler_TotalTasks = TotalTasks;
     cbc:	14 e0       	ldi	r17, 0x04	; 4
     cbe:	10 93 a9 01 	sts	0x01A9, r17

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

	/* Initialize USB Subsystem */
	USB_Init();
     cc2:	96 d4       	rcall	.+2348   	; 0x15f0 <USB_Init>
     cc4:	10 93 a9 01 	sts	0x01A9, r17
     cc8:	c2 e0       	ldi	r28, 0x02	; 2
     cca:	d1 e0       	ldi	r29, 0x01	; 1
     ccc:	07 c0       	rjmp	.+14     	; 0xcdc <main+0x66>
				{
					TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
					while (CurrTask != &Scheduler_TaskList[TotalTasks])
					{
						if (CurrTask->TaskStatus == TASK_RUN)
     cce:	8a 81       	ldd	r24, Y+2	; 0x02
     cd0:	88 23       	and	r24, r24
     cd2:	19 f0       	breq	.+6      	; 0xcda <main+0x64>
						  CurrTask->Task();
     cd4:	e8 81       	ld	r30, Y
     cd6:	f9 81       	ldd	r31, Y+1	; 0x01
     cd8:	09 95       	icall

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

				for (;;)
				{
					TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
					while (CurrTask != &Scheduler_TaskList[TotalTasks])
     cdc:	81 e0       	ldi	r24, 0x01	; 1
     cde:	c2 31       	cpi	r28, 0x12	; 18
     ce0:	d8 07       	cpc	r29, r24
     ce2:	a9 f7       	brne	.-22     	; 0xcce <main+0x58>
     ce4:	60 97       	sbiw	r28, 0x10	; 16
     ce6:	fa cf       	rjmp	.-12     	; 0xcdc <main+0x66>

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

	switch (wValue >> 8)
     cf0:	29 2f       	mov	r18, r25
     cf2:	33 27       	eor	r19, r19
     cf4:	22 30       	cpi	r18, 0x02	; 2
     cf6:	31 05       	cpc	r19, r1
     cf8:	39 f0       	breq	.+14     	; 0xd08 <USB_GetDescriptor+0x20>
     cfa:	23 30       	cpi	r18, 0x03	; 3
     cfc:	31 05       	cpc	r19, r1
     cfe:	49 f0       	breq	.+18     	; 0xd12 <USB_GetDescriptor+0x2a>
     d00:	21 30       	cpi	r18, 0x01	; 1
     d02:	31 05       	cpc	r19, r1
     d04:	e9 f4       	brne	.+58     	; 0xd40 <USB_GetDescriptor+0x58>
     d06:	20 c0       	rjmp	.+64     	; 0xd48 <USB_GetDescriptor+0x60>
     d08:	e3 ee       	ldi	r30, 0xE3	; 227
     d0a:	f0 e0       	ldi	r31, 0x00	; 0
     d0c:	83 e4       	ldi	r24, 0x43	; 67
     d0e:	90 e0       	ldi	r25, 0x00	; 0
     d10:	1f c0       	rjmp	.+62     	; 0xd50 <USB_GetDescriptor+0x68>
		case DTYPE_Configuration:
			Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
			Size    = sizeof(USB_Descriptor_Configuration_t);
			break;
		case DTYPE_String:
			switch (wValue & 0xFF)
     d12:	90 70       	andi	r25, 0x00	; 0
     d14:	81 30       	cpi	r24, 0x01	; 1
     d16:	91 05       	cpc	r25, r1
     d18:	51 f0       	breq	.+20     	; 0xd2e <USB_GetDescriptor+0x46>
     d1a:	81 30       	cpi	r24, 0x01	; 1
     d1c:	91 05       	cpc	r25, r1
     d1e:	18 f0       	brcs	.+6      	; 0xd26 <USB_GetDescriptor+0x3e>
     d20:	02 97       	sbiw	r24, 0x02	; 2
     d22:	71 f4       	brne	.+28     	; 0xd40 <USB_GetDescriptor+0x58>
     d24:	08 c0       	rjmp	.+16     	; 0xd36 <USB_GetDescriptor+0x4e>
			{
				case 0x00:
					Address = DESCRIPTOR_ADDRESS(LanguageString);
					Size    = pgm_read_byte(&LanguageString.Header.Size);
     d26:	e6 e2       	ldi	r30, 0x26	; 38
     d28:	f1 e0       	ldi	r31, 0x01	; 1
     d2a:	84 91       	lpm	r24, Z+
     d2c:	07 c0       	rjmp	.+14     	; 0xd3c <USB_GetDescriptor+0x54>
					break;
				case 0x01:
					Address = DESCRIPTOR_ADDRESS(ManufacturerString);
					Size    = pgm_read_byte(&ManufacturerString.Header.Size);
     d2e:	ea e2       	ldi	r30, 0x2A	; 42
     d30:	f1 e0       	ldi	r31, 0x01	; 1
     d32:	84 91       	lpm	r24, Z+
     d34:	03 c0       	rjmp	.+6      	; 0xd3c <USB_GetDescriptor+0x54>
					break;
				case 0x02:
					Address = DESCRIPTOR_ADDRESS(ProductString);
					Size    = pgm_read_byte(&ProductString.Header.Size);
     d36:	e4 e4       	ldi	r30, 0x44	; 68
     d38:	f1 e0       	ldi	r31, 0x01	; 1
     d3a:	84 91       	lpm	r24, Z+
     d3c:	90 e0       	ldi	r25, 0x00	; 0
     d3e:	08 c0       	rjmp	.+16     	; 0xd50 <USB_GetDescriptor+0x68>
     d40:	80 e0       	ldi	r24, 0x00	; 0

		return true;
	}
		
	return false;
}
     d42:	df 91       	pop	r29
     d44:	cf 91       	pop	r28
     d46:	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);
     d48:	e1 ed       	ldi	r30, 0xD1	; 209
     d4a:	f0 e0       	ldi	r31, 0x00	; 0
     d4c:	82 e1       	ldi	r24, 0x12	; 18
     d4e:	90 e0       	ldi	r25, 0x00	; 0
			break;
	}
	
	if (Address != NULL)
	{
		*DescriptorAddress = Address;
     d50:	ed 93       	st	X+, r30
     d52:	fc 93       	st	X, r31
		*DescriptorSize    = Size;
     d54:	99 83       	std	Y+1, r25	; 0x01
     d56:	88 83       	st	Y, r24
     d58:	81 e0       	ldi	r24, 0x01	; 1
     d5a:	f3 cf       	rjmp	.-26     	; 0xd42 <USB_GetDescriptor+0x5a>

00000d5c <Buffer_Initialize>:
*/

#include "RingBuff.h"

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     d60:	f8 94       	cli
	{
		Buffer->TopPtr    = (RingBuff_Data_t*)&Buffer->Buffer;
     d62:	df 01       	movw	r26, r30
     d64:	a0 5c       	subi	r26, 0xC0	; 192
     d66:	bf 4f       	sbci	r27, 0xFF	; 255
     d68:	11 96       	adiw	r26, 0x01	; 1
     d6a:	fc 93       	st	X, r31
     d6c:	ee 93       	st	-X, r30
		Buffer->BottomPtr   = (RingBuff_Data_t*)&Buffer->Buffer;
     d6e:	df 01       	movw	r26, r30
     d70:	ae 5b       	subi	r26, 0xBE	; 190
     d72:	bf 4f       	sbci	r27, 0xFF	; 255
     d74:	11 96       	adiw	r26, 0x01	; 1
     d76:	fc 93       	st	X, r31
     d78:	ee 93       	st	-X, r30
		Buffer->Elements = 0;
     d7a:	ec 5b       	subi	r30, 0xBC	; 188
     d7c:	ff 4f       	sbci	r31, 0xFF	; 255
     d7e:	10 82       	st	Z, r1
    (void)__s;
}

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

00000d84 <Buffer_StoreElementOnTop>:
	}
}

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     d88:	f8 94       	cli
	{
		if (Buffer->Elements == BUFF_LENGTH)//i.e. buffer is full.  So we will remove our oldest data
     d8a:	fc 01       	movw	r30, r24
     d8c:	ec 5b       	subi	r30, 0xBC	; 188
     d8e:	ff 4f       	sbci	r31, 0xFF	; 255
     d90:	80 81       	ld	r24, Z
     d92:	80 34       	cpi	r24, 0x40	; 64
     d94:	99 f4       	brne	.+38     	; 0xdbc <Buffer_StoreElementOnTop+0x38>
		{
			Buffer->BottomPtr++;
     d96:	fa 01       	movw	r30, r20
     d98:	ee 5b       	subi	r30, 0xBE	; 190
     d9a:	ff 4f       	sbci	r31, 0xFF	; 255
     d9c:	80 81       	ld	r24, Z
     d9e:	91 81       	ldd	r25, Z+1	; 0x01
     da0:	01 96       	adiw	r24, 0x01	; 1
     da2:	91 83       	std	Z+1, r25	; 0x01
     da4:	80 83       	st	Z, r24

			if (Buffer->BottomPtr == &Buffer->Buffer[BUFF_LENGTH])
     da6:	20 81       	ld	r18, Z
     da8:	31 81       	ldd	r19, Z+1	; 0x01
     daa:	ca 01       	movw	r24, r20
     dac:	80 5c       	subi	r24, 0xC0	; 192
     dae:	9f 4f       	sbci	r25, 0xFF	; 255
     db0:	28 17       	cp	r18, r24
     db2:	39 07       	cpc	r19, r25
     db4:	31 f4       	brne	.+12     	; 0xdc2 <Buffer_StoreElementOnTop+0x3e>
			{
				Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     db6:	51 83       	std	Z+1, r21	; 0x01
     db8:	40 83       	st	Z, r20
     dba:	03 c0       	rjmp	.+6      	; 0xdc2 <Buffer_StoreElementOnTop+0x3e>
			}
		}
		else
		{
			Buffer->Elements++;
     dbc:	80 81       	ld	r24, Z
     dbe:	8f 5f       	subi	r24, 0xFF	; 255
     dc0:	80 83       	st	Z, r24
		}


		*(Buffer->TopPtr) = Data;
     dc2:	da 01       	movw	r26, r20
     dc4:	a0 5c       	subi	r26, 0xC0	; 192
     dc6:	bf 4f       	sbci	r27, 0xFF	; 255
     dc8:	ed 91       	ld	r30, X+
     dca:	fc 91       	ld	r31, X
     dcc:	11 97       	sbiw	r26, 0x01	; 1
     dce:	60 83       	st	Z, r22
		Buffer->TopPtr++;
     dd0:	8d 91       	ld	r24, X+
     dd2:	9c 91       	ld	r25, X
     dd4:	11 97       	sbiw	r26, 0x01	; 1
     dd6:	01 96       	adiw	r24, 0x01	; 1
     dd8:	11 96       	adiw	r26, 0x01	; 1
     dda:	9c 93       	st	X, r25
     ddc:	8e 93       	st	-X, r24

		if (Buffer->TopPtr == &Buffer->Buffer[BUFF_LENGTH])
     dde:	ed 91       	ld	r30, X+
     de0:	fc 91       	ld	r31, X
     de2:	11 97       	sbiw	r26, 0x01	; 1
     de4:	ea 17       	cp	r30, r26
     de6:	fb 07       	cpc	r31, r27
     de8:	11 f4       	brne	.+4      	; 0xdee <Buffer_StoreElementOnTop+0x6a>
		{
			Buffer->TopPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     dea:	51 83       	std	Z+1, r21	; 0x01
     dec:	40 83       	st	Z, r20
    (void)__s;
}

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

00000df2 <Buffer_GetElementFromTop>:
		}
	}
}

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

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     df6:	f8 94       	cli
	{
		if (!(Buffer->Elements))
     df8:	ac 5b       	subi	r26, 0xBC	; 188
     dfa:	bf 4f       	sbci	r27, 0xFF	; 255
     dfc:	8c 91       	ld	r24, X
     dfe:	a4 54       	subi	r26, 0x44	; 68
     e00:	b0 40       	sbci	r27, 0x00	; 0
     e02:	88 23       	and	r24, r24
     e04:	11 f4       	brne	.+4      	; 0xe0a <Buffer_GetElementFromTop+0x18>
    (void)__s;
}

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

		if(Buffer->TopPtr == (RingBuff_Data_t*)&Buffer->Buffer)//at index 0
     e0a:	fd 01       	movw	r30, r26
     e0c:	e0 5c       	subi	r30, 0xC0	; 192
     e0e:	ff 4f       	sbci	r31, 0xFF	; 255
     e10:	80 81       	ld	r24, Z
     e12:	91 81       	ldd	r25, Z+1	; 0x01
     e14:	8a 17       	cp	r24, r26
     e16:	9b 07       	cpc	r25, r27
     e18:	29 f4       	brne	.+10     	; 0xe24 <Buffer_GetElementFromTop+0x32>
		{
			Buffer->TopPtr = (RingBuff_Data_t*)&Buffer->Buffer[BUFF_LENGTH-1];//now at the top of the array
     e1a:	df 96       	adiw	r26, 0x3f	; 63
     e1c:	b1 83       	std	Z+1, r27	; 0x01
     e1e:	a0 83       	st	Z, r26
     e20:	df 97       	sbiw	r26, 0x3f	; 63
     e22:	05 c0       	rjmp	.+10     	; 0xe2e <Buffer_GetElementFromTop+0x3c>
		}
		else
		{
			Buffer->TopPtr--;
     e24:	80 81       	ld	r24, Z
     e26:	91 81       	ldd	r25, Z+1	; 0x01
     e28:	01 97       	sbiw	r24, 0x01	; 1
     e2a:	91 83       	std	Z+1, r25	; 0x01
     e2c:	80 83       	st	Z, r24
		}

		Buffer->Elements--;
     e2e:	fd 01       	movw	r30, r26
     e30:	ec 5b       	subi	r30, 0xBC	; 188
     e32:	ff 4f       	sbci	r31, 0xFF	; 255
     e34:	80 81       	ld	r24, Z
     e36:	81 50       	subi	r24, 0x01	; 1
     e38:	80 83       	st	Z, r24

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

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

00000e48 <Buffer_GetElementFromBottom>:
	return BuffData;
}

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

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     e50:	f8 94       	cli
	{
		if (!(Buffer->Elements))
     e52:	ec 01       	movw	r28, r24
     e54:	cc 5b       	subi	r28, 0xBC	; 188
     e56:	df 4f       	sbci	r29, 0xFF	; 255
     e58:	88 81       	ld	r24, Y
     e5a:	88 23       	and	r24, r24
     e5c:	19 f4       	brne	.+6      	; 0xe64 <Buffer_GetElementFromBottom+0x1c>
    (void)__s;
}

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

		BuffData = *(Buffer->BottomPtr);
     e64:	da 01       	movw	r26, r20
     e66:	ae 5b       	subi	r26, 0xBE	; 190
     e68:	bf 4f       	sbci	r27, 0xFF	; 255
     e6a:	ed 91       	ld	r30, X+
     e6c:	fc 91       	ld	r31, X
     e6e:	11 97       	sbiw	r26, 0x01	; 1
     e70:	e0 81       	ld	r30, Z

		Buffer->BottomPtr++;
     e72:	8d 91       	ld	r24, X+
     e74:	9c 91       	ld	r25, X
     e76:	11 97       	sbiw	r26, 0x01	; 1
     e78:	01 96       	adiw	r24, 0x01	; 1
     e7a:	11 96       	adiw	r26, 0x01	; 1
     e7c:	9c 93       	st	X, r25
     e7e:	8e 93       	st	-X, r24
		Buffer->Elements--;
     e80:	88 81       	ld	r24, Y
     e82:	81 50       	subi	r24, 0x01	; 1
     e84:	88 83       	st	Y, r24

		if (Buffer->BottomPtr == &Buffer->Buffer[BUFF_LENGTH])
     e86:	2d 91       	ld	r18, X+
     e88:	3c 91       	ld	r19, X
     e8a:	11 97       	sbiw	r26, 0x01	; 1
     e8c:	ca 01       	movw	r24, r20
     e8e:	80 5c       	subi	r24, 0xC0	; 192
     e90:	9f 4f       	sbci	r25, 0xFF	; 255
     e92:	28 17       	cp	r18, r24
     e94:	39 07       	cpc	r19, r25
     e96:	19 f4       	brne	.+6      	; 0xe9e <Buffer_GetElementFromBottom+0x56>
		  Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer;
     e98:	11 96       	adiw	r26, 0x01	; 1
     e9a:	5c 93       	st	X, r21
     e9c:	4e 93       	st	-X, r20
    (void)__s;
}

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

00000ea8 <Buffer_StoreElementOnBottom>:

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

static __inline__ uint8_t __iCliRetVal(void)
{
    cli();
     eac:	f8 94       	cli
	{
		if(Buffer->Elements == BUFF_LENGTH)//i.e. buffer is full.  So we have no room
     eae:	ac 5b       	subi	r26, 0xBC	; 188
     eb0:	bf 4f       	sbci	r27, 0xFF	; 255
     eb2:	8c 91       	ld	r24, X
     eb4:	a4 54       	subi	r26, 0x44	; 68
     eb6:	b0 40       	sbci	r27, 0x00	; 0
     eb8:	80 34       	cpi	r24, 0x40	; 64
     eba:	d9 f0       	breq	.+54     	; 0xef2 <Buffer_StoreElementOnBottom+0x4a>
		{
			return;
		}
		if(Buffer->BottomPtr == (RingBuff_Data_t*)&Buffer->Buffer)
     ebc:	fd 01       	movw	r30, r26
     ebe:	ee 5b       	subi	r30, 0xBE	; 190
     ec0:	ff 4f       	sbci	r31, 0xFF	; 255
     ec2:	80 81       	ld	r24, Z
     ec4:	91 81       	ldd	r25, Z+1	; 0x01
     ec6:	8a 17       	cp	r24, r26
     ec8:	9b 07       	cpc	r25, r27
     eca:	29 f4       	brne	.+10     	; 0xed6 <Buffer_StoreElementOnBottom+0x2e>
		{
			Buffer->BottomPtr = (RingBuff_Data_t*)&Buffer->Buffer[BUFF_LENGTH-1];
     ecc:	df 96       	adiw	r26, 0x3f	; 63
     ece:	b1 83       	std	Z+1, r27	; 0x01
     ed0:	a0 83       	st	Z, r26
     ed2:	df 97       	sbiw	r26, 0x3f	; 63
     ed4:	05 c0       	rjmp	.+10     	; 0xee0 <Buffer_StoreElementOnBottom+0x38>
		}
		else
		{
			Buffer->BottomPtr--;
     ed6:	80 81       	ld	r24, Z
     ed8:	91 81       	ldd	r25, Z+1	; 0x01
     eda:	01 97       	sbiw	r24, 0x01	; 1
     edc:	91 83       	std	Z+1, r25	; 0x01
     ede:	80 83       	st	Z, r24
		}

		*(Buffer->BottomPtr) = Data;
     ee0:	ae 5b       	subi	r26, 0xBE	; 190
     ee2:	bf 4f       	sbci	r27, 0xFF	; 255
     ee4:	ed 91       	ld	r30, X+
     ee6:	fd 91       	ld	r31, X+
     ee8:	60 83       	st	Z, r22
		Buffer->Elements++;
     eea:	fd 01       	movw	r30, r26
     eec:	80 81       	ld	r24, Z
     eee:	8f 5f       	subi	r24, 0xFF	; 255
     ef0:	80 83       	st	Z, r24
    (void)__s;
}

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

00000ef6 <Set_High>:
}



void Set_High(uint8_t x)
{
     ef6:	90 91 19 01 	lds	r25, 0x0119
     efa:	92 33       	cpi	r25, 0x32	; 50
     efc:	41 f0       	breq	.+16     	; 0xf0e <Set_High+0x18>
     efe:	93 33       	cpi	r25, 0x33	; 51
     f00:	61 f0       	breq	.+24     	; 0xf1a <Set_High+0x24>
     f02:	91 33       	cpi	r25, 0x31	; 49
     f04:	79 f4       	brne	.+30     	; 0xf24 <Set_High+0x2e>
	switch(I2C_Port)
	{
		case '1':
			if(x == SCL)
     f06:	88 23       	and	r24, r24
     f08:	31 f0       	breq	.+12     	; 0xf16 <Set_High+0x20>
			{
				DDRD &= ~(1<<5);
			}
			else
			{
				DDRD &= ~(1<<6);
     f0a:	56 98       	cbi	0x0a, 6	; 10
     f0c:	08 95       	ret
			}
			break;
		case '2':
			if(x == SCL)
     f0e:	88 23       	and	r24, r24
     f10:	11 f4       	brne	.+4      	; 0xf16 <Set_High+0x20>
			{
				DDRD &= ~(1<<4);
     f12:	54 98       	cbi	0x0a, 4	; 10
     f14:	08 95       	ret
			}
			else
			{
				DDRD &= ~(1<<5);
     f16:	55 98       	cbi	0x0a, 5	; 10
     f18:	08 95       	ret
			}
			break;
		case '3':
			if(x == SCL)
     f1a:	88 23       	and	r24, r24
     f1c:	11 f4       	brne	.+4      	; 0xf22 <Set_High+0x2c>
			{
				DDRB &= ~(1<<3);
     f1e:	23 98       	cbi	0x04, 3	; 4
     f20:	08 95       	ret
			}
			else
			{
				DDRB &= ~(1<<0);
     f22:	20 98       	cbi	0x04, 0	; 4
     f24:	08 95       	ret

00000f26 <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)
{
     f26:	80 91 19 01 	lds	r24, 0x0119
     f2a:	82 33       	cpi	r24, 0x32	; 50
     f2c:	39 f0       	breq	.+14     	; 0xf3c <I2C_Init+0x16>
     f2e:	83 33       	cpi	r24, 0x33	; 51
     f30:	49 f0       	breq	.+18     	; 0xf44 <I2C_Init+0x1e>
     f32:	81 33       	cpi	r24, 0x31	; 49
     f34:	51 f4       	brne	.+20     	; 0xf4a <I2C_Init+0x24>
	
	switch(I2C_Port)
	{
		case '1':
			PORTD &= ~((1<<5) | (1<<6));
     f36:	8b b1       	in	r24, 0x0b	; 11
     f38:	8f 79       	andi	r24, 0x9F	; 159
     f3a:	02 c0       	rjmp	.+4      	; 0xf40 <I2C_Init+0x1a>
			break;
		case '2':
			PORTD &= ~((1<<4) | (1<<5));
     f3c:	8b b1       	in	r24, 0x0b	; 11
     f3e:	8f 7c       	andi	r24, 0xCF	; 207
     f40:	8b b9       	out	0x0b, r24	; 11
     f42:	03 c0       	rjmp	.+6      	; 0xf4a <I2C_Init+0x24>
			break;
		case '3':
			PORTB &= ~((1<<0) | (1<<3));
     f44:	85 b1       	in	r24, 0x05	; 5
     f46:	86 7f       	andi	r24, 0xF6	; 246
     f48:	85 b9       	out	0x05, r24	; 5
			break;
	}	
	
	Set_High(SDA);
     f4a:	81 e0       	ldi	r24, 0x01	; 1
     f4c:	d4 df       	rcall	.-88     	; 0xef6 <Set_High>
	Set_High(SCL);//ensure that the I2C lines are released
     f4e:	80 e0       	ldi	r24, 0x00	; 0
}
     f50:	d2 cf       	rjmp	.-92     	; 0xef6 <Set_High>

00000f52 <Set_Low>:
			break;
	}

} 
void Set_Low(uint8_t x)
{
     f52:	90 91 19 01 	lds	r25, 0x0119
     f56:	92 33       	cpi	r25, 0x32	; 50
     f58:	41 f0       	breq	.+16     	; 0xf6a <Set_Low+0x18>
     f5a:	93 33       	cpi	r25, 0x33	; 51
     f5c:	61 f0       	breq	.+24     	; 0xf76 <Set_Low+0x24>
     f5e:	91 33       	cpi	r25, 0x31	; 49
     f60:	79 f4       	brne	.+30     	; 0xf80 <Set_Low+0x2e>
	switch(I2C_Port)
	{
		case '1'://to molex
			if(x == SCL)
     f62:	88 23       	and	r24, r24
     f64:	31 f0       	breq	.+12     	; 0xf72 <Set_Low+0x20>
			{
				DDRD |= (1<<5);
			}
			else
			{
				DDRD |= (1<<6);
     f66:	56 9a       	sbi	0x0a, 6	; 10
     f68:	08 95       	ret
			}
			break;
		case '2'://to pins
			if(x == SCL)
     f6a:	88 23       	and	r24, r24
     f6c:	11 f4       	brne	.+4      	; 0xf72 <Set_Low+0x20>
			{
				DDRD |= (1<<4);
     f6e:	54 9a       	sbi	0x0a, 4	; 10
     f70:	08 95       	ret
			}
			else
			{
				DDRD |= (1<<5);
     f72:	55 9a       	sbi	0x0a, 5	; 10
     f74:	08 95       	ret
			}
			break;
		case '3'://to motor
			if(x == SCL)
     f76:	88 23       	and	r24, r24
     f78:	11 f4       	brne	.+4      	; 0xf7e <Set_Low+0x2c>
			{
				DDRB |= (1<<3);
     f7a:	23 9a       	sbi	0x04, 3	; 4
     f7c:	08 95       	ret
			}
			else
			{
				DDRB |= (1<<0);
     f7e:	20 9a       	sbi	0x04, 0	; 4
     f80:	08 95       	ret

00000f82 <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)
{	
     f82:	df 93       	push	r29
     f84:	cf 93       	push	r28
     f86:	0f 92       	push	r0
     f88:	cd b7       	in	r28, 0x3d	; 61
     f8a:	de b7       	in	r29, 0x3e	; 62
	//  Set SCL high
	Set_High(SCL);
     f8c:	80 e0       	ldi	r24, 0x00	; 0
     f8e:	b3 df       	rcall	.-154    	; 0xef6 <Set_High>
     f90:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     f92:	21 e0       	ldi	r18, 0x01	; 1
     f94:	29 83       	std	Y+1, r18	; 0x01
     f96:	03 c0       	rjmp	.+6      	; 0xf9e <I2C_Pulse_SCL+0x1c>
     f98:	89 81       	ldd	r24, Y+1	; 0x01
     f9a:	8f 5f       	subi	r24, 0xFF	; 255
     f9c:	89 83       	std	Y+1, r24	; 0x01
     f9e:	89 81       	ldd	r24, Y+1	; 0x01
     fa0:	8a 30       	cpi	r24, 0x0A	; 10
     fa2:	d0 f3       	brcs	.-12     	; 0xf98 <I2C_Pulse_SCL+0x16>
		{
		
				;
			
		}
		delay--;
     fa4:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     fa6:	b1 f7       	brne	.-20     	; 0xf94 <I2C_Pulse_SCL+0x12>
	
	//  Delay
	Delay(I2C_PERIOD);
	
	// Set SCL Low
	Set_Low(SCL);
     fa8:	80 e0       	ldi	r24, 0x00	; 0
     faa:	d3 df       	rcall	.-90     	; 0xf52 <Set_Low>
     fac:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     fae:	21 e0       	ldi	r18, 0x01	; 1
     fb0:	29 83       	std	Y+1, r18	; 0x01
     fb2:	03 c0       	rjmp	.+6      	; 0xfba <I2C_Pulse_SCL+0x38>
     fb4:	89 81       	ldd	r24, Y+1	; 0x01
     fb6:	8f 5f       	subi	r24, 0xFF	; 255
     fb8:	89 83       	std	Y+1, r24	; 0x01
     fba:	89 81       	ldd	r24, Y+1	; 0x01
     fbc:	8a 30       	cpi	r24, 0x0A	; 10
     fbe:	d0 f3       	brcs	.-12     	; 0xfb4 <I2C_Pulse_SCL+0x32>
		{
		
				;
			
		}
		delay--;
     fc0:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     fc2:	b1 f7       	brne	.-20     	; 0xfb0 <I2C_Pulse_SCL+0x2e>
	
	// Set SCL Low
	Set_Low(SCL);
	
	Delay(I2C_PERIOD);
}
     fc4:	0f 90       	pop	r0
     fc6:	cf 91       	pop	r28
     fc8:	df 91       	pop	r29
     fca:	08 95       	ret

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

void I2C_Send_NACK(void)
{
     fcc:	81 e0       	ldi	r24, 0x01	; 1
     fce:	93 df       	rcall	.-218    	; 0xef6 <Set_High>
	Set_High(SDA);
	//may want a bit of a delay here?
	I2C_Pulse_SCL();
     fd0:	d8 cf       	rjmp	.-80     	; 0xf82 <I2C_Pulse_SCL>

00000fd2 <I2C_Start>:
	
/*
 * This places a start condition onto the I2C lines
 */
void I2C_Start(void)
{
     fd2:	df 93       	push	r29
     fd4:	cf 93       	push	r28
     fd6:	0f 92       	push	r0
     fd8:	cd b7       	in	r28, 0x3d	; 61
     fda:	de b7       	in	r29, 0x3e	; 62
	Set_Low(SDA);
     fdc:	81 e0       	ldi	r24, 0x01	; 1
     fde:	b9 df       	rcall	.-142    	; 0xf52 <Set_Low>
     fe0:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     fe2:	21 e0       	ldi	r18, 0x01	; 1
     fe4:	29 83       	std	Y+1, r18	; 0x01
     fe6:	03 c0       	rjmp	.+6      	; 0xfee <I2C_Start+0x1c>
     fe8:	89 81       	ldd	r24, Y+1	; 0x01
     fea:	8f 5f       	subi	r24, 0xFF	; 255
     fec:	89 83       	std	Y+1, r24	; 0x01
     fee:	89 81       	ldd	r24, Y+1	; 0x01
     ff0:	8a 30       	cpi	r24, 0x0A	; 10
     ff2:	d0 f3       	brcs	.-12     	; 0xfe8 <I2C_Start+0x16>
		{
		
				;
			
		}
		delay--;
     ff4:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
     ff6:	b1 f7       	brne	.-20     	; 0xfe4 <I2C_Start+0x12>
 */
void I2C_Start(void)
{
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_Low(SCL);
     ff8:	80 e0       	ldi	r24, 0x00	; 0
     ffa:	ab df       	rcall	.-170    	; 0xf52 <Set_Low>
     ffc:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
     ffe:	21 e0       	ldi	r18, 0x01	; 1
    1000:	29 83       	std	Y+1, r18	; 0x01
    1002:	03 c0       	rjmp	.+6      	; 0x100a <I2C_Start+0x38>
    1004:	89 81       	ldd	r24, Y+1	; 0x01
    1006:	8f 5f       	subi	r24, 0xFF	; 255
    1008:	89 83       	std	Y+1, r24	; 0x01
    100a:	89 81       	ldd	r24, Y+1	; 0x01
    100c:	8a 30       	cpi	r24, 0x0A	; 10
    100e:	d0 f3       	brcs	.-12     	; 0x1004 <I2C_Start+0x32>
		{
		
				;
			
		}
		delay--;
    1010:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1012:	b1 f7       	brne	.-20     	; 0x1000 <I2C_Start+0x2e>
{
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_Low(SCL);
	Delay(I2C_PERIOD);
}
    1014:	0f 90       	pop	r0
    1016:	cf 91       	pop	r28
    1018:	df 91       	pop	r29
    101a:	08 95       	ret

0000101c <I2C_Send_ACK>:

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

00001026 <Wait_On_SCL_Low>:
			break;
	}
}

void Wait_On_SCL_Low(void)
{
    1026:	80 91 19 01 	lds	r24, 0x0119
    102a:	82 33       	cpi	r24, 0x32	; 50
    102c:	39 f0       	breq	.+14     	; 0x103c <Wait_On_SCL_Low+0x16>
    102e:	83 33       	cpi	r24, 0x33	; 51
    1030:	41 f0       	breq	.+16     	; 0x1042 <Wait_On_SCL_Low+0x1c>
    1032:	81 33       	cpi	r24, 0x31	; 49
    1034:	41 f4       	brne	.+16     	; 0x1046 <Wait_On_SCL_Low+0x20>
	switch(I2C_Port)
	{
		case '1'://to molex
			while( !(PIND & (1<<5)) );	
    1036:	4d 9b       	sbis	0x09, 5	; 9
    1038:	fe cf       	rjmp	.-4      	; 0x1036 <Wait_On_SCL_Low+0x10>
    103a:	08 95       	ret
			break;
		case '2'://to pins
			while( !(PIND & (1<<4)) );	
    103c:	4c 9b       	sbis	0x09, 4	; 9
    103e:	fe cf       	rjmp	.-4      	; 0x103c <Wait_On_SCL_Low+0x16>
    1040:	08 95       	ret
			break;
		case '3'://to motor
			while( !(PINB & (1<<3)) );	
    1042:	1b 9b       	sbis	0x03, 3	; 3
    1044:	fe cf       	rjmp	.-4      	; 0x1042 <Wait_On_SCL_Low+0x1c>
    1046:	08 95       	ret

00001048 <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)
{	
    1048:	df 93       	push	r29
    104a:	cf 93       	push	r28
    104c:	0f 92       	push	r0
    104e:	cd b7       	in	r28, 0x3d	; 61
    1050:	de b7       	in	r29, 0x3e	; 62
	//  Set SCL high
	Set_High(SCL);
    1052:	80 e0       	ldi	r24, 0x00	; 0
    1054:	50 df       	rcall	.-352    	; 0xef6 <Set_High>
	
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
    1056:	e7 df       	rcall	.-50     	; 0x1026 <Wait_On_SCL_Low>
    1058:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    105a:	21 e0       	ldi	r18, 0x01	; 1
    105c:	29 83       	std	Y+1, r18	; 0x01
    105e:	03 c0       	rjmp	.+6      	; 0x1066 <I2C_Pulse_SCL_After_ACK+0x1e>
    1060:	89 81       	ldd	r24, Y+1	; 0x01
    1062:	8f 5f       	subi	r24, 0xFF	; 255
    1064:	89 83       	std	Y+1, r24	; 0x01
    1066:	89 81       	ldd	r24, Y+1	; 0x01
    1068:	8a 30       	cpi	r24, 0x0A	; 10
    106a:	d0 f3       	brcs	.-12     	; 0x1060 <I2C_Pulse_SCL_After_ACK+0x18>
		{
		
				;
			
		}
		delay--;
    106c:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    106e:	b1 f7       	brne	.-20     	; 0x105c <I2C_Pulse_SCL_After_ACK+0x14>
	
	//  Delay
	Delay(I2C_PERIOD);
	
	// Set SCL Low
	Set_Low(SCL);
    1070:	80 e0       	ldi	r24, 0x00	; 0
    1072:	6f df       	rcall	.-290    	; 0xf52 <Set_Low>
    1074:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1076:	21 e0       	ldi	r18, 0x01	; 1
    1078:	29 83       	std	Y+1, r18	; 0x01
    107a:	03 c0       	rjmp	.+6      	; 0x1082 <I2C_Pulse_SCL_After_ACK+0x3a>
    107c:	89 81       	ldd	r24, Y+1	; 0x01
    107e:	8f 5f       	subi	r24, 0xFF	; 255
    1080:	89 83       	std	Y+1, r24	; 0x01
    1082:	89 81       	ldd	r24, Y+1	; 0x01
    1084:	8a 30       	cpi	r24, 0x0A	; 10
    1086:	d0 f3       	brcs	.-12     	; 0x107c <I2C_Pulse_SCL_After_ACK+0x34>
		{
		
				;
			
		}
		delay--;
    1088:	91 50       	subi	r25, 0x01	; 1

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

	return 0;
}
    108c:	80 e0       	ldi	r24, 0x00	; 0
    108e:	0f 90       	pop	r0
    1090:	cf 91       	pop	r28
    1092:	df 91       	pop	r29
    1094:	08 95       	ret

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

	
	if( data & 0x80)
    109c:	87 ff       	sbrs	r24, 7
    109e:	03 c0       	rjmp	.+6      	; 0x10a6 <I2C_Send_Byte+0x10>
	{
		Set_High(SDA);
    10a0:	81 e0       	ldi	r24, 0x01	; 1
    10a2:	29 df       	rcall	.-430    	; 0xef6 <Set_High>
    10a4:	02 c0       	rjmp	.+4      	; 0x10aa <I2C_Send_Byte+0x14>
	}
	else
	{
		Set_Low(SDA);
    10a6:	81 e0       	ldi	r24, 0x01	; 1
    10a8:	54 df       	rcall	.-344    	; 0xf52 <Set_Low>
	}
		
	if(I2C_Pulse_SCL_After_ACK())//ensure that the slave is not holding the SCL line to force us to wait
    10aa:	ce df       	rcall	.-100    	; 0x1048 <I2C_Pulse_SCL_After_ACK>
    10ac:	88 23       	and	r24, r24
    10ae:	11 f0       	breq	.+4      	; 0x10b4 <I2C_Send_Byte+0x1e>
    10b0:	81 e0       	ldi	r24, 0x01	; 1
    10b2:	13 c0       	rjmp	.+38     	; 0x10da <I2C_Send_Byte+0x44>
	{
		return 1;
	}
	data <<= 1;//shift the next data bit up
    10b4:	01 2f       	mov	r16, r17
    10b6:	00 0f       	add	r16, r16
    10b8:	11 e0       	ldi	r17, 0x01	; 1
	
	for(i = 1; i < 8; i++)//write out each data bit, MSB first
	{
		if( data & 0x80)
    10ba:	07 ff       	sbrs	r16, 7
    10bc:	03 c0       	rjmp	.+6      	; 0x10c4 <I2C_Send_Byte+0x2e>
		{
			Set_High(SDA);
    10be:	81 e0       	ldi	r24, 0x01	; 1
    10c0:	1a df       	rcall	.-460    	; 0xef6 <Set_High>
    10c2:	02 c0       	rjmp	.+4      	; 0x10c8 <I2C_Send_Byte+0x32>
		}
		else
		{
			Set_Low(SDA);
    10c4:	81 e0       	ldi	r24, 0x01	; 1
    10c6:	45 df       	rcall	.-374    	; 0xf52 <Set_Low>
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SL line down
    10c8:	5c df       	rcall	.-328    	; 0xf82 <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
    10ca:	1f 5f       	subi	r17, 0xFF	; 255
    10cc:	18 30       	cpi	r17, 0x08	; 8
    10ce:	11 f0       	breq	.+4      	; 0x10d4 <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
    10d0:	00 0f       	add	r16, r16
    10d2:	f3 cf       	rjmp	.-26     	; 0x10ba <I2C_Send_Byte+0x24>
	}

	Set_High(SDA);//release line
    10d4:	81 e0       	ldi	r24, 0x01	; 1
    10d6:	0f df       	rcall	.-482    	; 0xef6 <Set_High>
    10d8:	80 e0       	ldi	r24, 0x00	; 0

	return 0;

}
    10da:	1f 91       	pop	r17
    10dc:	0f 91       	pop	r16
    10de:	08 95       	ret

000010e0 <I2C_Stop>:

/*
 * This function places a stop condition onto the I2C bus
 */
void I2C_Stop(void)
{
    10e0:	df 93       	push	r29
    10e2:	cf 93       	push	r28
    10e4:	0f 92       	push	r0
    10e6:	cd b7       	in	r28, 0x3d	; 61
    10e8:	de b7       	in	r29, 0x3e	; 62
	
	Set_Low(SDA);
    10ea:	81 e0       	ldi	r24, 0x01	; 1
    10ec:	32 df       	rcall	.-412    	; 0xf52 <Set_Low>
    10ee:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    10f0:	21 e0       	ldi	r18, 0x01	; 1
    10f2:	29 83       	std	Y+1, r18	; 0x01
    10f4:	03 c0       	rjmp	.+6      	; 0x10fc <I2C_Stop+0x1c>
    10f6:	89 81       	ldd	r24, Y+1	; 0x01
    10f8:	8f 5f       	subi	r24, 0xFF	; 255
    10fa:	89 83       	std	Y+1, r24	; 0x01
    10fc:	89 81       	ldd	r24, Y+1	; 0x01
    10fe:	8a 30       	cpi	r24, 0x0A	; 10
    1100:	d0 f3       	brcs	.-12     	; 0x10f6 <I2C_Stop+0x16>
		{
		
				;
			
		}
		delay--;
    1102:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1104:	b1 f7       	brne	.-20     	; 0x10f2 <I2C_Stop+0x12>
void I2C_Stop(void)
{
	
	Set_Low(SDA);
	Delay(I2C_PERIOD);
	Set_High(SCL);
    1106:	80 e0       	ldi	r24, 0x00	; 0
    1108:	f6 de       	rcall	.-532    	; 0xef6 <Set_High>
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
    110a:	8d df       	rcall	.-230    	; 0x1026 <Wait_On_SCL_Low>
    110c:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    110e:	21 e0       	ldi	r18, 0x01	; 1
    1110:	29 83       	std	Y+1, r18	; 0x01
    1112:	03 c0       	rjmp	.+6      	; 0x111a <I2C_Stop+0x3a>
    1114:	89 81       	ldd	r24, Y+1	; 0x01
    1116:	8f 5f       	subi	r24, 0xFF	; 255
    1118:	89 83       	std	Y+1, r24	; 0x01
    111a:	89 81       	ldd	r24, Y+1	; 0x01
    111c:	8a 30       	cpi	r24, 0x0A	; 10
    111e:	d0 f3       	brcs	.-12     	; 0x1114 <I2C_Stop+0x34>
		{
		
				;
			
		}
		delay--;
    1120:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1122:	b1 f7       	brne	.-20     	; 0x1110 <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);
    1124:	81 e0       	ldi	r24, 0x01	; 1
    1126:	e7 de       	rcall	.-562    	; 0xef6 <Set_High>
    1128:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    112a:	21 e0       	ldi	r18, 0x01	; 1
    112c:	29 83       	std	Y+1, r18	; 0x01
    112e:	03 c0       	rjmp	.+6      	; 0x1136 <I2C_Stop+0x56>
    1130:	89 81       	ldd	r24, Y+1	; 0x01
    1132:	8f 5f       	subi	r24, 0xFF	; 255
    1134:	89 83       	std	Y+1, r24	; 0x01
    1136:	89 81       	ldd	r24, Y+1	; 0x01
    1138:	8a 30       	cpi	r24, 0x0A	; 10
    113a:	d0 f3       	brcs	.-12     	; 0x1130 <I2C_Stop+0x50>
		{
		
				;
			
		}
		delay--;
    113c:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    113e:	b1 f7       	brne	.-20     	; 0x112c <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);
}
    1140:	0f 90       	pop	r0
    1142:	cf 91       	pop	r28
    1144:	df 91       	pop	r29
    1146:	08 95       	ret

00001148 <I2C_Pin_Value>:
	}
}


uint8_t I2C_Pin_Value(uint8_t x)
{
    1148:	90 91 19 01 	lds	r25, 0x0119
    114c:	92 33       	cpi	r25, 0x32	; 50
    114e:	59 f0       	breq	.+22     	; 0x1166 <I2C_Pin_Value+0x1e>
    1150:	93 33       	cpi	r25, 0x33	; 51
    1152:	89 f0       	breq	.+34     	; 0x1176 <I2C_Pin_Value+0x2e>
    1154:	91 33       	cpi	r25, 0x31	; 49
    1156:	11 f0       	breq	.+4      	; 0x115c <I2C_Pin_Value+0x14>
    1158:	80 e0       	ldi	r24, 0x00	; 0
    115a:	08 95       	ret
	switch(I2C_Port)
	{
		case '1'://to molex
			if(x == SCL)
    115c:	88 23       	and	r24, r24
    115e:	41 f0       	breq	.+16     	; 0x1170 <I2C_Pin_Value+0x28>
			{
				return (PIND & (1<<5));
			}
			else
			{
				return (PIND & (1<<6));
    1160:	89 b1       	in	r24, 0x09	; 9
    1162:	80 74       	andi	r24, 0x40	; 64
    1164:	08 95       	ret
			}
			break;
		case '2'://to pins
			if(x == SCL)
    1166:	88 23       	and	r24, r24
    1168:	19 f4       	brne	.+6      	; 0x1170 <I2C_Pin_Value+0x28>
			{
				return (PIND & (1<<4));
    116a:	89 b1       	in	r24, 0x09	; 9
    116c:	80 71       	andi	r24, 0x10	; 16
    116e:	08 95       	ret
			}
			else
			{
				return (PIND & (1<<5));
    1170:	89 b1       	in	r24, 0x09	; 9
    1172:	80 72       	andi	r24, 0x20	; 32
    1174:	08 95       	ret
			}
			break;
		case '3'://to motor
			if(x == SCL)
    1176:	88 23       	and	r24, r24
    1178:	19 f4       	brne	.+6      	; 0x1180 <I2C_Pin_Value+0x38>
			{
				return (PINB & (1<<3));
    117a:	83 b1       	in	r24, 0x03	; 3
    117c:	88 70       	andi	r24, 0x08	; 8
    117e:	08 95       	ret
			}
			else
			{
				return (PINB & (1<<0));
    1180:	83 b1       	in	r24, 0x03	; 3
    1182:	81 70       	andi	r24, 0x01	; 1
			}
			break;
	}
	return 0;
}
    1184:	08 95       	ret

00001186 <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)
{
    1186:	0f 93       	push	r16
    1188:	1f 93       	push	r17
    118a:	df 93       	push	r29
    118c:	cf 93       	push	r28
    118e:	0f 92       	push	r0
    1190:	cd b7       	in	r28, 0x3d	; 61
    1192:	de b7       	in	r29, 0x3e	; 62
	uint8_t i;
	uint8_t received = 0x00;
	
	Set_High(SCL);
    1194:	80 e0       	ldi	r24, 0x00	; 0
    1196:	af de       	rcall	.-674    	; 0xef6 <Set_High>
	
	Wait_On_SCL_Low();//wait for the Slave to allow us to move on
    1198:	46 df       	rcall	.-372    	; 0x1026 <Wait_On_SCL_Low>
    119a:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    119c:	21 e0       	ldi	r18, 0x01	; 1
    119e:	29 83       	std	Y+1, r18	; 0x01
    11a0:	03 c0       	rjmp	.+6      	; 0x11a8 <I2C_Receive_Byte+0x22>
    11a2:	89 81       	ldd	r24, Y+1	; 0x01
    11a4:	8f 5f       	subi	r24, 0xFF	; 255
    11a6:	89 83       	std	Y+1, r24	; 0x01
    11a8:	89 81       	ldd	r24, Y+1	; 0x01
    11aa:	8a 30       	cpi	r24, 0x0A	; 10
    11ac:	d0 f3       	brcs	.-12     	; 0x11a2 <I2C_Receive_Byte+0x1c>
		{
		
				;
			
		}
		delay--;
    11ae:	91 50       	subi	r25, 0x01	; 1

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

	//  Delay
	Delay(I2C_PERIOD);

	if(I2C_Pin_Value(SDA))
    11b2:	81 e0       	ldi	r24, 0x01	; 1
    11b4:	c9 df       	rcall	.-110    	; 0x1148 <I2C_Pin_Value>
    11b6:	18 2f       	mov	r17, r24
	{
		received |= 1;//append 1 to our databyte
	}
	// Set SCL Low
	Set_Low(SCL);
    11b8:	80 e0       	ldi	r24, 0x00	; 0
    11ba:	cb de       	rcall	.-618    	; 0xf52 <Set_Low>
    11bc:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    11be:	21 e0       	ldi	r18, 0x01	; 1
    11c0:	29 83       	std	Y+1, r18	; 0x01
    11c2:	03 c0       	rjmp	.+6      	; 0x11ca <I2C_Receive_Byte+0x44>
    11c4:	89 81       	ldd	r24, Y+1	; 0x01
    11c6:	8f 5f       	subi	r24, 0xFF	; 255
    11c8:	89 83       	std	Y+1, r24	; 0x01
    11ca:	89 81       	ldd	r24, Y+1	; 0x01
    11cc:	8a 30       	cpi	r24, 0x0A	; 10
    11ce:	d0 f3       	brcs	.-12     	; 0x11c4 <I2C_Receive_Byte+0x3e>
		{
		
				;
			
		}
		delay--;
    11d0:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    11d2:	b1 f7       	brne	.-20     	; 0x11c0 <I2C_Receive_Byte+0x3a>
    11d4:	81 2f       	mov	r24, r17
    11d6:	11 11       	cpse	r17, r1
    11d8:	81 e0       	ldi	r24, 0x01	; 1
    11da:	18 2f       	mov	r17, r24
    11dc:	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
    11de:	11 0f       	add	r17, r17
		if(I2C_Pin_Value(SDA))
    11e0:	81 e0       	ldi	r24, 0x01	; 1
    11e2:	b2 df       	rcall	.-156    	; 0x1148 <I2C_Pin_Value>
    11e4:	81 11       	cpse	r24, r1
		{
			received |= 1;//append 1 to our databyte
    11e6:	11 60       	ori	r17, 0x01	; 1
		}
		
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SCL line down
    11e8:	cc de       	rcall	.-616    	; 0xf82 <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
    11ea:	0f 5f       	subi	r16, 0xFF	; 255
    11ec:	08 30       	cpi	r16, 0x08	; 8
    11ee:	b9 f7       	brne	.-18     	; 0x11de <I2C_Receive_Byte+0x58>
		I2C_Pulse_SCL();//no checking to see if the slave is holding the SCL line down
	}

	return received;

}
    11f0:	81 2f       	mov	r24, r17
    11f2:	0f 90       	pop	r0
    11f4:	cf 91       	pop	r28
    11f6:	df 91       	pop	r29
    11f8:	1f 91       	pop	r17
    11fa:	0f 91       	pop	r16
    11fc:	08 95       	ret

000011fe <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)
{
    11fe:	1f 93       	push	r17
    1200:	df 93       	push	r29
    1202:	cf 93       	push	r28
    1204:	0f 92       	push	r0
    1206:	cd b7       	in	r28, 0x3d	; 61
    1208:	de b7       	in	r29, 0x3e	; 62
	uint8_t value = ACK;	
	
	//  Set SCL high
	Set_High(SCL);
    120a:	80 e0       	ldi	r24, 0x00	; 0
    120c:	74 de       	rcall	.-792    	; 0xef6 <Set_High>
    120e:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1210:	21 e0       	ldi	r18, 0x01	; 1
    1212:	29 83       	std	Y+1, r18	; 0x01
    1214:	03 c0       	rjmp	.+6      	; 0x121c <I2C_Get_ACK+0x1e>
    1216:	89 81       	ldd	r24, Y+1	; 0x01
    1218:	8f 5f       	subi	r24, 0xFF	; 255
    121a:	89 83       	std	Y+1, r24	; 0x01
    121c:	89 81       	ldd	r24, Y+1	; 0x01
    121e:	8a 30       	cpi	r24, 0x0A	; 10
    1220:	d0 f3       	brcs	.-12     	; 0x1216 <I2C_Get_ACK+0x18>
		{
		
				;
			
		}
		delay--;
    1222:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1224:	b1 f7       	brne	.-20     	; 0x1212 <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)
    1226:	81 e0       	ldi	r24, 0x01	; 1
    1228:	8f df       	rcall	.-226    	; 0x1148 <I2C_Pin_Value>
    122a:	18 2f       	mov	r17, r24
		value = NACK;
	}
	
	
	// Set SCL Low
	Set_Low(SCL);
    122c:	80 e0       	ldi	r24, 0x00	; 0
    122e:	91 de       	rcall	.-734    	; 0xf52 <Set_Low>
    1230:	91 e0       	ldi	r25, 0x01	; 1
{
	volatile uint8_t a;
		
	while(delay > 0)
	{
		for ( a = 1;a<10;a++)
    1232:	21 e0       	ldi	r18, 0x01	; 1
    1234:	29 83       	std	Y+1, r18	; 0x01
    1236:	03 c0       	rjmp	.+6      	; 0x123e <I2C_Get_ACK+0x40>
    1238:	89 81       	ldd	r24, Y+1	; 0x01
    123a:	8f 5f       	subi	r24, 0xFF	; 255
    123c:	89 83       	std	Y+1, r24	; 0x01
    123e:	89 81       	ldd	r24, Y+1	; 0x01
    1240:	8a 30       	cpi	r24, 0x0A	; 10
    1242:	d0 f3       	brcs	.-12     	; 0x1238 <I2C_Get_ACK+0x3a>
		{
		
				;
			
		}
		delay--;
    1244:	91 50       	subi	r25, 0x01	; 1

void Delay(uint8_t delay)
{
	volatile uint8_t a;
		
	while(delay > 0)
    1246:	b1 f7       	brne	.-20     	; 0x1234 <I2C_Get_ACK+0x36>
    1248:	81 2f       	mov	r24, r17
    124a:	11 11       	cpse	r17, r1
    124c:	81 e0       	ldi	r24, 0x01	; 1
	
	Delay(I2C_PERIOD);	

	
	return value;
}
    124e:	0f 90       	pop	r0
    1250:	cf 91       	pop	r28
    1252:	df 91       	pop	r29
    1254:	1f 91       	pop	r17
    1256:	08 95       	ret

00001258 <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)
{
    1258:	cf 92       	push	r12
    125a:	df 92       	push	r13
    125c:	ef 92       	push	r14
    125e:	ff 92       	push	r15
    1260:	0f 93       	push	r16
    1262:	1f 93       	push	r17
    1264:	cf 93       	push	r28
    1266:	df 93       	push	r29
    1268:	18 2f       	mov	r17, r24
    126a:	6b 01       	movw	r12, r22
    126c:	7a 01       	movw	r14, r20
	uint16_t i;

	I2C_Start();//place a start condition on the I2C lines
    126e:	b1 de       	rcall	.-670    	; 0xfd2 <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
    1270:	11 0f       	add	r17, r17
    1272:	81 2f       	mov	r24, r17
    1274:	81 60       	ori	r24, 0x01	; 1
    1276:	0f df       	rcall	.-482    	; 0x1096 <I2C_Send_Byte>
    1278:	88 23       	and	r24, r24
    127a:	49 f4       	brne	.+18     	; 0x128e <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
    127c:	c0 df       	rcall	.-128    	; 0x11fe <I2C_Get_ACK>
    127e:	81 30       	cpi	r24, 0x01	; 1
    1280:	31 f0       	breq	.+12     	; 0x128e <I2C_Read+0x36>
    1282:	c0 e0       	ldi	r28, 0x00	; 0
    1284:	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
    1286:	87 01       	movw	r16, r14
    1288:	01 50       	subi	r16, 0x01	; 1
    128a:	10 40       	sbci	r17, 0x00	; 0
    128c:	0f c0       	rjmp	.+30     	; 0x12ac <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
    128e:	28 df       	rcall	.-432    	; 0x10e0 <I2C_Stop>
    1290:	80 e0       	ldi	r24, 0x00	; 0
    1292:	11 c0       	rjmp	.+34     	; 0x12b6 <I2C_Read+0x5e>
	}
	
	//read the data
	for(i = 0; i < lenght; i++)
	{
		data[i] = I2C_Receive_Byte();
    1294:	78 df       	rcall	.-272    	; 0x1186 <I2C_Receive_Byte>
    1296:	f6 01       	movw	r30, r12
    1298:	ec 0f       	add	r30, r28
    129a:	fd 1f       	adc	r31, r29
    129c:	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
    129e:	c0 17       	cp	r28, r16
    12a0:	d1 07       	cpc	r29, r17
    12a2:	10 f4       	brcc	.+4      	; 0x12a8 <I2C_Read+0x50>
		{
			I2C_Send_ACK();	
    12a4:	bb de       	rcall	.-650    	; 0x101c <I2C_Send_ACK>
    12a6:	01 c0       	rjmp	.+2      	; 0x12aa <I2C_Read+0x52>
		}
		else
		{
			I2C_Send_NACK();//Nack the last byte
    12a8:	91 de       	rcall	.-734    	; 0xfcc <I2C_Send_NACK>
		return 0;
		
	}
	
	//read the data
	for(i = 0; i < lenght; i++)
    12aa:	21 96       	adiw	r28, 0x01	; 1
    12ac:	ce 15       	cp	r28, r14
    12ae:	df 05       	cpc	r29, r15
    12b0:	88 f3       	brcs	.-30     	; 0x1294 <I2C_Read+0x3c>
		{
			I2C_Send_NACK();//Nack the last byte
		}
	}

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

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

}
    12b6:	df 91       	pop	r29
    12b8:	cf 91       	pop	r28
    12ba:	1f 91       	pop	r17
    12bc:	0f 91       	pop	r16
    12be:	ff 90       	pop	r15
    12c0:	ef 90       	pop	r14
    12c2:	df 90       	pop	r13
    12c4:	cf 90       	pop	r12
    12c6:	08 95       	ret

000012c8 <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)
{
    12c8:	cf 92       	push	r12
    12ca:	df 92       	push	r13
    12cc:	ef 92       	push	r14
    12ce:	ff 92       	push	r15
    12d0:	1f 93       	push	r17
    12d2:	cf 93       	push	r28
    12d4:	df 93       	push	r29
    12d6:	18 2f       	mov	r17, r24
    12d8:	6b 01       	movw	r12, r22
    12da:	7a 01       	movw	r14, r20
	uint16_t i;

	I2C_Start();//place a start condition on the I2C lines
    12dc:	7a de       	rcall	.-780    	; 0xfd2 <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
    12de:	81 2f       	mov	r24, r17
    12e0:	88 0f       	add	r24, r24
    12e2:	d9 de       	rcall	.-590    	; 0x1096 <I2C_Send_Byte>
    12e4:	88 23       	and	r24, r24
    12e6:	69 f4       	brne	.+26     	; 0x1302 <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
    12e8:	8a df       	rcall	.-236    	; 0x11fe <I2C_Get_ACK>
    12ea:	81 30       	cpi	r24, 0x01	; 1
    12ec:	51 f0       	breq	.+20     	; 0x1302 <I2C_Write+0x3a>
    12ee:	c0 e0       	ldi	r28, 0x00	; 0
    12f0:	d0 e0       	ldi	r29, 0x00	; 0
    12f2:	13 c0       	rjmp	.+38     	; 0x131a <I2C_Write+0x52>
	}
	
	//send the data
	for(i = 0; i < lenght; i++)
	{
		if( I2C_Send_Byte(data[i]) )
    12f4:	f6 01       	movw	r30, r12
    12f6:	ec 0f       	add	r30, r28
    12f8:	fd 1f       	adc	r31, r29
    12fa:	80 81       	ld	r24, Z
    12fc:	cc de       	rcall	.-616    	; 0x1096 <I2C_Send_Byte>
    12fe:	88 23       	and	r24, r24
    1300:	19 f0       	breq	.+6      	; 0x1308 <I2C_Write+0x40>
		{
			I2C_Stop();//release the lines
    1302:	ee de       	rcall	.-548    	; 0x10e0 <I2C_Stop>
    1304:	80 e0       	ldi	r24, 0x00	; 0
    1306:	0e c0       	rjmp	.+28     	; 0x1324 <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
    1308:	7a df       	rcall	.-268    	; 0x11fe <I2C_Get_ACK>
    130a:	81 30       	cpi	r24, 0x01	; 1
    130c:	29 f4       	brne	.+10     	; 0x1318 <I2C_Write+0x50>
		{
			I2C_Stop();//release the lines
    130e:	e8 de       	rcall	.-560    	; 0x10e0 <I2C_Stop>
			return i+1;
    1310:	9e 01       	movw	r18, r28
    1312:	2f 5f       	subi	r18, 0xFF	; 255
    1314:	82 2f       	mov	r24, r18
    1316:	06 c0       	rjmp	.+12     	; 0x1324 <I2C_Write+0x5c>
		return 0;
		
	}
	
	//send the data
	for(i = 0; i < lenght; i++)
    1318:	21 96       	adiw	r28, 0x01	; 1
    131a:	ce 15       	cp	r28, r14
    131c:	df 05       	cpc	r29, r15
    131e:	50 f3       	brcs	.-44     	; 0x12f4 <I2C_Write+0x2c>
			return i+1;
		
		}
	}

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

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

}
    1324:	df 91       	pop	r29
    1326:	cf 91       	pop	r28
    1328:	1f 91       	pop	r17
    132a:	ff 90       	pop	r15
    132c:	ef 90       	pop	r14
    132e:	df 90       	pop	r13
    1330:	cf 90       	pop	r12
    1332:	08 95       	ret

00001334 <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)
{
    1334:	85 b1       	in	r24, 0x05	; 5
    1336:	80 7c       	andi	r24, 0xC0	; 192
    1338:	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) );
    133a:	84 b1       	in	r24, 0x04	; 4
    133c:	8f 63       	ori	r24, 0x3F	; 63
    133e:	84 b9       	out	0x04, r24	; 4

}
    1340:	08 95       	ret

00001342 <StartCodition>:


void StartCodition(uint8_t step, uint8_t dir)
{
    1342:	95 b1       	in	r25, 0x05	; 5
    1344:	21 e0       	ldi	r18, 0x01	; 1
    1346:	30 e0       	ldi	r19, 0x00	; 0
    1348:	a9 01       	movw	r20, r18
    134a:	02 c0       	rjmp	.+4      	; 0x1350 <StartCodition+0xe>
    134c:	44 0f       	add	r20, r20
    134e:	55 1f       	adc	r21, r21
    1350:	6a 95       	dec	r22
    1352:	e2 f7       	brpl	.-8      	; 0x134c <StartCodition+0xa>
    1354:	ba 01       	movw	r22, r20
    1356:	94 2b       	or	r25, r20
    1358:	95 b9       	out	0x05, r25	; 5
	Set_High(dir);
	Set_High(step);
    135a:	95 b1       	in	r25, 0x05	; 5
    135c:	02 c0       	rjmp	.+4      	; 0x1362 <StartCodition+0x20>
    135e:	22 0f       	add	r18, r18
    1360:	33 1f       	adc	r19, r19
    1362:	8a 95       	dec	r24
    1364:	e2 f7       	brpl	.-8      	; 0x135e <StartCodition+0x1c>
    1366:	92 2b       	or	r25, r18
    1368:	95 b9       	out	0x05, r25	; 5
	DelayUsec();
    136a:	00 00       	nop
    136c:	00 00       	nop
    136e:	00 00       	nop
    1370:	00 00       	nop
    1372:	00 00       	nop
    1374:	00 00       	nop
    1376:	00 00       	nop
    1378:	00 00       	nop
	DelayUsec();
    137a:	00 00       	nop
    137c:	00 00       	nop
    137e:	00 00       	nop
    1380:	00 00       	nop
    1382:	00 00       	nop
    1384:	00 00       	nop
    1386:	00 00       	nop
    1388:	00 00       	nop
	DelayUsec();
    138a:	00 00       	nop
    138c:	00 00       	nop
    138e:	00 00       	nop
    1390:	00 00       	nop
    1392:	00 00       	nop
    1394:	00 00       	nop
    1396:	00 00       	nop
    1398:	00 00       	nop
	DelayUsec();
    139a:	00 00       	nop
    139c:	00 00       	nop
    139e:	00 00       	nop
    13a0:	00 00       	nop
    13a2:	00 00       	nop
    13a4:	00 00       	nop
    13a6:	00 00       	nop
    13a8:	00 00       	nop
	DelayUsec();
    13aa:	00 00       	nop
    13ac:	00 00       	nop
    13ae:	00 00       	nop
    13b0:	00 00       	nop
    13b2:	00 00       	nop
    13b4:	00 00       	nop
    13b6:	00 00       	nop
    13b8:	00 00       	nop
	Set_Low(dir);
    13ba:	85 b1       	in	r24, 0x05	; 5
    13bc:	60 95       	com	r22
    13be:	68 23       	and	r22, r24
    13c0:	65 b9       	out	0x05, r22	; 5
	DelayUsec();
    13c2:	00 00       	nop
    13c4:	00 00       	nop
    13c6:	00 00       	nop
    13c8:	00 00       	nop
    13ca:	00 00       	nop
    13cc:	00 00       	nop
    13ce:	00 00       	nop
    13d0:	00 00       	nop
}
    13d2:	08 95       	ret

000013d4 <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)
{
    13d4:	ff 92       	push	r15
    13d6:	0f 93       	push	r16
    13d8:	1f 93       	push	r17
    13da:	f8 2e       	mov	r15, r24
	uint8_t axisdir,axisstep;
	uint8_t i;
	
	switch(axisselect)
    13dc:	61 30       	cpi	r22, 0x01	; 1
    13de:	29 f0       	breq	.+10     	; 0x13ea <SendByte+0x16>
    13e0:	62 30       	cpi	r22, 0x02	; 2
    13e2:	31 f4       	brne	.+12     	; 0x13f0 <SendByte+0x1c>
    13e4:	02 e0       	ldi	r16, 0x02	; 2
    13e6:	11 e0       	ldi	r17, 0x01	; 1
    13e8:	05 c0       	rjmp	.+10     	; 0x13f4 <SendByte+0x20>
    13ea:	00 e0       	ldi	r16, 0x00	; 0
    13ec:	13 e0       	ldi	r17, 0x03	; 3
    13ee:	02 c0       	rjmp	.+4      	; 0x13f4 <SendByte+0x20>
    13f0:	04 e0       	ldi	r16, 0x04	; 4
    13f2:	15 e0       	ldi	r17, 0x05	; 5
			break;
	}		
	


	StartCodition(axisstep,axisdir);
    13f4:	60 2f       	mov	r22, r16
    13f6:	81 2f       	mov	r24, r17
    13f8:	a4 df       	rcall	.-184    	; 0x1342 <StartCodition>
	
	for(i=0; i<8; i++)
	{
		Set_Low(axisstep);
    13fa:	81 e0       	ldi	r24, 0x01	; 1
    13fc:	90 e0       	ldi	r25, 0x00	; 0
    13fe:	38 2f       	mov	r19, r24
    1400:	01 c0       	rjmp	.+2      	; 0x1404 <SendByte+0x30>
    1402:	33 0f       	add	r19, r19
    1404:	1a 95       	dec	r17
    1406:	ea f7       	brpl	.-6      	; 0x1402 <SendByte+0x2e>
    1408:	93 2f       	mov	r25, r19
    140a:	90 95       	com	r25
		DelayUsec();
		DelayUsec();

		if(inchar&0x01)
		{
			Set_High(axisdir);
    140c:	68 2f       	mov	r22, r24
    140e:	01 c0       	rjmp	.+2      	; 0x1412 <SendByte+0x3e>
    1410:	66 0f       	add	r22, r22
    1412:	0a 95       	dec	r16
    1414:	ea f7       	brpl	.-6      	; 0x1410 <SendByte+0x3c>
		}
		else
		{
			Set_Low(axisdir);
    1416:	46 2f       	mov	r20, r22
    1418:	40 95       	com	r20
    141a:	20 e0       	ldi	r18, 0x00	; 0

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

		DelayUsec();//may be better to move this delay to after we modify 
    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
		DelayUsec();
    1432:	00 00       	nop
    1434:	00 00       	nop
    1436:	00 00       	nop
    1438:	00 00       	nop
    143a:	00 00       	nop
    143c:	00 00       	nop
    143e:	00 00       	nop
    1440:	00 00       	nop
		DelayUsec();
    1442:	00 00       	nop
    1444:	00 00       	nop
    1446:	00 00       	nop
    1448:	00 00       	nop
    144a:	00 00       	nop
    144c:	00 00       	nop
    144e:	00 00       	nop
    1450:	00 00       	nop
		DelayUsec();
    1452:	00 00       	nop
    1454:	00 00       	nop
    1456:	00 00       	nop
    1458:	00 00       	nop
    145a:	00 00       	nop
    145c:	00 00       	nop
    145e:	00 00       	nop
    1460:	00 00       	nop
		DelayUsec();
    1462:	00 00       	nop
    1464:	00 00       	nop
    1466:	00 00       	nop
    1468:	00 00       	nop
    146a:	00 00       	nop
    146c:	00 00       	nop
    146e:	00 00       	nop
    1470:	00 00       	nop

		if(inchar&0x01)
    1472:	f0 fe       	sbrs	r15, 0
    1474:	03 c0       	rjmp	.+6      	; 0x147c <SendByte+0xa8>
		{
			Set_High(axisdir);
    1476:	85 b1       	in	r24, 0x05	; 5
    1478:	86 2b       	or	r24, r22
    147a:	02 c0       	rjmp	.+4      	; 0x1480 <SendByte+0xac>
		}
		else
		{
			Set_Low(axisdir);
    147c:	85 b1       	in	r24, 0x05	; 5
    147e:	84 23       	and	r24, r20
    1480:	85 b9       	out	0x05, r24	; 5
		}

		Set_High(axisstep);
    1482:	85 b1       	in	r24, 0x05	; 5
    1484:	83 2b       	or	r24, r19
    1486:	85 b9       	out	0x05, r24	; 5

		DelayUsec();
    1488:	00 00       	nop
    148a:	00 00       	nop
    148c:	00 00       	nop
    148e:	00 00       	nop
    1490:	00 00       	nop
    1492:	00 00       	nop
    1494:	00 00       	nop
    1496:	00 00       	nop
		DelayUsec();
    1498:	00 00       	nop
    149a:	00 00       	nop
    149c:	00 00       	nop
    149e:	00 00       	nop
    14a0:	00 00       	nop
    14a2:	00 00       	nop
    14a4:	00 00       	nop
    14a6:	00 00       	nop
		DelayUsec();
    14a8:	00 00       	nop
    14aa:	00 00       	nop
    14ac:	00 00       	nop
    14ae:	00 00       	nop
    14b0:	00 00       	nop
    14b2:	00 00       	nop
    14b4:	00 00       	nop
    14b6:	00 00       	nop
		DelayUsec();
    14b8:	00 00       	nop
    14ba:	00 00       	nop
    14bc:	00 00       	nop
    14be:	00 00       	nop
    14c0:	00 00       	nop
    14c2:	00 00       	nop
    14c4:	00 00       	nop
    14c6:	00 00       	nop
		DelayUsec();
    14c8:	00 00       	nop
    14ca:	00 00       	nop
    14cc:	00 00       	nop
    14ce:	00 00       	nop
    14d0:	00 00       	nop
    14d2:	00 00       	nop
    14d4:	00 00       	nop
    14d6:	00 00       	nop
	


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

	Set_Low(axisstep);
    14e2:	85 b1       	in	r24, 0x05	; 5
    14e4:	98 23       	and	r25, r24
    14e6:	95 b9       	out	0x05, r25	; 5
}
    14e8:	1f 91       	pop	r17
    14ea:	0f 91       	pop	r16
    14ec:	ff 90       	pop	r15
    14ee:	08 95       	ret

000014f0 <Scheduler_SetTaskMode>:
	
	return false;
}

void Scheduler_SetTaskMode(const TaskPtr_t Task, const bool TaskStatus)
{
    14f0:	9c 01       	movw	r18, r24
    14f2:	e2 e0       	ldi	r30, 0x02	; 2
    14f4:	f1 e0       	ldi	r31, 0x01	; 1
    14f6:	08 c0       	rjmp	.+16     	; 0x1508 <Scheduler_SetTaskMode+0x18>
	TaskEntry_t* CurrTask = &Scheduler_TaskList[0];
					
	while (CurrTask != &Scheduler_TaskList[Scheduler_TotalTasks])
	{
		if (CurrTask->Task == Task)
    14f8:	80 81       	ld	r24, Z
    14fa:	91 81       	ldd	r25, Z+1	; 0x01
    14fc:	82 17       	cp	r24, r18
    14fe:	93 07       	cpc	r25, r19
    1500:	11 f4       	brne	.+4      	; 0x1506 <Scheduler_SetTaskMode+0x16>
		{
			CurrTask->TaskStatus = TaskStatus;
    1502:	62 83       	std	Z+2, r22	; 0x02
    1504:	08 95       	ret
			break;
		}
		
		CurrTask++;
    1506:	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])
    1508:	80 91 a9 01 	lds	r24, 0x01A9
    150c:	90 e0       	ldi	r25, 0x00	; 0
    150e:	88 0f       	add	r24, r24
    1510:	99 1f       	adc	r25, r25
    1512:	88 0f       	add	r24, r24
    1514:	99 1f       	adc	r25, r25
    1516:	8e 5f       	subi	r24, 0xFE	; 254
    1518:	9e 4f       	sbci	r25, 0xFE	; 254
    151a:	e8 17       	cp	r30, r24
    151c:	f9 07       	cpc	r31, r25
    151e:	61 f7       	brne	.-40     	; 0x14f8 <Scheduler_SetTaskMode+0x8>
    1520:	08 95       	ret

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

void USB_SetupInterface(void)
{
    1522:	df 93       	push	r29
    1524:	cf 93       	push	r28
    1526:	00 d0       	rcall	.+0      	; 0x1528 <USB_SetupInterface+0x6>
    1528:	00 d0       	rcall	.+0      	; 0x152a <USB_SetupInterface+0x8>
    152a:	cd b7       	in	r28, 0x3d	; 61
    152c:	de b7       	in	r29, 0x3e	; 62
	USB_INT_DisableAllInterrupts();
    152e:	dc d2       	rcall	.+1464   	; 0x1ae8 <USB_INT_DisableAllInterrupts>
	USB_INT_ClearAllInterrupts();
    1530:	de d2       	rcall	.+1468   	; 0x1aee <USB_INT_ClearAllInterrupts>

	USB_IsConnected         = false;
    1532:	10 92 b0 01 	sts	0x01B0, r1
	#if defined(USB_CAN_BE_HOST)
	USB_HostState           = HOST_STATE_Unattached;
	#endif

	#if defined(USB_CAN_BE_DEVICE)
	USB_ConfigurationNumber  = 0;
    1536:	10 92 ae 01 	sts	0x01AE, r1
	USB_RemoteWakeupEnabled  = false;
    153a:	10 92 ad 01 	sts	0x01AD, r1
	USB_CurrentlySelfPowered = false;
    153e:	10 92 ac 01 	sts	0x01AC, 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();
    1542:	84 e0       	ldi	r24, 0x04	; 4
    1544:	89 bd       	out	0x29, r24	; 41
    1546:	89 b5       	in	r24, 0x29	; 41
    1548:	82 60       	ori	r24, 0x02	; 2
    154a:	89 bd       	out	0x29, r24	; 41
	#endif

	while (!(USB_PLL_IsReady()));
    154c:	09 b4       	in	r0, 0x29	; 41
    154e:	00 fe       	sbrs	r0, 0
    1550:	fd cf       	rjmp	.-6      	; 0x154c <USB_SetupInterface+0x2a>
		
	USB_Interface_Reset();
    1552:	80 91 d8 00 	lds	r24, 0x00D8
    1556:	98 2f       	mov	r25, r24
    1558:	9f 77       	andi	r25, 0x7F	; 127
    155a:	90 93 d8 00 	sts	0x00D8, r25
    155e:	80 68       	ori	r24, 0x80	; 128
    1560:	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();
    1564:	80 91 63 00 	lds	r24, 0x0063
    1568:	8e 7f       	andi	r24, 0xFE	; 254
    156a:	80 93 63 00 	sts	0x0063, r24
	
	USB_CLK_Unfreeze();
    156e:	80 91 d8 00 	lds	r24, 0x00D8
    1572:	8f 7d       	andi	r24, 0xDF	; 223
    1574:	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)
    1578:	9e 01       	movw	r18, r28
    157a:	2d 5f       	subi	r18, 0xFD	; 253
    157c:	3f 4f       	sbci	r19, 0xFF	; 255
    157e:	ae 01       	movw	r20, r28
    1580:	4f 5f       	subi	r20, 0xFF	; 255
    1582:	5f 4f       	sbci	r21, 0xFF	; 255
    1584:	60 e0       	ldi	r22, 0x00	; 0
    1586:	80 e0       	ldi	r24, 0x00	; 0
    1588:	91 e0       	ldi	r25, 0x01	; 1
    158a:	ae db       	rcall	.-2212   	; 0xce8 <USB_GetDescriptor>
    158c:	88 23       	and	r24, r24
    158e:	31 f0       	breq	.+12     	; 0x159c <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);
    1590:	e9 81       	ldd	r30, Y+1	; 0x01
    1592:	fa 81       	ldd	r31, Y+2	; 0x02
    1594:	37 96       	adiw	r30, 0x07	; 7
    1596:	e4 91       	lpm	r30, Z+
    1598:	e0 93 1a 01 	sts	0x011A, r30
		#endif
	}
	#endif

	USB_Attach();
    159c:	80 91 e0 00 	lds	r24, 0x00E0
    15a0:	8e 7f       	andi	r24, 0xFE	; 254
    15a2:	80 93 e0 00 	sts	0x00E0, r24
	
	#if defined(USB_DEVICE_ONLY)	
	USB_INT_Enable(USB_INT_SUSPEND);
    15a6:	80 91 e2 00 	lds	r24, 0x00E2
    15aa:	81 60       	ori	r24, 0x01	; 1
    15ac:	80 93 e2 00 	sts	0x00E2, r24
	USB_INT_Enable(USB_INT_EORSTI);	
    15b0:	80 91 e2 00 	lds	r24, 0x00E2
    15b4:	88 60       	ori	r24, 0x08	; 8
    15b6:	80 93 e2 00 	sts	0x00E2, r24
	#endif
	
	#if defined(USB_CAN_BE_BOTH)
	USB_InitTaskPointer();
	#endif
}
    15ba:	0f 90       	pop	r0
    15bc:	0f 90       	pop	r0
    15be:	0f 90       	pop	r0
    15c0:	0f 90       	pop	r0
    15c2:	cf 91       	pop	r28
    15c4:	df 91       	pop	r29
    15c6:	08 95       	ret

000015c8 <USB_ShutDown>:
	
	sei();
}

void USB_ShutDown(void)
{
    15c8:	80 91 b0 01 	lds	r24, 0x01B0
    15cc:	88 23       	and	r24, r24
    15ce:	09 f0       	breq	.+2      	; 0x15d2 <USB_ShutDown+0xa>
	if (USB_IsConnected)
	  RAISE_EVENT(USB_Disconnect);
    15d0:	41 d8       	rcall	.-3966   	; 0x654 <Event_USB_Disconnect>

	USB_INT_DisableAllInterrupts();
    15d2:	8a d2       	rcall	.+1300   	; 0x1ae8 <USB_INT_DisableAllInterrupts>
	USB_INT_ClearAllInterrupts();
    15d4:	8c d2       	rcall	.+1304   	; 0x1aee <USB_INT_ClearAllInterrupts>

	USB_IsConnected         = false;
    15d6:	10 92 b0 01 	sts	0x01B0, r1
	USB_IsInitialized       = false;
    15da:	10 92 af 01 	sts	0x01AF, r1
	#if defined(USB_CAN_BE_HOST)
	USB_HostState           = HOST_STATE_Unattached;
	#endif

	#if defined(USB_CAN_BE_DEVICE)
	USB_ConfigurationNumber = 0;
    15de:	10 92 ae 01 	sts	0x01AE, r1
	
	#if !defined(USE_STATIC_OPTIONS)
	USB_Options     = 0;
	#endif

	USB_Interface_Disable();
    15e2:	80 91 d8 00 	lds	r24, 0x00D8
    15e6:	8f 77       	andi	r24, 0x7F	; 127
    15e8:	80 93 d8 00 	sts	0x00D8, r24
	USB_PLL_Off();
    15ec:	19 bc       	out	0x29, r1	; 41
	#endif

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

000015f0 <USB_Init>:
			   
               #if !defined(USE_STATIC_OPTIONS)
               const uint8_t Options
               #endif
               )
{
    15f0:	80 91 af 01 	lds	r24, 0x01AF
    15f4:	88 23       	and	r24, r24
    15f6:	09 f0       	breq	.+2      	; 0x15fa <USB_Init+0xa>
	if (USB_IsInitialized)
	  USB_ShutDown();
    15f8:	e7 df       	rcall	.-50     	; 0x15c8 <USB_ShutDown>
	#endif

	#if defined(USB_CAN_BE_BOTH)
	USB_InitTaskPointer();
	#else
	USB_IsInitialized = true;
    15fa:	81 e0       	ldi	r24, 0x01	; 1
    15fc:	80 93 af 01 	sts	0x01AF, 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();
    1600:	90 df       	rcall	.-224    	; 0x1522 <USB_SetupInterface>
	  USB_INT_Enable(USB_INT_VBUS);
	else
	  USB_SetupInterface();
	#endif
	
	sei();
    1602:	78 94       	sei
}
    1604:	08 95       	ret

00001606 <Endpoint_ConfigureEndpoint_P>:

void Endpoint_ConfigureEndpoint_P(const uint8_t  EndpointNum,
                                  const uint16_t EndpointSize,
                                  const uint8_t  UECFG0Xdata,
                                  const uint8_t  UECFG1Xdata)
{
    1606:	80 93 e9 00 	sts	0x00E9, r24
	Endpoint_SelectEndpoint(EndpointNum);
	Endpoint_EnableEndpoint();
    160a:	80 91 eb 00 	lds	r24, 0x00EB
    160e:	81 60       	ori	r24, 0x01	; 1
    1610:	80 93 eb 00 	sts	0x00EB, r24
	
	UECFG0X = UECFG0Xdata;
    1614:	40 93 ec 00 	sts	0x00EC, r20
	UECFG1X = ((UECFG1X & (1 << ALLOC)) | UECFG1Xdata | Endpoint_BytesToEPSizeMask(EndpointSize));
    1618:	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;
    161c:	77 70       	andi	r23, 0x07	; 7
			
				if (Bytes <= 8)
    161e:	69 30       	cpi	r22, 0x09	; 9
    1620:	71 05       	cpc	r23, r1
    1622:	10 f4       	brcc	.+4      	; 0x1628 <Endpoint_ConfigureEndpoint_P+0x22>
    1624:	80 e0       	ldi	r24, 0x00	; 0
    1626:	0b c0       	rjmp	.+22     	; 0x163e <Endpoint_ConfigureEndpoint_P+0x38>
				  return (0 << EPSIZE0);
				else if (Bytes <= 16)
    1628:	61 31       	cpi	r22, 0x11	; 17
    162a:	71 05       	cpc	r23, r1
    162c:	10 f4       	brcc	.+4      	; 0x1632 <Endpoint_ConfigureEndpoint_P+0x2c>
    162e:	80 e1       	ldi	r24, 0x10	; 16
    1630:	06 c0       	rjmp	.+12     	; 0x163e <Endpoint_ConfigureEndpoint_P+0x38>
				  return (1 << EPSIZE0);
				else if (Bytes <= 32)
    1632:	61 32       	cpi	r22, 0x21	; 33
    1634:	71 05       	cpc	r23, r1
    1636:	10 f0       	brcs	.+4      	; 0x163c <Endpoint_ConfigureEndpoint_P+0x36>
    1638:	80 e3       	ldi	r24, 0x30	; 48
    163a:	01 c0       	rjmp	.+2      	; 0x163e <Endpoint_ConfigureEndpoint_P+0x38>
    163c:	80 e2       	ldi	r24, 0x20	; 32
    163e:	92 70       	andi	r25, 0x02	; 2
    1640:	92 2b       	or	r25, r18
    1642:	89 2b       	or	r24, r25
    1644:	80 93 ed 00 	sts	0x00ED, r24
	
	Endpoint_AllocateMemory();
    1648:	80 91 ed 00 	lds	r24, 0x00ED
    164c:	82 60       	ori	r24, 0x02	; 2
    164e:	80 93 ed 00 	sts	0x00ED, r24
}
    1652:	08 95       	ret

00001654 <Endpoint_Write_Control_Stream_LE>:
	
	return ENDPOINT_RWSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Write_Control_Stream_LE(const void* Buffer, uint16_t Length)
{
    1654:	1f 93       	push	r17
    1656:	9c 01       	movw	r18, r24
    1658:	fb 01       	movw	r30, r22
	uint8_t* DataStream = (uint8_t*)Buffer;
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
    165a:	10 91 1a 01 	lds	r17, 0x011A
    165e:	cb 01       	movw	r24, r22
    1660:	61 2f       	mov	r22, r17
    1662:	70 e0       	ldi	r23, 0x00	; 0
    1664:	ee d2       	rcall	.+1500   	; 0x1c42 <__udivmodhi4>
    1666:	89 2b       	or	r24, r25
    1668:	21 f0       	breq	.+8      	; 0x1672 <Endpoint_Write_Control_Stream_LE+0x1e>
    166a:	40 e0       	ldi	r20, 0x00	; 0
    166c:	50 e0       	ldi	r21, 0x00	; 0
    166e:	30 97       	sbiw	r30, 0x00	; 0
    1670:	11 f4       	brne	.+4      	; 0x1676 <Endpoint_Write_Control_Stream_LE+0x22>
    1672:	41 e0       	ldi	r20, 0x01	; 1
    1674:	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;
    1676:	d9 01       	movw	r26, r18
    1678:	13 c0       	rjmp	.+38     	; 0x16a0 <Endpoint_Write_Control_Stream_LE+0x4c>
	bool     SendZLP    = (!(Length % USB_ControlEndpointSize) || (Length == 0));
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
	{
		while (!(Endpoint_IsSetupINReady()));
    167a:	80 91 e8 00 	lds	r24, 0x00E8
    167e:	80 ff       	sbrs	r24, 0
    1680:	fc cf       	rjmp	.-8      	; 0x167a <Endpoint_Write_Control_Stream_LE+0x26>
    1682:	05 c0       	rjmp	.+10     	; 0x168e <Endpoint_Write_Control_Stream_LE+0x3a>
		
		while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
		{
			Endpoint_Write_Byte(*(DataStream++));
    1684:	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;
    1686:	80 93 f1 00 	sts	0x00F1, r24
			
			Length--;
    168a:	31 97       	sbiw	r30, 0x01	; 1
	
	while (Length && !(Endpoint_IsSetupOUTReceived()))
	{
		while (!(Endpoint_IsSetupINReady()));
		
		while (Length && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
    168c:	21 f0       	breq	.+8      	; 0x1696 <Endpoint_Write_Control_Stream_LE+0x42>
    168e:	80 91 f2 00 	lds	r24, 0x00F2
    1692:	81 17       	cp	r24, r17
    1694:	b8 f3       	brcs	.-18     	; 0x1684 <Endpoint_Write_Control_Stream_LE+0x30>
			Endpoint_Write_Byte(*(DataStream++));
			
			Length--;
		}
		
		Endpoint_ClearSetupIN();
    1696:	80 91 e8 00 	lds	r24, 0x00E8
    169a:	8e 7f       	andi	r24, 0xFE	; 254
    169c:	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()))
    16a0:	30 97       	sbiw	r30, 0x00	; 0
    16a2:	21 f0       	breq	.+8      	; 0x16ac <Endpoint_Write_Control_Stream_LE+0x58>
    16a4:	80 91 e8 00 	lds	r24, 0x00E8
    16a8:	82 ff       	sbrs	r24, 2
    16aa:	e7 cf       	rjmp	.-50     	; 0x167a <Endpoint_Write_Control_Stream_LE+0x26>
		}
		
		Endpoint_ClearSetupIN();
	}
	
	if (Endpoint_IsSetupOUTReceived())
    16ac:	80 91 e8 00 	lds	r24, 0x00E8
    16b0:	82 ff       	sbrs	r24, 2
    16b2:	02 c0       	rjmp	.+4      	; 0x16b8 <Endpoint_Write_Control_Stream_LE+0x64>
    16b4:	81 e0       	ldi	r24, 0x01	; 1
    16b6:	10 c0       	rjmp	.+32     	; 0x16d8 <Endpoint_Write_Control_Stream_LE+0x84>
	  return ENDPOINT_RWCSTREAM_ERROR_HostAborted;
	
	if (SendZLP)
    16b8:	45 2b       	or	r20, r21
    16ba:	49 f0       	breq	.+18     	; 0x16ce <Endpoint_Write_Control_Stream_LE+0x7a>
	{
		while (!(Endpoint_IsSetupINReady()));
    16bc:	80 91 e8 00 	lds	r24, 0x00E8
    16c0:	80 ff       	sbrs	r24, 0
    16c2:	fc cf       	rjmp	.-8      	; 0x16bc <Endpoint_Write_Control_Stream_LE+0x68>
		Endpoint_ClearSetupIN();
    16c4:	80 91 e8 00 	lds	r24, 0x00E8
    16c8:	8e 7f       	andi	r24, 0xFE	; 254
    16ca:	80 93 e8 00 	sts	0x00E8, r24
	}
	
	while (!(Endpoint_IsSetupOUTReceived()));
    16ce:	80 91 e8 00 	lds	r24, 0x00E8
    16d2:	82 ff       	sbrs	r24, 2
    16d4:	fc cf       	rjmp	.-8      	; 0x16ce <Endpoint_Write_Control_Stream_LE+0x7a>
    16d6:	80 e0       	ldi	r24, 0x00	; 0

	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}
    16d8:	1f 91       	pop	r17
    16da:	08 95       	ret

000016dc <Endpoint_Read_Control_Stream_LE>:

	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}

uint8_t Endpoint_Read_Control_Stream_LE(void* Buffer, uint16_t Length)
{
    16dc:	fc 01       	movw	r30, r24
    16de:	14 c0       	rjmp	.+40     	; 0x1708 <Endpoint_Read_Control_Stream_LE+0x2c>
	uint8_t* DataStream = (uint8_t*)Buffer;
	
	while (Length)
	{
		while (!(Endpoint_IsSetupOUTReceived()));
    16e0:	80 91 e8 00 	lds	r24, 0x00E8
    16e4:	82 ff       	sbrs	r24, 2
    16e6:	fc cf       	rjmp	.-8      	; 0x16e0 <Endpoint_Read_Control_Stream_LE+0x4>
    16e8:	06 c0       	rjmp	.+12     	; 0x16f6 <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;
    16ea:	80 91 f1 00 	lds	r24, 0x00F1
		
		while (Length && Endpoint_BytesInEndpoint())
		{
			*(DataStream++) = Endpoint_Read_Byte();
    16ee:	81 93       	st	Z+, r24
			
			Length--;
    16f0:	61 50       	subi	r22, 0x01	; 1
    16f2:	70 40       	sbci	r23, 0x00	; 0
	
	while (Length)
	{
		while (!(Endpoint_IsSetupOUTReceived()));
		
		while (Length && Endpoint_BytesInEndpoint())
    16f4:	21 f0       	breq	.+8      	; 0x16fe <Endpoint_Read_Control_Stream_LE+0x22>
    16f6:	80 91 f2 00 	lds	r24, 0x00F2
    16fa:	88 23       	and	r24, r24
    16fc:	b1 f7       	brne	.-20     	; 0x16ea <Endpoint_Read_Control_Stream_LE+0xe>
			*(DataStream++) = Endpoint_Read_Byte();
			
			Length--;
		}
		
		Endpoint_ClearSetupOUT();
    16fe:	80 91 e8 00 	lds	r24, 0x00E8
    1702:	8b 7f       	andi	r24, 0xFB	; 251
    1704:	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)
    1708:	61 15       	cp	r22, r1
    170a:	71 05       	cpc	r23, r1
    170c:	49 f7       	brne	.-46     	; 0x16e0 <Endpoint_Read_Control_Stream_LE+0x4>
		}
		
		Endpoint_ClearSetupOUT();
	}
	
	while (!(Endpoint_IsSetupINReady()));
    170e:	80 91 e8 00 	lds	r24, 0x00E8
    1712:	80 ff       	sbrs	r24, 0
    1714:	fc cf       	rjmp	.-8      	; 0x170e <Endpoint_Read_Control_Stream_LE+0x32>
	
	return ENDPOINT_RWCSTREAM_ERROR_NoError;
}
    1716:	80 e0       	ldi	r24, 0x00	; 0
    1718:	08 95       	ret

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

void USB_Device_ProcessControlPacket(void)
{
    171a:	ff 92       	push	r15
    171c:	0f 93       	push	r16
    171e:	1f 93       	push	r17
    1720:	df 93       	push	r29
    1722:	cf 93       	push	r28
    1724:	cd b7       	in	r28, 0x3d	; 61
    1726:	de b7       	in	r29, 0x3e	; 62
    1728:	28 97       	sbiw	r28, 0x08	; 8
    172a:	0f b6       	in	r0, 0x3f	; 63
    172c:	f8 94       	cli
    172e:	de bf       	out	0x3e, r29	; 62
    1730:	0f be       	out	0x3f, r0	; 63
    1732:	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;
    1734:	60 91 f1 00 	lds	r22, 0x00F1
	uint8_t bmRequestType  = Endpoint_Read_Byte();
	uint8_t bRequest       = Endpoint_Read_Byte();
	bool    RequestHandled = false;
	
	switch (bRequest)
    1738:	40 91 f1 00 	lds	r20, 0x00F1
    173c:	45 30       	cpi	r20, 0x05	; 5
    173e:	09 f4       	brne	.+2      	; 0x1742 <USB_Device_ProcessControlPacket+0x28>
    1740:	cb c0       	rjmp	.+406    	; 0x18d8 <USB_Device_ProcessControlPacket+0x1be>
    1742:	46 30       	cpi	r20, 0x06	; 6
    1744:	48 f4       	brcc	.+18     	; 0x1758 <USB_Device_ProcessControlPacket+0x3e>
    1746:	41 30       	cpi	r20, 0x01	; 1
    1748:	09 f4       	brne	.+2      	; 0x174c <USB_Device_ProcessControlPacket+0x32>
    174a:	74 c0       	rjmp	.+232    	; 0x1834 <USB_Device_ProcessControlPacket+0x11a>
    174c:	41 30       	cpi	r20, 0x01	; 1
    174e:	70 f0       	brcs	.+28     	; 0x176c <USB_Device_ProcessControlPacket+0x52>
    1750:	43 30       	cpi	r20, 0x03	; 3
    1752:	09 f0       	breq	.+2      	; 0x1756 <USB_Device_ProcessControlPacket+0x3c>
    1754:	9a c1       	rjmp	.+820    	; 0x1a8a <USB_Device_ProcessControlPacket+0x370>
    1756:	6e c0       	rjmp	.+220    	; 0x1834 <USB_Device_ProcessControlPacket+0x11a>
    1758:	48 30       	cpi	r20, 0x08	; 8
    175a:	09 f4       	brne	.+2      	; 0x175e <USB_Device_ProcessControlPacket+0x44>
    175c:	48 c1       	rjmp	.+656    	; 0x19ee <USB_Device_ProcessControlPacket+0x2d4>
    175e:	49 30       	cpi	r20, 0x09	; 9
    1760:	09 f4       	brne	.+2      	; 0x1764 <USB_Device_ProcessControlPacket+0x4a>
    1762:	60 c1       	rjmp	.+704    	; 0x1a24 <USB_Device_ProcessControlPacket+0x30a>
    1764:	46 30       	cpi	r20, 0x06	; 6
    1766:	09 f0       	breq	.+2      	; 0x176a <USB_Device_ProcessControlPacket+0x50>
    1768:	90 c1       	rjmp	.+800    	; 0x1a8a <USB_Device_ProcessControlPacket+0x370>
    176a:	d6 c0       	rjmp	.+428    	; 0x1918 <USB_Device_ProcessControlPacket+0x1fe>
	{
		case REQ_GetStatus:
			if (((bmRequestType & (CONTROL_REQTYPE_DIRECTION | CONTROL_REQTYPE_TYPE)) ==
    176c:	26 2f       	mov	r18, r22
    176e:	30 e0       	ldi	r19, 0x00	; 0
    1770:	c9 01       	movw	r24, r18
    1772:	80 7e       	andi	r24, 0xE0	; 224
    1774:	90 70       	andi	r25, 0x00	; 0
    1776:	80 38       	cpi	r24, 0x80	; 128
    1778:	91 05       	cpc	r25, r1
    177a:	09 f0       	breq	.+2      	; 0x177e <USB_Device_ProcessControlPacket+0x64>
    177c:	86 c1       	rjmp	.+780    	; 0x1a8a <USB_Device_ProcessControlPacket+0x370>
    177e:	c9 01       	movw	r24, r18
    1780:	8f 71       	andi	r24, 0x1F	; 31
    1782:	90 70       	andi	r25, 0x00	; 0
    1784:	83 30       	cpi	r24, 0x03	; 3
    1786:	91 05       	cpc	r25, r1
    1788:	09 f4       	brne	.+2      	; 0x178c <USB_Device_ProcessControlPacket+0x72>
    178a:	7f c1       	rjmp	.+766    	; 0x1a8a <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;
    178c:	20 91 f1 00 	lds	r18, 0x00F1
				Dummy = UEDATX;
    1790:	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;
    1794:	20 91 f1 00 	lds	r18, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1798:	40 91 f1 00 	lds	r20, 0x00F1

	Endpoint_Discard_Word();

	uint16_t wIndex = Endpoint_Read_Word_LE();
	
	switch (bmRequestType & CONTROL_REQTYPE_RECIPIENT)
    179c:	81 30       	cpi	r24, 0x01	; 1
    179e:	91 05       	cpc	r25, r1
    17a0:	31 f0       	breq	.+12     	; 0x17ae <USB_Device_ProcessControlPacket+0x94>
    17a2:	82 30       	cpi	r24, 0x02	; 2
    17a4:	91 05       	cpc	r25, r1
    17a6:	f9 f0       	breq	.+62     	; 0x17e6 <USB_Device_ProcessControlPacket+0xcc>
    17a8:	89 2b       	or	r24, r25
    17aa:	21 f0       	breq	.+8      	; 0x17b4 <USB_Device_ProcessControlPacket+0x9a>
    17ac:	70 c1       	rjmp	.+736    	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
    17ae:	20 e0       	ldi	r18, 0x00	; 0
    17b0:	30 e0       	ldi	r19, 0x00	; 0
    17b2:	2d c0       	rjmp	.+90     	; 0x180e <USB_Device_ProcessControlPacket+0xf4>
	{
		case REQREC_DEVICE:
			if (USB_GetDescriptor(((DTYPE_Configuration << 8) | USB_ConfigurationNumber), 0,
    17b4:	80 91 ae 01 	lds	r24, 0x01AE
    17b8:	90 e0       	ldi	r25, 0x00	; 0
    17ba:	9e 01       	movw	r18, r28
    17bc:	29 5f       	subi	r18, 0xF9	; 249
    17be:	3f 4f       	sbci	r19, 0xFF	; 255
    17c0:	ae 01       	movw	r20, r28
    17c2:	4f 5f       	subi	r20, 0xFF	; 255
    17c4:	5f 4f       	sbci	r21, 0xFF	; 255
    17c6:	60 e0       	ldi	r22, 0x00	; 0
    17c8:	92 60       	ori	r25, 0x02	; 2
    17ca:	8e da       	rcall	.-2788   	; 0xce8 <USB_GetDescriptor>
    17cc:	88 23       	and	r24, r24
    17ce:	09 f4       	brne	.+2      	; 0x17d2 <USB_Device_ProcessControlPacket+0xb8>
    17d0:	5e c1       	rjmp	.+700    	; 0x1a8e <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);
    17d2:	80 91 ac 01 	lds	r24, 0x01AC
    17d6:	28 2f       	mov	r18, r24
    17d8:	30 e0       	ldi	r19, 0x00	; 0
#endif

			if (USB_CurrentlySelfPowered)
			  CurrentStatus |= FEATURE_SELFPOWERED_ENABLED;
			
			if (USB_RemoteWakeupEnabled)
    17da:	80 91 ad 01 	lds	r24, 0x01AD
    17de:	88 23       	and	r24, r24
    17e0:	b1 f0       	breq	.+44     	; 0x180e <USB_Device_ProcessControlPacket+0xf4>
			  CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;
    17e2:	22 60       	ori	r18, 0x02	; 2
    17e4:	14 c0       	rjmp	.+40     	; 0x180e <USB_Device_ProcessControlPacket+0xf4>
		case REQREC_INTERFACE:
			// No bits set, all bits currently reserved
				
			break;
		case REQREC_ENDPOINT:
			Endpoint_SelectEndpoint(wIndex);
    17e6:	94 2f       	mov	r25, r20
    17e8:	80 e0       	ldi	r24, 0x00	; 0
    17ea:	30 e0       	ldi	r19, 0x00	; 0
    17ec:	82 2b       	or	r24, r18
    17ee:	93 2b       	or	r25, r19
    17f0:	80 93 e9 00 	sts	0x00E9, r24

			CurrentStatus = Endpoint_IsStalled();
    17f4:	80 91 eb 00 	lds	r24, 0x00EB
    17f8:	28 2f       	mov	r18, r24
    17fa:	30 e0       	ldi	r19, 0x00	; 0
    17fc:	85 e0       	ldi	r24, 0x05	; 5
    17fe:	36 95       	lsr	r19
    1800:	27 95       	ror	r18
    1802:	8a 95       	dec	r24
    1804:	e1 f7       	brne	.-8      	; 0x17fe <USB_Device_ProcessControlPacket+0xe4>
    1806:	21 70       	andi	r18, 0x01	; 1
    1808:	30 70       	andi	r19, 0x00	; 0

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

	Endpoint_ClearSetupIN();
    1820:	80 91 e8 00 	lds	r24, 0x00E8
    1824:	8e 7f       	andi	r24, 0xFE	; 254
    1826:	80 93 e8 00 	sts	0x00E8, r24
	
	while (!(Endpoint_IsSetupOUTReceived()));
    182a:	80 91 e8 00 	lds	r24, 0x00E8
    182e:	82 ff       	sbrs	r24, 2
    1830:	fc cf       	rjmp	.-8      	; 0x182a <USB_Device_ProcessControlPacket+0x110>
    1832:	f2 c0       	rjmp	.+484    	; 0x1a18 <USB_Device_ProcessControlPacket+0x2fe>
			}

			break;
		case REQ_ClearFeature:
		case REQ_SetFeature:
			if (((bmRequestType & (CONTROL_REQTYPE_DIRECTION | CONTROL_REQTYPE_TYPE)) ==
    1834:	26 2f       	mov	r18, r22
    1836:	30 e0       	ldi	r19, 0x00	; 0
    1838:	86 2f       	mov	r24, r22
    183a:	80 7e       	andi	r24, 0xE0	; 224
    183c:	09 f0       	breq	.+2      	; 0x1840 <USB_Device_ProcessControlPacket+0x126>
    183e:	25 c1       	rjmp	.+586    	; 0x1a8a <USB_Device_ProcessControlPacket+0x370>
    1840:	c9 01       	movw	r24, r18
    1842:	8f 71       	andi	r24, 0x1F	; 31
    1844:	90 70       	andi	r25, 0x00	; 0
    1846:	83 30       	cpi	r24, 0x03	; 3
    1848:	91 05       	cpc	r25, r1
    184a:	09 f4       	brne	.+2      	; 0x184e <USB_Device_ProcessControlPacket+0x134>
    184c:	1e c1       	rjmp	.+572    	; 0x1a8a <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;
    184e:	20 91 f1 00 	lds	r18, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1852:	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;
    1856:	70 91 f1 00 	lds	r23, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    185a:	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)
    185e:	02 97       	sbiw	r24, 0x02	; 2
    1860:	09 f0       	breq	.+2      	; 0x1864 <USB_Device_ProcessControlPacket+0x14a>
    1862:	15 c1       	rjmp	.+554    	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
	{
		case REQREC_ENDPOINT:
			if (wValue == FEATURE_ENDPOINT_HALT)
    1864:	95 2f       	mov	r25, r21
    1866:	80 e0       	ldi	r24, 0x00	; 0
    1868:	30 e0       	ldi	r19, 0x00	; 0
    186a:	82 2b       	or	r24, r18
    186c:	93 2b       	or	r25, r19
    186e:	89 2b       	or	r24, r25
    1870:	09 f0       	breq	.+2      	; 0x1874 <USB_Device_ProcessControlPacket+0x15a>
    1872:	0d c1       	rjmp	.+538    	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
			{
				uint8_t EndpointIndex = (wIndex & ENDPOINT_EPNUM_MASK);
    1874:	80 e0       	ldi	r24, 0x00	; 0
    1876:	27 2f       	mov	r18, r23
    1878:	28 2b       	or	r18, r24
    187a:	27 70       	andi	r18, 0x07	; 7
				
				if (EndpointIndex != ENDPOINT_CONTROLEP)
    187c:	09 f4       	brne	.+2      	; 0x1880 <USB_Device_ProcessControlPacket+0x166>
    187e:	07 c1       	rjmp	.+526    	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
				{
					Endpoint_SelectEndpoint(EndpointIndex);
    1880:	20 93 e9 00 	sts	0x00E9, r18

					if (Endpoint_IsEnabled())
    1884:	80 91 eb 00 	lds	r24, 0x00EB
    1888:	80 ff       	sbrs	r24, 0
    188a:	1b c0       	rjmp	.+54     	; 0x18c2 <USB_Device_ProcessControlPacket+0x1a8>
					{				
						if (bRequest == REQ_ClearFeature)
    188c:	41 30       	cpi	r20, 0x01	; 1
    188e:	a1 f4       	brne	.+40     	; 0x18b8 <USB_Device_ProcessControlPacket+0x19e>
						{
							Endpoint_ClearStall();
    1890:	80 91 eb 00 	lds	r24, 0x00EB
    1894:	80 61       	ori	r24, 0x10	; 16
    1896:	80 93 eb 00 	sts	0x00EB, r24
							Endpoint_ResetFIFO(EndpointIndex);
    189a:	81 e0       	ldi	r24, 0x01	; 1
    189c:	90 e0       	ldi	r25, 0x00	; 0
    189e:	02 c0       	rjmp	.+4      	; 0x18a4 <USB_Device_ProcessControlPacket+0x18a>
    18a0:	88 0f       	add	r24, r24
    18a2:	99 1f       	adc	r25, r25
    18a4:	2a 95       	dec	r18
    18a6:	e2 f7       	brpl	.-8      	; 0x18a0 <USB_Device_ProcessControlPacket+0x186>
    18a8:	80 93 ea 00 	sts	0x00EA, r24
    18ac:	10 92 ea 00 	sts	0x00EA, r1
							Endpoint_ResetDataToggle();
    18b0:	80 91 eb 00 	lds	r24, 0x00EB
    18b4:	88 60       	ori	r24, 0x08	; 8
    18b6:	03 c0       	rjmp	.+6      	; 0x18be <USB_Device_ProcessControlPacket+0x1a4>
						}
						else
						{
							Endpoint_StallTransaction();						
    18b8:	80 91 eb 00 	lds	r24, 0x00EB
    18bc:	80 62       	ori	r24, 0x20	; 32
    18be:	80 93 eb 00 	sts	0x00EB, r24
						}
					}

					Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
    18c2:	10 92 e9 00 	sts	0x00E9, r1
					Endpoint_ClearSetupReceived();
    18c6:	80 91 e8 00 	lds	r24, 0x00E8
    18ca:	87 7f       	andi	r24, 0xF7	; 247
    18cc:	80 93 e8 00 	sts	0x00E8, r24
					Endpoint_ClearSetupIN();
    18d0:	80 91 e8 00 	lds	r24, 0x00E8
    18d4:	8e 7f       	andi	r24, 0xFE	; 254
    18d6:	a3 c0       	rjmp	.+326    	; 0x1a1e <USB_Device_ProcessControlPacket+0x304>
				RequestHandled = true;
			}

			break;
		case REQ_SetAddress:
			if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE))
    18d8:	66 23       	and	r22, r22
    18da:	09 f0       	breq	.+2      	; 0x18de <USB_Device_ProcessControlPacket+0x1c4>
    18dc:	d6 c0       	rjmp	.+428    	; 0x1a8a <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;
    18de:	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));
    18e2:	80 91 e3 00 	lds	r24, 0x00E3
    18e6:	9f 77       	andi	r25, 0x7F	; 127
    18e8:	80 78       	andi	r24, 0x80	; 128
    18ea:	98 2b       	or	r25, r24
    18ec:	90 93 e3 00 	sts	0x00E3, r25

	Endpoint_ClearSetupReceived();
    18f0:	80 91 e8 00 	lds	r24, 0x00E8
    18f4:	87 7f       	andi	r24, 0xF7	; 247
    18f6:	80 93 e8 00 	sts	0x00E8, r24

	Endpoint_ClearSetupIN();
    18fa:	80 91 e8 00 	lds	r24, 0x00E8
    18fe:	8e 7f       	andi	r24, 0xFE	; 254
    1900:	80 93 e8 00 	sts	0x00E8, r24
	while (!(Endpoint_IsSetupINReady()));
    1904:	80 91 e8 00 	lds	r24, 0x00E8
    1908:	80 ff       	sbrs	r24, 0
    190a:	fc cf       	rjmp	.-8      	; 0x1904 <USB_Device_ProcessControlPacket+0x1ea>
	
	UDADDR |= (1 << ADDEN);
    190c:	80 91 e3 00 	lds	r24, 0x00E3
    1910:	80 68       	ori	r24, 0x80	; 128
    1912:	80 93 e3 00 	sts	0x00E3, r24
    1916:	bb c0       	rjmp	.+374    	; 0x1a8e <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;
    1918:	e0 91 f1 00 	lds	r30, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    191c:	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;
    1920:	80 91 f1 00 	lds	r24, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    1924:	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;
    1928:	00 91 f1 00 	lds	r16, 0x00F1
				Data |= (((uint16_t)UEDATX) << 8);
    192c:	10 91 f1 00 	lds	r17, 0x00F1
	void*    DescriptorPointer;
	uint16_t DescriptorSize;
	
	bool     SendZLP;
	
	if (!(USB_GetDescriptor(wValue, wIndex, &DescriptorPointer, &DescriptorSize)))
    1930:	72 2f       	mov	r23, r18
    1932:	60 e0       	ldi	r22, 0x00	; 0
    1934:	90 e0       	ldi	r25, 0x00	; 0
    1936:	68 2b       	or	r22, r24
    1938:	79 2b       	or	r23, r25
    193a:	93 2f       	mov	r25, r19
    193c:	80 e0       	ldi	r24, 0x00	; 0
    193e:	f0 e0       	ldi	r31, 0x00	; 0
    1940:	9e 01       	movw	r18, r28
    1942:	29 5f       	subi	r18, 0xF9	; 249
    1944:	3f 4f       	sbci	r19, 0xFF	; 255
    1946:	ae 01       	movw	r20, r28
    1948:	4d 5f       	subi	r20, 0xFD	; 253
    194a:	5f 4f       	sbci	r21, 0xFF	; 255
    194c:	8e 2b       	or	r24, r30
    194e:	9f 2b       	or	r25, r31
    1950:	cb d9       	rcall	.-3178   	; 0xce8 <USB_GetDescriptor>
    1952:	88 23       	and	r24, r24
    1954:	09 f4       	brne	.+2      	; 0x1958 <USB_Device_ProcessControlPacket+0x23e>
    1956:	9b c0       	rjmp	.+310    	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
	  return;
	
	Endpoint_ClearSetupReceived();
    1958:	80 91 e8 00 	lds	r24, 0x00E8
    195c:	87 7f       	andi	r24, 0xF7	; 247
    195e:	80 93 e8 00 	sts	0x00E8, r24
    1962:	91 2f       	mov	r25, r17
    1964:	80 e0       	ldi	r24, 0x00	; 0
    1966:	40 2f       	mov	r20, r16
    1968:	50 e0       	ldi	r21, 0x00	; 0
    196a:	2f 81       	ldd	r18, Y+7	; 0x07
    196c:	38 85       	ldd	r19, Y+8	; 0x08
    196e:	48 2b       	or	r20, r24
    1970:	59 2b       	or	r21, r25
    1972:	24 17       	cp	r18, r20
    1974:	35 07       	cpc	r19, r21
    1976:	08 f4       	brcc	.+2      	; 0x197a <USB_Device_ProcessControlPacket+0x260>
    1978:	a9 01       	movw	r20, r18
	
	if (wLength > DescriptorSize)
	  wLength = DescriptorSize;
	  
	SendZLP = !(wLength % USB_ControlEndpointSize);
    197a:	60 91 1a 01 	lds	r22, 0x011A
    197e:	ab 81       	ldd	r26, Y+3	; 0x03
    1980:	bc 81       	ldd	r27, Y+4	; 0x04
    1982:	9a 01       	movw	r18, r20
    1984:	16 c0       	rjmp	.+44     	; 0x19b2 <USB_Device_ProcessControlPacket+0x298>
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
	{
		while (!(Endpoint_IsSetupINReady()));
    1986:	80 91 e8 00 	lds	r24, 0x00E8
    198a:	80 ff       	sbrs	r24, 0
    198c:	fc cf       	rjmp	.-8      	; 0x1986 <USB_Device_ProcessControlPacket+0x26c>
    198e:	08 c0       	rjmp	.+16     	; 0x19a0 <USB_Device_ProcessControlPacket+0x286>
    1990:	fd 01       	movw	r30, r26
    1992:	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++));
    1994:	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;
    1996:	e0 93 f1 00 	sts	0x00F1, r30
			#endif
			
			wLength--;
    199a:	21 50       	subi	r18, 0x01	; 1
    199c:	30 40       	sbci	r19, 0x00	; 0
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
	{
		while (!(Endpoint_IsSetupINReady()));
		
		while (wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
    199e:	21 f0       	breq	.+8      	; 0x19a8 <USB_Device_ProcessControlPacket+0x28e>
    19a0:	80 91 f2 00 	lds	r24, 0x00F2
    19a4:	86 17       	cp	r24, r22
    19a6:	a0 f3       	brcs	.-24     	; 0x1990 <USB_Device_ProcessControlPacket+0x276>
			#endif
			
			wLength--;
		}
		
		Endpoint_ClearSetupIN();
    19a8:	80 91 e8 00 	lds	r24, 0x00E8
    19ac:	8e 7f       	andi	r24, 0xFE	; 254
    19ae:	80 93 e8 00 	sts	0x00E8, r24
	if (wLength > DescriptorSize)
	  wLength = DescriptorSize;
	  
	SendZLP = !(wLength % USB_ControlEndpointSize);
	
	while (wLength && (!(Endpoint_IsSetupOUTReceived())))
    19b2:	21 15       	cp	r18, r1
    19b4:	31 05       	cpc	r19, r1
    19b6:	21 f0       	breq	.+8      	; 0x19c0 <USB_Device_ProcessControlPacket+0x2a6>
    19b8:	80 91 e8 00 	lds	r24, 0x00E8
    19bc:	82 ff       	sbrs	r24, 2
    19be:	e3 cf       	rjmp	.-58     	; 0x1986 <USB_Device_ProcessControlPacket+0x26c>
		}
		
		Endpoint_ClearSetupIN();
	}
	
	if (Endpoint_IsSetupOUTReceived())
    19c0:	80 91 e8 00 	lds	r24, 0x00E8
    19c4:	82 fd       	sbrc	r24, 2
    19c6:	28 c0       	rjmp	.+80     	; 0x1a18 <USB_Device_ProcessControlPacket+0x2fe>
	{
		Endpoint_ClearSetupOUT();
		return;
	}
	
	if (SendZLP)
    19c8:	ca 01       	movw	r24, r20
    19ca:	70 e0       	ldi	r23, 0x00	; 0
    19cc:	3a d1       	rcall	.+628    	; 0x1c42 <__udivmodhi4>
    19ce:	89 2b       	or	r24, r25
    19d0:	49 f4       	brne	.+18     	; 0x19e4 <USB_Device_ProcessControlPacket+0x2ca>
	{
		while (!(Endpoint_IsSetupINReady()));
    19d2:	80 91 e8 00 	lds	r24, 0x00E8
    19d6:	80 ff       	sbrs	r24, 0
    19d8:	fc cf       	rjmp	.-8      	; 0x19d2 <USB_Device_ProcessControlPacket+0x2b8>
		Endpoint_ClearSetupIN();
    19da:	80 91 e8 00 	lds	r24, 0x00E8
    19de:	8e 7f       	andi	r24, 0xFE	; 254
    19e0:	80 93 e8 00 	sts	0x00E8, r24
	}

	while (!(Endpoint_IsSetupOUTReceived()));
    19e4:	80 91 e8 00 	lds	r24, 0x00E8
    19e8:	82 ff       	sbrs	r24, 2
    19ea:	fc cf       	rjmp	.-8      	; 0x19e4 <USB_Device_ProcessControlPacket+0x2ca>
    19ec:	15 c0       	rjmp	.+42     	; 0x1a18 <USB_Device_ProcessControlPacket+0x2fe>
			USB_Device_GetDescriptor();
			RequestHandled = true;
			
			break;
		case REQ_GetConfiguration:
			if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE))
    19ee:	60 38       	cpi	r22, 0x80	; 128
    19f0:	09 f0       	breq	.+2      	; 0x19f4 <USB_Device_ProcessControlPacket+0x2da>
    19f2:	4b c0       	rjmp	.+150    	; 0x1a8a <USB_Device_ProcessControlPacket+0x370>
	RAISE_EVENT(USB_ConfigurationChanged);
}

void USB_Device_GetConfiguration(void)
{
	Endpoint_ClearSetupReceived();	
    19f4:	80 91 e8 00 	lds	r24, 0x00E8
    19f8:	87 7f       	andi	r24, 0xF7	; 247
    19fa:	80 93 e8 00 	sts	0x00E8, r24

	Endpoint_Write_Byte(USB_ConfigurationNumber);
    19fe:	80 91 ae 01 	lds	r24, 0x01AE
    1a02:	80 93 f1 00 	sts	0x00F1, r24
	
	Endpoint_ClearSetupIN();
    1a06:	80 91 e8 00 	lds	r24, 0x00E8
    1a0a:	8e 7f       	andi	r24, 0xFE	; 254
    1a0c:	80 93 e8 00 	sts	0x00E8, r24

	while (!(Endpoint_IsSetupOUTReceived()));
    1a10:	80 91 e8 00 	lds	r24, 0x00E8
    1a14:	82 ff       	sbrs	r24, 2
    1a16:	fc cf       	rjmp	.-8      	; 0x1a10 <USB_Device_ProcessControlPacket+0x2f6>
	Endpoint_ClearSetupOUT();
    1a18:	80 91 e8 00 	lds	r24, 0x00E8
    1a1c:	8b 7f       	andi	r24, 0xFB	; 251
    1a1e:	80 93 e8 00 	sts	0x00E8, r24
    1a22:	35 c0       	rjmp	.+106    	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
				RequestHandled = true;
			}

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

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

	if ((USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DevDescriptorPtr, &DevDescriptorSize) == false) ||
    1a34:	9e 01       	movw	r18, r28
    1a36:	29 5f       	subi	r18, 0xF9	; 249
    1a38:	3f 4f       	sbci	r19, 0xFF	; 255
    1a3a:	ae 01       	movw	r20, r28
    1a3c:	4b 5f       	subi	r20, 0xFB	; 251
    1a3e:	5f 4f       	sbci	r21, 0xFF	; 255
    1a40:	80 e0       	ldi	r24, 0x00	; 0
    1a42:	91 e0       	ldi	r25, 0x01	; 1
    1a44:	51 d9       	rcall	.-3422   	; 0xce8 <USB_GetDescriptor>
    1a46:	88 23       	and	r24, r24
    1a48:	11 f1       	breq	.+68     	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
    1a4a:	91 2f       	mov	r25, r17
    1a4c:	80 e0       	ldi	r24, 0x00	; 0
    1a4e:	20 2f       	mov	r18, r16
    1a50:	30 e0       	ldi	r19, 0x00	; 0
    1a52:	28 2b       	or	r18, r24
    1a54:	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)))
    1a56:	ed 81       	ldd	r30, Y+5	; 0x05
    1a58:	fe 81       	ldd	r31, Y+6	; 0x06
    1a5a:	71 96       	adiw	r30, 0x11	; 17
    1a5c:	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) ||
    1a5e:	8e 2f       	mov	r24, r30
    1a60:	90 e0       	ldi	r25, 0x00	; 0
    1a62:	82 17       	cp	r24, r18
    1a64:	93 07       	cpc	r25, r19
    1a66:	98 f0       	brcs	.+38     	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>
#endif
	{
		return;
	}
	
	Endpoint_ClearSetupReceived();
    1a68:	80 91 e8 00 	lds	r24, 0x00E8
    1a6c:	87 7f       	andi	r24, 0xF7	; 247
    1a6e:	80 93 e8 00 	sts	0x00E8, r24

	USB_ConfigurationNumber = wValue;
    1a72:	20 93 ae 01 	sts	0x01AE, r18

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

	if (NotAlreadyConfigured)
    1a80:	ff 20       	and	r15, r15
    1a82:	09 f4       	brne	.+2      	; 0x1a86 <USB_Device_ProcessControlPacket+0x36c>
	  RAISE_EVENT(USB_DeviceEnumerationComplete);
    1a84:	cb d0       	rcall	.+406    	; 0x1c1c <Event_USB_DeviceEnumerationComplete>

	RAISE_EVENT(USB_ConfigurationChanged);
    1a86:	e1 d8       	rcall	.-3646   	; 0xc4a <Event_USB_ConfigurationChanged>
    1a88:	02 c0       	rjmp	.+4      	; 0x1a8e <USB_Device_ProcessControlPacket+0x374>

			break;
	}

	if (!(RequestHandled))
	  RAISE_EVENT(USB_UnhandledControlPacket, bRequest, bmRequestType);
    1a8a:	84 2f       	mov	r24, r20
    1a8c:	84 d8       	rcall	.-3832   	; 0xb96 <Event_USB_UnhandledControlPacket>
	  
	if (Endpoint_IsSetupReceived())
    1a8e:	80 91 e8 00 	lds	r24, 0x00E8
    1a92:	83 ff       	sbrs	r24, 3
    1a94:	0a c0       	rjmp	.+20     	; 0x1aaa <USB_Device_ProcessControlPacket+0x390>
	{
		Endpoint_StallTransaction();
    1a96:	80 91 eb 00 	lds	r24, 0x00EB
    1a9a:	80 62       	ori	r24, 0x20	; 32
    1a9c:	80 93 eb 00 	sts	0x00EB, r24
		Endpoint_ClearSetupReceived();		
    1aa0:	80 91 e8 00 	lds	r24, 0x00E8
    1aa4:	87 7f       	andi	r24, 0xF7	; 247
    1aa6:	80 93 e8 00 	sts	0x00E8, r24
	}
}
    1aaa:	28 96       	adiw	r28, 0x08	; 8
    1aac:	0f b6       	in	r0, 0x3f	; 63
    1aae:	f8 94       	cli
    1ab0:	de bf       	out	0x3e, r29	; 62
    1ab2:	0f be       	out	0x3f, r0	; 63
    1ab4:	cd bf       	out	0x3d, r28	; 61
    1ab6:	cf 91       	pop	r28
    1ab8:	df 91       	pop	r29
    1aba:	1f 91       	pop	r17
    1abc:	0f 91       	pop	r16
    1abe:	ff 90       	pop	r15
    1ac0:	08 95       	ret

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

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

#if defined(USB_CAN_BE_DEVICE)
static void USB_DeviceTask(void)
{
	if (USB_IsConnected)
    1ac4:	80 91 b0 01 	lds	r24, 0x01B0
    1ac8:	88 23       	and	r24, r24
    1aca:	61 f0       	breq	.+24     	; 0x1ae4 <USB_USBTask+0x22>
	{
		uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint();
    1acc:	10 91 e9 00 	lds	r17, 0x00E9
	
		Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
    1ad0:	10 92 e9 00 	sts	0x00E9, r1

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

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

00001ae8 <USB_INT_DisableAllInterrupts>:

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

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

00001aee <USB_INT_ClearAllInterrupts>:

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

00001af4 <__vector_11>:

ISR(USB_GEN_vect)
{
    1af4:	1f 92       	push	r1
    1af6:	0f 92       	push	r0
    1af8:	0f b6       	in	r0, 0x3f	; 63
    1afa:	0f 92       	push	r0
    1afc:	11 24       	eor	r1, r1
    1afe:	2f 93       	push	r18
    1b00:	3f 93       	push	r19
    1b02:	4f 93       	push	r20
    1b04:	5f 93       	push	r21
    1b06:	6f 93       	push	r22
    1b08:	7f 93       	push	r23
    1b0a:	8f 93       	push	r24
    1b0c:	9f 93       	push	r25
    1b0e:	af 93       	push	r26
    1b10:	bf 93       	push	r27
    1b12:	ef 93       	push	r30
    1b14:	ff 93       	push	r31
			USB_IsConnected = false;
		}
	}
	#endif

	if (USB_INT_HasOccurred(USB_INT_SUSPEND) && USB_INT_IsEnabled(USB_INT_SUSPEND))
    1b16:	80 91 e1 00 	lds	r24, 0x00E1
    1b1a:	80 ff       	sbrs	r24, 0
    1b1c:	1e c0       	rjmp	.+60     	; 0x1b5a <__vector_11+0x66>
    1b1e:	80 91 e2 00 	lds	r24, 0x00E2
    1b22:	80 ff       	sbrs	r24, 0
    1b24:	1a c0       	rjmp	.+52     	; 0x1b5a <__vector_11+0x66>
	{
		USB_INT_Clear(USB_INT_SUSPEND);
    1b26:	80 91 e1 00 	lds	r24, 0x00E1
    1b2a:	8e 7f       	andi	r24, 0xFE	; 254
    1b2c:	80 93 e1 00 	sts	0x00E1, r24

		USB_INT_Disable(USB_INT_SUSPEND);
    1b30:	80 91 e2 00 	lds	r24, 0x00E2
    1b34:	8e 7f       	andi	r24, 0xFE	; 254
    1b36:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_WAKEUP);
    1b3a:	80 91 e2 00 	lds	r24, 0x00E2
    1b3e:	80 61       	ori	r24, 0x10	; 16
    1b40:	80 93 e2 00 	sts	0x00E2, r24
		
		USB_CLK_Freeze();
    1b44:	80 91 d8 00 	lds	r24, 0x00D8
    1b48:	80 62       	ori	r24, 0x20	; 32
    1b4a:	80 93 d8 00 	sts	0x00D8, r24
		#if !defined(MANUAL_PLL_CONTROL)
		USB_PLL_Off();
    1b4e:	19 bc       	out	0x29, r1	; 41
		#endif

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

		#if defined(USB_LIMITED_CONTROLLER)
		USB_IsConnected = false;
    1b52:	10 92 b0 01 	sts	0x01B0, r1
		RAISE_EVENT(USB_Disconnect);
    1b56:	0e 94 2a 03 	call	0x654	; 0x654 <Event_USB_Disconnect>
		#endif
	}

	if (USB_INT_HasOccurred(USB_INT_WAKEUP) && USB_INT_IsEnabled(USB_INT_WAKEUP))
    1b5a:	80 91 e1 00 	lds	r24, 0x00E1
    1b5e:	84 ff       	sbrs	r24, 4
    1b60:	26 c0       	rjmp	.+76     	; 0x1bae <__vector_11+0xba>
    1b62:	80 91 e2 00 	lds	r24, 0x00E2
    1b66:	84 ff       	sbrs	r24, 4
    1b68:	22 c0       	rjmp	.+68     	; 0x1bae <__vector_11+0xba>
	{
		#if !defined(MANUAL_PLL_CONTROL)
		USB_PLL_On();
    1b6a:	84 e0       	ldi	r24, 0x04	; 4
    1b6c:	89 bd       	out	0x29, r24	; 41
    1b6e:	89 b5       	in	r24, 0x29	; 41
    1b70:	82 60       	ori	r24, 0x02	; 2
    1b72:	89 bd       	out	0x29, r24	; 41
		#endif
		while (!(USB_PLL_IsReady()));
    1b74:	09 b4       	in	r0, 0x29	; 41
    1b76:	00 fe       	sbrs	r0, 0
    1b78:	fd cf       	rjmp	.-6      	; 0x1b74 <__vector_11+0x80>

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

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

		USB_INT_Disable(USB_INT_WAKEUP);
    1b8e:	80 91 e2 00 	lds	r24, 0x00E2
    1b92:	8f 7e       	andi	r24, 0xEF	; 239
    1b94:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_SUSPEND);
    1b98:	80 91 e2 00 	lds	r24, 0x00E2
    1b9c:	81 60       	ori	r24, 0x01	; 1
    1b9e:	80 93 e2 00 	sts	0x00E2, r24
		
		#if defined(USB_LIMITED_CONTROLLER)
		USB_IsConnected = true;
    1ba2:	81 e0       	ldi	r24, 0x01	; 1
    1ba4:	80 93 b0 01 	sts	0x01B0, r24
		RAISE_EVENT(USB_Connect);
    1ba8:	0e 94 32 03 	call	0x664	; 0x664 <Event_USB_Connect>
		#endif

		RAISE_EVENT(USB_WakeUp);
    1bac:	37 d0       	rcall	.+110    	; 0x1c1c <Event_USB_DeviceEnumerationComplete>
	}
   
	if (USB_INT_HasOccurred(USB_INT_EORSTI) && USB_INT_IsEnabled(USB_INT_EORSTI))
    1bae:	80 91 e1 00 	lds	r24, 0x00E1
    1bb2:	83 ff       	sbrs	r24, 3
    1bb4:	22 c0       	rjmp	.+68     	; 0x1bfa <__vector_11+0x106>
    1bb6:	80 91 e2 00 	lds	r24, 0x00E2
    1bba:	83 ff       	sbrs	r24, 3
    1bbc:	1e c0       	rjmp	.+60     	; 0x1bfa <__vector_11+0x106>
	{
		USB_INT_Clear(USB_INT_EORSTI);
    1bbe:	80 91 e1 00 	lds	r24, 0x00E1
    1bc2:	87 7f       	andi	r24, 0xF7	; 247
    1bc4:	80 93 e1 00 	sts	0x00E1, r24

		USB_ConfigurationNumber = 0;
    1bc8:	10 92 ae 01 	sts	0x01AE, r1

		USB_INT_Clear(USB_INT_SUSPEND);
    1bcc:	80 91 e1 00 	lds	r24, 0x00E1
    1bd0:	8e 7f       	andi	r24, 0xFE	; 254
    1bd2:	80 93 e1 00 	sts	0x00E1, r24
		USB_INT_Disable(USB_INT_SUSPEND);
    1bd6:	80 91 e2 00 	lds	r24, 0x00E2
    1bda:	8e 7f       	andi	r24, 0xFE	; 254
    1bdc:	80 93 e2 00 	sts	0x00E2, r24
		USB_INT_Enable(USB_INT_WAKEUP);
    1be0:	80 91 e2 00 	lds	r24, 0x00E2
    1be4:	80 61       	ori	r24, 0x10	; 16
    1be6:	80 93 e2 00 	sts	0x00E2, r24

		Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL,
    1bea:	60 91 1a 01 	lds	r22, 0x011A
    1bee:	20 e0       	ldi	r18, 0x00	; 0
    1bf0:	40 e0       	ldi	r20, 0x00	; 0
    1bf2:	70 e0       	ldi	r23, 0x00	; 0
    1bf4:	80 e0       	ldi	r24, 0x00	; 0
    1bf6:	07 dd       	rcall	.-1522   	; 0x1606 <Endpoint_ConfigureEndpoint_P>
		                           ENDPOINT_DIR_OUT, USB_ControlEndpointSize,
		                           ENDPOINT_BANK_SINGLE);

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

		USB_SetupInterface();	
	}
	#endif
}
    1bfa:	ff 91       	pop	r31
    1bfc:	ef 91       	pop	r30
    1bfe:	bf 91       	pop	r27
    1c00:	af 91       	pop	r26
    1c02:	9f 91       	pop	r25
    1c04:	8f 91       	pop	r24
    1c06:	7f 91       	pop	r23
    1c08:	6f 91       	pop	r22
    1c0a:	5f 91       	pop	r21
    1c0c:	4f 91       	pop	r20
    1c0e:	3f 91       	pop	r19
    1c10:	2f 91       	pop	r18
    1c12:	0f 90       	pop	r0
    1c14:	0f be       	out	0x3f, r0	; 63
    1c16:	0f 90       	pop	r0
    1c18:	1f 90       	pop	r1
    1c1a:	18 95       	reti

00001c1c <Event_USB_DeviceEnumerationComplete>:

#define INCLUDE_FROM_EVENTS_C
#include "Events.h"

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

00001c1e <__mulhi3>:
    1c1e:	55 27       	eor	r21, r21
    1c20:	00 24       	eor	r0, r0

00001c22 <__mulhi3_loop>:
    1c22:	80 ff       	sbrs	r24, 0
    1c24:	02 c0       	rjmp	.+4      	; 0x1c2a <__mulhi3_skip1>
    1c26:	06 0e       	add	r0, r22
    1c28:	57 1f       	adc	r21, r23

00001c2a <__mulhi3_skip1>:
    1c2a:	66 0f       	add	r22, r22
    1c2c:	77 1f       	adc	r23, r23
    1c2e:	61 15       	cp	r22, r1
    1c30:	71 05       	cpc	r23, r1
    1c32:	21 f0       	breq	.+8      	; 0x1c3c <__mulhi3_exit>
    1c34:	96 95       	lsr	r25
    1c36:	87 95       	ror	r24
    1c38:	00 97       	sbiw	r24, 0x00	; 0
    1c3a:	99 f7       	brne	.-26     	; 0x1c22 <__mulhi3_loop>

00001c3c <__mulhi3_exit>:
    1c3c:	95 2f       	mov	r25, r21
    1c3e:	80 2d       	mov	r24, r0
    1c40:	08 95       	ret

00001c42 <__udivmodhi4>:
    1c42:	aa 1b       	sub	r26, r26
    1c44:	bb 1b       	sub	r27, r27
    1c46:	51 e1       	ldi	r21, 0x11	; 17
    1c48:	07 c0       	rjmp	.+14     	; 0x1c58 <__udivmodhi4_ep>

00001c4a <__udivmodhi4_loop>:
    1c4a:	aa 1f       	adc	r26, r26
    1c4c:	bb 1f       	adc	r27, r27
    1c4e:	a6 17       	cp	r26, r22
    1c50:	b7 07       	cpc	r27, r23
    1c52:	10 f0       	brcs	.+4      	; 0x1c58 <__udivmodhi4_ep>
    1c54:	a6 1b       	sub	r26, r22
    1c56:	b7 0b       	sbc	r27, r23

00001c58 <__udivmodhi4_ep>:
    1c58:	88 1f       	adc	r24, r24
    1c5a:	99 1f       	adc	r25, r25
    1c5c:	5a 95       	dec	r21
    1c5e:	a9 f7       	brne	.-22     	; 0x1c4a <__udivmodhi4_loop>
    1c60:	80 95       	com	r24
    1c62:	90 95       	com	r25
    1c64:	bc 01       	movw	r22, r24
    1c66:	cd 01       	movw	r24, r26
    1c68:	08 95       	ret

00001c6a <__udivmodsi4>:
    1c6a:	a1 e2       	ldi	r26, 0x21	; 33
    1c6c:	1a 2e       	mov	r1, r26
    1c6e:	aa 1b       	sub	r26, r26
    1c70:	bb 1b       	sub	r27, r27
    1c72:	fd 01       	movw	r30, r26
    1c74:	0d c0       	rjmp	.+26     	; 0x1c90 <__udivmodsi4_ep>

00001c76 <__udivmodsi4_loop>:
    1c76:	aa 1f       	adc	r26, r26
    1c78:	bb 1f       	adc	r27, r27
    1c7a:	ee 1f       	adc	r30, r30
    1c7c:	ff 1f       	adc	r31, r31
    1c7e:	a2 17       	cp	r26, r18
    1c80:	b3 07       	cpc	r27, r19
    1c82:	e4 07       	cpc	r30, r20
    1c84:	f5 07       	cpc	r31, r21
    1c86:	20 f0       	brcs	.+8      	; 0x1c90 <__udivmodsi4_ep>
    1c88:	a2 1b       	sub	r26, r18
    1c8a:	b3 0b       	sbc	r27, r19
    1c8c:	e4 0b       	sbc	r30, r20
    1c8e:	f5 0b       	sbc	r31, r21

00001c90 <__udivmodsi4_ep>:
    1c90:	66 1f       	adc	r22, r22
    1c92:	77 1f       	adc	r23, r23
    1c94:	88 1f       	adc	r24, r24
    1c96:	99 1f       	adc	r25, r25
    1c98:	1a 94       	dec	r1
    1c9a:	69 f7       	brne	.-38     	; 0x1c76 <__udivmodsi4_loop>
    1c9c:	60 95       	com	r22
    1c9e:	70 95       	com	r23
    1ca0:	80 95       	com	r24
    1ca2:	90 95       	com	r25
    1ca4:	9b 01       	movw	r18, r22
    1ca6:	ac 01       	movw	r20, r24
    1ca8:	bd 01       	movw	r22, r26
    1caa:	cf 01       	movw	r24, r30
    1cac:	08 95       	ret

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

00001cb0 <__stop_program>:
    1cb0:	ff cf       	rjmp	.-2      	; 0x1cb0 <__stop_program>
