summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-10-13 11:29:05 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-10-13 12:10:23 +0200
commit86cbbe8a4a0d7568d56617222cf1c672fc87c68e (patch)
treea6aa8d606051fe57bbb00cf85878e9c6cf3ed6d3 /src
parentb6c4d1006f66744f67cbd03005e438f8512012cd (diff)
downloadopenocd+libswd-86cbbe8a4a0d7568d56617222cf1c672fc87c68e.tar.gz
openocd+libswd-86cbbe8a4a0d7568d56617222cf1c672fc87c68e.tar.bz2
openocd+libswd-86cbbe8a4a0d7568d56617222cf1c672fc87c68e.tar.xz
openocd+libswd-86cbbe8a4a0d7568d56617222cf1c672fc87c68e.zip
Propagate error from assert, deassert and halt on tcl target object.
Diffstat (limited to 'src')
-rw-r--r--src/target/target.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 8bb9371f..2b7d7e2c 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3452,6 +3452,10 @@ void target_all_handle_event(enum target_event e)
}
}
+
+/* FIX? should we propagate errors here rather than printing them
+ * and continuing?
+ */
void target_handle_event(target_t *target, enum target_event e)
{
target_event_action_t *teap;
@@ -4093,11 +4097,11 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
/* do the assert */
if (n->value == NVP_ASSERT) {
- target->type->assert_reset(target);
+ e = target->type->assert_reset(target);
} else {
- target->type->deassert_reset(target);
+ e = target->type->deassert_reset(target);
}
- return JIM_OK;
+ return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
case TS_CMD_HALT:
if (goi.argc) {
Jim_WrongNumArgs(goi.interp, 0, argv, "halt [no parameters]");
@@ -4105,8 +4109,8 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
}
if (!target->tap->enabled)
goto err_tap_disabled;
- target->type->halt(target);
- return JIM_OK;
+ e = target->type->halt(target);
+ return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
case TS_CMD_WAITSTATE:
/* params: <name> statename timeoutmsecs */
if (goi.argc != 2) {