aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRodrigo L. Rosa <rodrigorosa.LG@gmail.com>2011-08-09 11:25:23 -0700
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-08-09 20:59:40 +0200
commit194e3c5bc5e0fbb7d41cfcbe913c4264782cdd5b (patch)
treebb06e56550d5101038340095914202fc08769866 /src
parentd1a16ce9d61cbcf3a56cb578da62370632aa923a (diff)
downloadriscv-openocd-194e3c5bc5e0fbb7d41cfcbe913c4264782cdd5b.zip
riscv-openocd-194e3c5bc5e0fbb7d41cfcbe913c4264782cdd5b.tar.gz
riscv-openocd-194e3c5bc5e0fbb7d41cfcbe913c4264782cdd5b.tar.bz2
fix tapenabler return code
if tap enable/disable failed then a warning was written to the log, but JIM_OK was returned. if using openocd via a TCP interface to the TCL port, there is no way to catch that the command failed (it didn't enable the tap, so it failed) now it return an error if it fails.
Diffstat (limited to 'src')
-rw-r--r--src/jtag/tcl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 267802e..3b2f83b 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -774,11 +774,15 @@ static int jim_jtag_tap_enabler(Jim_Interp *interp, int argc, Jim_Obj *const *ar
if (strcasecmp(cmd_name, "tapisenabled") == 0) {
// do nothing, just return the value
} else if (strcasecmp(cmd_name, "tapenable") == 0) {
- if (!jtag_tap_enable(t))
+ if (!jtag_tap_enable(t)){
LOG_WARNING("failed to enable tap %s", t->dotted_name);
+ return JIM_ERR;
+ }
} else if (strcasecmp(cmd_name, "tapdisable") == 0) {
- if (!jtag_tap_disable(t))
+ if (!jtag_tap_disable(t)){
LOG_WARNING("failed to disable tap %s", t->dotted_name);
+ return JIM_ERR;
+ }
} else {
LOG_ERROR("command '%s' unknown", cmd_name);
return JIM_ERR;