- 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
static tap_state_t cmd_queue_end_state = TAP_RESET;
tap_state_t cmd_queue_cur_state = TAP_RESET;
-int jtag_verify_capture_ir = 1;
+static bool jtag_verify_capture_ir = true;
static int jtag_verify = 1;
/* how long the OpenOCD should wait before attempting JTAG communication after reset lines deasserted (in ms) */
return jtag_verify;
}
+void jtag_set_verify_capture_ir(bool enable)
+{
+ jtag_verify_capture_ir = enable;
+}
+
+bool jtag_will_verify_capture_ir()
+{
+ return jtag_verify_capture_ir;
+}
int jtag_power_dropout(int *dropout)
{
extern int jtag_call_event_callbacks(enum jtag_event event);
extern int jtag_register_event_callback(int (* callback)(enum jtag_event event, void* priv), void* priv);
-extern int jtag_verify_capture_ir;
-
void jtag_tap_handle_event(jtag_tap_t* tap, enum jtag_tap_event e);
/*
void jtag_set_verify(bool enable);
bool jtag_will_verify(void);
+void jtag_set_verify_capture_ir(bool enable);
+bool jtag_will_verify_capture_ir(void);
+
#endif /* JTAG_H */
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;
}