diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-04-22 13:54:04 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-04-22 13:54:04 +0000 |
commit | 779c44125a8804dabb40f59b068b55a9ac810096 (patch) | |
tree | 0fd9aa1ef6a36036bdbef0381cc1169da09d72ca | |
parent | f6fd9bc8235ea944b4fde4feb1b845762190f3d2 (diff) | |
download | openocd+libswd-779c44125a8804dabb40f59b068b55a9ac810096.tar.gz openocd+libswd-779c44125a8804dabb40f59b068b55a9ac810096.tar.bz2 openocd+libswd-779c44125a8804dabb40f59b068b55a9ac810096.tar.xz openocd+libswd-779c44125a8804dabb40f59b068b55a9ac810096.zip |
Zach Welch <zw@superlucidity.net> do not pad TMS
git-svn-id: svn://svn.berlios.de/openocd/trunk@1509 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/jtag/jlink.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c index f16be361..a229cec5 100644 --- a/src/jtag/jlink.c +++ b/src/jtag/jlink.c @@ -623,6 +623,10 @@ static void jlink_tap_append_step(int tms, int tdi) int bit_index = tap_length % 8; u8 bit = 1 << bit_index; + // we do not pad TMS, so be sure to initialize all bits + if (0 == bit_index) + tms_buffer[index] = tdi_buffer[index] = 0; + if (tms) tms_buffer[index] |= bit; else @@ -669,15 +673,8 @@ static int jlink_tap_execute(void) if (!tap_length) return ERROR_OK; - /* Pad last byte so that tap_length is divisible by 8 */ - while (tap_length % 8 != 0) - { - /* More of the last TMS value keeps us in the same state, - * analogous to free-running JTAG interfaces. */ - jlink_tap_append_step(last_tms, 0); - } - - byte_length = tap_length / 8; + // number of full bytes (plus one if some would be left over) + byte_length = tap_length / 8 + !!(tap_length % 8); usb_out_buffer[0] = EMU_CMD_HW_JTAG3; usb_out_buffer[1] = 0; |