Commit 55be316d authored by zwelch's avatar zwelch
Browse files

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
parent a70d77ae
......@@ -87,7 +87,7 @@ static enum reset_types jtag_reset_config = RESET_NONE;
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) */
......@@ -1201,6 +1201,15 @@ bool jtag_will_verify()
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)
{
......
......@@ -611,8 +611,6 @@ extern void jtag_sleep(u32 us);
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);
/*
......@@ -708,4 +706,7 @@ unsigned jtag_get_speed_khz(void);
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 */
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment