diff options
| author | Jenna Fox <a@creativepony.com> | 2012-09-23 22:37:45 +1000 | 
|---|---|---|
| committer | Jenna Fox <a@creativepony.com> | 2012-09-23 22:37:45 +1000 | 
| commit | 409e6097d172f4027b8e541128ef3e89cbaed027 (patch) | |
| tree | a5602811db452b7f3da009b5f39ef13d8cefdb93 | |
| parent | 28b65b95cc1f47a6353e6ede5a4dbee6a36a76e3 (diff) | |
| download | micronucleus-409e6097d172f4027b8e541128ef3e89cbaed027.tar.gz micronucleus-409e6097d172f4027b8e541128ef3e89cbaed027.tar.bz2 micronucleus-409e6097d172f4027b8e541128ef3e89cbaed027.zip | |
very close to it working - it uploads some, but the words uploaded are spaced out with 0xFF's between each word :S
| -rw-r--r-- | firmware/Makefile | 7 | ||||
| -rw-r--r-- | firmware/libs-device/osccal.c.lst | 20 | ||||
| -rw-r--r-- | firmware/libs-device/osccal.o | bin | 0 -> 956 bytes | |||
| -rwxr-xr-x | firmware/main.bin | bin | 8879 -> 8919 bytes | |||
| -rw-r--r-- | firmware/main.c | 150 | ||||
| -rw-r--r-- | firmware/main.c.lst | 1808 | ||||
| -rw-r--r-- | firmware/main.hex | 291 | ||||
| -rw-r--r-- | firmware/main.map | 174 | ||||
| -rw-r--r-- | firmware/main.o | bin | 6304 -> 5852 bytes | |||
| -rw-r--r-- | firmware/temp-dump.bin | bin | 0 -> 7664 bytes | |||
| -rw-r--r-- | firmware/upload.rb | 2 | ||||
| -rw-r--r-- | firmware/usbconfig.h | 264 | ||||
| -rw-r--r-- | firmware/usbdrv/oddebug.c.lst | 16 | ||||
| -rw-r--r-- | firmware/usbdrv/oddebug.o | bin | 0 -> 623 bytes | |||
| -rw-r--r-- | firmware/usbdrv/usbdrvasm.o | bin | 4364 -> 4344 bytes | 
15 files changed, 1323 insertions, 1409 deletions
| diff --git a/firmware/Makefile b/firmware/Makefile index bc6ab7f..4f4c077 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -148,8 +148,8 @@ DEFINES = -DBOOTLOADER_ADDRESS=0x$(BOOTLOADER_ADDRESS) #-DDEBUG_LEVEL=2  CFLAGS = -Wall -Os -fno-move-loop-invariants -fno-tree-scev-cprop -fno-inline-small-functions -I. -Ilibs-device -mmcu=$(DEVICE) -DF_CPU=$(F_CPU) $(DEFINES)  LDFLAGS = -Wl,--relax,--gc-sections -Wl,--section-start=.text=$(BOOTLOADER_ADDRESS),-Map=main.map -OBJECTS =  usbdrv/usbdrvasm.o main.o -#### OBJECTS += libs-device/osccal.o +OBJECTS =  usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o +OBJECTS += libs-device/osccal.o  # symbolic targets:  all: main.hex @@ -220,6 +220,5 @@ $(ALLHEXFILES):  	addr=`echo $$device | sed -e 's/\([0-9]\)8/\1/g' | awk '{printf("%x", ($$1 - 2) * 1024)}'`; \  	echo "### Make with F_CPU=$${clock}000000 DEVICE=atmega$$device BOOTLOADER_ADDRESS=$$addr"; \  	$(MAKE) clean; \ -#	$(MAKE) main.hex F_CPU=$${clock}000000 DEVICE=atmega$$device BOOTLOADER_ADDRESS=$$addr DEFINES=-DUSE_AUTOCONFIG=1 -	$(MAKE) main.hex F_CPU=$${clock}000000 DEVICE=atmega$$device BOOTLOADER_ADDRESS=$$addr +	$(MAKE) main.hex F_CPU=$${clock}000000 DEVICE=atmega$$device BOOTLOADER_ADDRESS=$$addr DEFINES=-DUSE_AUTOCONFIG=1  	mv main.hex $@ diff --git a/firmware/libs-device/osccal.c.lst b/firmware/libs-device/osccal.c.lst index 15c6e39..5bf009c 100644 --- a/firmware/libs-device/osccal.c.lst +++ b/firmware/libs-device/osccal.c.lst @@ -1,4 +1,4 @@ -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s 			page 1 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s 			page 1     1               		.file	"osccal.c" @@ -58,7 +58,7 @@ GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s 			page    55 0046 8C17      		cp r24,r28    56 0048 9D07      		cpc r25,r29    57 004a 04F4      		brge .L6 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s 			page 2 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s 			page 2    58 004c 01B7      		in r16,81-32 @@ -85,18 +85,18 @@ GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s 			page    79 0070 FF90      		pop r15    80 0072 0895      		ret    81               		.size	calibrateOscillator, .-calibrateOscillator -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s 			page 3 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s 			page 3  DEFINED SYMBOLS                              *ABS*:00000000 osccal.c -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:2      *ABS*:0000003f __SREG__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:3      *ABS*:0000003e __SP_H__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:4      *ABS*:0000003d __SP_L__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:5      *ABS*:00000034 __CCP__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:6      *ABS*:00000000 __tmp_reg__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:7      *ABS*:00000001 __zero_reg__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccFtOAWY.s:11     .text:00000000 calibrateOscillator +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:2      *ABS*:0000003f __SREG__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:3      *ABS*:0000003e __SP_H__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:4      *ABS*:0000003d __SP_L__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:5      *ABS*:00000034 __CCP__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:6      *ABS*:00000000 __tmp_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:7      *ABS*:00000001 __zero_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccWDDb8O.s:11     .text:00000000 calibrateOscillator  UNDEFINED SYMBOLS  usbMeasureFrameLength diff --git a/firmware/libs-device/osccal.o b/firmware/libs-device/osccal.oBinary files differ new file mode 100644 index 0000000..79622f1 --- /dev/null +++ b/firmware/libs-device/osccal.o diff --git a/firmware/main.bin b/firmware/main.binBinary files differ index af6070d..b376872 100755 --- a/firmware/main.bin +++ b/firmware/main.bin diff --git a/firmware/main.c b/firmware/main.c index d4fc842..5f15353 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -22,8 +22,28 @@ static void leaveBootloader() __attribute__((__noreturn__));  #include "bootloaderconfig.h"  #include "usbdrv/usbdrv.c" -#include "libs-device/osccal.c" +#define UBOOT_VERSION 1 +// how many milliseconds should host wait till it sends another write? +// this needs to be above 9, but 20 is only sensible for testing +#define UBOOT_WRITE_SLEEP 20 + +// set a pin on DDRB to be an input or an output - i.e. becomeOutput(pin(3)); +#define bit(number) _BV(number) +#define pin(number) _BV(number) +#define inputs(pinmap) DDRB &= ~(pinmap) +#define outputs(pinmap) DDRB |= (pinmap) + +// turn some pins on or off +#define pinsOn(pinmap) PORTB |= (pinmap) +#define pinsOff(pinmap) PORTB &= ~(pinmap) +#define pinsToggle(pinmap) PORTB ^= pinmap + +// turn a single pin on or off +#define pinOn(pin) pinsOn(bit(pin)) +#define pinOff(pin) pinsOff(bit(pin)) +// TODO: Should be called pinToggle +#define toggle(pin) pinsToggle(bit(pin))  /* ------------------------------------------------------------------------ */ @@ -75,39 +95,19 @@ static uchar events = 0; // bitmap of events to run  #define isEvent(event)   (events & (event))  #define clearEvents()    events = 0 -// state for uploading process -static uchar state = 0; -#define STATE_UNDEFINED 0 -#define STATE_NEW_PAGE 1 -#define STATE_CONTINUING_PAGE 2 +static uchar writeLength;  // becomes 1 when some programming happened  // lets leaveBootloader know if needs to finish up the programming  static uchar didWriteSomething = 0; -static uint16_t         vectorTemp[2]; -static addr_t  currentAddress; /* in bytes */ -PROGMEM char usbHidReportDescriptor[33] = { -    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop) -    0x09, 0x01,                    // USAGE (Vendor Usage 1) -    0xa1, 0x01,                    // COLLECTION (Application) -    0x15, 0x00,                    //   LOGICAL_MINIMUM (0) -    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255) -    0x75, 0x08,                    //   REPORT_SIZE (8) -    0x85, 0x01,                    //   REPORT_ID (1) -    0x95, 0x06,                    //   REPORT_COUNT (6) -    0x09, 0x00,                    //   USAGE (Undefined) -    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf) -    0x85, 0x02,                    //   REPORT_ID (2) -    0x95, 0x83,                    //   REPORT_COUNT (131) -    0x09, 0x00,                    //   USAGE (Undefined) -    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf) -    0xc0                           // END_COLLECTION -}; + +static uint16_t         vectorTemp[2]; +static addr_t  currentAddress; /* in bytes */  /* ------------------------------------------------------------------------ */ @@ -153,6 +153,7 @@ static void writeWordToPageBuffer(uint16_t data) {          data = vectorTemp[1] + ((FLASHEND + 1) - BOOTLOADER_ADDRESS)/2 + 1 + USBPLUS_VECTOR_OFFSET;      } +          // clear page buffer as a precaution before filling the buffer on the first page      // TODO: maybe clear on the first byte of every page?      if (currentAddress == 0x0000) __boot_page_fill_clear(); @@ -164,7 +165,7 @@ static void writeWordToPageBuffer(uint16_t data) {  	// only need to erase if there is data already in the page that doesn't match what we're programming  	// TODO: what about this: if (pgm_read_word(currentAddress) & data != data) { ??? should work right?  	//if (pgm_read_word(currentAddress) != data && pgm_read_word(currentAddress) != 0xFFFF) { -    if (pgm_read_word(currentAddress) & data != data) { +    if ((pgm_read_word(currentAddress) & data) != data) {          fireEvent(EVENT_PAGE_NEEDS_ERASE);      } @@ -192,7 +193,6 @@ static inline __attribute__((noreturn)) void leaveBootloader(void) {  	// make sure remainder of flash is erased and write checksum and application reset vectors  	if (didWriteSomething) { -    //if(appWriteComplete) {          while (currentAddress < BOOTLOADER_ADDRESS) {              fillFlashWithVectors();          } @@ -209,58 +209,38 @@ static inline __attribute__((noreturn)) void leaveBootloader(void) {  /* ------------------------------------------------------------------------ */  static uchar usbFunctionSetup(uchar data[8]) { -   usbRequest_t *rq = (void *)data; -   static uchar replyBuffer[7] = { // TODO: Adjust this buffer size when trimming off those two useless bytes -      1, // report ID -      SPM_PAGESIZE & 0xff, -      0, // also completely useless on tiny85's - they'll never have more than 64 byte pagesize -      ((uint)PROGMEM_SIZE) & 0xff, -      (((uint)PROGMEM_SIZE) >> 8) & 0xff, -      0, -      0 // TODO: remove these last ones that don't do anything for these small chips ? -   }; - -   if (rq->bRequest == USBRQ_HID_SET_REPORT) { -      if (rq->wValue.bytes[0] == 2) { -         //offset = 0; -         state = STATE_NEW_PAGE; -         return USB_NO_MSG; -      } +    usbRequest_t *rq = (void *)data; +    static uchar replyBuffer[5] = { // TODO: Adjust this buffer size when trimming off those two useless bytes +        UBOOT_VERSION, +        (((uint)PROGMEM_SIZE) >> 8) & 0xff, +        ((uint)PROGMEM_SIZE) & 0xff, +        SPM_PAGESIZE, +        UBOOT_WRITE_SLEEP +    }; +     +    if (rq->bRequest == 0) { // get device info +        usbMsgPtr = replyBuffer; +        return 5; +       +    } else if (rq->bRequest == 1) { // write page +        pinOff(0); +        writeLength = rq->wValue.word; +        currentAddress = rq->wIndex.word; +        return 0xFF; // magical? IDK - USBaspLoader-tiny85 returns this and it works so whatever. +         +    } else { // exit bootloader  #if BOOTLOADER_CAN_EXIT -      else { -         fireEvent(EVENT_EXIT_BOOTLOADER); -      } +        fireEvent(EVENT_EXIT_BOOTLOADER);  #endif -   } else if (rq->bRequest == USBRQ_HID_GET_REPORT) { -      usbMsgPtr = replyBuffer; -      return 7; // TODO: Adjust this to match replyBuffer's size after trimming two useless bytes -   } -   return 0; +    } +     +    return 0;  }  // read in a page over usb, and write it in to the flash write buffer  static uchar usbFunctionWrite(uchar *data, uchar length) { -    union { -        addr_t  l; -        uint    s[sizeof(addr_t)/2]; -        uchar   c[sizeof(addr_t)]; -    } address; -     -    // if we are the first functionWrite for this page, update our write address -    if (state == STATE_NEW_PAGE) { -        address.l = currentAddress; -         -        //DBG1(0x30, data, 3); -        address.c[0] = data[1]; -        address.c[1] = data[2]; -        data += 4; -        length -= 4; -         -        currentAddress = address.l; -         -        state = STATE_CONTINUING_PAGE; -    } +    writeLength -= length;      do {          // remember vectors or the tinyvector table  @@ -284,8 +264,9 @@ static uchar usbFunctionWrite(uchar *data, uchar length) {          length -= 2;      } while(length); +    // TODO: Isn't this always last?      // if we have now reached another page boundary, we're done -    uchar isLast = !(currentAddress % SPM_PAGESIZE == 0); +    uchar isLast = (writeLength == 0);      if (isLast) fireEvent(EVENT_WRITE_PAGE); // ask runloop to write our page      return isLast; // let vusb know we're done with this request @@ -314,6 +295,20 @@ static inline void initForUsbConnectivity(void) {      sei();  } +static inline void tiny85FlashInit(void) { +    // check for erased first page (no bootloader interrupt vectors), add vectors if missing +    // this needs to happen for usb communication to work later - essential to first run after bootloader +    // being installed +    if(pgm_read_word(RESET_VECTOR_OFFSET * 2) != 0xC000 + (BOOTLOADER_ADDRESS/2) - 1 || +            pgm_read_word(USBPLUS_VECTOR_OFFSET * 2) != 0xC000 + (BOOTLOADER_ADDRESS/2) - 1) { + +        fillFlashWithVectors(); +    } + +    // TODO: necessary to reset currentAddress? +    currentAddress = 0; +} +  static inline void tiny85FlashWrites(void) {      _delay_ms(2); // TODO: why is this here?      // write page to flash, interrupts will be disabled for > 4.5ms including erase @@ -330,13 +325,16 @@ int __attribute__((noreturn)) main(void) {      /* initialize  */      wdt_disable();      /* main app may have enabled watchdog */ -    //tiny85FlashInit(); +    tiny85FlashInit();      currentAddress = 0; // TODO: think about if this is necessary      bootLoaderInit();      //odDebugInit();      ////DBG1(0x00, 0, 0); - - +     +    outputs(pin(0) | pin(1)); +    pinOn(0); +    pinOff(1); +          if (bootLoaderCondition()){          initForUsbConnectivity();          do { diff --git a/firmware/main.c.lst b/firmware/main.c.lst index e442403..e376e68 100644 --- a/firmware/main.c.lst +++ b/firmware/main.c.lst @@ -1,4 +1,4 @@ -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 1 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 1     1               		.file	"main.c" @@ -53,989 +53,877 @@ GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page    50 0022 3091 0000 		lds r19,currentAddress+1    51 0026 2115      		cp r18,__zero_reg__    52 0028 3105      		cpc r19,__zero_reg__ -  53 002a 01F0      		breq .L4 -  54 002c 2430      		cpi r18,4 -  55 002e 3105      		cpc r19,__zero_reg__ -  56 0030 01F0      		breq .L8 -  57 0032 44E1      		ldi r20,hi8(5372) -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 2 - - -  58 0034 2C3F      		cpi r18,lo8(5372) -  59 0036 3407      		cpc r19,r20 -  60 0038 01F4      		brne .L6 -  61 003a 8091 0000 		lds r24,vectorTemp -  62 003e 9091 0000 		lds r25,vectorTemp+1 -  63 0042 8E57      		subi r24,lo8(-(1410)) -  64 0044 9A4F      		sbci r25,hi8(-(1410)) -  65 0046 00C0      		rjmp .L7 -  66               	.L6: -  67 0048 44E1      		ldi r20,hi8(5374) -  68 004a 2E3F      		cpi r18,lo8(5374) -  69 004c 3407      		cpc r19,r20 -  70 004e 01F4      		brne .L7 -  71 0050 8091 0000 		lds r24,vectorTemp+2 -  72 0054 9091 0000 		lds r25,vectorTemp+2+1 -  73 0058 8D57      		subi r24,lo8(-(1411)) -  74 005a 9A4F      		sbci r25,hi8(-(1411)) -  75 005c 00C0      		rjmp .L7 -  76               	.L8: -  77 005e 8FE7      		ldi r24,lo8(-13697) -  78 0060 9AEC      		ldi r25,hi8(-13697) -  79               	.L7: -  80               	/* #APP */ -  81               	 ;  160 "main.c" 1 -  82 0062 F894      		cli -  83               	 ;  0 "" 2 -  84               	/* #NOAPP */ -  85 0064 E091 0000 		lds r30,currentAddress -  86 0068 F091 0000 		lds r31,currentAddress+1 -  87 006c 21E0      		ldi r18,lo8(1) -  88               	/* #APP */ -  89               	 ;  161 "main.c" 1 -  90 006e 0C01      		movw  r0, r24 -  91 0070 2093 5700 		sts 87, r18 -  92 0074 E895      		spm -  93 0076 1124      		clr  r1 -  94               		 -  95               	 ;  0 "" 2 -  96               	 ;  162 "main.c" 1 -  97 0078 7894      		sei -  98               	 ;  0 "" 2 -  99               	/* #NOAPP */ - 100 007a 8091 0000 		lds r24,currentAddress - 101 007e 9091 0000 		lds r25,currentAddress+1 - 102 0082 0296      		adiw r24,2 - 103 0084 9093 0000 		sts currentAddress+1,r25 - 104 0088 8093 0000 		sts currentAddress,r24 - 105               	/* epilogue start */ - 106 008c 0895      		ret - 107               	.L4: - 108 008e 81E1      		ldi r24,lo8(17) - 109               	/* #APP */ - 110               	 ;  158 "main.c" 1 - 111 0090 8093 5700 		sts 87, r24 - 112 0094 E895      		spm - 113               		 - 114               	 ;  0 "" 2 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 3 - - - 115               	/* #NOAPP */ - 116 0096 00C0      		rjmp .L8 - 117               		.size	writeWordToPageBuffer, .-writeWordToPageBuffer - 118               		.type	fillFlashWithVectors, @function - 119               	fillFlashWithVectors: - 120 0098 CF93      		push r28 - 121 009a DF93      		push r29 - 122               	/* prologue: function */ - 123               	/* frame size = 0 */ - 124               	/* stack size = 2 */ - 125               	.L__stack_usage = 2 - 126 009c C091 0000 		lds r28,currentAddress - 127 00a0 D091 0000 		lds r29,currentAddress+1 - 128 00a4 CF73      		andi r28,lo8(63) - 129 00a6 D070      		andi r29,hi8(63) - 130               	.L10: - 131 00a8 8FEF      		ldi r24,lo8(-1) - 132 00aa 9FEF      		ldi r25,hi8(-1) - 133 00ac 00D0      		rcall writeWordToPageBuffer - 134 00ae 2296      		adiw r28,2 - 135 00b0 C034      		cpi r28,64 - 136 00b2 D105      		cpc r29,__zero_reg__ - 137 00b4 04F0      		brlt .L10 - 138 00b6 00D0      		rcall writeFlashPage - 139               	/* epilogue start */ - 140 00b8 DF91      		pop r29 - 141 00ba CF91      		pop r28 - 142 00bc 0895      		ret - 143               		.size	fillFlashWithVectors, .-fillFlashWithVectors - 144               	.global	calibrateOscillator - 145               		.type	calibrateOscillator, @function - 146               	calibrateOscillator: - 147 00be FF92      		push r15 - 148 00c0 0F93      		push r16 - 149 00c2 1F93      		push r17 - 150 00c4 CF93      		push r28 - 151 00c6 DF93      		push r29 - 152               	/* prologue: function */ - 153               	/* frame size = 0 */ - 154               	/* stack size = 5 */ - 155               	.L__stack_usage = 5 - 156 00c8 C8E0      		ldi r28,lo8(8) - 157 00ca D0E0      		ldi r29,hi8(8) - 158 00cc 10E0      		ldi r17,lo8(0) - 159 00ce 00E8      		ldi r16,lo8(-128) - 160               	.L13: - 161 00d0 F12E      		mov r15,r17 - 162 00d2 F00E      		add r15,r16 - 163 00d4 F1BE      		out 81-32,r15 - 164 00d6 00D0      		rcall usbMeasureFrameLength - 165 00d8 9C01      		movw r18,r24 - 166 00da 89E0      		ldi r24,hi8(2356) - 167 00dc 2433      		cpi r18,lo8(2356) - 168 00de 3807      		cpc r19,r24 - 169 00e0 04F4      		brge .L12 - 170 00e2 1F2D      		mov r17,r15 - 171               	.L12: -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 4 - - - 172 00e4 0695      		lsr r16 - 173 00e6 2197      		sbiw r28,1 - 174 00e8 01F4      		brne .L13 - 175 00ea 812F      		mov r24,r17 - 176 00ec 8150      		subi r24,lo8(-(-1)) - 177 00ee 81BF      		out 81-32,r24 - 178 00f0 E901      		movw r28,r18 - 179 00f2 012F      		mov r16,r17 - 180 00f4 00C0      		rjmp .L14 - 181               	.L17: - 182 00f6 00D0      		rcall usbMeasureFrameLength - 183 00f8 8453      		subi r24,lo8(-(-2356)) - 184 00fa 9940      		sbci r25,hi8(-(-2356)) - 185 00fc 97FF      		sbrs r25,7 - 186 00fe 00C0      		rjmp .L15 - 187 0100 9095      		com r25 - 188 0102 8195      		neg r24 - 189 0104 9F4F      		sbci r25,lo8(-1) - 190               	.L15: - 191 0106 8C17      		cp r24,r28 - 192 0108 9D07      		cpc r25,r29 - 193 010a 04F4      		brge .L16 - 194 010c 01B7      		in r16,81-32 - 195 010e EC01      		movw r28,r24 - 196               	.L16: - 197 0110 81B7      		in r24,81-32 - 198 0112 8F5F      		subi r24,lo8(-(1)) - 199 0114 81BF      		out 81-32,r24 - 200               	.L14: - 201 0116 21B7      		in r18,81-32 - 202 0118 30E0      		ldi r19,lo8(0) - 203 011a 812F      		mov r24,r17 - 204 011c 90E0      		ldi r25,lo8(0) - 205 011e 0196      		adiw r24,1 - 206 0120 8217      		cp r24,r18 - 207 0122 9307      		cpc r25,r19 - 208 0124 04F4      		brge .L17 - 209 0126 01BF      		out 81-32,r16 - 210               	/* epilogue start */ - 211 0128 DF91      		pop r29 - 212 012a CF91      		pop r28 - 213 012c 1F91      		pop r17 - 214 012e 0F91      		pop r16 - 215 0130 FF90      		pop r15 - 216 0132 0895      		ret - 217               		.size	calibrateOscillator, .-calibrateOscillator - 218               		.section	.init3,"ax",@progbits - 219               	.global	PushMagicWord - 220               		.type	PushMagicWord, @function - 221               	PushMagicWord: - 222               	/* prologue: naked */ - 223               	/* frame size = 0 */ - 224               	/* stack size = 0 */ - 225               	.L__stack_usage = 0 +  53 002a 01F4      		brne .+2 +  54 002c 00C0      		rjmp .L4 +  55 002e 2430      		cpi r18,4 +  56 0030 3105      		cpc r19,__zero_reg__ +  57 0032 01F0      		breq .L9 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 2 + + +  58 0034 44E1      		ldi r20,hi8(5372) +  59 0036 2C3F      		cpi r18,lo8(5372) +  60 0038 3407      		cpc r19,r20 +  61 003a 01F4      		brne .L6 +  62 003c 8091 0000 		lds r24,vectorTemp +  63 0040 9091 0000 		lds r25,vectorTemp+1 +  64 0044 8E57      		subi r24,lo8(-(1410)) +  65 0046 9A4F      		sbci r25,hi8(-(1410)) +  66 0048 00C0      		rjmp .L7 +  67               	.L6: +  68 004a 44E1      		ldi r20,hi8(5374) +  69 004c 2E3F      		cpi r18,lo8(5374) +  70 004e 3407      		cpc r19,r20 +  71 0050 01F4      		brne .L7 +  72 0052 8091 0000 		lds r24,vectorTemp+2 +  73 0056 9091 0000 		lds r25,vectorTemp+2+1 +  74 005a 8D57      		subi r24,lo8(-(1411)) +  75 005c 9A4F      		sbci r25,hi8(-(1411)) +  76 005e 00C0      		rjmp .L7 +  77               	.L9: +  78 0060 8FE7      		ldi r24,lo8(-13697) +  79 0062 9AEC      		ldi r25,hi8(-13697) +  80               	.L7: +  81               	/* #APP */ +  82               	 ;  161 "main.c" 1 +  83 0064 F894      		cli +  84               	 ;  0 "" 2 +  85               	/* #NOAPP */ +  86 0066 E091 0000 		lds r30,currentAddress +  87 006a F091 0000 		lds r31,currentAddress+1 +  88 006e 21E0      		ldi r18,lo8(1) +  89               	/* #APP */ +  90               	 ;  162 "main.c" 1 +  91 0070 0C01      		movw  r0, r24 +  92 0072 2093 5700 		sts 87, r18 +  93 0076 E895      		spm +  94 0078 1124      		clr  r1 +  95               		 +  96               	 ;  0 "" 2 +  97               	 ;  163 "main.c" 1 +  98 007a 7894      		sei +  99               	 ;  0 "" 2 + 100               	/* #NOAPP */ + 101 007c 4091 0000 		lds r20,currentAddress + 102 0080 5091 0000 		lds r21,currentAddress+1 + 103 0084 FA01      		movw r30,r20 + 104               	/* #APP */ + 105               	 ;  168 "main.c" 1 + 106 0086 2591      		lpm r18, Z+ + 107 0088 3491      		lpm r19, Z + 108               		 + 109               	 ;  0 "" 2 + 110               	/* #NOAPP */ + 111 008a 2823      		and r18,r24 + 112 008c 3923      		and r19,r25 + 113 008e 2817      		cp r18,r24 + 114 0090 3907      		cpc r19,r25 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 3 + + + 115 0092 01F0      		breq .L8 + 116 0094 8091 0000 		lds r24,events + 117 0098 8160      		ori r24,lo8(1) + 118 009a 8093 0000 		sts events,r24 + 119               	.L8: + 120 009e 4E5F      		subi r20,lo8(-(2)) + 121 00a0 5F4F      		sbci r21,hi8(-(2)) + 122 00a2 5093 0000 		sts currentAddress+1,r21 + 123 00a6 4093 0000 		sts currentAddress,r20 + 124               	/* epilogue start */ + 125 00aa 0895      		ret + 126               	.L4: + 127 00ac 81E1      		ldi r24,lo8(17) + 128               	/* #APP */ + 129               	 ;  159 "main.c" 1 + 130 00ae 8093 5700 		sts 87, r24 + 131 00b2 E895      		spm + 132               		 + 133               	 ;  0 "" 2 + 134               	/* #NOAPP */ + 135 00b4 00C0      		rjmp .L9 + 136               		.size	writeWordToPageBuffer, .-writeWordToPageBuffer + 137               		.type	fillFlashWithVectors, @function + 138               	fillFlashWithVectors: + 139 00b6 CF93      		push r28 + 140 00b8 DF93      		push r29 + 141               	/* prologue: function */ + 142               	/* frame size = 0 */ + 143               	/* stack size = 2 */ + 144               	.L__stack_usage = 2 + 145 00ba C091 0000 		lds r28,currentAddress + 146 00be D091 0000 		lds r29,currentAddress+1 + 147 00c2 CF73      		andi r28,lo8(63) + 148 00c4 D070      		andi r29,hi8(63) + 149               	.L11: + 150 00c6 8FEF      		ldi r24,lo8(-1) + 151 00c8 9FEF      		ldi r25,hi8(-1) + 152 00ca 00D0      		rcall writeWordToPageBuffer + 153 00cc 2296      		adiw r28,2 + 154 00ce C034      		cpi r28,64 + 155 00d0 D105      		cpc r29,__zero_reg__ + 156 00d2 04F0      		brlt .L11 + 157 00d4 00D0      		rcall writeFlashPage + 158               	/* epilogue start */ + 159 00d6 DF91      		pop r29 + 160 00d8 CF91      		pop r28 + 161 00da 0895      		ret + 162               		.size	fillFlashWithVectors, .-fillFlashWithVectors + 163               		.section	.init3,"ax",@progbits + 164               	.global	PushMagicWord + 165               		.type	PushMagicWord, @function + 166               	PushMagicWord: + 167               	/* prologue: naked */ + 168               	/* frame size = 0 */ + 169               	/* stack size = 0 */ + 170               	.L__stack_usage = 0 + 171               	/* #APP */ +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 4 + + + 172               	 ;  281 "main.c" 1 + 173 0000 00EB      		ldi r16, 0xB0 + 174               	 ;  0 "" 2 + 175               	 ;  282 "main.c" 1 + 176 0002 0F93      		push r16 + 177               	 ;  0 "" 2 + 178               	 ;  283 "main.c" 1 + 179 0004 07E0      		ldi r16, 0x07 + 180               	 ;  0 "" 2 + 181               	 ;  284 "main.c" 1 + 182 0006 0F93      		push r16 + 183               	 ;  0 "" 2 + 184               	/* epilogue start */ + 185               	/* #NOAPP */ + 186               		.size	PushMagicWord, .-PushMagicWord + 187               		.text + 188               	.global	main + 189               		.type	main, @function + 190               	main: + 191 00dc DF93      		push r29 + 192 00de CF93      		push r28 + 193 00e0 0F92      		push __tmp_reg__ + 194 00e2 CDB7      		in r28,__SP_L__ + 195 00e4 DEB7      		in r29,__SP_H__ + 196               	/* prologue: function */ + 197               	/* frame size = 1 */ + 198               	/* stack size = 3 */ + 199               	.L__stack_usage = 3 + 200 00e6 88E1      		ldi r24,lo8(24) + 201               	/* #APP */ + 202               	 ;  327 "main.c" 1 + 203 00e8 0FB6      		in __tmp_reg__, __SREG__ + 204 00ea F894      		cli + 205 00ec 81BD      		out 33, r24 + 206 00ee 11BC      		out 33, __zero_reg__ + 207 00f0 0FBE      		out __SREG__,__tmp_reg__ + 208               		 + 209               	 ;  0 "" 2 + 210               	/* #NOAPP */ + 211 00f2 E0E0      		ldi r30,lo8(0) + 212 00f4 F0E0      		ldi r31,hi8(0) + 213               	/* #APP */ + 214               	 ;  302 "main.c" 1 + 215 00f6 8591      		lpm r24, Z+ + 216 00f8 9491      		lpm r25, Z + 217               		 + 218               	 ;  0 "" 2 + 219               	/* #NOAPP */ + 220 00fa 2AEC      		ldi r18,hi8(-13697) + 221 00fc 8F37      		cpi r24,lo8(-13697) + 222 00fe 9207      		cpc r25,r18 + 223 0100 01F4      		brne .L14 + 224 0102 E4E0      		ldi r30,lo8(4) + 225 0104 F0E0      		ldi r31,hi8(4)   226               	/* #APP */ - 227               	 ;  300 "main.c" 1 - 228 0000 00EB      		ldi r16, 0xB0 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 5 - - - 229               	 ;  0 "" 2 - 230               	 ;  301 "main.c" 1 - 231 0002 0F93      		push r16 - 232               	 ;  0 "" 2 - 233               	 ;  302 "main.c" 1 - 234 0004 07E0      		ldi r16, 0x07 - 235               	 ;  0 "" 2 - 236               	 ;  303 "main.c" 1 - 237 0006 0F93      		push r16 - 238               	 ;  0 "" 2 - 239               	/* epilogue start */ - 240               	/* #NOAPP */ - 241               		.size	PushMagicWord, .-PushMagicWord - 242               		.text - 243               	.global	main - 244               		.type	main, @function - 245               	main: - 246 0134 DF93      		push r29 - 247 0136 CF93      		push r28 - 248 0138 0F92      		push __tmp_reg__ - 249 013a CDB7      		in r28,__SP_L__ - 250 013c DEB7      		in r29,__SP_H__ - 251               	/* prologue: function */ - 252               	/* frame size = 1 */ - 253               	/* stack size = 3 */ - 254               	.L__stack_usage = 3 - 255 013e 88E1      		ldi r24,lo8(24) - 256               	/* #APP */ - 257               	 ;  332 "main.c" 1 - 258 0140 0FB6      		in __tmp_reg__, __SREG__ - 259 0142 F894      		cli - 260 0144 81BD      		out 33, r24 - 261 0146 11BC      		out 33, __zero_reg__ - 262 0148 0FBE      		out __SREG__,__tmp_reg__ - 263               		 - 264               	 ;  0 "" 2 - 265               	/* #NOAPP */ - 266 014a 1092 0000 		sts currentAddress+1,__zero_reg__ - 267 014e 1092 0000 		sts currentAddress,__zero_reg__ - 268 0152 AC9A      		sbi 53-32,4 - 269 0154 8BB7      		in r24,91-32 - 270 0156 8062      		ori r24,lo8(32) - 271 0158 8BBF      		out 91-32,r24 - 272 015a BB9A      		sbi 55-32,3 - 273 015c 8FE4      		 ldi r24,lo8(1649999) - 274 015e 9DE2      	    ldi r25,hi8(1649999) - 275 0160 A9E1      	    ldi r26,hlo8(1649999) - 276 0162 8150      	    1:subi r24,1 - 277 0164 9040      	    sbci r25,0 - 278 0166 A040      	    sbci r26,0 - 279 0168 01F4      	    brne 1b - 280 016a 00C0      		rjmp . - 281 016c 0000      		nop - 282 016e BB98      		cbi 55-32,3 - 283               	/* #APP */ - 284               	 ;  314 "main.c" 1 - 285 0170 7894      		sei -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 6 - - - 286               	 ;  0 "" 2 - 287               	/* #NOAPP */ - 288 0172 EE24      		clr r14 - 289 0174 FF24      		clr r15 - 290               	.L69: - 291 0176 8091 0000 		lds r24,usbRxLen - 292 017a 282F      		mov r18,r24 - 293 017c 2350      		subi r18,lo8(-(-3)) - 294 017e 27FD      		sbrc r18,7 - 295 0180 00C0      		rjmp .L20 - 296 0182 9091 0000 		lds r25,usbInputBufOffset - 297 0186 ECE0      		ldi r30,lo8(12) - 298 0188 F0E0      		ldi r31,hi8(12) - 299 018a E91B      		sub r30,r25 - 300 018c F109      		sbc r31,__zero_reg__ - 301 018e E050      		subi r30,lo8(-(usbRxBuf)) - 302 0190 F040      		sbci r31,hi8(-(usbRxBuf)) - 303 0192 9091 0000 		lds r25,usbRxToken - 304 0196 9D32      		cpi r25,lo8(45) - 305 0198 01F0      		breq .+2 - 306 019a 00C0      		rjmp .L21 - 307 019c 2830      		cpi r18,lo8(8) - 308 019e 01F0      		breq .+2 - 309 01a0 00C0      		rjmp .L22 - 310 01a2 83EC      		ldi r24,lo8(-61) - 311 01a4 8093 0000 		sts usbTxBuf,r24 - 312 01a8 8AE5      		ldi r24,lo8(90) - 313 01aa 8093 0000 		sts usbTxLen,r24 - 314 01ae 1092 0000 		sts usbMsgFlags,__zero_reg__ - 315 01b2 9081      		ld r25,Z - 316 01b4 292F      		mov r18,r25 - 317 01b6 2076      		andi r18,lo8(96) - 318 01b8 8181      		ldd r24,Z+1 - 319 01ba 2223      		tst r18 - 320 01bc 01F0      		breq .L23 - 321 01be 8930      		cpi r24,lo8(9) - 322 01c0 01F4      		brne .L24 - 323 01c2 8281      		ldd r24,Z+2 - 324 01c4 8230      		cpi r24,lo8(2) - 325 01c6 01F4      		brne .L25 - 326 01c8 81E0      		ldi r24,lo8(1) - 327 01ca 8093 0000 		sts state,r24 - 328 01ce 97FD      		sbrc r25,7 - 329 01d0 00C0      		rjmp .L26 - 330 01d2 2FEF      		ldi r18,lo8(-1) - 331 01d4 00C0      		rjmp .L27 - 332               	.L25: - 333 01d6 8091 0000 		lds r24,events - 334 01da 8460      		ori r24,lo8(4) - 335 01dc 8093 0000 		sts events,r24 - 336 01e0 00C0      		rjmp .L71 - 337               	.L24: - 338 01e2 8130      		cpi r24,lo8(1) - 339 01e4 01F0      		breq .+2 - 340 01e6 00C0      		rjmp .L71 - 341 01e8 80E0      		ldi r24,lo8(replyBuffer.1776) - 342 01ea 90E0      		ldi r25,hi8(replyBuffer.1776) -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 7 - - - 343 01ec 9093 0000 		sts usbMsgPtr+1,r25 - 344 01f0 8093 0000 		sts usbMsgPtr,r24 - 345 01f4 27E0      		ldi r18,lo8(7) - 346 01f6 00C0      		rjmp .L70 - 347               	.L23: - 348 01f8 9281      		ldd r25,Z+2 - 349 01fa 1092 0000 		sts usbTxBuf+9,__zero_reg__ - 350 01fe 8823      		tst r24 - 351 0200 01F4      		brne .L29 - 352 0202 1092 0000 		sts usbTxBuf+10,__zero_reg__ - 353 0206 80E0      		ldi r24,lo8(usbTxBuf+9) - 354 0208 90E0      		ldi r25,hi8(usbTxBuf+9) - 355 020a 22E0      		ldi r18,lo8(2) - 356 020c 00C0      		rjmp .L30 - 357               	.L29: - 358 020e 8530      		cpi r24,lo8(5) - 359 0210 01F4      		brne .L31 - 360 0212 9093 0000 		sts usbNewDeviceAddr,r25 - 361 0216 00C0      		rjmp .L78 - 362               	.L31: - 363 0218 8630      		cpi r24,lo8(6) - 364 021a 01F0      		breq .+2 - 365 021c 00C0      		rjmp .L32 - 366 021e 8381      		ldd r24,Z+3 - 367 0220 8130      		cpi r24,lo8(1) - 368 0222 01F4      		brne .L33 - 369 0224 80E0      		ldi r24,lo8(usbDescriptorDevice) - 370 0226 90E0      		ldi r25,hi8(usbDescriptorDevice) - 371 0228 00C0      		rjmp .L77 + 227               	 ;  303 "main.c" 1 + 228 0106 8591      		lpm r24, Z+ +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 5 + + + 229 0108 9491      		lpm r25, Z + 230               		 + 231               	 ;  0 "" 2 + 232               	/* #NOAPP */ + 233 010a 3AEC      		ldi r19,hi8(-13697) + 234 010c 8F37      		cpi r24,lo8(-13697) + 235 010e 9307      		cpc r25,r19 + 236 0110 01F0      		breq .L15 + 237               	.L14: + 238 0112 00D0      		rcall fillFlashWithVectors + 239               	.L15: + 240 0114 1092 0000 		sts currentAddress+1,__zero_reg__ + 241 0118 1092 0000 		sts currentAddress,__zero_reg__ + 242 011c 87B3      		in r24,55-32 + 243 011e 8360      		ori r24,lo8(3) + 244 0120 87BB      		out 55-32,r24 + 245 0122 C09A      		sbi 56-32,0 + 246 0124 C198      		cbi 56-32,1 + 247 0126 AC9A      		sbi 53-32,4 + 248 0128 8BB7      		in r24,91-32 + 249 012a 8062      		ori r24,lo8(32) + 250 012c 8BBF      		out 91-32,r24 + 251 012e BB9A      		sbi 55-32,3 + 252 0130 8FE4      		 ldi r24,lo8(1649999) + 253 0132 9DE2      	    ldi r25,hi8(1649999) + 254 0134 A9E1      	    ldi r26,hlo8(1649999) + 255 0136 8150      	    1:subi r24,1 + 256 0138 9040      	    sbci r25,0 + 257 013a A040      	    sbci r26,0 + 258 013c 01F4      	    brne 1b + 259 013e 00C0      		rjmp . + 260 0140 0000      		nop + 261 0142 BB98      		cbi 55-32,3 + 262               	/* #APP */ + 263               	 ;  295 "main.c" 1 + 264 0144 7894      		sei + 265               	 ;  0 "" 2 + 266               	/* #NOAPP */ + 267 0146 EE24      		clr r14 + 268 0148 FF24      		clr r15 + 269               	.L63: + 270 014a 2091 0000 		lds r18,usbRxLen + 271 014e 2350      		subi r18,lo8(-(-3)) + 272 0150 27FD      		sbrc r18,7 + 273 0152 00C0      		rjmp .L16 + 274 0154 8091 0000 		lds r24,usbInputBufOffset + 275 0158 ECE0      		ldi r30,lo8(12) + 276 015a F0E0      		ldi r31,hi8(12) + 277 015c E81B      		sub r30,r24 + 278 015e F109      		sbc r31,__zero_reg__ + 279 0160 E050      		subi r30,lo8(-(usbRxBuf)) + 280 0162 F040      		sbci r31,hi8(-(usbRxBuf)) + 281 0164 8091 0000 		lds r24,usbRxToken + 282 0168 8D32      		cpi r24,lo8(45) + 283 016a 01F0      		breq .+2 + 284 016c 00C0      		rjmp .L17 + 285 016e 2830      		cpi r18,lo8(8) +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 6 + + + 286 0170 01F0      		breq .+2 + 287 0172 00C0      		rjmp .L18 + 288 0174 83EC      		ldi r24,lo8(-61) + 289 0176 8093 0000 		sts usbTxBuf,r24 + 290 017a 8AE5      		ldi r24,lo8(90) + 291 017c 8093 0000 		sts usbTxLen,r24 + 292 0180 1092 0000 		sts usbMsgFlags,__zero_reg__ + 293 0184 9081      		ld r25,Z + 294 0186 9076      		andi r25,lo8(96) + 295 0188 8181      		ldd r24,Z+1 + 296 018a 9923      		tst r25 + 297 018c 01F0      		breq .L19 + 298 018e 8823      		tst r24 + 299 0190 01F4      		brne .L20 + 300 0192 80E0      		ldi r24,lo8(replyBuffer.1756) + 301 0194 90E0      		ldi r25,hi8(replyBuffer.1756) + 302 0196 9093 0000 		sts usbMsgPtr+1,r25 + 303 019a 8093 0000 		sts usbMsgPtr,r24 + 304 019e 25E0      		ldi r18,lo8(5) + 305 01a0 00C0      		rjmp .L25 + 306               	.L20: + 307 01a2 8130      		cpi r24,lo8(1) + 308 01a4 01F4      		brne .L22 + 309 01a6 C098      		cbi 56-32,0 + 310 01a8 8281      		ldd r24,Z+2 + 311 01aa 8093 0000 		sts writeLength,r24 + 312 01ae 8481      		ldd r24,Z+4 + 313 01b0 9581      		ldd r25,Z+5 + 314 01b2 9093 0000 		sts currentAddress+1,r25 + 315 01b6 8093 0000 		sts currentAddress,r24 + 316 01ba 8081      		ld r24,Z + 317 01bc 87FD      		sbrc r24,7 + 318 01be 00C0      		rjmp .L23 + 319 01c0 2FEF      		ldi r18,lo8(-1) + 320 01c2 00C0      		rjmp .L24 + 321               	.L22: + 322 01c4 8091 0000 		lds r24,events + 323 01c8 8460      		ori r24,lo8(4) + 324 01ca 8093 0000 		sts events,r24 + 325 01ce 20E0      		ldi r18,lo8(0) + 326 01d0 00C0      		rjmp .L25 + 327               	.L19: + 328 01d2 9281      		ldd r25,Z+2 + 329 01d4 1092 0000 		sts usbTxBuf+9,__zero_reg__ + 330 01d8 8823      		tst r24 + 331 01da 01F4      		brne .L26 + 332 01dc 1092 0000 		sts usbTxBuf+10,__zero_reg__ + 333 01e0 80E0      		ldi r24,lo8(usbTxBuf+9) + 334 01e2 90E0      		ldi r25,hi8(usbTxBuf+9) + 335 01e4 22E0      		ldi r18,lo8(2) + 336 01e6 00C0      		rjmp .L27 + 337               	.L26: + 338 01e8 8530      		cpi r24,lo8(5) + 339 01ea 01F4      		brne .L28 + 340 01ec 9093 0000 		sts usbNewDeviceAddr,r25 + 341 01f0 00C0      		rjmp .L70 + 342               	.L28: +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 7 + + + 343 01f2 8630      		cpi r24,lo8(6) + 344 01f4 01F4      		brne .L29 + 345 01f6 8381      		ldd r24,Z+3 + 346 01f8 8130      		cpi r24,lo8(1) + 347 01fa 01F4      		brne .L30 + 348 01fc 80E0      		ldi r24,lo8(usbDescriptorDevice) + 349 01fe 90E0      		ldi r25,hi8(usbDescriptorDevice) + 350 0200 00C0      		rjmp .L69 + 351               	.L30: + 352 0202 8230      		cpi r24,lo8(2) + 353 0204 01F4      		brne .L32 + 354 0206 80E0      		ldi r24,lo8(usbDescriptorConfiguration) + 355 0208 90E0      		ldi r25,hi8(usbDescriptorConfiguration) + 356               	.L69: + 357 020a 9093 0000 		sts usbMsgPtr+1,r25 + 358 020e 8093 0000 		sts usbMsgPtr,r24 + 359 0212 22E1      		ldi r18,lo8(18) + 360 0214 00C0      		rjmp .L31 + 361               	.L32: + 362 0216 8330      		cpi r24,lo8(3) + 363 0218 01F4      		brne .L65 + 364 021a 9923      		tst r25 + 365 021c 01F4      		brne .L33 + 366 021e 80E0      		ldi r24,lo8(usbDescriptorString0) + 367 0220 90E0      		ldi r25,hi8(usbDescriptorString0) + 368 0222 9093 0000 		sts usbMsgPtr+1,r25 + 369 0226 8093 0000 		sts usbMsgPtr,r24 + 370 022a 24E0      		ldi r18,lo8(4) + 371 022c 00C0      		rjmp .L31   372               	.L33: - 373 022a 8230      		cpi r24,lo8(2) - 374 022c 01F4      		brne .L35 - 375 022e 80E0      		ldi r24,lo8(usbDescriptorConfiguration) - 376 0230 90E0      		ldi r25,hi8(usbDescriptorConfiguration) - 377 0232 9093 0000 		sts usbMsgPtr+1,r25 - 378 0236 8093 0000 		sts usbMsgPtr,r24 - 379 023a 22E2      		ldi r18,lo8(34) - 380 023c 00C0      		rjmp .L34 - 381               	.L35: - 382 023e 8330      		cpi r24,lo8(3) - 383 0240 01F4      		brne .L36 - 384 0242 9923      		tst r25 - 385 0244 01F4      		brne .L37 - 386 0246 80E0      		ldi r24,lo8(usbDescriptorString0) - 387 0248 90E0      		ldi r25,hi8(usbDescriptorString0) - 388 024a 9093 0000 		sts usbMsgPtr+1,r25 - 389 024e 8093 0000 		sts usbMsgPtr,r24 - 390 0252 24E0      		ldi r18,lo8(4) - 391 0254 00C0      		rjmp .L34 - 392               	.L37: - 393 0256 9130      		cpi r25,lo8(1) - 394 0258 01F4      		brne .L38 - 395 025a 80E0      		ldi r24,lo8(usbDescriptorStringVendor) - 396 025c 90E0      		ldi r25,hi8(usbDescriptorStringVendor) - 397               	.L77: - 398 025e 9093 0000 		sts usbMsgPtr+1,r25 - 399 0262 8093 0000 		sts usbMsgPtr,r24 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 8 - - - 400 0266 22E1      		ldi r18,lo8(18) - 401 0268 00C0      		rjmp .L34 - 402               	.L38: - 403 026a 9230      		cpi r25,lo8(2) - 404 026c 01F4      		brne .L73 - 405 026e 80E0      		ldi r24,lo8(usbDescriptorStringDevice) - 406 0270 90E0      		ldi r25,hi8(usbDescriptorStringDevice) - 407 0272 9093 0000 		sts usbMsgPtr+1,r25 - 408 0276 8093 0000 		sts usbMsgPtr,r24 - 409 027a 20E1      		ldi r18,lo8(16) - 410 027c 00C0      		rjmp .L34 - 411               	.L36: - 412 027e 8132      		cpi r24,lo8(33) - 413 0280 01F4      		brne .L39 - 414 0282 80E0      		ldi r24,lo8(usbDescriptorConfiguration+18) - 415 0284 90E0      		ldi r25,hi8(usbDescriptorConfiguration+18) - 416 0286 9093 0000 		sts usbMsgPtr+1,r25 - 417 028a 8093 0000 		sts usbMsgPtr,r24 - 418 028e 29E0      		ldi r18,lo8(9) - 419 0290 00C0      		rjmp .L34 - 420               	.L39: - 421 0292 8232      		cpi r24,lo8(34) - 422 0294 01F4      		brne .L73 - 423 0296 80E0      		ldi r24,lo8(usbDescriptorHidReport) - 424 0298 90E0      		ldi r25,hi8(usbDescriptorHidReport) - 425 029a 9093 0000 		sts usbMsgPtr+1,r25 - 426 029e 8093 0000 		sts usbMsgPtr,r24 - 427 02a2 21E2      		ldi r18,lo8(33) - 428 02a4 00C0      		rjmp .L34 - 429               	.L73: - 430 02a6 20E0      		ldi r18,lo8(0) - 431               	.L34: - 432 02a8 80E4      		ldi r24,lo8(64) - 433 02aa 8093 0000 		sts usbMsgFlags,r24 - 434 02ae 00C0      		rjmp .L70 - 435               	.L32: - 436 02b0 8830      		cpi r24,lo8(8) - 437 02b2 01F0      		breq .L74 - 438 02b4 8930      		cpi r24,lo8(9) - 439 02b6 01F4      		brne .L41 - 440 02b8 9093 0000 		sts usbConfiguration,r25 - 441 02bc 00C0      		rjmp .L78 - 442               	.L41: - 443 02be 8A30      		cpi r24,lo8(10) - 444 02c0 01F0      		breq .L75 - 445               	.L78: - 446 02c2 80E0      		ldi r24,lo8(usbTxBuf+9) - 447 02c4 90E0      		ldi r25,hi8(usbTxBuf+9) - 448 02c6 20E0      		ldi r18,lo8(0) - 449 02c8 00C0      		rjmp .L30 - 450               	.L74: - 451 02ca 80E0      		ldi r24,lo8(usbConfiguration) - 452 02cc 90E0      		ldi r25,hi8(usbConfiguration) - 453 02ce 00C0      		rjmp .L79 - 454               	.L75: - 455 02d0 80E0      		ldi r24,lo8(usbTxBuf+9) - 456 02d2 90E0      		ldi r25,hi8(usbTxBuf+9) -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 9 - - - 457               	.L79: - 458 02d4 21E0      		ldi r18,lo8(1) - 459               	.L30: - 460 02d6 9093 0000 		sts usbMsgPtr+1,r25 - 461 02da 8093 0000 		sts usbMsgPtr,r24 - 462 02de 00C0      		rjmp .L70 - 463               	.L26: - 464 02e0 2681      		ldd r18,Z+6 - 465               	.L27: - 466 02e2 80E8      		ldi r24,lo8(-128) - 467 02e4 8093 0000 		sts usbMsgFlags,r24 - 468 02e8 00C0      		rjmp .L42 - 469               	.L70: - 470 02ea 8781      		ldd r24,Z+7 - 471 02ec 8823      		tst r24 - 472 02ee 01F4      		brne .L42 - 473 02f0 8681      		ldd r24,Z+6 - 474 02f2 8217      		cp r24,r18 - 475 02f4 00F4      		brsh .L42 - 476 02f6 282F      		mov r18,r24 - 477               	.L42: - 478 02f8 2093 0000 		sts usbMsgLen,r18 - 479 02fc 00C0      		rjmp .L22 - 480               	.L21: - 481 02fe 9091 0000 		lds r25,usbMsgFlags - 482 0302 97FF      		sbrs r25,7 - 483 0304 00C0      		rjmp .L22 - 484 0306 9091 0000 		lds r25,state - 485 030a 9130      		cpi r25,lo8(1) - 486 030c 01F4      		brne .L43 - 487 030e 3181      		ldd r19,Z+1 - 488 0310 9281      		ldd r25,Z+2 - 489 0312 3496      		adiw r30,4 - 490 0314 282F      		mov r18,r24 - 491 0316 2750      		subi r18,lo8(-(-7)) - 492 0318 3093 0000 		sts currentAddress,r19 - 493 031c 9093 0000 		sts currentAddress+1,r25 - 494 0320 82E0      		ldi r24,lo8(2) - 495 0322 8093 0000 		sts state,r24 - 496               	.L43: - 497 0326 8F01      		movw r16,r30 - 498               	.L48: - 499 0328 8091 0000 		lds r24,currentAddress - 500 032c 9091 0000 		lds r25,currentAddress+1 - 501 0330 0097      		sbiw r24,0 - 502 0332 01F4      		brne .L44 - 503 0334 D801      		movw r26,r16 - 504 0336 8D91      		ld r24,X+ - 505 0338 9C91      		ld r25,X - 506 033a 1197      		sbiw r26,1 - 507 033c 9093 0000 		sts vectorTemp+1,r25 - 508 0340 8093 0000 		sts vectorTemp,r24 - 509 0344 00C0      		rjmp .L45 - 510               	.L44: - 511 0346 8430      		cpi r24,4 - 512 0348 9105      		cpc r25,__zero_reg__ - 513 034a 01F4      		brne .L46 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 10 - - - 514 034c F801      		movw r30,r16 - 515 034e 8081      		ld r24,Z - 516 0350 9181      		ldd r25,Z+1 - 517 0352 9093 0000 		sts vectorTemp+2+1,r25 - 518 0356 8093 0000 		sts vectorTemp+2,r24 - 519 035a 00C0      		rjmp .L45 - 520               	.L46: - 521 035c F4E1      		ldi r31,hi8(5370) - 522 035e 8A3F      		cpi r24,lo8(5370) - 523 0360 9F07      		cpc r25,r31 - 524 0362 00F0      		brlo .L45 - 525 0364 81E1      		ldi r24,lo8(17) - 526               	/* #APP */ - 527               	 ;  277 "main.c" 1 - 528 0366 8093 5700 		sts 87, r24 - 529 036a E895      		spm - 530               		 - 531               	 ;  0 "" 2 - 532               	/* #NOAPP */ - 533 036c 00C0      		rjmp .L47 - 534               	.L45: - 535 036e D801      		movw r26,r16 - 536 0370 8D91      		ld r24,X+ - 537 0372 9D91      		ld r25,X+ - 538 0374 8D01      		movw r16,r26 - 539 0376 2983      		std Y+1,r18 - 540 0378 00D0      		rcall writeWordToPageBuffer - 541 037a 8091 0000 		lds r24,currentAddress - 542 037e 9091 0000 		lds r25,currentAddress+1 - 543 0382 0296      		adiw r24,2 - 544 0384 9093 0000 		sts currentAddress+1,r25 - 545 0388 8093 0000 		sts currentAddress,r24 - 546 038c 2981      		ldd r18,Y+1 - 547 038e 2250      		subi r18,lo8(-(-2)) - 548 0390 01F4      		brne .L48 - 549               	.L47: - 550 0392 8091 0000 		lds r24,currentAddress - 551 0396 9091 0000 		lds r25,currentAddress+1 - 552 039a 8F73      		andi r24,lo8(63) - 553 039c 9070      		andi r25,hi8(63) - 554 039e 0097      		sbiw r24,0 - 555 03a0 01F0      		breq .L22 - 556 03a2 8091 0000 		lds r24,events - 557 03a6 8260      		ori r24,lo8(2) - 558 03a8 8093 0000 		sts events,r24 - 559 03ac 1092 0000 		sts usbMsgLen,__zero_reg__ - 560               	.L22: - 561 03b0 1092 0000 		sts usbRxLen,__zero_reg__ - 562               	.L20: - 563 03b4 8091 0000 		lds r24,usbTxLen - 564 03b8 84FF      		sbrs r24,4 - 565 03ba 00C0      		rjmp .L49 - 566 03bc 8091 0000 		lds r24,usbMsgLen - 567 03c0 8F3F      		cpi r24,lo8(-1) - 568 03c2 01F4      		brne .+2 - 569 03c4 00C0      		rjmp .L49 - 570 03c6 082F      		mov r16,r24 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 11 - - - 571 03c8 8930      		cpi r24,lo8(9) - 572 03ca 00F0      		brlo .L50 - 573 03cc 08E0      		ldi r16,lo8(8) - 574               	.L50: - 575 03ce 801B      		sub r24,r16 - 576 03d0 8093 0000 		sts usbMsgLen,r24 - 577 03d4 8091 0000 		lds r24,usbTxBuf - 578 03d8 98E8      		ldi r25,lo8(-120) - 579 03da 8927      		eor r24,r25 - 580 03dc 8093 0000 		sts usbTxBuf,r24 - 581 03e0 0023      		tst r16 - 582 03e2 01F0      		breq .L51 - 583 03e4 E091 0000 		lds r30,usbMsgPtr - 584 03e8 F091 0000 		lds r31,usbMsgPtr+1 - 585 03ec 9091 0000 		lds r25,usbMsgFlags - 586 03f0 802F      		mov r24,r16 - 587 03f2 8150      		subi r24,lo8(-(-1)) - 588 03f4 96FF      		sbrs r25,6 - 589 03f6 00C0      		rjmp .L52 - 590 03f8 90E0      		ldi r25,lo8(0) - 591 03fa 8050      		subi r24,lo8(-(usbTxBuf+2)) - 592 03fc 9040      		sbci r25,hi8(-(usbTxBuf+2)) - 593 03fe A0E0      		ldi r26,lo8(usbTxBuf+1) - 594 0400 B0E0      		ldi r27,hi8(usbTxBuf+1) - 595               	.L53: - 596               	/* #APP */ - 597               	 ;  504 "usbdrv/usbdrv.c" 1 - 598 0402 2491      		lpm r18, Z - 599               		 - 600               	 ;  0 "" 2 - 601               	/* #NOAPP */ - 602 0404 2D93      		st X+,r18 - 603 0406 3196      		adiw r30,1 - 604 0408 A817      		cp r26,r24 - 605 040a B907      		cpc r27,r25 - 606 040c 01F4      		brne .L53 - 607 040e 00C0      		rjmp .L54 - 608               	.L52: - 609 0410 9F01      		movw r18,r30 - 610 0412 90E0      		ldi r25,lo8(0) - 611 0414 8050      		subi r24,lo8(-(usbTxBuf+2)) - 612 0416 9040      		sbci r25,hi8(-(usbTxBuf+2)) - 613 0418 A0E0      		ldi r26,lo8(usbTxBuf+1) - 614 041a B0E0      		ldi r27,hi8(usbTxBuf+1) - 615               	.L55: - 616 041c F901      		movw r30,r18 - 617 041e 4191      		ld r20,Z+ - 618 0420 9F01      		movw r18,r30 - 619 0422 4D93      		st X+,r20 - 620 0424 A817      		cp r26,r24 - 621 0426 B907      		cpc r27,r25 - 622 0428 01F4      		brne .L55 - 623               	.L54: - 624 042a F093 0000 		sts usbMsgPtr+1,r31 - 625 042e E093 0000 		sts usbMsgPtr,r30 - 626               	.L51: - 627 0432 80E0      		ldi r24,lo8(usbTxBuf+1) -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 12 - - - 628 0434 90E0      		ldi r25,hi8(usbTxBuf+1) - 629 0436 602F      		mov r22,r16 - 630 0438 00D0      		rcall usbCrc16Append - 631 043a 0C5F      		subi r16,lo8(-(4)) - 632 043c 0C30      		cpi r16,lo8(12) - 633 043e 01F0      		breq .L56 - 634 0440 8FEF      		ldi r24,lo8(-1) - 635 0442 8093 0000 		sts usbMsgLen,r24 - 636               	.L56: - 637 0446 0093 0000 		sts usbTxLen,r16 - 638               	.L49: - 639 044a 84E1      		ldi r24,lo8(20) - 640               	.L58: - 641 044c 96B3      		in r25,54-32 - 642 044e 9871      		andi r25,lo8(24) - 643 0450 01F4      		brne .L57 - 644 0452 8150      		subi r24,lo8(-(-1)) - 645 0454 01F4      		brne .L58 - 646 0456 1092 0000 		sts usbNewDeviceAddr,__zero_reg__ - 647 045a 1092 0000 		sts usbDeviceAddr,__zero_reg__ - 648               	.L57: - 649 045e 01E0      		ldi r16,lo8(1) - 650 0460 8111      		cpse r24,__zero_reg__ - 651 0462 00E0      		ldi r16,lo8(0) - 652               	.L59: - 653 0464 8091 0000 		lds r24,wasReset.1703 - 654 0468 8017      		cp r24,r16 - 655 046a 01F0      		breq .L60 - 656 046c 0023      		tst r16 - 657 046e 01F4      		brne .L61 + 373 022e 9130      		cpi r25,lo8(1) + 374 0230 01F4      		brne .L34 + 375 0232 80E0      		ldi r24,lo8(usbDescriptorStringVendor) + 376 0234 90E0      		ldi r25,hi8(usbDescriptorStringVendor) + 377 0236 9093 0000 		sts usbMsgPtr+1,r25 + 378 023a 8093 0000 		sts usbMsgPtr,r24 + 379 023e 22E2      		ldi r18,lo8(34) + 380 0240 00C0      		rjmp .L31 + 381               	.L34: + 382 0242 9230      		cpi r25,lo8(2) + 383 0244 01F4      		brne .L65 + 384 0246 80E0      		ldi r24,lo8(usbDescriptorStringDevice) + 385 0248 90E0      		ldi r25,hi8(usbDescriptorStringDevice) + 386 024a 9093 0000 		sts usbMsgPtr+1,r25 + 387 024e 8093 0000 		sts usbMsgPtr,r24 + 388 0252 2CE0      		ldi r18,lo8(12) + 389 0254 00C0      		rjmp .L31 + 390               	.L65: + 391 0256 20E0      		ldi r18,lo8(0) + 392               	.L31: + 393 0258 80E4      		ldi r24,lo8(64) + 394 025a 8093 0000 		sts usbMsgFlags,r24 + 395 025e 00C0      		rjmp .L25 + 396               	.L29: + 397 0260 8830      		cpi r24,lo8(8) + 398 0262 01F0      		breq .L66 + 399 0264 8930      		cpi r24,lo8(9) +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 8 + + + 400 0266 01F4      		brne .L36 + 401 0268 9093 0000 		sts usbConfiguration,r25 + 402 026c 00C0      		rjmp .L70 + 403               	.L36: + 404 026e 8A30      		cpi r24,lo8(10) + 405 0270 01F0      		breq .L67 + 406               	.L70: + 407 0272 80E0      		ldi r24,lo8(usbTxBuf+9) + 408 0274 90E0      		ldi r25,hi8(usbTxBuf+9) + 409 0276 20E0      		ldi r18,lo8(0) + 410 0278 00C0      		rjmp .L27 + 411               	.L66: + 412 027a 80E0      		ldi r24,lo8(usbConfiguration) + 413 027c 90E0      		ldi r25,hi8(usbConfiguration) + 414 027e 00C0      		rjmp .L71 + 415               	.L67: + 416 0280 80E0      		ldi r24,lo8(usbTxBuf+9) + 417 0282 90E0      		ldi r25,hi8(usbTxBuf+9) + 418               	.L71: + 419 0284 21E0      		ldi r18,lo8(1) + 420               	.L27: + 421 0286 9093 0000 		sts usbMsgPtr+1,r25 + 422 028a 8093 0000 		sts usbMsgPtr,r24 + 423 028e 00C0      		rjmp .L25 + 424               	.L23: + 425 0290 2681      		ldd r18,Z+6 + 426               	.L24: + 427 0292 80E8      		ldi r24,lo8(-128) + 428 0294 8093 0000 		sts usbMsgFlags,r24 + 429 0298 00C0      		rjmp .L37 + 430               	.L25: + 431 029a 8781      		ldd r24,Z+7 + 432 029c 8823      		tst r24 + 433 029e 01F4      		brne .L37 + 434 02a0 8681      		ldd r24,Z+6 + 435 02a2 8217      		cp r24,r18 + 436 02a4 00F4      		brsh .L37 + 437 02a6 282F      		mov r18,r24 + 438               	.L37: + 439 02a8 2093 0000 		sts usbMsgLen,r18 + 440 02ac 00C0      		rjmp .L18 + 441               	.L17: + 442 02ae 8091 0000 		lds r24,usbMsgFlags + 443 02b2 87FF      		sbrs r24,7 + 444 02b4 00C0      		rjmp .L18 + 445 02b6 8091 0000 		lds r24,writeLength + 446 02ba 821B      		sub r24,r18 + 447 02bc 8093 0000 		sts writeLength,r24 + 448 02c0 8F01      		movw r16,r30 + 449               	.L42: + 450 02c2 8091 0000 		lds r24,currentAddress + 451 02c6 9091 0000 		lds r25,currentAddress+1 + 452 02ca 0097      		sbiw r24,0 + 453 02cc 01F4      		brne .L38 + 454 02ce D801      		movw r26,r16 + 455 02d0 8D91      		ld r24,X+ + 456 02d2 9C91      		ld r25,X +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 9 + + + 457 02d4 1197      		sbiw r26,1 + 458 02d6 9093 0000 		sts vectorTemp+1,r25 + 459 02da 8093 0000 		sts vectorTemp,r24 + 460 02de 00C0      		rjmp .L39 + 461               	.L38: + 462 02e0 8430      		cpi r24,4 + 463 02e2 9105      		cpc r25,__zero_reg__ + 464 02e4 01F4      		brne .L40 + 465 02e6 F801      		movw r30,r16 + 466 02e8 8081      		ld r24,Z + 467 02ea 9181      		ldd r25,Z+1 + 468 02ec 9093 0000 		sts vectorTemp+2+1,r25 + 469 02f0 8093 0000 		sts vectorTemp+2,r24 + 470 02f4 00C0      		rjmp .L39 + 471               	.L40: + 472 02f6 F4E1      		ldi r31,hi8(5370) + 473 02f8 8A3F      		cpi r24,lo8(5370) + 474 02fa 9F07      		cpc r25,r31 + 475 02fc 00F0      		brlo .L39 + 476 02fe 81E1      		ldi r24,lo8(17) + 477               	/* #APP */ + 478               	 ;  257 "main.c" 1 + 479 0300 8093 5700 		sts 87, r24 + 480 0304 E895      		spm + 481               		 + 482               	 ;  0 "" 2 + 483               	/* #NOAPP */ + 484 0306 00C0      		rjmp .L41 + 485               	.L39: + 486 0308 D801      		movw r26,r16 + 487 030a 8D91      		ld r24,X+ + 488 030c 9D91      		ld r25,X+ + 489 030e 8D01      		movw r16,r26 + 490 0310 2983      		std Y+1,r18 + 491 0312 00D0      		rcall writeWordToPageBuffer + 492 0314 8091 0000 		lds r24,currentAddress + 493 0318 9091 0000 		lds r25,currentAddress+1 + 494 031c 0296      		adiw r24,2 + 495 031e 9093 0000 		sts currentAddress+1,r25 + 496 0322 8093 0000 		sts currentAddress,r24 + 497 0326 2981      		ldd r18,Y+1 + 498 0328 2250      		subi r18,lo8(-(-2)) + 499 032a 01F4      		brne .L42 + 500               	.L41: + 501 032c 8091 0000 		lds r24,writeLength + 502 0330 8823      		tst r24 + 503 0332 01F4      		brne .L18 + 504 0334 8091 0000 		lds r24,events + 505 0338 8260      		ori r24,lo8(2) + 506 033a 8093 0000 		sts events,r24 + 507 033e 1092 0000 		sts usbMsgLen,__zero_reg__ + 508               	.L18: + 509 0342 1092 0000 		sts usbRxLen,__zero_reg__ + 510               	.L16: + 511 0346 8091 0000 		lds r24,usbTxLen + 512 034a 84FF      		sbrs r24,4 + 513 034c 00C0      		rjmp .L43 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 10 + + + 514 034e 8091 0000 		lds r24,usbMsgLen + 515 0352 8F3F      		cpi r24,lo8(-1) + 516 0354 01F4      		brne .+2 + 517 0356 00C0      		rjmp .L43 + 518 0358 082F      		mov r16,r24 + 519 035a 8930      		cpi r24,lo8(9) + 520 035c 00F0      		brlo .L44 + 521 035e 08E0      		ldi r16,lo8(8) + 522               	.L44: + 523 0360 801B      		sub r24,r16 + 524 0362 8093 0000 		sts usbMsgLen,r24 + 525 0366 8091 0000 		lds r24,usbTxBuf + 526 036a 98E8      		ldi r25,lo8(-120) + 527 036c 8927      		eor r24,r25 + 528 036e 8093 0000 		sts usbTxBuf,r24 + 529 0372 0023      		tst r16 + 530 0374 01F0      		breq .L45 + 531 0376 E091 0000 		lds r30,usbMsgPtr + 532 037a F091 0000 		lds r31,usbMsgPtr+1 + 533 037e 9091 0000 		lds r25,usbMsgFlags + 534 0382 802F      		mov r24,r16 + 535 0384 8150      		subi r24,lo8(-(-1)) + 536 0386 96FF      		sbrs r25,6 + 537 0388 00C0      		rjmp .L46 + 538 038a 90E0      		ldi r25,lo8(0) + 539 038c 8050      		subi r24,lo8(-(usbTxBuf+2)) + 540 038e 9040      		sbci r25,hi8(-(usbTxBuf+2)) + 541 0390 A0E0      		ldi r26,lo8(usbTxBuf+1) + 542 0392 B0E0      		ldi r27,hi8(usbTxBuf+1) + 543               	.L47: + 544               	/* #APP */ + 545               	 ;  504 "usbdrv/usbdrv.c" 1 + 546 0394 2491      		lpm r18, Z + 547               		 + 548               	 ;  0 "" 2 + 549               	/* #NOAPP */ + 550 0396 2D93      		st X+,r18 + 551 0398 3196      		adiw r30,1 + 552 039a A817      		cp r26,r24 + 553 039c B907      		cpc r27,r25 + 554 039e 01F4      		brne .L47 + 555 03a0 00C0      		rjmp .L48 + 556               	.L46: + 557 03a2 9F01      		movw r18,r30 + 558 03a4 90E0      		ldi r25,lo8(0) + 559 03a6 8050      		subi r24,lo8(-(usbTxBuf+2)) + 560 03a8 9040      		sbci r25,hi8(-(usbTxBuf+2)) + 561 03aa A0E0      		ldi r26,lo8(usbTxBuf+1) + 562 03ac B0E0      		ldi r27,hi8(usbTxBuf+1) + 563               	.L49: + 564 03ae F901      		movw r30,r18 + 565 03b0 4191      		ld r20,Z+ + 566 03b2 9F01      		movw r18,r30 + 567 03b4 4D93      		st X+,r20 + 568 03b6 A817      		cp r26,r24 + 569 03b8 B907      		cpc r27,r25 + 570 03ba 01F4      		brne .L49 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 11 + + + 571               	.L48: + 572 03bc F093 0000 		sts usbMsgPtr+1,r31 + 573 03c0 E093 0000 		sts usbMsgPtr,r30 + 574               	.L45: + 575 03c4 80E0      		ldi r24,lo8(usbTxBuf+1) + 576 03c6 90E0      		ldi r25,hi8(usbTxBuf+1) + 577 03c8 602F      		mov r22,r16 + 578 03ca 00D0      		rcall usbCrc16Append + 579 03cc 0C5F      		subi r16,lo8(-(4)) + 580 03ce 0C30      		cpi r16,lo8(12) + 581 03d0 01F0      		breq .L50 + 582 03d2 8FEF      		ldi r24,lo8(-1) + 583 03d4 8093 0000 		sts usbMsgLen,r24 + 584               	.L50: + 585 03d8 0093 0000 		sts usbTxLen,r16 + 586               	.L43: + 587 03dc 84E1      		ldi r24,lo8(20) + 588               	.L52: + 589 03de 96B3      		in r25,54-32 + 590 03e0 9871      		andi r25,lo8(24) + 591 03e2 01F4      		brne .L51 + 592 03e4 8150      		subi r24,lo8(-(-1)) + 593 03e6 01F4      		brne .L52 + 594 03e8 1092 0000 		sts usbNewDeviceAddr,__zero_reg__ + 595 03ec 1092 0000 		sts usbDeviceAddr,__zero_reg__ + 596               	.L51: + 597 03f0 01E0      		ldi r16,lo8(1) + 598 03f2 8111      		cpse r24,__zero_reg__ + 599 03f4 00E0      		ldi r16,lo8(0) + 600               	.L53: + 601 03f6 8091 0000 		lds r24,wasReset.1698 + 602 03fa 8017      		cp r24,r16 + 603 03fc 01F0      		breq .L54 + 604 03fe 0023      		tst r16 + 605 0400 01F4      		brne .L55 + 606               	/* #APP */ + 607               	 ;  557 "usbdrv/usbdrv.c" 1 + 608 0402 F894      		cli + 609               	 ;  0 "" 2 + 610               	/* #NOAPP */ + 611 0404 00D0      		rcall calibrateOscillator + 612               	/* #APP */ + 613               	 ;  557 "usbdrv/usbdrv.c" 1 + 614 0406 7894      		sei + 615               	 ;  0 "" 2 + 616               	/* #NOAPP */ + 617               	.L55: + 618 0408 0093 0000 		sts wasReset.1698,r16 + 619               	.L54: + 620 040c 8CE9      		 ldi r24,lo8(412) + 621 040e 91E0      	    ldi r25,hi8(412) + 622 0410 0197      	    1:sbiw r24,1 + 623 0412 01F4      	    brne 1b + 624 0414 0000      		nop + 625 0416 8091 0000 		lds r24,events + 626 041a 8823      		tst r24 + 627 041c 01F4      		brne .L68 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 12 + + + 628 041e 0894      		sec + 629 0420 E11C      		adc r14,__zero_reg__ + 630 0422 F11C      		adc r15,__zero_reg__ + 631 0424 00C0      		rjmp .L56 + 632               	.L68: + 633 0426 EE24      		clr r14 + 634 0428 FF24      		clr r15 + 635               	.L56: + 636 042a 80FF      		sbrs r24,0 + 637 042c 00C0      		rjmp .L57 + 638               	/* #APP */ + 639               	 ;  117 "main.c" 1 + 640 042e F894      		cli + 641               	 ;  0 "" 2 + 642               	/* #NOAPP */ + 643 0430 E091 0000 		lds r30,currentAddress + 644 0434 F091 0000 		lds r31,currentAddress+1 + 645 0438 3297      		sbiw r30,2 + 646 043a 83E0      		ldi r24,lo8(3) + 647               	/* #APP */ + 648               	 ;  118 "main.c" 1 + 649 043c 8093 5700 		sts 87, r24 + 650 0440 E895      		spm + 651               		 + 652               	 ;  0 "" 2 + 653               	/* #NOAPP */ + 654               	.L58: + 655 0442 07B6      		in __tmp_reg__,87-32 + 656 0444 00FC      		sbrc __tmp_reg__,0 + 657 0446 00C0      		rjmp .L58   658               	/* #APP */ - 659               	 ;  557 "usbdrv/usbdrv.c" 1 - 660 0470 F894      		cli + 659               	 ;  120 "main.c" 1 + 660 0448 7894      		sei   661               	 ;  0 "" 2   662               	/* #NOAPP */ - 663 0472 00D0      		rcall calibrateOscillator - 664               	/* #APP */ - 665               	 ;  557 "usbdrv/usbdrv.c" 1 - 666 0474 7894      		sei - 667               	 ;  0 "" 2 - 668               	/* #NOAPP */ - 669               	.L61: - 670 0476 0093 0000 		sts wasReset.1703,r16 - 671               	.L60: - 672 047a 8CE9      		 ldi r24,lo8(412) - 673 047c 91E0      	    ldi r25,hi8(412) - 674 047e 0197      	    1:sbiw r24,1 - 675 0480 01F4      	    brne 1b - 676 0482 0000      		nop - 677 0484 8091 0000 		lds r24,events - 678 0488 8823      		tst r24 - 679 048a 01F4      		brne .L76 - 680 048c 0894      		sec - 681 048e E11C      		adc r14,__zero_reg__ - 682 0490 F11C      		adc r15,__zero_reg__ - 683 0492 00C0      		rjmp .L62 - 684               	.L76: -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 13 - - - 685 0494 EE24      		clr r14 - 686 0496 FF24      		clr r15 - 687               	.L62: - 688 0498 80FF      		sbrs r24,0 - 689 049a 00C0      		rjmp .L63 - 690               	/* #APP */ - 691               	 ;  117 "main.c" 1 - 692 049c F894      		cli - 693               	 ;  0 "" 2 - 694               	/* #NOAPP */ - 695 049e E091 0000 		lds r30,currentAddress - 696 04a2 F091 0000 		lds r31,currentAddress+1 - 697 04a6 3297      		sbiw r30,2 - 698 04a8 83E0      		ldi r24,lo8(3) + 663               	.L57: + 664 044a 8091 0000 		lds r24,events + 665 044e 81FF      		sbrs r24,1 + 666 0450 00C0      		rjmp .L59 + 667 0452 A9E3      		 ldi r26,lo8(8249) + 668 0454 B0E2      	    ldi r27,hi8(8249) + 669 0456 1197      	    1:sbiw r26,1 + 670 0458 01F4      	    brne 1b + 671 045a 00C0      		rjmp . + 672 045c 0000      		nop + 673 045e 8091 0000 		lds r24,currentAddress + 674 0462 9091 0000 		lds r25,currentAddress+1 + 675 0466 8F73      		andi r24,lo8(63) + 676 0468 9070      		andi r25,hi8(63) + 677 046a 0097      		sbiw r24,0 + 678 046c 01F0      		breq .L60 + 679 046e 00D0      		rcall fillFlashWithVectors + 680 0470 00C0      		rjmp .L59 + 681               	.L60: + 682 0472 00D0      		rcall writeFlashPage + 683               	.L59: + 684 0474 8091 0000 		lds r24,events +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 13 + + + 685 0478 82FD      		sbrc r24,2 + 686 047a 00C0      		rjmp .L61 + 687 047c B1E5      		ldi r27,lo8(-15535) + 688 047e EB16      		cp r14,r27 + 689 0480 B3EC      		ldi r27,hi8(-15535) + 690 0482 FB06      		cpc r15,r27 + 691 0484 00F0      		brlo .L62 + 692               	.L61: + 693 0486 E1E2      		 ldi r30,lo8(-24287) + 694 0488 F1EA      	    ldi r31,hi8(-24287) + 695 048a 3197      	    1:sbiw r30,1 + 696 048c 01F4      	    brne 1b + 697 048e 00C0      		rjmp . + 698 0490 0000      		nop   699               	/* #APP */ - 700               	 ;  118 "main.c" 1 - 701 04aa 8093 5700 		sts 87, r24 - 702 04ae E895      		spm - 703               		 - 704               	 ;  0 "" 2 - 705               	/* #NOAPP */ - 706               	.L64: - 707 04b0 07B6      		in __tmp_reg__,87-32 - 708 04b2 00FC      		sbrc __tmp_reg__,0 - 709 04b4 00C0      		rjmp .L64 - 710               	/* #APP */ - 711               	 ;  120 "main.c" 1 - 712 04b6 7894      		sei - 713               	 ;  0 "" 2 - 714               	/* #NOAPP */ - 715               	.L63: - 716 04b8 8091 0000 		lds r24,events - 717 04bc 81FF      		sbrs r24,1 - 718 04be 00C0      		rjmp .L65 - 719 04c0 A9E3      		 ldi r26,lo8(8249) - 720 04c2 B0E2      	    ldi r27,hi8(8249) - 721 04c4 1197      	    1:sbiw r26,1 - 722 04c6 01F4      	    brne 1b - 723 04c8 00C0      		rjmp . - 724 04ca 0000      		nop - 725 04cc 8091 0000 		lds r24,currentAddress - 726 04d0 9091 0000 		lds r25,currentAddress+1 - 727 04d4 8F73      		andi r24,lo8(63) - 728 04d6 9070      		andi r25,hi8(63) - 729 04d8 0097      		sbiw r24,0 - 730 04da 01F0      		breq .L66 - 731 04dc 00D0      		rcall fillFlashWithVectors - 732 04de 00C0      		rjmp .L65 - 733               	.L66: - 734 04e0 00D0      		rcall writeFlashPage - 735               	.L65: - 736 04e2 8091 0000 		lds r24,events - 737 04e6 82FD      		sbrc r24,2 - 738 04e8 00C0      		rjmp .L67 - 739 04ea B1E5      		ldi r27,lo8(-15535) - 740 04ec EB16      		cp r14,r27 - 741 04ee B3EC      		ldi r27,hi8(-15535) -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 14 - - - 742 04f0 FB06      		cpc r15,r27 - 743 04f2 00F0      		brlo .L68 - 744               	.L67: - 745 04f4 E1E2      		 ldi r30,lo8(-24287) - 746 04f6 F1EA      	    ldi r31,hi8(-24287) - 747 04f8 3197      	    1:sbiw r30,1 - 748 04fa 01F4      	    brne 1b - 749 04fc 00C0      		rjmp . - 750 04fe 0000      		nop - 751               	/* #APP */ - 752               	 ;  189 "main.c" 1 - 753 0500 F894      		cli - 754               	 ;  0 "" 2 - 755               	/* #NOAPP */ - 756 0502 1BBE      		out 91-32,__zero_reg__ - 757 0504 15BA      		out 53-32,__zero_reg__ - 758 0506 1092 5F02 		sts 607,__zero_reg__ - 759 050a 1092 5E02 		sts 606,__zero_reg__ - 760               	/* #APP */ - 761               	 ;  206 "main.c" 1 - 762 050e 00C0      		rjmp __vectors - 4 - 763               	 ;  0 "" 2 - 764               	/* #NOAPP */ - 765               	.L68: - 766 0510 1092 0000 		sts events,__zero_reg__ - 767 0514 00C0      		rjmp .L69 - 768               	.L71: - 769 0516 20E0      		ldi r18,lo8(0) - 770 0518 00C0      		rjmp .L70 - 771               		.size	main, .-main - 772               	.global	usbTxLen - 773               		.data - 774               		.type	usbTxLen, @object - 775               		.size	usbTxLen, 1 - 776               	usbTxLen: - 777 0000 5A        		.byte	90 - 778               	.global	usbDescriptorString0 - 779               		.section	.progmem.data,"a",@progbits - 780               		.type	usbDescriptorString0, @object - 781               		.size	usbDescriptorString0, 4 - 782               	usbDescriptorString0: - 783 0000 04        		.byte	4 - 784 0001 03        		.byte	3 - 785 0002 09        		.byte	9 - 786 0003 04        		.byte	4 - 787               	.global	usbDescriptorStringVendor - 788               		.type	usbDescriptorStringVendor, @object - 789               		.size	usbDescriptorStringVendor, 18 - 790               	usbDescriptorStringVendor: - 791 0004 1203      		.word	786 - 792 0006 6F00      		.word	111 - 793 0008 6200      		.word	98 - 794 000a 6400      		.word	100 - 795 000c 6500      		.word	101 - 796 000e 7600      		.word	118 - 797 0010 2E00      		.word	46 - 798 0012 6100      		.word	97 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 15 - - - 799 0014 7400      		.word	116 - 800               	.global	usbDescriptorStringDevice - 801               		.type	usbDescriptorStringDevice, @object - 802               		.size	usbDescriptorStringDevice, 16 - 803               	usbDescriptorStringDevice: - 804 0016 1003      		.word	784 - 805 0018 4800      		.word	72 - 806 001a 4900      		.word	73 - 807 001c 4400      		.word	68 - 808 001e 4200      		.word	66 - 809 0020 6F00      		.word	111 - 810 0022 6F00      		.word	111 - 811 0024 7400      		.word	116 - 812               	.global	usbDescriptorDevice - 813               		.type	usbDescriptorDevice, @object - 814               		.size	usbDescriptorDevice, 18 - 815               	usbDescriptorDevice: - 816 0026 12        		.byte	18 - 817 0027 01        		.byte	1 - 818 0028 10        		.byte	16 - 819 0029 01        		.byte	1 - 820 002a 00        		.byte	0 - 821 002b 00        		.byte	0 - 822 002c 00        		.byte	0 - 823 002d 08        		.byte	8 - 824 002e C0        		.byte	-64 - 825 002f 16        		.byte	22 - 826 0030 DF        		.byte	-33 - 827 0031 05        		.byte	5 - 828 0032 00        		.byte	0 - 829 0033 01        		.byte	1 - 830 0034 01        		.byte	1 - 831 0035 02        		.byte	2 - 832 0036 00        		.byte	0 - 833 0037 01        		.byte	1 - 834               	.global	usbDescriptorConfiguration - 835               		.type	usbDescriptorConfiguration, @object - 836               		.size	usbDescriptorConfiguration, 34 - 837               	usbDescriptorConfiguration: - 838 0038 09        		.byte	9 - 839 0039 02        		.byte	2 - 840 003a 22        		.byte	34 - 841 003b 00        		.byte	0 - 842 003c 01        		.byte	1 - 843 003d 01        		.byte	1 - 844 003e 00        		.byte	0 - 845 003f 80        		.byte	-128 - 846 0040 32        		.byte	50 - 847 0041 09        		.byte	9 - 848 0042 04        		.byte	4 - 849 0043 00        		.byte	0 - 850 0044 00        		.byte	0 - 851 0045 01        		.byte	1 - 852 0046 03        		.byte	3 - 853 0047 00        		.byte	0 - 854 0048 00        		.byte	0 - 855 0049 00        		.byte	0 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 16 - - - 856 004a 09        		.byte	9 - 857 004b 21        		.byte	33 - 858 004c 01        		.byte	1 - 859 004d 01        		.byte	1 - 860 004e 00        		.byte	0 - 861 004f 01        		.byte	1 - 862 0050 22        		.byte	34 - 863 0051 21        		.byte	33 - 864 0052 00        		.byte	0 - 865 0053 07        		.byte	7 - 866 0054 05        		.byte	5 - 867 0055 81        		.byte	-127 - 868 0056 03        		.byte	3 - 869 0057 08        		.byte	8 - 870 0058 00        		.byte	0 - 871 0059 C8        		.byte	-56 - 872               	.global	usbDescriptorHidReport - 873               		.type	usbDescriptorHidReport, @object - 874               		.size	usbDescriptorHidReport, 33 - 875               	usbDescriptorHidReport: - 876 005a 06        		.byte	6 - 877 005b 00        		.byte	0 - 878 005c FF        		.byte	-1 - 879 005d 09        		.byte	9 - 880 005e 01        		.byte	1 - 881 005f A1        		.byte	-95 - 882 0060 01        		.byte	1 - 883 0061 15        		.byte	21 - 884 0062 00        		.byte	0 - 885 0063 26        		.byte	38 - 886 0064 FF        		.byte	-1 - 887 0065 00        		.byte	0 - 888 0066 75        		.byte	117 - 889 0067 08        		.byte	8 - 890 0068 85        		.byte	-123 - 891 0069 01        		.byte	1 - 892 006a 95        		.byte	-107 - 893 006b 06        		.byte	6 - 894 006c 09        		.byte	9 - 895 006d 00        		.byte	0 - 896 006e B2        		.byte	-78 - 897 006f 02        		.byte	2 - 898 0070 01        		.byte	1 - 899 0071 85        		.byte	-123 - 900 0072 02        		.byte	2 - 901 0073 95        		.byte	-107 - 902 0074 83        		.byte	-125 - 903 0075 09        		.byte	9 - 904 0076 00        		.byte	0 - 905 0077 B2        		.byte	-78 - 906 0078 02        		.byte	2 - 907 0079 01        		.byte	1 - 908 007a C0        		.byte	-64 - 909               		.comm usbMsgPtr,2,1 - 910               		.comm usbRxToken,1,1 - 911               		.comm usbConfiguration,1,1 - 912               		.comm usbRxBuf,22,1 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 17 - - - 913               		.comm usbInputBufOffset,1,1 - 914               		.comm usbDeviceAddr,1,1 - 915               		.comm usbNewDeviceAddr,1,1 - 916               		.comm usbRxLen,1,1 - 917               		.comm usbCurrentTok,1,1 - 918               		.comm usbTxBuf,11,1 - 919               		.lcomm currentAddress,2 - 920               		.lcomm events,1 - 921               		.data - 922               		.type	usbMsgLen, @object - 923               		.size	usbMsgLen, 1 - 924               	usbMsgLen: - 925 0001 FF        		.byte	-1 - 926               		.lcomm usbMsgFlags,1 - 927               		.lcomm state,1 - 928               		.type	replyBuffer.1776, @object - 929               		.size	replyBuffer.1776, 7 - 930               	replyBuffer.1776: - 931 0002 01        		.byte	1 - 932 0003 40        		.byte	64 - 933 0004 00        		.byte	0 - 934 0005 FA        		.byte	-6 - 935 0006 14        		.byte	20 - 936 0007 00        		.byte	0 - 937 0008 00        		.byte	0 - 938               		.lcomm vectorTemp,4 - 939               		.lcomm wasReset.1703,1 - 940               	.global __do_copy_data - 941               	.global __do_clear_bss -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s 			page 18 + 700               	 ;  190 "main.c" 1 + 701 0492 F894      		cli + 702               	 ;  0 "" 2 + 703               	/* #NOAPP */ + 704 0494 1BBE      		out 91-32,__zero_reg__ + 705 0496 15BA      		out 53-32,__zero_reg__ + 706 0498 1092 5F02 		sts 607,__zero_reg__ + 707 049c 1092 5E02 		sts 606,__zero_reg__ + 708               	/* #APP */ + 709               	 ;  206 "main.c" 1 + 710 04a0 00C0      		rjmp __vectors - 4 + 711               	 ;  0 "" 2 + 712               	/* #NOAPP */ + 713               	.L62: + 714 04a2 1092 0000 		sts events,__zero_reg__ + 715 04a6 00C0      		rjmp .L63 + 716               		.size	main, .-main + 717               	.global	usbTxLen + 718               		.data + 719               		.type	usbTxLen, @object + 720               		.size	usbTxLen, 1 + 721               	usbTxLen: + 722 0000 5A        		.byte	90 + 723               	.global	usbDescriptorString0 + 724               		.section	.progmem.data,"a",@progbits + 725               		.type	usbDescriptorString0, @object + 726               		.size	usbDescriptorString0, 4 + 727               	usbDescriptorString0: + 728 0000 04        		.byte	4 + 729 0001 03        		.byte	3 + 730 0002 09        		.byte	9 + 731 0003 04        		.byte	4 + 732               	.global	usbDescriptorStringVendor + 733               		.type	usbDescriptorStringVendor, @object + 734               		.size	usbDescriptorStringVendor, 34 + 735               	usbDescriptorStringVendor: + 736 0004 2203      		.word	802 + 737 0006 6300      		.word	99 + 738 0008 7200      		.word	114 + 739 000a 6500      		.word	101 + 740 000c 6100      		.word	97 + 741 000e 7400      		.word	116 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 14 + + + 742 0010 6900      		.word	105 + 743 0012 7600      		.word	118 + 744 0014 6500      		.word	101 + 745 0016 7000      		.word	112 + 746 0018 6F00      		.word	111 + 747 001a 6E00      		.word	110 + 748 001c 7900      		.word	121 + 749 001e 2E00      		.word	46 + 750 0020 6300      		.word	99 + 751 0022 6F00      		.word	111 + 752 0024 6D00      		.word	109 + 753               	.global	usbDescriptorStringDevice + 754               		.type	usbDescriptorStringDevice, @object + 755               		.size	usbDescriptorStringDevice, 12 + 756               	usbDescriptorStringDevice: + 757 0026 0C03      		.word	780 + 758 0028 7500      		.word	117 + 759 002a 4200      		.word	66 + 760 002c 6F00      		.word	111 + 761 002e 6F00      		.word	111 + 762 0030 7400      		.word	116 + 763               	.global	usbDescriptorDevice + 764               		.type	usbDescriptorDevice, @object + 765               		.size	usbDescriptorDevice, 18 + 766               	usbDescriptorDevice: + 767 0032 12        		.byte	18 + 768 0033 01        		.byte	1 + 769 0034 10        		.byte	16 + 770 0035 01        		.byte	1 + 771 0036 FF        		.byte	-1 + 772 0037 00        		.byte	0 + 773 0038 00        		.byte	0 + 774 0039 08        		.byte	8 + 775 003a C0        		.byte	-64 + 776 003b 16        		.byte	22 + 777 003c DC        		.byte	-36 + 778 003d 05        		.byte	5 + 779 003e 01        		.byte	1 + 780 003f 00        		.byte	0 + 781 0040 01        		.byte	1 + 782 0041 02        		.byte	2 + 783 0042 00        		.byte	0 + 784 0043 01        		.byte	1 + 785               	.global	usbDescriptorConfiguration + 786               		.type	usbDescriptorConfiguration, @object + 787               		.size	usbDescriptorConfiguration, 18 + 788               	usbDescriptorConfiguration: + 789 0044 09        		.byte	9 + 790 0045 02        		.byte	2 + 791 0046 12        		.byte	18 + 792 0047 00        		.byte	0 + 793 0048 01        		.byte	1 + 794 0049 01        		.byte	1 + 795 004a 00        		.byte	0 + 796 004b 80        		.byte	-128 + 797 004c 32        		.byte	50 + 798 004d 09        		.byte	9 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 15 + + + 799 004e 04        		.byte	4 + 800 004f 00        		.byte	0 + 801 0050 00        		.byte	0 + 802 0051 00        		.byte	0 + 803 0052 00        		.byte	0 + 804 0053 00        		.byte	0 + 805 0054 00        		.byte	0 + 806 0055 00        		.byte	0 + 807               		.comm usbMsgPtr,2,1 + 808               		.comm usbRxToken,1,1 + 809               		.comm usbConfiguration,1,1 + 810               		.comm usbRxBuf,22,1 + 811               		.comm usbInputBufOffset,1,1 + 812               		.comm usbDeviceAddr,1,1 + 813               		.comm usbNewDeviceAddr,1,1 + 814               		.comm usbRxLen,1,1 + 815               		.comm usbCurrentTok,1,1 + 816               		.comm usbTxBuf,11,1 + 817               		.lcomm currentAddress,2 + 818               		.lcomm events,1 + 819               		.lcomm vectorTemp,4 + 820               		.data + 821               		.type	usbMsgLen, @object + 822               		.size	usbMsgLen, 1 + 823               	usbMsgLen: + 824 0001 FF        		.byte	-1 + 825               		.lcomm usbMsgFlags,1 + 826               		.lcomm writeLength,1 + 827               		.type	replyBuffer.1756, @object + 828               		.size	replyBuffer.1756, 5 + 829               	replyBuffer.1756: + 830 0002 01        		.byte	1 + 831 0003 14        		.byte	20 + 832 0004 FA        		.byte	-6 + 833 0005 40        		.byte	64 + 834 0006 14        		.byte	20 + 835               		.lcomm wasReset.1698,1 + 836               	.global __do_copy_data + 837               	.global __do_clear_bss +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s 			page 16  DEFINED SYMBOLS                              *ABS*:00000000 main.c -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:2      *ABS*:0000003f __SREG__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:3      *ABS*:0000003e __SP_H__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:4      *ABS*:0000003d __SP_L__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:5      *ABS*:00000034 __CCP__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:6      *ABS*:00000000 __tmp_reg__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:7      *ABS*:00000001 __zero_reg__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:10     .text:00000000 writeFlashPage +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:2      *ABS*:0000003f __SREG__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:3      *ABS*:0000003e __SP_H__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:4      *ABS*:0000003d __SP_L__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:5      *ABS*:00000034 __CCP__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:6      *ABS*:00000000 __tmp_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:7      *ABS*:00000001 __zero_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:10     .text:00000000 writeFlashPage                               .bss:00000000 currentAddress -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:44     .text:0000001e writeWordToPageBuffer -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:927    .bss:00000005 vectorTemp -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:119    .text:00000098 fillFlashWithVectors -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:146    .text:000000be calibrateOscillator -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:221    .init3:00000000 PushMagicWord -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:245    .text:00000134 main +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:44     .text:0000001e writeWordToPageBuffer +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:818    .bss:00000003 vectorTemp +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:817    .bss:00000002 events +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:138    .text:000000b6 fillFlashWithVectors +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:166    .init3:00000000 PushMagicWord +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:190    .text:000000dc main                              *COM*:00000001 usbRxLen                              *COM*:00000001 usbInputBufOffset                              *COM*:00000016 usbRxBuf                              *COM*:00000001 usbRxToken                              *COM*:0000000b usbTxBuf -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:776    .data:00000000 usbTxLen -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:920    .bss:00000003 usbMsgFlags -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:926    .bss:00000004 state -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:919    .bss:00000002 events -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:930    .data:00000002 replyBuffer.1776 +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:721    .data:00000000 usbTxLen +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:819    .bss:00000007 usbMsgFlags +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:829    .data:00000002 replyBuffer.1756                              *COM*:00000002 usbMsgPtr +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:825    .bss:00000008 writeLength                              *COM*:00000001 usbNewDeviceAddr -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:815    .progmem.data:00000026 usbDescriptorDevice -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:837    .progmem.data:00000038 usbDescriptorConfiguration -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:782    .progmem.data:00000000 usbDescriptorString0 -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:790    .progmem.data:00000004 usbDescriptorStringVendor -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:803    .progmem.data:00000016 usbDescriptorStringDevice -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:875    .progmem.data:0000005a usbDescriptorHidReport +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:766    .progmem.data:00000032 usbDescriptorDevice +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:788    .progmem.data:00000044 usbDescriptorConfiguration +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:727    .progmem.data:00000000 usbDescriptorString0 +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:735    .progmem.data:00000004 usbDescriptorStringVendor +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:756    .progmem.data:00000026 usbDescriptorStringDevice                              *COM*:00000001 usbConfiguration -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:924    .data:00000001 usbMsgLen +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:823    .data:00000001 usbMsgLen                              *COM*:00000001 usbDeviceAddr -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccKpW58U.s:938    .bss:00000009 wasReset.1703 +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc8OMEVS.s:826    .bss:00000009 wasReset.1698                              *COM*:00000001 usbCurrentTok  UNDEFINED SYMBOLS -usbMeasureFrameLength  usbCrc16Append +calibrateOscillator  __vectors  __do_copy_data  __do_clear_bss diff --git a/firmware/main.hex b/firmware/main.hex index e0e59e1..c71b27a 100644 --- a/firmware/main.hex +++ b/firmware/main.hex @@ -1,149 +1,146 @@ -:101500004CC06AC096C068C067C066C065C064C091
 -:1015100063C062C061C060C05FC05EC05DC00403E4
 -:10152000090412036F0062006400650076002E005B
 -:1015300061007400100348004900440042006F003D
 -:101540006F0074001201100100000008C016DF05D2
 -:10155000000101020001090222000101008032099C
 -:101560000400000103000000092101010001222103
 -:1015700000070581030800C80600FF0901A1011545
 -:101580000026FF007508850195060900B202018555
 -:101590000295830900B20201C00011241FBECFE5ED
 -:1015A000D2E0DEBFCDBF00EB0F9307E00F9310E05A
 -:1015B000A0E6B0E0E4E1FEE102C005900D92AA369B
 -:1015C000B107D9F710E0AAE6B0E001C01D92AE392C
 -:1015D000B107E1F72AD21CC493CFA82FB92F80E01E
 -:1015E00090E041E050EA609530E009C02D918227FB
 -:1015F0009795879510F084279527305EC8F36F5F25
 -:10160000A8F30895EADF8D939D930895A6E08827B7
 -:101610009927AA9569F00197E1F3B399FCCFB39BA1
 -:10162000FECF81E09927A6B3019611F0A871D9F7F2
 -:101630000895CF93CFB7CF93C0915F02C03B21F401
 -:10164000C0915E02C73021F0CF91CFBFCF9157CF6D
 -:10165000CC27C395B39BE9F7B39B0BC0B39B09C0E1
 -:10166000B39B07C0B39B05C0B39B03C0B39B01C032
 -:10167000D5C00F92DF93C0918100DD27C857DF4F9F
 -:10168000012EB39B03C0DF910F90E6CF2F930F93F2
 -:101690001F934F932FEF4F6F06B303FB20F95F9318
 -:1016A0003F9350E03BE065C016B30126502953FD3F
 -:1016B000C89556B3012703FB25F92F7306B3B1F084
 -:1016C0005027102713FB26F906B22230F0F000C095
 -:1016D00016B3012703FB27F90126502906B224304F
 -:1016E000E8F54F77206816B30000F6CF50274F7DFE
 -:1016F000206206B2102F000000C006B30026502959
 -:10170000102713FB26F906B2E2CF4F7B06B3206405
 -:1017100000C0DACF01265029187106B269F14E7F58
 -:101720002160012F16B328C0002650294D7F06B234
 -:101730002260102F29C0012650294B7F06B2246059
 -:10174000012F2DC016B301265029477F28600000C5
 -:1017500006B22EC04F7E06B3206130C0422706B3CA
 -:10176000499300265029102706B24FEF13FB20F9AA
 -:10177000297F16B379F2187159F10126502906B262
 -:10178000012703FB21F9237F06B371F200265029BC
 -:101790003150D0F006B2102713FB22F9277E16B382
 -:1017A00051F201265029012703FB06B223F92F7CB1
 -:1017B00049F2000006B3102713FB24F90026502934
 -:1017C00006B22F7939F270CF10E21ABF002719C084
 -:1017D0003B503195C31BD04010E21ABF0881033C37
 -:1017E00009F10B34F9F020917F001981110F1213C8
 -:1017F000EDCF4A81441F093651F10D3211F0013EFF
 -:1018000029F7009386003F915F914F911F910F91AF
 -:101810002F91DF910F90CAB7C5FD1BCFCF91CFBFDE
 -:10182000CF91189520918600222369F310918400AE
 -:10183000112331F5343032F130938400209380004D
 -:10184000109181003BE0311B309381001BC000915F
 -:1018500084000130ACF40AE54F7091F430916000DF
 -:1018600034FD11C000936000C4E7D0E010C005272C
 -:1018700010E000C021C0052710E0C89508BB14C0C7
 -:101880003AE501C032ED032EC0E0D0E032E017B3FC
 -:101890001861C39A08B317BB58E120E84FEF20FF47
 -:1018A000052708BB279517951C3F28F700004552D0
 -:1018B000B0F720FF0527279508BB17951C3FB8F602
 -:1018C00029913A9561F7077E10918500110F08BBA9
 -:1018D000C250D04011F010937F0010E21ABF086090
 -:1018E00017B3177E402F477E54E05A95F1F708BB97
 -:1018F00017BB48BB88CFF894E0916A00F0916B0069
 -:10190000329785E080935700E89507B600FCFDCF3D
 -:101910007894089520916A0030916B00211531056B
 -:1019200089F124303105B1F044E12C3F340739F41A
 -:1019300080916F00909170008E579A4F0DC044E1D6
 -:101940002E3F340749F480917100909172008D57B9
 -:101950009A4F02C08FE79AECF894E0916A00F091F8
 -:101960006B0021E00C0120935700E8951124789436
 -:1019700080916A0090916B00029690936B00809327
 -:101980006A00089581E180935700E895E3CFCF93F3
 -:10199000DF93C0916A00D0916B00CF73D0708FEF4E
 -:1019A0009FEFB8DF2296C034D105CCF3A4DFDF91DE
 -:1019B000CF910895FF920F931F93CF93DF93C8E0C9
 -:1019C000D0E010E000E8F12EF00EF1BE1FDE9C0129
 -:1019D00089E0243338070CF41F2D0695219799F7D9
 -:1019E000812F815081BFE901012F10C00FDE845388
 -:1019F000994097FF03C0909581959F4F8C179D0745
 -:101A000014F401B7EC0181B78F5F81BF21B730E0DB
 -:101A1000812F90E001968217930744F701BFDF9171
 -:101A2000CF911F910F91FF900895DF93CF930F9265
 -:101A3000CDB7DEB788E10FB6F89481BD11BC0FBEFB
 -:101A400010926B0010926A00AC9A8BB780628BBFC9
 -:101A5000BB9A8FE49DE2A9E181509040A040E1F75C
 -:101A600000C00000BB987894EE24FF24809184008D
 -:101A7000282F235027FD19C190918100ECE0F0E060
 -:101A8000E91BF109E857FF4F909180009D3209F062
 -:101A9000B1C0283009F007C183EC809374008AE557
 -:101AA0008093600010926D009081292F20768181B3
 -:101AB0002223E9F0893081F48281823039F481E097
 -:101AC00080936E0097FD87C02FEF86C080916C00D9
 -:101AD000846080936C009AC1813009F097C182E6DE
 -:101AE00090E0909383008093820027E079C09281F8
 -:101AF00010927D00882331F410927E008DE790E0F3
 -:101B000022E064C0853019F49093850055C086307A
 -:101B100009F049C08381813019F484E495E11AC049
 -:101B2000823041F486E595E19093830080938200B2
 -:101B300022E235C08330F1F4992341F48EE195E13E
 -:101B4000909383008093820024E029C0913041F477
 -:101B500082E295E1909383008093820022E11FC08E
 -:101B60009230E1F484E395E19093830080938200C6
 -:101B700020E115C0813241F488E695E1909383001D
 -:101B80008093820029E00BC0823241F488E795E11E
 -:101B9000909383008093820021E201C020E080E4E2
 -:101BA00080936D001DC0883059F0893019F49093EE
 -:101BB000870002C08A3039F08DE790E020E006C04F
 -:101BC00087E890E002C08DE790E021E090938300E9
 -:101BD0008093820005C0268180E880936D0007C055
 -:101BE0008781882321F48681821708F4282F209387
 -:101BF000610059C090916D0097FF55C090916E00A3
 -:101C0000913061F4318192813496282F275030939E
 -:101C10006A0090936B0082E080936E008F01809148
 -:101C20006A0090916B00009749F4D8018D919C91C6
 -:101C300011979093700080936F0014C084309105C9
 -:101C400041F4F8018081918190937200809371003A
 -:101C500009C0F4E18A3F9F0728F081E18093570093
 -:101C6000E89512C0D8018D919D918D01298352DE96
 -:101C700080916A0090916B00029690936B00809324
 -:101C80006A002981225059F680916A0090916B0078
 -:101C90008F739070009739F080916C008260809310
 -:101CA0006C0010926100109284008091600084FFAB
 -:101CB00047C0809161008F3F09F442C0082F8930EE
 -:101CC00008F008E0801B809361008091740098E820
 -:101CD000892780937400002339F1E0918200F0910C
 -:101CE000830090916D00802F815096FF0CC090E092
 -:101CF0008A589F4FA5E7B0E024912D933196A817FD
 -:101D0000B907D1F70DC09F0190E08A589F4FA5E712
 -:101D1000B0E0F90141919F014D93A817B907C9F7A8
 -:101D2000F0938300E093820085E790E0602F6ADC07
 -:101D30000C5F0C3019F08FEF80936100009360000E
 -:101D400084E196B3987131F48150D9F710928500EF
 -:101D500010927F0001E0811100E0809173008017F4
 -:101D600039F0002319F4F89425DE78940093730079
 -:101D70008CE991E00197F1F7000080916C008823D5
 -:101D800021F40894E11CF11C02C0EE24FF2480FF22
 -:101D90000EC0F894E0916A00F0916B00329783E0F6
 -:101DA00080935700E89507B600FCFDCF78948091AA
 -:101DB0006C0081FF11C0A9E3B0E21197F1F700C0F8
 -:101DC000000080916A0090916B008F739070009773
 -:101DD00011F0DDDD01C08FDD80916C0082FD05C05A
 -:101DE000B1E5EB16B3ECFB0670F0E1E2F1EA3197F6
 -:101DF000F1F700C00000F8941BBE15BA10925F0204
 -:101E000010925E027BCB10926C0030CE20E0E8CEC8
 -:041E1000F894FFCF74
 -:0A1E14005AFF014000FA140000001C
 +:1015000039C057C083C055C054C053C052C051C029
 +:1015100050C04FC04EC04DC04CC04BC04AC0040369
 +:101520000904220363007200650061007400690011
 +:101530007600650070006F006E0079002E00630079
 +:101540006F006D000C03750042006F006F007400A7
 +:1015500012011001FF000008C016DC0501000102A5
 +:10156000000109021200010100803209040000009C
 +:101570000000000011241FBECFE5D2E0DEBFCDBFCA
 +:1015800000EB0F9307E00F9310E0A0E6B0E0E8EE69
 +:10159000FDE102C005900D92A836B107D9F710E021
 +:1015A000A8E6B0E001C01D92AC39B107E1F7FAD16D
 +:1015B00019C4A6CFA82FB92F80E090E041E050EAEF
 +:1015C000609530E009C02D9182279795879510F09E
 +:1015D00084279527305EC8F36F5FA8F30895EADF8C
 +:1015E0008D939D930895A6E088279927AA9569F081
 +:1015F0000197E1F3B399FCCFB39BFECF81E099272C
 +:10160000A6B3019611F0A871D9F70895CF93CFB77B
 +:10161000CF93C0915F02C03B21F4C0915E02C730FE
 +:1016200021F0CF91CFBFCF916ACFCC27C395B39B89
 +:10163000E9F7B39B0BC0B39B09C0B39B07C0B39B37
 +:1016400005C0B39B03C0B39B01C0D3C00F92DF930F
 +:10165000C0917F00DD27CA57DF4F012EB39B03C027
 +:10166000DF910F90E6CF2F930F931F934F932FEFA0
 +:101670004F6F06B303FB20F95F933F9350E03BE0CD
 +:1016800065C016B30126502953FDC89556B30127EE
 +:1016900003FB25F92F7306B3B1F05027102713FB76
 +:1016A00026F906B22230F0F000C016B3012703FB82
 +:1016B00027F90126502906B22430E8F54F77206833
 +:1016C00016B30000F6CF50274F7D206206B2102FD0
 +:1016D000000000C006B300265029102713FB26F98E
 +:1016E00006B2E2CF4F7B06B3206400C0DACF0126FA
 +:1016F0005029187106B269F14E7F2160012F16B38F
 +:1017000028C0002650294D7F06B22260102F29C024
 +:10171000012650294B7F06B22460012F2DC016B33D
 +:1017200001265029477F2860000006B22EC04F7E58
 +:1017300006B3206130C0422706B3499300265029E2
 +:10174000102706B24FEF13FB20F9297F16B379F269
 +:10175000187159F10126502906B2012703FB21F91E
 +:10176000237F06B371F2002650293150D0F006B223
 +:10177000102713FB22F9277E16B351F201265029B8
 +:10178000012703FB06B223F92F7C49F2000006B3C0
 +:10179000102713FB24F90026502906B22F7939F2BD
 +:1017A00070CF10E21ABF002717C03B503195C31B02
 +:1017B000D04010E21ABF0881033CF9F00B34E9F085
 +:1017C00020917D001981110F1213EDCF093651F1CF
 +:1017D0000D3211F0013E39F7009384003F915F9183
 +:1017E0004F911F910F912F91DF910F90CAB7C5FDB7
 +:1017F0001DCFCF91CFBFCF91189520918400222388
 +:1018000069F310918200112321F5343022F13093D5
 +:10181000820020937E0010917F003BE0311B3093CB
 +:101820007F0019C00091820001309CF40AE53091DC
 +:10183000600034FD11C000936000C2E7D0E010C02A
 +:10184000052710E000C021C0052710E0C89508BB9F
 +:1018500014C03AE501C032ED032EC0E0D0E032E022
 +:1018600017B31861C39A08B317BB58E120E84FEFCC
 +:1018700020FF052708BB279517951C3F28F7000078
 +:101880004552B0F720FF0527279508BB17951C3F49
 +:10189000B8F629913A9561F7077E10918300110FF0
 +:1018A00008BBC250D04011F010937D0010E21ABF67
 +:1018B000086017B3177E402F477E54E05A95F1F722
 +:1018C00008BB17BB48BB8ACFF894E0916800F09141
 +:1018D0006900329785E080935700E89507B600FCD1
 +:1018E000FDCF78940895209168003091690021150A
 +:1018F000310509F43FC024303105B1F044E12C3FFB
 +:10190000340739F480916B0090916C008E579A4F98
 +:101910000DC044E12E3F340749F480916D00909151
 +:101920006E008D579A4F02C08FE79AECF894E091C1
 +:101930006800F091690021E00C0120935700E895C0
 +:10194000112478944091680050916900FA01259122
 +:101950003491282339232817390729F080916A0008
 +:10196000816080936A004E5F5F4F5093690040939F
 +:101970006800089581E180935700E895D5CFCF9313
 +:10198000DF93C0916800D0916900CF73D0708FEF62
 +:101990009FEFA9DF2296C034D105CCF395DFDF910C
 +:1019A000CF910895DF93CF930F92CDB7DEB788E143
 +:1019B0000FB6F89481BD11BC0FBEE0E0F0E0859158
 +:1019C00094912AEC8F37920741F4E4E0F0E085919E
 +:1019D00094913AEC8F37930709F0D1DF10926900A8
 +:1019E0001092680087B3836087BBC09AC198AC9A95
 +:1019F0008BB780628BBFBB9A8FE49DE2A9E18150D7
 +:101A00009040A040E1F700C00000BB987894EE241D
 +:101A1000FF2420918200235027FDF9C080917F0090
 +:101A2000ECE0F0E0E81BF109EA57FF4F80917E00FF
 +:101A30008D3209F0A0C0283009F0E7C083EC809314
 +:101A400072008AE58093600010926F00908190761A
 +:101A50008181992311F1882341F482E690E09093EB
 +:101A600081008093800025E07CC0813079F4C098AB
 +:101A70008281809370008481958190936900809326
 +:101A80006800808187FD68C02FEF67C080916A0081
 +:101A9000846080936A0020E064C0928110927B0091
 +:101AA000882331F410927C008BE790E022E04FC055
 +:101AB000853019F49093830040C08630A9F5838166
 +:101AC000813019F480E595E104C0823041F482E66A
 +:101AD00095E1909381008093800022E121C08330C2
 +:101AE000F1F4992341F48EE195E190938100809384
 +:101AF000800024E015C0913041F482E295E190939A
 +:101B000081008093800022E20BC0923041F484E493
 +:101B100095E190938100809380002CE001C020E04B
 +:101B200080E480936F001DC0883059F0893019F42B
 +:101B30009093850002C08A3039F08BE790E020E076
 +:101B400006C085E890E002C08BE790E021E090932A
 +:101B500081008093800005C0268180E880936F001B
 +:101B600007C08781882321F48681821708F4282FF3
 +:101B7000209361004AC080916F0087FF46C080912A
 +:101B80007000821B809370008F018091680090919B
 +:101B90006900009749F4D8018D919C911197909319
 +:101BA0006C0080936B0014C08430910541F4F801FF
 +:101BB0008081918190936E0080936D0009C0F4E163
 +:101BC0008A3F9F0728F081E180935700E89512C073
 +:101BD000D8018D919D918D01298385DE80916800CA
 +:101BE0009091690002969093690080936800298122
 +:101BF000225059F680917000882339F480916A0050
 +:101C0000826080936A00109261001092820080913D
 +:101C1000600084FF47C0809161008F3F09F442C09B
 +:101C2000082F893008F008E0801B809361008091C4
 +:101C3000720098E8892780937200002339F1E091BF
 +:101C40008000F091810090916F00802F815096FF6D
 +:101C50000CC090E08C589F4FA3E7B0E024912D93E7
 +:101C60003196A817B907D1F70DC09F0190E08C58A5
 +:101C70009F4FA3E7B0E0F90141919F014D93A81751
 +:101C8000B907C9F7F0938100E093800083E790E003
 +:101C9000602FA5DC0C5F0C3019F08FEF8093610092
 +:101CA0000093600084E196B3987131F48150D9F7C4
 +:101CB0001092830010927D0001E0811100E080917C
 +:101CC0007100801739F0002319F4F89451D07894FA
 +:101CD000009371008CE991E00197F1F70000809189
 +:101CE0006A00882321F40894E11CF11C02C0EE2450
 +:101CF000FF2480FF0EC0F894E0916800F091690025
 +:101D0000329783E080935700E89507B600FCFDCF3B
 +:101D1000789480916A0081FF11C0A9E3B0E2119725
 +:101D2000F1F700C0000080916800909169008F7306
 +:101D30009070009711F023DE01C0C6DD80916A002B
 +:101D400082FD05C0B1E5EB16B3ECFB0670F0E1E2F5
 +:101D5000F1EA3197F1F700C00000F8941BBE15BA04
 +:101D600010925F0210925E02C9CB10926A0051CEAF
 +:101D7000FF920F931F93CF93DF93C8E0D0E010E062
 +:101D800000E8F12EF00EF1BE2EDC29E0843392073C
 +:101D90000CF41F2D06952197A1F7212F215021BF6B
 +:101DA000EC01012F10C01FDC8453994097FF03C042
 +:101DB000909581959F4F8C179D0714F401B7EC0106
 +:101DC00081B78F5F81BF21B730E0812F90E001960E
 +:101DD0008217930744F701BFDF91CF911F910F91B5
 +:081DE000FF900895F894FFCF75
 +:081DE8005AFF0114FA40140037
  :0400000300001500E4
  :00000001FF
 diff --git a/firmware/main.map b/firmware/main.map index 2b663ae..fddc06e 100644 --- a/firmware/main.map +++ b/firmware/main.map @@ -27,6 +27,11 @@ Discarded input sections   .bss           0x00000000        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o   .data          0x00000000        0x0 usbdrv/usbdrvasm.o   .bss           0x00000000        0x0 usbdrv/usbdrvasm.o + .text          0x00000000        0x0 usbdrv/oddebug.o + .data          0x00000000        0x0 usbdrv/oddebug.o + .bss           0x00000000        0x0 usbdrv/oddebug.o + .data          0x00000000        0x0 libs-device/osccal.o + .bss           0x00000000        0x0 libs-device/osccal.o   .text          0x00000000        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o)   .data          0x00000000        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o)   .bss           0x00000000        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o) @@ -55,7 +60,9 @@ Linker script and memory map  LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o  LOAD usbdrv/usbdrvasm.o +LOAD usbdrv/oddebug.o  LOAD main.o +LOAD libs-device/osccal.o  Address of section .text set to 0x1500  LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a  LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/libc.a @@ -151,7 +158,7 @@ LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a  .rela.plt   *(.rela.plt) -.text           0x00001500      0x914 +.text           0x00001500      0x8e8   *(.vectors)   .vectors       0x00001500       0x1e /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o                  0x00001500                __vectors @@ -159,50 +166,48 @@ LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a   *(.vectors)   *(.progmem.gcc*)   *(.progmem*) - .progmem.data  0x0000151e       0x7b main.o + .progmem.data  0x0000151e       0x56 main.o                  0x0000151e                usbDescriptorString0                  0x00001522                usbDescriptorStringVendor -                0x00001534                usbDescriptorStringDevice -                0x00001544                usbDescriptorDevice -                0x00001556                usbDescriptorConfiguration -                0x00001578                usbDescriptorHidReport -                0x0000159a                . = ALIGN (0x2) - *fill*         0x00001599        0x1 00 -                0x0000159a                __trampolines_start = . +                0x00001544                usbDescriptorStringDevice +                0x00001550                usbDescriptorDevice +                0x00001562                usbDescriptorConfiguration +                0x00001574                . = ALIGN (0x2) +                0x00001574                __trampolines_start = .   *(.trampolines) - .trampolines   0x0000159a        0x0 linker stubs + .trampolines   0x00001574        0x0 linker stubs   *(.trampolines*) -                0x0000159a                __trampolines_end = . +                0x00001574                __trampolines_end = .   *(.jumptables)   *(.jumptables*)   *(.lowtext)   *(.lowtext*) -                0x0000159a                __ctors_start = . +                0x00001574                __ctors_start = .   *(.ctors) -                0x0000159a                __ctors_end = . -                0x0000159a                __dtors_start = . +                0x00001574                __ctors_end = . +                0x00001574                __dtors_start = .   *(.dtors) -                0x0000159a                __dtors_end = . +                0x00001574                __dtors_end = .   SORT(*)(.ctors)   SORT(*)(.dtors)   *(.init0) - .init0         0x0000159a        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o -                0x0000159a                __init + .init0         0x00001574        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o +                0x00001574                __init   *(.init0)   *(.init1)   *(.init1)   *(.init2) - .init2         0x0000159a        0xc /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o + .init2         0x00001574        0xc /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o   *(.init2)   *(.init3) - .init3         0x000015a6        0x8 main.o -                0x000015a6                PushMagicWord + .init3         0x00001580        0x8 main.o +                0x00001580                PushMagicWord   *(.init3)   *(.init4) - .init4         0x000015ae       0x16 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_copy_data.o) -                0x000015ae                __do_copy_data - .init4         0x000015c4       0x10 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_clear_bss.o) -                0x000015c4                __do_clear_bss + .init4         0x00001588       0x16 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_copy_data.o) +                0x00001588                __do_copy_data + .init4         0x0000159e       0x10 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_clear_bss.o) +                0x0000159e                __do_clear_bss   *(.init4)   *(.init5)   *(.init5) @@ -213,39 +218,40 @@ LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a   *(.init8)   *(.init8)   *(.init9) - .init9         0x000015d4        0x4 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o + .init9         0x000015ae        0x4 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o   *(.init9)   *(.text) - .text          0x000015d8        0x2 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o -                0x000015d8                __vector_10 -                0x000015d8                __vector_12 -                0x000015d8                __bad_interrupt -                0x000015d8                __vector_6 -                0x000015d8                __vector_3 -                0x000015d8                __vector_11 -                0x000015d8                __vector_13 -                0x000015d8                __vector_7 -                0x000015d8                __vector_5 -                0x000015d8                __vector_4 -                0x000015d8                __vector_9 -                0x000015d8                __vector_8 -                0x000015d8                __vector_14 -                0x000015d8                __vector_1 - .text          0x000015da      0x31c usbdrv/usbdrvasm.o -                0x000015da                usbCrc16 -                0x00001604                usbCrc16Append -                0x0000160c                usbMeasureFrameLength -                0x00001632                __vector_2 - .text          0x000018f6      0x51a main.o -                0x000019b4                calibrateOscillator -                0x00001a2a                main -                0x00001e10                . = ALIGN (0x2) + .text          0x000015b2        0x2 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/../../../../avr/lib/avr25/crttn85.o +                0x000015b2                __vector_10 +                0x000015b2                __vector_12 +                0x000015b2                __bad_interrupt +                0x000015b2                __vector_6 +                0x000015b2                __vector_3 +                0x000015b2                __vector_11 +                0x000015b2                __vector_13 +                0x000015b2                __vector_7 +                0x000015b2                __vector_5 +                0x000015b2                __vector_4 +                0x000015b2                __vector_9 +                0x000015b2                __vector_8 +                0x000015b2                __vector_14 +                0x000015b2                __vector_1 + .text          0x000015b4      0x314 usbdrv/usbdrvasm.o +                0x000015b4                usbCrc16 +                0x000015de                usbCrc16Append +                0x000015e6                usbMeasureFrameLength +                0x0000160c                __vector_2 + .text          0x000018c8      0x4a8 main.o +                0x000019a4                main + .text          0x00001d70       0x74 libs-device/osccal.o +                0x00001d70                calibrateOscillator +                0x00001de4                . = ALIGN (0x2)   *(.text.*) -                0x00001e10                . = ALIGN (0x2) +                0x00001de4                . = ALIGN (0x2)   *(.fini9) - .fini9         0x00001e10        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o) -                0x00001e10                exit -                0x00001e10                _exit + .fini9         0x00001de4        0x0 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o) +                0x00001de4                exit +                0x00001de4                _exit   *(.fini9)   *(.fini8)   *(.fini8) @@ -264,51 +270,51 @@ LOAD /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a   *(.fini1)   *(.fini1)   *(.fini0) - .fini0         0x00001e10        0x4 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o) + .fini0         0x00001de4        0x4 /usr/local/CrossPack-AVR-20120217/lib/gcc/avr/4.5.1/avr25/libgcc.a(_exit.o)   *(.fini0) -                0x00001e14                _etext = . +                0x00001de8                _etext = . -.data           0x00800060        0xa load address 0x00001e14 +.data           0x00800060        0x8 load address 0x00001de8                  0x00800060                PROVIDE (__data_start, .)   *(.data) - .data          0x00800060        0x9 main.o + .data          0x00800060        0x7 main.o                  0x00800060                usbTxLen   *(.data*)   *(.rodata)   *(.rodata*)   *(.gnu.linkonce.d*) -                0x0080006a                . = ALIGN (0x2) - *fill*         0x00800069        0x1 00 -                0x0080006a                _edata = . -                0x0080006a                PROVIDE (__data_end, .) +                0x00800068                . = ALIGN (0x2) + *fill*         0x00800067        0x1 00 +                0x00800068                _edata = . +                0x00800068                PROVIDE (__data_end, .) -.bss            0x0080006a       0x34 -                0x0080006a                PROVIDE (__bss_start, .) +.bss            0x00800068       0x34 +                0x00800068                PROVIDE (__bss_start, .)   *(.bss) - .bss           0x0080006a        0xa main.o + .bss           0x00800068        0xa main.o   *(.bss*)   *(COMMON) - COMMON         0x00800074       0x2a main.o -                0x00800074                usbTxBuf -                0x0080007f                usbDeviceAddr -                0x00800080                usbRxToken -                0x00800081                usbInputBufOffset -                0x00800082                usbMsgPtr -                0x00800084                usbRxLen -                0x00800085                usbNewDeviceAddr -                0x00800086                usbCurrentTok -                0x00800087                usbConfiguration -                0x00800088                usbRxBuf -                0x0080009e                PROVIDE (__bss_end, .) -                0x00001e14                __data_load_start = LOADADDR (.data) -                0x00001e1e                __data_load_end = (__data_load_start + SIZEOF (.data)) - -.noinit         0x0080009e        0x0 -                0x0080009e                PROVIDE (__noinit_start, .) + COMMON         0x00800072       0x2a main.o +                0x00800072                usbTxBuf +                0x0080007d                usbDeviceAddr +                0x0080007e                usbRxToken +                0x0080007f                usbInputBufOffset +                0x00800080                usbMsgPtr +                0x00800082                usbRxLen +                0x00800083                usbNewDeviceAddr +                0x00800084                usbCurrentTok +                0x00800085                usbConfiguration +                0x00800086                usbRxBuf +                0x0080009c                PROVIDE (__bss_end, .) +                0x00001de8                __data_load_start = LOADADDR (.data) +                0x00001df0                __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit         0x0080009c        0x0 +                0x0080009c                PROVIDE (__noinit_start, .)   *(.noinit*) -                0x0080009e                PROVIDE (__noinit_end, .) -                0x0080009e                _end = . -                0x0080009e                PROVIDE (__heap_start, .) +                0x0080009c                PROVIDE (__noinit_end, .) +                0x0080009c                _end = . +                0x0080009c                PROVIDE (__heap_start, .)  .eeprom         0x00810000        0x0   *(.eeprom*) diff --git a/firmware/main.o b/firmware/main.oBinary files differ index efd5d65..18cd008 100644 --- a/firmware/main.o +++ b/firmware/main.o diff --git a/firmware/temp-dump.bin b/firmware/temp-dump.binBinary files differ new file mode 100644 index 0000000..c6f4c8e --- /dev/null +++ b/firmware/temp-dump.bin diff --git a/firmware/upload.rb b/firmware/upload.rb index 7253ef5..c68b02c 100644 --- a/firmware/upload.rb +++ b/firmware/upload.rb @@ -98,7 +98,7 @@ thinklet = thinklets.first  puts "First thinklet: #{thinklet.info.inspect}" -test_data = ("---- Hello World! ----" * 10).encode("BINARY") +test_data = ("---- Hello World! ----" * 1).encode("BINARY")  puts "Attempting to write '#{test_data}' to first thinklet's program memory"  thinklet.program = test_data diff --git a/firmware/usbconfig.h b/firmware/usbconfig.h index 929d5e2..e046c00 100644 --- a/firmware/usbconfig.h +++ b/firmware/usbconfig.h @@ -1,64 +1,49 @@  /* Name: usbconfig.h - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers   * Author: Christian Starkjohann - * Creation Date: 2007-03-13 + * Creation Date: 2005-04-01   * Tabsize: 4 - * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt) - * This Revision: $Id: usbconfig.h 693 2008-11-14 15:09:37Z cs $ + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig.h 799 2010-07-27 17:30:13Z cs $   */  #ifndef __usbconfig_h_included__  #define __usbconfig_h_included__ -/* -General Description: -This file contains the configuration options for the USB driver. +/* YOU SHOULD NOT NEED TO MODIFY THIS FILE! All configurations are supposed + * to go into bootloaderconfig.h! + */ -Please note that the usbdrv contains a usbconfig-prototype.h file now. We -recommend that you use that file as a template because it will always list -the newest features and options. -*/ +/* ---------------------------- Hardware Config ---------------------------- */ -/* Fetch the hardware configuration from bootloaderconfig.h so that we have a - * single file where hardware settings are stored. - * Do not edit the functional settings below. - */ -#include "bootloaderconfig.h" +/* All the port and pin assignments, as well as the clock speed and CRC +   setting are now in bootloaderconfig.h: */ -#define USB_PUBLIC static -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ -  -//#if USB_CFG_CLOCK_KHZ==16500 -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH   1 -#include "osccal.h" -//#else -//#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH   0 -//#endif -/* define this macro to 1 if you want the function usbMeasureFrameLength() - * compiled in. This function can be used to calibrate the AVR's RC oscillator. - */ +#include "bootloaderconfig.h"  /* --------------------------- Functional Range ---------------------------- */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT    1 +#define USB_CFG_HAVE_INTRIN_ENDPOINT    0  /* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint 1. + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number).   */  #define USB_CFG_HAVE_INTRIN_ENDPOINT3   0  /* Define this to 1 if you want to compile a version with three endpoints: The - * default control endpoint 0, an interrupt-in endpoint 1 and an interrupt-in - * endpoint 3. You must also enable endpoint 1 above. + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.   */ -#define USB_CFG_SUPPRESS_INTR_CODE      1 -/* Define this to 1 if you want to declare interrupt-in endpoints, but don't - * want to send any data over them. If this macro is defined to 1, functions - * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if - * you need the interrupt-in endpoints in order to comply to an interface - * (e.g. HID), but never want to send any data. This option saves a couple - * of bytes in flash memory and the transmit buffers in RAM. +#define USB_CFG_EP3_NUMBER              3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN           USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration!   */  #define USB_CFG_IMPLEMENT_HALT          0  /* Define this to 1 if you also want to implement the ENDPOINT_HALT feature @@ -66,16 +51,28 @@ the newest features and options.   * it is required by the standard. We have made it a config option because it   * bloats the code considerably.   */ -#define USB_CFG_INTR_POLL_INTERVAL      200 +#define USB_CFG_SUPPRESS_INTR_CODE      0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL      10  /* If you compile a version with endpoint 1 (interrupt-in), this is the poll   * interval. The value is in milliseconds and must not be less than 10 ms for   * low speed devices.   */ +#ifndef USB_CFG_IS_SELF_POWERED // allow bootloaderconfig.h to override  #define USB_CFG_IS_SELF_POWERED         0 +#endif  /* Define this to 1 if the device has its own power supply. Set it to 0 if the   * device is powered from the USB bus.   */ +#ifndef USB_CFG_MAX_BUS_POWER   // allow bootloaderconfig.h to override  #define USB_CFG_MAX_BUS_POWER           100 +#endif  /* Set this variable to the maximum USB bus power consumption of your device.   * The value is in milliamperes. [It will be divided by two since USB   * communicates power requirements in units of 2 mA.] @@ -92,54 +89,55 @@ the newest features and options.   * usbFunctionSetup(). This saves a couple of bytes.   */  #define USB_CFG_IMPLEMENT_FN_WRITEOUT   0 -/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoint 1. +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.   * You must implement the function usbFunctionWriteOut() which receives all - * interrupt/bulk data sent to endpoint 1. + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'.   */  #define USB_CFG_HAVE_FLOWCONTROL        0  /* Define this to 1 if you want flowcontrol over USB data. See the definition   * of the macros usbDisableAllRequests() and usbEnableAllRequests() in   * usbdrv.h.   */ -#define TIMER0_PRESCALING           64 /* must match the configuration for TIMER0 in main */ -#define TOLERATED_DEVIATION_PPT     5  /* max clock deviation before we tune in 1/10 % */ -/* derived constants: */ -#define EXPECTED_TIMER0_INCREMENT   ((F_CPU / (1000 * TIMER0_PRESCALING)) & 0xff) -#define TOLERATED_DEVIATION         (TOLERATED_DEVIATION_PPT * F_CPU / (1000000 * TIMER0_PRESCALING)) -#ifdef __ASSEMBLER__ -macro tuneOsccal -    push    YH                              ;[0] -    clr     YH                              ;[2] -    in      YL, TCNT0                       ;[3] -    out     TCNT0, YH                       ;[4] -    subi    YL, EXPECTED_TIMER0_INCREMENT   ;[5] -#if OSCCAL > 0x3f -    lds     YH, OSCCAL                      ;[6] -#else -    in      YH, OSCCAL                      ;[6] -#endif -    cpi     YL, TOLERATED_DEVIATION + 1     ;[7] -    brmi    notTooHigh                      ;[8] -    subi    YH, 1                           ;[9] clock rate was too high -    rjmp    osctuneDone                     ;[10] -notTooHigh: -    cpi     YL, -TOLERATED_DEVIATION        ;[10] -    brpl    osctuneDone                     ;[11] not too low -    inc     YH                              ;[12] clock rate was too low -osctuneDone: -#if OSCCAL > 0x3f -    sts     OSCCAL, YH                      ;[12-13] store tuned value -#else -    out     OSCCAL, YH                      ;[12-13] store tuned value -#endif -tuningOverflow: -    pop     YH                              ;[14] -    endm                                    ;[16] max number of cycles -#endif -#if F_CPU == 12800000 -#   define USB_SOF_HOOK        tuneOsccal -#endif -/* This macro (if defined) is executed in the assembler module when a +#define USB_CFG_DRIVER_FLASH_PAGE       0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS          0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len)     if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts)     if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK()              hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF                   0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + *     in      YL, TCNT0 + *     sts     timer0Snapshot, YL + *     endm + * #endif + * #define USB_SOF_HOOK                    myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a   * Start Of Frame condition is detected. It is recommended to define it to   * the name of an assembler macro which is defined here as well so that more   * than one assembler instruction can be used. The macro may use the register @@ -151,39 +149,64 @@ tuningOverflow:   * Please note that Start Of Frame detection works only if D- is wired to the   * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!   */ +#define USB_CFG_CHECK_DATA_TOGGLING     0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +//#if USB_CFG_CLOCK_KHZ==16500 +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH   1 +#include "osccal.h" +//#else +//#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH   0 +//#endif +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC                0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */  /* -------------------------- Device Description --------------------------- */ -#define  USB_CFG_VENDOR_ID       0xc0, 0x16 +#define USB_CFG_VENDOR_ID  0xc0, 0x16 /* = 0x16c0 = 5824 = voti.nl */  /* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you use obdev's free shared - * VID/PID pair. Be sure to read USBID-License.txt for rules! + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!   */ -#define  USB_CFG_DEVICE_ID       0xdf, 0x05 +#define  USB_CFG_DEVICE_ID       0xdc, 0x05 /* = 0x05dc = 1500 */  /* This is the ID of the product, low byte first. It is interpreted in the   * scope of the vendor ID. If you have registered your own VID with usb.org   * or if you have licensed a PID from somebody else, define it here. Otherwise - * you use obdev's free shared VID/PID pair. Be sure to read the rules in - * USBID-License.txt! + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details!   */ -#define USB_CFG_DEVICE_VERSION  0x00, 0x01 +#define USB_CFG_DEVICE_VERSION  0x01, 0x00  /* Version number of the device: Minor number first, then major number.   */ -#define USB_CFG_VENDOR_NAME     'o', 'b', 'd', 'e', 'v', '.', 'a', 't' -#define USB_CFG_VENDOR_NAME_LEN 8 +#define USB_CFG_VENDOR_NAME 'c','r','e','a','t','i','v','e','p','o','n','y','.','c','o','m' +#define USB_CFG_VENDOR_NAME_LEN 16  /* These two values define the vendor name returned by the USB device. The name   * must be given as a list of characters under single quotes. The characters   * are interpreted as Unicode (UTF-16) entities.   * If you don't want a vendor name string, undefine these macros.   * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USBID-License.txt for + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for   * details.   */ -#define USB_CFG_DEVICE_NAME     'H', 'I', 'D', 'B', 'o', 'o', 't' -#define USB_CFG_DEVICE_NAME_LEN 7 +#define USB_CFG_DEVICE_NAME 'u','B','o','o','t' +#define USB_CFG_DEVICE_NAME_LEN 5  /* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USBID-License.txt before you assign a name if you - * use a shared VID/PID. + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID.   */  /*#define USB_CFG_SERIAL_NUMBER   'N', 'o', 'n', 'e' */  /*#define USB_CFG_SERIAL_NUMBER_LEN   0 */ @@ -194,19 +217,30 @@ tuningOverflow:   * to fine tune control over USB descriptors such as the string descriptor   * for the serial number.   */ -#define USB_CFG_DEVICE_CLASS        0 +#define USB_CFG_DEVICE_CLASS        0xff    /* set to 0 if deferred to interface */  #define USB_CFG_DEVICE_SUBCLASS     0  /* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific".   */ -#define USB_CFG_INTERFACE_CLASS     3   /* HID */ +#define USB_CFG_INTERFACE_CLASS     0   /* define class here if not at device level */  #define USB_CFG_INTERFACE_SUBCLASS  0  #define USB_CFG_INTERFACE_PROTOCOL  0  /* See USB specification if you want to conform to an existing device class or - * protocol. + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM   */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    33  /* total length of report descriptor */ +/* #define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    42 */  /* Define this to the length of the HID report descriptor, if you implement   * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +#define USB_PUBLIC static +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory.   */  /* ------------------- Fine Control over USB Descriptors ------------------- */ @@ -219,7 +253,9 @@ tuningOverflow:   * no properties are defined or if they are 0, the default descriptor is used.   * Possible properties are:   *   + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - *     at runtime via usbFunctionDescriptor(). + *     at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + *     used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + *     you want RAM pointers.   *   + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found   *     in static memory is in RAM, not in flash memory.   *   + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), @@ -251,6 +287,12 @@ tuningOverflow:   *   USB_CFG_DESCR_PROPS_HID_REPORT   *   USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)   * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int  serialNumberDescriptor[] = { + *     USB_STRING_DESCRIPTOR_HEADER(6), + *     'S', 'e', 'r', 'i', 'a', 'l' + * };   */  #define USB_CFG_DESCR_PROPS_DEVICE                  0 @@ -264,20 +306,4 @@ tuningOverflow:  #define USB_CFG_DESCR_PROPS_HID_REPORT              0  #define USB_CFG_DESCR_PROPS_UNKNOWN                 0 -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG            MCUCR */ -/* #define USB_INTR_CFG_SET        ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR        0 */ -/* #define USB_INTR_ENABLE         GIMSK */ -/* #define USB_INTR_ENABLE_BIT     INT0 */ -/* #define USB_INTR_PENDING        GIFR */ -/* #define USB_INTR_PENDING_BIT    INTF0 */ -  #endif /* __usbconfig_h_included__ */ diff --git a/firmware/usbdrv/oddebug.c.lst b/firmware/usbdrv/oddebug.c.lst index 72040ab..45b7879 100644 --- a/firmware/usbdrv/oddebug.c.lst +++ b/firmware/usbdrv/oddebug.c.lst @@ -1,4 +1,4 @@ -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s 			page 1 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s 			page 1     1               		.file	"oddebug.c" @@ -8,16 +8,16 @@ GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s 			page     5               	__CCP__ = 0x34     6               	__tmp_reg__ = 0     7               	__zero_reg__ = 1 -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s 			page 2 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s 			page 2  DEFINED SYMBOLS                              *ABS*:00000000 oddebug.c -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s:2      *ABS*:0000003f __SREG__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s:3      *ABS*:0000003e __SP_H__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s:4      *ABS*:0000003d __SP_L__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s:5      *ABS*:00000034 __CCP__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s:6      *ABS*:00000000 __tmp_reg__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccdlOM9B.s:7      *ABS*:00000001 __zero_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s:2      *ABS*:0000003f __SREG__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s:3      *ABS*:0000003e __SP_H__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s:4      *ABS*:0000003d __SP_L__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s:5      *ABS*:00000034 __CCP__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s:6      *ABS*:00000000 __tmp_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cct8KN9m.s:7      *ABS*:00000001 __zero_reg__  NO UNDEFINED SYMBOLS diff --git a/firmware/usbdrv/oddebug.o b/firmware/usbdrv/oddebug.oBinary files differ new file mode 100644 index 0000000..b772817 --- /dev/null +++ b/firmware/usbdrv/oddebug.o diff --git a/firmware/usbdrv/usbdrvasm.o b/firmware/usbdrv/usbdrvasm.oBinary files differ index 3894ce9..4461d11 100644 --- a/firmware/usbdrv/usbdrvasm.o +++ b/firmware/usbdrv/usbdrvasm.o | 
