From 55be316dbf13dcb1cc54c41330ac37960e82630e Mon Sep 17 00:00:00 2001 From: zwelch Date: Tue, 9 Jun 2009 08:41:00 +0000 Subject: Cleanup and encapsulate IR Capture verification: - Add accessors for setting the jtag_verify_capture_ir flag. - Use them in handle_verify_ircapture_cpmmand - Change variable type to bool; make it static. git-svn-id: svn://svn.berlios.de/openocd/trunk@2164 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/tcl.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/jtag/tcl.c') diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 121c19ab..1ec307ab 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -1304,25 +1304,21 @@ static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { + if (argc > 1) + return ERROR_COMMAND_SYNTAX_ERROR; + if (argc == 1) { if (strcmp(args[0], "enable") == 0) - { - jtag_verify_capture_ir = 1; - } + jtag_set_verify_capture_ir(true); else if (strcmp(args[0], "disable") == 0) - { - jtag_verify_capture_ir = 0; - } else - { + jtag_set_verify_capture_ir(false); + else return ERROR_COMMAND_SYNTAX_ERROR; - } - } else if (argc != 0) - { - return ERROR_COMMAND_SYNTAX_ERROR; } - command_print(cmd_ctx, "verify Capture-IR is %s", (jtag_verify_capture_ir) ? "enabled": "disabled"); + const char *status = jtag_will_verify_capture_ir() ? "enabled": "disabled"; + command_print(cmd_ctx, "verify Capture-IR is %s", status); return ERROR_OK; } -- cgit v1.2.3