From: oharboe Date: Mon, 26 May 2008 11:46:05 +0000 (+0000) Subject: clock 1/0 in idle now configurable. X-Git-Tag: v0.1.0~602 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e0d6a125c41939402eab050feda53f190d947421;p=openocd clock 1/0 in idle now configurable. git-svn-id: svn://svn.berlios.de/openocd/trunk@687 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- diff --git a/src/jtag/bitbang.c b/src/jtag/bitbang.c index 79f77b56..c4f9ce94 100644 --- a/src/jtag/bitbang.c +++ b/src/jtag/bitbang.c @@ -36,6 +36,10 @@ bitbang_interface_t *bitbang_interface; + +/* should the clock be high or low in idle? */ +#define CLOCK_IDLE() 0 + int bitbang_execute_queue(void); /* The bitbang driver leaves the TCK 0 when in idle */ @@ -62,7 +66,7 @@ void bitbang_state_move(void) { bitbang_interface->write(0, tms, 0); bitbang_interface->write(1, tms, 0); } - bitbang_interface->write(0, tms, 0); + bitbang_interface->write(CLOCK_IDLE(), tms, 0); cur_state = end_state; } @@ -98,7 +102,7 @@ void bitbang_path_move(pathmove_command_t *cmd) num_states--; } - bitbang_interface->write(0, tms, 0); + bitbang_interface->write(CLOCK_IDLE(), tms, 0); end_state = cur_state; } @@ -117,12 +121,12 @@ void bitbang_runtest(int num_cycles) } /* execute num_cycles */ - bitbang_interface->write(0, 0, 0); for (i = 0; i < num_cycles; i++) { - bitbang_interface->write(1, 0, 0); bitbang_interface->write(0, 0, 0); + bitbang_interface->write(1, 0, 0); } + bitbang_interface->write(CLOCK_IDLE(), 0, 0); /* finish in end_state */ bitbang_end_state(saved_end_state); @@ -187,7 +191,7 @@ void bitbang_scan(int ir_scan, enum scan_type type, u8 *buffer, int scan_size) */ bitbang_interface->write(0, 0, 0); bitbang_interface->write(1, 0, 0); - bitbang_interface->write(0, 0, 0); + bitbang_interface->write(CLOCK_IDLE(), 0, 0); if (ir_scan) cur_state = TAP_PI;