From: Stephan Baerwolf Date: Sun, 5 May 2013 18:35:45 +0000 (+0200) Subject: step-by-step migrate to new usbdrv API (allow USB_CFG_LONG_TRANSFERS) X-Git-Tag: v0.96.1~5 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/e693c8b8e91713770eae45cce80ca46ef4820705 step-by-step migrate to new usbdrv API (allow USB_CFG_LONG_TRANSFERS) Signed-off-by: Stephan Baerwolf --- diff --git a/firmware/main.c b/firmware/main.c index 2b44ac3..b8e17a0 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -371,19 +371,19 @@ defined (__AVR_ATmega2561__) } -uchar usbFunctionSetup(uchar data[8]) +usbMsgLen_t usbFunctionSetup(uchar data[8]) { usbRequest_t *rq = (void *)data; -uchar len = 0; +usbMsgLen_t len = 0; static uchar replyBuffer[4]; usbMsgPtr = (usbMsgPtr_t)replyBuffer; if(rq->bRequest == USBASP_FUNC_TRANSMIT){ /* emulate parts of ISP protocol */ replyBuffer[3] = usbFunctionSetup_USBASP_FUNC_TRANSMIT(rq); - len = 4; + len = (usbMsgLen_t)4; }else if((rq->bRequest == USBASP_FUNC_ENABLEPROG) || (rq->bRequest == USBASP_FUNC_SETISPSCK)){ /* replyBuffer[0] = 0; is never touched and thus always 0 which means success */ - len = 1; + len = (usbMsgLen_t)1; }else if(rq->bRequest >= USBASP_FUNC_READFLASH && rq->bRequest <= USBASP_FUNC_SETLONGADDRESS){ currentAddress.w[0] = rq->wValue.word; if(rq->bRequest == USBASP_FUNC_SETLONGADDRESS){ @@ -397,7 +397,7 @@ static uchar replyBuffer[4]; #if HAVE_EEPROM_PAGED_ACCESS currentRequest = rq->bRequest; #endif - len = 0xff; /* hand over to usbFunctionRead() / usbFunctionWrite() */ + len = USB_NO_MSG; /* hand over to usbFunctionRead() / usbFunctionWrite() */ } }else if(rq->bRequest == USBASP_FUNC_DISCONNECT){