From ebf16b4ddf0dcbadf96aebdec3304f703917fdc7 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 9 Nov 2011 23:22:13 +0100 Subject: usb: Do not send ZLP when we have filled the window Only send the ZLP if we send less data than was required/asked for by the host and it is a multiple of the bMaxPacketSize0 (which is hardcoded to 8 right now). This is completing the change done in fe88b83e80df8be0351ff38ee6 to fix SIMtrace attached to OSX and not regress on windows. Introduce another parameter to udp_ep0_send_data to specify the window size (wLength) or if not available the default from USB 2.0 specification. --- firmware/src/dfu/dfu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/src/dfu/dfu.h') diff --git a/firmware/src/dfu/dfu.h b/firmware/src/dfu/dfu.h index c898197..27c63b5 100644 --- a/firmware/src/dfu/dfu.h +++ b/firmware/src/dfu/dfu.h @@ -124,7 +124,7 @@ struct _dfu_desc { struct dfuapi { void (*udp_init)(void); - void (*ep0_send_data)(const char *data, u_int32_t len); + void (*ep0_send_data)(const char *data, u_int32_t len, u_int32_t wlen); void (*ep0_send_zlp)(void); void (*ep0_send_stall)(void); int (*dfu_ep0_handler)(u_int8_t req_type, u_int8_t req, -- cgit v1.2.3