From ff8457ce060a4f5ece83612bbc1eae298344baae Mon Sep 17 00:00:00 2001 From: Jenna Fox Date: Mon, 24 Sep 2012 01:49:35 +1000 Subject: remove redundant UBOOT_VERSION part of :get_info usb function --- firmware/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'firmware/main.c') diff --git a/firmware/main.c b/firmware/main.c index 1b0369c..3787850 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -8,6 +8,8 @@ * License: GNU GPL v2 (see License.txt) * This Revision: $Id: main.c 786 2010-05-30 20:41:40Z cs $ */ + +#define UBOOT_VERSION 1 #include #include @@ -23,7 +25,6 @@ static void leaveBootloader() __attribute__((__noreturn__)); #include "bootloaderconfig.h" #include "usbdrv/usbdrv.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 12 @@ -59,11 +60,11 @@ static void leaveBootloader() __attribute__((__noreturn__)); #define addr_t uint -typedef union longConverter{ - addr_t l; - uint w[sizeof(addr_t)/2]; - uchar b[sizeof(addr_t)]; -} longConverter_t; +// typedef union longConverter{ +// addr_t l; +// uint w[sizeof(addr_t)/2]; +// uchar b[sizeof(addr_t)]; +// } longConverter_t; //////// Stuff Bluebie Added #define PROGMEM_SIZE (BOOTLOADER_ADDRESS - 6) @@ -170,8 +171,7 @@ static void fillFlashWithVectors(void) { static uchar usbFunctionSetup(uchar data[8]) { usbRequest_t *rq = (void *)data; - static uchar replyBuffer[5] = { - UBOOT_VERSION, + static uchar replyBuffer[4] = { (((uint)PROGMEM_SIZE) >> 8) & 0xff, ((uint)PROGMEM_SIZE) & 0xff, SPM_PAGESIZE, @@ -180,7 +180,7 @@ static uchar usbFunctionSetup(uchar data[8]) { if (rq->bRequest == 0) { // get device info usbMsgPtr = replyBuffer; - return 5; + return 4; } else if (rq->bRequest == 1) { // write page writeLength = rq->wValue.word; -- cgit v1.2.3