aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-18 20:25:19 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-18 20:25:19 +0000
commit7ad67c8b341cc2bd769275a8d8050ae1e7be9481 (patch)
tree92f118e20df10549f4dc318c14ad5b776de6db53 /src
parent23fd80f2b658395d24056f6b84c8483f428ab33d (diff)
downloadriscv-openocd-7ad67c8b341cc2bd769275a8d8050ae1e7be9481.zip
riscv-openocd-7ad67c8b341cc2bd769275a8d8050ae1e7be9481.tar.gz
riscv-openocd-7ad67c8b341cc2bd769275a8d8050ae1e7be9481.tar.bz2
use tap_get_tms_path_len() instead of fix # of 7. Not tested if this builds, but at least we're looking at a build error instead of a runtime error.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1833 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/jtag/arm-jtag-ew.c3
-rw-r--r--src/jtag/bitq.c3
-rw-r--r--src/jtag/gw16012.c3
-rw-r--r--src/jtag/rlink/rlink.c3
-rw-r--r--src/jtag/usbprog.c3
-rw-r--r--src/jtag/zy1000.c3
6 files changed, 12 insertions, 6 deletions
diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/arm-jtag-ew.c
index 0c00cac..f883d5d 100644
--- a/src/jtag/arm-jtag-ew.c
+++ b/src/jtag/arm-jtag-ew.c
@@ -333,8 +333,9 @@ static void armjtagew_state_move(void)
int i;
int tms = 0;
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
- for (i = 0; i < 7; i++)
+ for (i = 0; i < tms_count; i++)
{
tms = (tms_scan >> i) & 1;
armjtagew_tap_append_step(tms, 0);
diff --git a/src/jtag/bitq.c b/src/jtag/bitq.c
index af17b63..b196ffc 100644
--- a/src/jtag/bitq.c
+++ b/src/jtag/bitq.c
@@ -161,8 +161,9 @@ void bitq_state_move(tap_state_t new_state)
}
tms_scan = tap_get_tms_path(tap_get_state(), new_state);
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
- for (i = 0; i<7; i++)
+ for (i = 0; i<tms_count; i++)
{
bitq_io(tms_scan & 1, 0, 0);
tms_scan >>= 1;
diff --git a/src/jtag/gw16012.c b/src/jtag/gw16012.c
index d8502d9..c6acaca 100644
--- a/src/jtag/gw16012.c
+++ b/src/jtag/gw16012.c
@@ -197,10 +197,11 @@ static void gw16012_state_move(void)
{
int i=0, tms=0;
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
gw16012_control(0x0); /* single-bit mode */
- for (i = 0; i < 7; i++)
+ for (i = 0; i < tms_count; i++)
{
tms = (tms_scan >> i) & 1;
gw16012_data(tms << 1); /* output next TMS bit */
diff --git a/src/jtag/rlink/rlink.c b/src/jtag/rlink/rlink.c
index 77cab9b..934a889 100644
--- a/src/jtag/rlink/rlink.c
+++ b/src/jtag/rlink/rlink.c
@@ -916,8 +916,9 @@ void rlink_state_move(void) {
int i=0, tms=0;
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
- for (i = 0; i < 7; i++)
+ for (i = 0; i < tms_count; i++)
{
tms = (tms_scan >> i) & 1;
tap_state_queue_append(tms);
diff --git a/src/jtag/usbprog.c b/src/jtag/usbprog.c
index 7e4b998..2794e17 100644
--- a/src/jtag/usbprog.c
+++ b/src/jtag/usbprog.c
@@ -247,9 +247,10 @@ static void usbprog_state_move(void)
{
int i = 0, tms = 0;
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
usbprog_jtag_write_tms(usbprog_jtag_handle, (char)tms_scan);
- for (i = 0; i < 7; i++)
+ for (i = 0; i < tms_count; i++)
{
tms = (tms_scan >> i) & 1;
}
diff --git a/src/jtag/zy1000.c b/src/jtag/zy1000.c
index 2a43d01..1e684c1 100644
--- a/src/jtag/zy1000.c
+++ b/src/jtag/zy1000.c
@@ -686,8 +686,9 @@ static int zy1000_jtag_add_clocks(int num_cycles, tap_state_t state, tap_state_t
/* test manual drive code on any target */
int tms;
u8 tms_scan = tap_get_tms_path(t, state);
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
- for (i = 0; i < 7; i++)
+ for (i = 0; i < tms_count; i++)
{
tms = (tms_scan >> i) & 1;
waitIdle();