Propagate error from assert, deassert and halt on tcl target object.
authorØyvind Harboe <oyvind.harboe@zylin.com>
Tue, 13 Oct 2009 09:29:05 +0000 (11:29 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Tue, 13 Oct 2009 10:10:23 +0000 (12:10 +0200)
src/target/target.c

index 8bb9371f903bca836e16a17021668ac79dc8a21e..2b7d7e2c6394855510e12790fe09c8bbbba8462e 100644 (file)
@@ -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) {

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)