summaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-11 12:17:56 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-11 12:17:56 +0000
commitc5b718f5e85c7a884f7610fea46ceea2c3fbd4a7 (patch)
tree74c2c110f0f40a21a846cb00f5163d66f295ca82 /src/openocd.c
parent381f9a2e8aa1697e2af3c2bcad962dfcfe7348d7 (diff)
downloadopenocd+libswd-c5b718f5e85c7a884f7610fea46ceea2c3fbd4a7.tar.gz
openocd+libswd-c5b718f5e85c7a884f7610fea46ceea2c3fbd4a7.tar.bz2
openocd+libswd-c5b718f5e85c7a884f7610fea46ceea2c3fbd4a7.tar.xz
openocd+libswd-c5b718f5e85c7a884f7610fea46ceea2c3fbd4a7.zip
- retired variable stuff.
- drscan is now a low level tcl command: execute DR scan <device> <num_bits> <value> <num_bits1> <value2> - removed obsolete partial command text support git-svn-id: svn://svn.berlios.de/openocd/trunk@791 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/src/openocd.c b/src/openocd.c
index eef6e60d..1dfe5515 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -28,7 +28,6 @@
#include "types.h"
#include "jtag.h"
#include "configuration.h"
-#include "interpreter.h"
#include "xsvf.h"
#include "target.h"
#include "flash.h"
@@ -66,33 +65,6 @@
#include "replacements.h"
-int launchTarget(struct command_context_s *cmd_ctx)
-{
- int retval;
- /* Try to examine & validate jtag chain, though this may require a reset first
- * in which case we continue setup */
- jtag_init(cmd_ctx);
-
- /* try to examine target at this point. If it fails, perhaps a reset will
- * bring it up later on via a telnet/gdb session */
- target_examine(cmd_ctx);
-
- retval=flash_init_drivers(cmd_ctx);
- if (retval!=ERROR_OK)
- return retval;
- LOG_DEBUG("flash init complete");
-
- retval=nand_init(cmd_ctx);
- if (retval!=ERROR_OK)
- return retval;
- LOG_DEBUG("NAND init complete");
-
- retval=pld_init(cmd_ctx);
- if (retval!=ERROR_OK)
- return retval;
- LOG_DEBUG("pld init complete");
- return retval;
-}
/* Give TELNET a way to find out what version this is */
int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
@@ -722,6 +694,13 @@ static char* openocd_jim_fgets(char *s, int size, void *cookie)
return NULL;
}
+void add_jim(const char *name, int (*cmd)(Jim_Interp *interp, int argc, Jim_Obj *const *argv), const char *help)
+{
+ Jim_CreateCommand(interp, name, cmd, NULL, NULL);
+ /* FIX!!! add scheme to accumulate help! */
+
+}
+
void initJim(void)
{
Jim_CreateCommand(interp, "openocd", Jim_Command_openocd, NULL, NULL);
@@ -755,6 +734,19 @@ void initJim2(void)
}
}
+
+int handle_script_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+{
+ FILE *script_file;
+
+ if (argc != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+
+ /* Run a tcl script file */
+ return command_run_linef(cmd_ctx, "source [find {%s}]", args[0]);
+}
+
command_context_t *setup_command_handler(void)
{
command_context_t *cmd_ctx;
@@ -773,7 +765,7 @@ command_context_t *setup_command_handler(void)
tcl_register_commands(cmd_ctx); /* tcl server commands */
log_register_commands(cmd_ctx);
jtag_register_commands(cmd_ctx);
- interpreter_register_commands(cmd_ctx);
+ register_command(cmd_ctx, NULL, "script", handle_script_command, COMMAND_ANY, "execute commands from <file>");
xsvf_register_commands(cmd_ctx);
target_register_commands(cmd_ctx);
flash_register_commands(cmd_ctx);