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 219412f9d65cff4457f9b9ce339a444ad903a1df (commit)
from 7319eb3a25732c9d9bcaff804dac6abded99fc43 (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 219412f9d65cff4457f9b9ce339a444ad903a1df
Author: Antonio Borneo <bor...@gm...>
Date: Mon Mar 27 10:34:14 2023 +0200
target: rewrite command 'arp_poll' as COMMAND_HANDLER
While there, add the missing .usage field.
Change-Id: I16e0aeacdaaada09fa77ad29552fa4025eff0c45
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7557
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index fb5ef7219..e995f134e 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5753,26 +5753,21 @@ COMMAND_HANDLER(handle_target_halt_gdb)
return target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);
}
-static int jim_target_poll(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_target_poll)
{
- 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;
if (!(target_was_examined(target)))
- e = ERROR_TARGET_NOT_EXAMINED;
- else
- e = target->type->poll(target);
- if (e != ERROR_OK)
- return JIM_ERR;
- return JIM_OK;
+ return ERROR_TARGET_NOT_EXAMINED;
+
+ return target->type->poll(target);
}
static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -6100,8 +6095,9 @@ static const struct command_registration target_instance_command_handlers[] = {
{
.name = "arp_poll",
.mode = COMMAND_EXEC,
- .jim_handler = jim_target_poll,
+ .handler = handle_target_poll,
.help = "used internally for reset processing",
+ .usage = "",
},
{
.name = "arp_reset",
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|