dstat->iString = 0;
}
-static void handle_getstate(struct usb_request *req)
+static int handle_getstate(struct usb_request *req)
{
struct f_dfu *f_dfu = req->context;
((u8 *)req->buf)[0] = f_dfu->dfu_state;
- req->actual = sizeof(u8);
+ return sizeof(u8);
}
static inline void to_dfu_mode(struct f_dfu *f_dfu)
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
case USB_REQ_DFU_DETACH:
f_dfu->dfu_state = DFU_STATE_appDETACH;
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_appIDLE;
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
case USB_REQ_DFU_DETACH:
/*
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_dfuERROR;
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_dfuERROR;
req->complete = dnload_request_flush;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_dfuERROR;
puts("DOWNLOAD ... OK\nCtrl+C to exit ...\n");
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_dfuERROR;
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
default:
f_dfu->dfu_state = DFU_STATE_dfuERROR;
value = RET_STAT_LEN;
break;
case USB_REQ_DFU_GETSTATE:
- handle_getstate(req);
+ value = handle_getstate(req);
break;
case USB_REQ_DFU_CLRSTATUS:
f_dfu->dfu_state = DFU_STATE_dfuIDLE;