summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-23 05:42:42 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-23 05:42:42 +0000
commit6510be8b8b0ffbe6c3d577625f7485775c69a99a (patch)
tree29c469c17e20e823a92392ba8703c26a5d754714 /src/helper
parent30dc76644da0dd9203dc9969a9be1d520fc5feb0 (diff)
downloadopenocd+libswd-6510be8b8b0ffbe6c3d577625f7485775c69a99a.tar.gz
openocd+libswd-6510be8b8b0ffbe6c3d577625f7485775c69a99a.tar.bz2
openocd+libswd-6510be8b8b0ffbe6c3d577625f7485775c69a99a.tar.xz
openocd+libswd-6510be8b8b0ffbe6c3d577625f7485775c69a99a.zip
added fast option.
git-svn-id: svn://svn.berlios.de/openocd/trunk@604 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/command.c17
-rw-r--r--src/helper/command.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index 7a7cbcbb..31666e3a 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -38,10 +38,13 @@
#include <stdio.h>
#include <unistd.h>
+int fast_and_dangerous = 0;
+
void command_print_help_line(command_context_t* context, struct command_s *command, int indent);
int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_time_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int build_unique_lengths(command_context_t *context, command_t *commands)
{
@@ -559,6 +562,9 @@ command_context_t* command_init()
register_command(context, NULL, "time", handle_time_command,
COMMAND_ANY, "time <cmd + args> - execute <cmd + args> and print time it took");
+ register_command(context, NULL, "fast", handle_fast_command,
+ COMMAND_ANY, "fast <enable/disable> - place at beginning of config files. Sets defaults to fast and dangerous.");
+
return context;
}
@@ -578,6 +584,17 @@ int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
return ERROR_OK;
}
+int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+{
+ if (argc!=1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ fast_and_dangerous = strcmp("enable", args[0])==0;
+
+ return ERROR_OK;
+}
+
+
int handle_time_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
duration_t duration;
diff --git a/src/helper/command.h b/src/helper/command.h
index 6e6af75e..3586017d 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -79,4 +79,7 @@ extern int command_run_file(command_context_t *context, FILE *file, enum command
#define ERROR_COMMAND_CLOSE_CONNECTION (-600)
#define ERROR_COMMAND_SYNTAX_ERROR (-601)
+
+extern int fast_and_dangerous;
+
#endif /* COMMAND_H */