summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-04 07:43:04 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-04 07:43:04 +0000
commit7abe97565e77d5a9c34099ea15ad1608567b1581 (patch)
tree39a44a4b4d9924abdda9cc0f8f54849381130448 /src
parent32cc2202f0bd6a1d36f679008e965e5df68315ae (diff)
downloadopenocd+libswd-7abe97565e77d5a9c34099ea15ad1608567b1581.tar.gz
openocd+libswd-7abe97565e77d5a9c34099ea15ad1608567b1581.tar.bz2
openocd+libswd-7abe97565e77d5a9c34099ea15ad1608567b1581.tar.xz
openocd+libswd-7abe97565e77d5a9c34099ea15ad1608567b1581.zip
added query of reset speed
git-svn-id: svn://svn.berlios.de/openocd/trunk@538 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/jtag/jtag.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c
index 884cf2f3..9a95de42 100644
--- a/src/jtag/jtag.c
+++ b/src/jtag/jtag.c
@@ -1733,21 +1733,26 @@ int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx, char *cmd
int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
int cur_speed = 0;
- if ((argc<1) || (argc>2))
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- LOG_DEBUG("handle jtag speed");
- if (argc >= 1)
- cur_speed = jtag_speed = jtag_speed_post_reset = strtoul(args[0], NULL, 0);
- if (argc == 2)
- cur_speed = jtag_speed_post_reset = strtoul(args[1], NULL, 0);
+ if (argc != 0)
+ {
+ if ((argc<1) || (argc>2))
+ return ERROR_COMMAND_SYNTAX_ERROR;
- /* this command can be called during CONFIG,
- * in which case jtag isn't initialized */
- if (jtag)
- jtag->speed(cur_speed);
-
+ LOG_DEBUG("handle jtag speed");
+
+ if (argc >= 1)
+ cur_speed = jtag_speed = jtag_speed_post_reset = strtoul(args[0], NULL, 0);
+ if (argc == 2)
+ cur_speed = jtag_speed_post_reset = strtoul(args[1], NULL, 0);
+
+ /* this command can be called during CONFIG,
+ * in which case jtag isn't initialized */
+ if (jtag)
+ jtag->speed(cur_speed);
+ }
+ command_print(cmd_ctx, "jtag_speed: %d, %d", jtag_speed, jtag_speed_post_reset);
+
return ERROR_OK;
}