summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-05 00:06:34 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-05 00:06:34 +0000
commit499f30f693c8bac29405a290f6e4f4bac0eff01f (patch)
tree1390153959871cfa830670fd859d4c58631135d9 /src
parent99fd47950335a0bc146b7fcf090e4a490cc81ffd (diff)
downloadopenocd+libswd-499f30f693c8bac29405a290f6e4f4bac0eff01f.tar.gz
openocd+libswd-499f30f693c8bac29405a290f6e4f4bac0eff01f.tar.bz2
openocd+libswd-499f30f693c8bac29405a290f6e4f4bac0eff01f.tar.xz
openocd+libswd-499f30f693c8bac29405a290f6e4f4bac0eff01f.zip
Add accessors for jtag_verify; use them in jim command handler.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2060 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/jtag/jtag.c30
-rw-r--r--src/jtag/jtag.h4
2 files changed, 22 insertions, 12 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c
index d256b8bd..a31bb6ee 100644
--- a/src/jtag/jtag.c
+++ b/src/jtag/jtag.c
@@ -2524,27 +2524,33 @@ static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, ch
return ERROR_OK;
}
+void jtag_set_verify(bool enable)
+{
+ jtag_verify = enable;
+}
+
+bool jtag_will_verify()
+{
+ return jtag_verify;
+}
+
static int handle_verify_jtag_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 = 1;
- }
+ jtag_set_verify(true);
else if (strcmp(args[0], "disable") == 0)
- {
- jtag_verify = 0;
- } else
- {
+ jtag_set_verify(false);
+ else
return ERROR_COMMAND_SYNTAX_ERROR;
- }
- } else if (argc != 0)
- {
- return ERROR_COMMAND_SYNTAX_ERROR;
}
- command_print(cmd_ctx, "verify jtag capture is %s", (jtag_verify) ? "enabled": "disabled");
+ const char *status = jtag_will_verify() ? "enabled": "disabled";
+ command_print(cmd_ctx, "verify jtag capture is %s", status);
return ERROR_OK;
}
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h
index 341f7702..ab5b8f4d 100644
--- a/src/jtag/jtag.h
+++ b/src/jtag/jtag.h
@@ -640,11 +640,15 @@ extern void jtag_add_dr_out(jtag_tap_t* tap,
*/
extern int jtag_add_statemove(tap_state_t goal_state);
+
+
/// @returns the number of times the scan queue has been flushed
int jtag_get_flush_queue_count(void);
void jtag_set_nsrst_delay(unsigned delay);
void jtag_set_ntrst_delay(unsigned delay);
void jtag_set_speed_khz(unsigned speed);
unsigned jtag_get_speed_khz(void);
+void jtag_set_verify(bool enable);
+bool jtag_will_verify(void);
#endif /* JTAG_H */