From 4e273abf910f871f2d49b9185f1f4551589b65ab Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Tue, 2 Feb 2010 07:10:30 +0000 Subject: [PATCH] * src/tap/usbconn/libftdi.c (usbconn_ftdi_write): Make sure scheduled send bytes be less than URJ_USBCONN_FTDX_MAXSEND. * src/tap/usbconn/libftd2xx.c (usbconn_ftd2xx_write): Likewise. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1753 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 6 ++++++ urjtag/src/tap/usbconn/libftd2xx.c | 2 +- urjtag/src/tap/usbconn/libftdi.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 65a2783f..b522b21e 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,9 @@ +2010-02-02 Jie Zhang + + * src/tap/usbconn/libftdi.c (usbconn_ftdi_write): Make sure + scheduled send bytes be less than URJ_USBCONN_FTDX_MAXSEND. + * src/tap/usbconn/libftd2xx.c (usbconn_ftd2xx_write): Likewise. + 2010-02-01 Jie Zhang * tap/cable/ft2232.c (ft2232_gnice_done): Turn LED off when done. diff --git a/urjtag/src/tap/usbconn/libftd2xx.c b/urjtag/src/tap/usbconn/libftd2xx.c index 38c96f5e..1407bed6 100644 --- a/urjtag/src/tap/usbconn/libftd2xx.c +++ b/urjtag/src/tap/usbconn/libftd2xx.c @@ -249,7 +249,7 @@ usbconn_ftd2xx_write (urj_usbconn_t *conn, uint8_t *buf, int len, int recv) with this write Case B: max number of scheduled send bytes has been reached */ if ((p->to_recv + recv > URJ_USBCONN_FTD2XX_MAXRECV) - || ((p->send_buffered > URJ_USBCONN_FTDX_MAXSEND) + || ((p->send_buffered + len > URJ_USBCONN_FTDX_MAXSEND) && (p->to_recv == 0))) xferred = usbconn_ftd2xx_flush (p); diff --git a/urjtag/src/tap/usbconn/libftdi.c b/urjtag/src/tap/usbconn/libftdi.c index 86a2d9aa..34457d04 100644 --- a/urjtag/src/tap/usbconn/libftdi.c +++ b/urjtag/src/tap/usbconn/libftdi.c @@ -193,7 +193,7 @@ usbconn_ftdi_write (urj_usbconn_t *conn, uint8_t *buf, int len, int recv) with this write Case B: max number of scheduled send bytes has been reached */ if ((p->to_recv + recv > URJ_USBCONN_FTDI_MAXRECV) - || ((p->send_buffered > URJ_USBCONN_FTDX_MAXSEND) + || ((p->send_buffered + len > URJ_USBCONN_FTDX_MAXSEND) && (p->to_recv == 0))) xferred = usbconn_ftdi_flush (p);