|
From: openocd-gerrit <ope...@us...> - 2023-05-13 08:56:01
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via b931286ab440f4677a9ac983a64b55055d20c438 (commit)
from 219412f9d65cff4457f9b9ce339a444ad903a1df (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b931286ab440f4677a9ac983a64b55055d20c438
Author: Antonio Borneo <bor...@gm...>
Date: Mon Mar 27 10:43:30 2023 +0200
target: rewrite command 'arp_halt' as COMMAND_HANDLER
While there, add the missing .usage field.
Change-Id: I748382cafe08443c458ff1d4e47819610cfbf85c
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7558
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index e995f134e..f2e8d531a 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5822,19 +5822,18 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
}
-static int jim_target_halt(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_target_halt)
{
- if (argc != 1) {
- Jim_WrongNumArgs(interp, 1, argv, "[no parameters]");
- return JIM_ERR;
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ struct target *target = get_current_target(CMD_CTX);
+ if (!target->tap->enabled) {
+ command_print(CMD, "[TAP is disabled]");
+ return ERROR_FAIL;
}
- struct command_context *cmd_ctx = current_command_context(interp);
- assert(cmd_ctx);
- struct target *target = get_current_target(cmd_ctx);
- if (!target->tap->enabled)
- return jim_target_tap_disabled(interp);
- int e = target->type->halt(target);
- return (e == ERROR_OK) ? JIM_OK : JIM_ERR;
+
+ return target->type->halt(target);
}
static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -6108,8 +6107,9 @@ static const struct command_registration target_instance_command_handlers[] = {
{
.name = "arp_halt",
.mode = COMMAND_EXEC,
- .jim_handler = jim_target_halt,
+ .handler = handle_target_halt,
.help = "used internally for reset processing",
+ .usage = "",
},
{
.name = "arp_waitstate",
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|