]> git.sur5r.net Git - openocd/commitdiff
Fix ft2232 TX buffer overflow
authormlu <mlu@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 25 Apr 2009 00:58:49 +0000 (00:58 +0000)
committermlu <mlu@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 25 Apr 2009 00:58:49 +0000 (00:58 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1527 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/ft2232.c

index 9bcd1660168d136dd7bbbd778ec125316160a26f..a985465347e8529861b3b22577360cea3ec33382 100644 (file)
@@ -1589,6 +1589,13 @@ static int ft2232_execute_queue()
        {
                if (ft2232_execute_command(cmd) != ERROR_OK)
                        retval = ERROR_JTAG_QUEUE_FAILED;
+               /* Start reading input before FT2232 TX buffer fills up */
+               if (ft2232_expect_read > 280)
+               {
+                       if (ft2232_send_and_recv(first_unsent, cmd) != ERROR_OK)
+                               retval = ERROR_JTAG_QUEUE_FAILED;
+                       first_unsent = cmd;
+               }
                cmd = cmd->next;
        }