|
From: <zw...@ma...> - 2009-06-08 12:55:34
|
Author: zwelch
Date: 2009-06-08 12:55:24 +0200 (Mon, 08 Jun 2009)
New Revision: 2113
Modified:
trunk/src/jtag/jtag.c
Log:
Extend handle_jtag_n{s,t}rst_delay_command routines:
- Add support to display the reset delays too, like the other commands.
- Always show the values, so users can see if they are being redundant.
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-06-08 10:55:13 UTC (rev 2112)
+++ trunk/src/jtag/jtag.c 2009-06-08 10:55:24 UTC (rev 2113)
@@ -2115,24 +2115,22 @@
static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc)
{
- if (argc != 1)
- {
- LOG_ERROR("jtag_nsrst_delay <ms> -- command requires one argument");
+ if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
- }
- jtag_set_nsrst_delay(strtoul(args[0], NULL, 0));
+ if (argc == 1)
+ jtag_set_nsrst_delay(strtoul(args[0], NULL, 0));
+ command_print(cmd_ctx, "jtag_nsrst_delay: %u", jtag_get_nsrst_delay());
return ERROR_OK;
}
static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc)
{
- if (argc != 1)
- {
- LOG_ERROR("jtag_ntrst_delay <ms> -- command requires one argument");
+ if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
- }
- jtag_set_ntrst_delay(strtoul(args[0], NULL, 0));
+ if (argc == 1)
+ jtag_set_ntrst_delay(strtoul(args[0], NULL, 0));
+ command_print(cmd_ctx, "jtag_ntrst_delay: %u", jtag_get_ntrst_delay());
return ERROR_OK;
}
|