This is an automated email from Gerrit.

Spencer Oliver ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/849

-- gerrit

commit ea2b01a501f88c10a57fcad93f7b16f92d7355af
Author: Spencer Oliver <[email protected]>
Date:   Wed Sep 26 12:17:13 2012 +0100

    ftdi: mask io direction bits
    
    make sure to mask the direction bits when using same io as output enable.
    
    Change-Id: I5caaa4d16d30f26a453bd6a00c95261fd6e716c5
    Signed-off-by: Spencer Oliver <[email protected]>

diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c
index a038a23..35d0c08 100644
--- a/src/jtag/drivers/ftdi.c
+++ b/src/jtag/drivers/ftdi.c
@@ -174,9 +174,10 @@ static int ftdi_set_signal(const struct signal *s, char 
value)
        }
 
        output = data ? output | s->data_mask : output & ~s->data_mask;
-       if (s->oe_mask == s->data_mask)
-               direction = oe ? output | s->oe_mask : output & ~s->oe_mask;
-       else
+       if (s->oe_mask == s->data_mask) {
+               direction &= ~s->oe_mask;
+               direction |= oe ? output | s->oe_mask : output & ~s->oe_mask;
+       } else
                output = oe ? output | s->oe_mask : output & ~s->oe_mask;
 
        retval = mpsse_set_data_bits_low_byte(mpsse_ctx, output & 0xff, 
direction & 0xff);

-- 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to