DFU_MANIFEST_POLL_TIMEOUT;
}
-static void handle_getstatus(struct usb_request *req)
+static int handle_getstatus(struct usb_request *req)
{
struct dfu_status *dstat = (struct dfu_status *)req->buf;
struct f_dfu *f_dfu = req->context;
dstat->bStatus = f_dfu->dfu_status;
dstat->bState = f_dfu->dfu_state;
dstat->iString = 0;
+
+ return sizeof(struct dfu_status);
}
static int handle_getstate(struct usb_request *req)
switch (ctrl->bRequest) {
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);
switch (ctrl->bRequest) {
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);
value = RET_ZLP;
break;
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);
switch (ctrl->bRequest) {
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);
switch (ctrl->bRequest) {
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_dfuERROR;
value = RET_ZLP;
break;
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);
case USB_REQ_DFU_GETSTATUS:
/* We're MainfestationTolerant */
f_dfu->dfu_state = DFU_STATE_dfuMANIFEST;
- handle_getstatus(req);
+ value = handle_getstatus(req);
f_dfu->blk_seq_num = 0;
- value = RET_STAT_LEN;
req->complete = dnload_request_flush;
break;
case USB_REQ_DFU_GETSTATE:
case USB_REQ_DFU_GETSTATUS:
/* We're MainfestationTolerant */
f_dfu->dfu_state = DFU_STATE_dfuIDLE;
- handle_getstatus(req);
+ value = handle_getstatus(req);
f_dfu->blk_seq_num = 0;
- value = RET_STAT_LEN;
puts("DOWNLOAD ... OK\nCtrl+C to exit ...\n");
break;
case USB_REQ_DFU_GETSTATE:
value = RET_ZLP;
break;
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);
switch (ctrl->bRequest) {
case USB_REQ_DFU_GETSTATUS:
- handle_getstatus(req);
- value = RET_STAT_LEN;
+ value = handle_getstatus(req);
break;
case USB_REQ_DFU_GETSTATE:
value = handle_getstate(req);