From ece853a5c6808bacf00f85af47b7a0f136d2f6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Sat, 28 Mar 2009 22:34:43 +0000 Subject: [PATCH] keep old value of trst in case trst isn't modified by mask/val git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1470 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 3 +++ jtag/src/tap/chain.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 8e390d5b..f010d32d 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,5 +1,8 @@ 2009-03-28 Arnim Laeuger + * src/tap/chain.c (chain_set_pod_signal) : keep old value of trst in + case trst isn't modified by mask/val + * src/tap/chain.c: [ 2610857 ] chain_set_pod_signal() looks funky * UrJTAG.txt: typo diff --git a/jtag/src/tap/chain.c b/jtag/src/tap/chain.c index 6b94b43f..76ae7984 100644 --- a/jtag/src/tap/chain.c +++ b/jtag/src/tap/chain.c @@ -122,7 +122,7 @@ chain_set_pod_signal( chain_t *chain, int mask, int val ) { int old_val = cable_set_signal( chain->cable, mask, val ); int old_trst = (old_val & CS_TRST) ? 1 : 0; - int new_trst = (val & mask & CS_TRST) ? 1 : 0; + int new_trst = (((old_val & ~mask) | (val & mask)) & CS_TRST) ? 1 : 0; tap_state_set_trst( chain, old_trst, new_trst ); return old_val; }