- retired variable stuff.
[openocd.git] / src / openocd.c
index eef6e60dca30e7234c8076c87ab483885349fd6e..1dfe5515ceb577580d3fa88739e192c145ea7849 100644 (file)
@@ -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"
 
 #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);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)