From: Spencer O. <nt...@us...> - 2010-07-02 18:01:46
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via deb176d33514eb6b702b14043c338b2d0053f11d (commit) from f97b6b59abc878745bb54e8f44ec82897bacaf7d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit deb176d33514eb6b702b14043c338b2d0053f11d Author: Spencer Oliver <nt...@us...> Date: Fri Jul 2 17:00:57 2010 +0100 ft2232: revert ft2232_read_scan changes Revert change made in commit dd88b461da1cb8642200dd5c96fb1ff384ca9f7b. Caused segfaults when using ftdi driver under win32. Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 90516a0..f315d69 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -714,24 +714,23 @@ static void ft2232_end_state(tap_state_t state) static void ft2232_read_scan(enum scan_type type, uint8_t* buffer, int scan_size) { - int num_bytes = scan_size / 8; - int bits_left = scan_size % 8; - int cur_byte; + int num_bytes = (scan_size + 7) / 8; + int bits_left = scan_size; + int cur_byte = 0; - for (cur_byte = 0; cur_byte < num_bytes; cur_byte++) + while (num_bytes-- > 1) { - buffer[cur_byte] = buffer_read(); + buffer[cur_byte++] = buffer_read(); + bits_left -= 8; } - /* Manage partial byte left from the clock data in/out instructions, if any */ + buffer[cur_byte] = 0x0; + + /* There is one more partial byte left from the clock data in/out instructions */ if (bits_left > 1) { buffer[cur_byte] = buffer_read() >> 1; } - else - { - buffer[cur_byte] = 0x0; - } /* This shift depends on the length of the clock data to tms instruction, insterted at end of the scan, now fixed to a two step transition in ft2232_add_scan */ buffer[cur_byte] = (buffer[cur_byte] | (((buffer_read()) << 1) & 0x80)) >> (8 - bits_left); } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/ft2232.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |