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);