From 7f04633daa50eb9f402cac64fc705f60462f558d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Sat, 7 Aug 2010 22:47:54 +0000 Subject: [PATCH] fix TDO handling ingeneric_flush_using_transfer() (Matthias Drochner) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1820 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/tap/cable/generic.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 3346ae38..ef22c2bf 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2010-08-08 Arnim Laeuger + + * src/tap/cable/generic.c: fix TDO handling ingeneric_flush_using_transfer() + (Matthias Drochner) + 2010-08-07 Mike Frysinger * src/global/params.c (parse_param_lu): Accept unsigned values in hex format. diff --git a/urjtag/src/tap/cable/generic.c b/urjtag/src/tap/cable/generic.c index 47682c89..f3e9afca 100644 --- a/urjtag/src/tap/cable/generic.c +++ b/urjtag/src/tap/cable/generic.c @@ -208,7 +208,7 @@ urj_tap_cable_generic_flush_using_transfer (urj_cable_t *cable, do { - int r, bits = 0, tdo = 0; + int r, bits = 0, tdo = 0, savbits; urj_log (URJ_LOG_LEVEL_DETAIL, "flush(%d)\n", cable->todo.num_items); @@ -255,6 +255,8 @@ urj_tap_cable_generic_flush_using_transfer (urj_cable_t *cable, urj_log (URJ_LOG_LEVEL_DETAIL, "%d combined into one (%d bits)\n", n, bits); + savbits = bits; + if (bits == 0 || n <= 1) { do_one_queued_action (cable); @@ -333,6 +335,10 @@ urj_tap_cable_generic_flush_using_transfer (urj_cable_t *cable, "add result from transfer to %p.%d\n", &(cable->done), c); cable->done.data[c].action = URJ_TAP_CABLE_GET_TDO; + if (bits < savbits) + tdo = out[bits]; + else + tdo = cable->driver->get_tdo(cable); cable->done.data[c].arg.value.val = tdo; } else if (cable->todo.data[i].action == URJ_TAP_CABLE_TRANSFER)