Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
-uchar usbFunctionSetup(uchar data[8])
+usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
{
usbRequest_t *rq = (void *)data;
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);
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);
}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 */
}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 */
}else if(rq->bRequest >= USBASP_FUNC_READFLASH && rq->bRequest <= USBASP_FUNC_SETLONGADDRESS){
currentAddress.w[0] = rq->wValue.word;
if(rq->bRequest == USBASP_FUNC_SETLONGADDRESS){
}else if(rq->bRequest >= USBASP_FUNC_READFLASH && rq->bRequest <= USBASP_FUNC_SETLONGADDRESS){
currentAddress.w[0] = rq->wValue.word;
if(rq->bRequest == USBASP_FUNC_SETLONGADDRESS){
#if HAVE_EEPROM_PAGED_ACCESS
currentRequest = rq->bRequest;
#endif
#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){
}
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){