added echo command in tcl. Issues a LOG_USER() for the single argument.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 4 Jul 2008 13:37:34 +0000 (13:37 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 4 Jul 2008 13:37:34 +0000 (13:37 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@746 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/openocd.c
src/tcl/commands.tcl

index e24eb9a7cd717aee536eedc416886c0e26783726..99ee6527ed352e5edac3ff73cdc9e9cf1d507f94 100644 (file)
@@ -311,6 +311,17 @@ Jim_Command_find(Jim_Interp *interp,
        return JIM_OK;
 }
 
+static int
+Jim_Command_echo(Jim_Interp *interp, 
+                                   int argc,
+                                   Jim_Obj *const *argv)
+{
+       if (argc!=2)
+               return JIM_ERR;
+       char *str = (char*)Jim_GetString(argv[1], NULL);
+       LOG_USER("%s", str);
+       return JIM_OK;
+}
 
 void initJim(void)
 {
@@ -323,6 +334,7 @@ void initJim(void)
     Jim_CreateCommand(interp, "openocd", Jim_Command_openocd, NULL, NULL);
     Jim_CreateCommand(interp, "openocd_throw", Jim_Command_openocd_throw, NULL, NULL);
     Jim_CreateCommand(interp, "find", Jim_Command_find, NULL, NULL);
+    Jim_CreateCommand(interp, "echo", Jim_Command_echo, NULL, NULL);
 }
 
 int main(int argc, char *argv[])
index 0c5132a9bfd7cd75bdbc260671a05cd1b8a7e4ac..f42047f7f740f66924277b21c74de173359fb4c9 100644 (file)
@@ -1,4 +1,16 @@
 # implements Tcl procedures/functions\r
 proc peek {address} {\r
        return [openocd mdw $address]
-}
\ No newline at end of file
+}\r
+\r
+# Production command\r
+proc board_produce {filename serialnumber} {\r
+       openocd "reset init"\r
+       openocd "flash write_image erase $filename [flash] bin"]]\r
+       openocd "verify_image $filename [flash] bin"]]\r
+       echo "Successfully ran production procedure"\r
+}\r
+\r
+proc board_test {} {\r
+       echo "Production test not implemented"
+}\r

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)