|
From: oharboe at B. <oh...@ma...> - 2009-05-06 13:22:34
|
Author: oharboe
Date: 2009-05-06 13:22:30 +0200 (Wed, 06 May 2009)
New Revision: 1613
Modified:
trunk/src/jtag/zy1000.c
zy1000/trunk/build/menu/zy1000menu.xml
zy1000/trunk/build/menu/zy1000menu.xsl
zy1000/trunk/build/tcl/browsemem.tcl
zy1000/trunk/build/tcl/downloadmem.tcl
zy1000/trunk/build/tcl/editconfigs.tcl
zy1000/trunk/build/tcl/editfile.tcl
zy1000/trunk/build/tcl/erase.tcl
zy1000/trunk/build/tcl/flash.tcl
zy1000/trunk/build/tcl/flashinfo.tcl
zy1000/trunk/build/tcl/guiupload.tcl
zy1000/trunk/build/tcl/index.tcl
zy1000/trunk/build/tcl/log.tcl
zy1000/trunk/build/tcl/openocd.tcl
zy1000/trunk/build/tcl/preconfig.tcl
zy1000/trunk/build/tcl/production.tcl
zy1000/trunk/build/tcl/reload.tcl
zy1000/trunk/build/tcl/run.tcl
zy1000/trunk/build/tcl/support.tcl
zy1000/trunk/build/tcl/targets.tcl
zy1000/trunk/build/tcl/terminal.tcl
zy1000/trunk/build/tcl/upgrade.tcl
zy1000/trunk/build/tcl/zy1000.tcl
zy1000/trunk/build/testhttpd.tcl
Log:
log noise reduction
Modified: trunk/src/jtag/zy1000.c
===================================================================
--- trunk/src/jtag/zy1000.c 2009-05-06 08:30:50 UTC (rev 1612)
+++ trunk/src/jtag/zy1000.c 2009-05-06 11:22:30 UTC (rev 1613)
@@ -285,37 +285,43 @@
/* Give TELNET a way to find out what version this is */
-int handle_zy1000_version_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc)
+static int jim_zy1000_version(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- if (argc > 1)
+ if ((argc < 1) || (argc > 2))
+ return JIM_ERR;
+ char buff[128];
+ const char *version_str=NULL;
+
+ if (argc == 1)
{
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
- if (argc == 0)
+ version_str=ZYLIN_OPENOCD_VERSION;
+ } else
{
- command_print(cmd_ctx, ZYLIN_OPENOCD_VERSION);
+ const char *str = Jim_GetString(argv[1], NULL);
+ if (strcmp("openocd", str) == 0)
+ {
+ int revision;
+ revision = atol(ZYLIN_OPENOCD+strlen("XRevision: "));
+ sprintf(buff, "%d", revision);
+ version_str=buff;
+ }
+ else if (strcmp("zy1000", str) == 0)
+ {
+ version_str=ZYLIN_VERSION;
+ }
+ else if (strcmp("date", str) == 0)
+ {
+ version_str=ZYLIN_DATE;
+ }
+ else
+ {
+ return JIM_ERR;
+ }
}
- else if (strcmp("openocd", args[0]) == 0)
- {
- int revision;
- revision = atol(ZYLIN_OPENOCD+strlen("XRevision: "));
- command_print(cmd_ctx, "%d", revision);
- }
- else if (strcmp("zy1000", args[0]) == 0)
- {
- command_print(cmd_ctx, "%s", ZYLIN_VERSION);
- }
- else if (strcmp("date", args[0]) == 0)
- {
- command_print(cmd_ctx, "%s", ZYLIN_DATE);
- }
- else
- {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
- return ERROR_OK;
+ Jim_SetResult(interp, Jim_NewStringObj(interp, version_str, -1));
+
+ return JIM_OK;
}
@@ -342,9 +348,10 @@
{
register_command(cmd_ctx, NULL, "power", handle_power_command, COMMAND_ANY,
"power <on/off> - turn power switch to target on/off. No arguments - print status.");
- register_command(cmd_ctx, NULL, "zy1000_version", handle_zy1000_version_command,
- COMMAND_EXEC, "show zy1000 version numbers");
+ Jim_CreateCommand(interp, "zy1000_version", jim_zy1000_version, NULL, NULL);
+
+
Jim_CreateCommand(interp, "powerstatus", zylinjtag_Jim_Command_powerstatus, NULL, NULL);
return ERROR_OK;
Modified: zy1000/trunk/build/menu/zy1000menu.xml
===================================================================
--- zy1000/trunk/build/menu/zy1000menu.xml 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/menu/zy1000menu.xml 2009-05-06 11:22:30 UTC (rev 1613)
@@ -62,9 +62,9 @@
append buffer [ocd_jtag_khz]
</tcl>
<br>
- <tcl>append buffer [capture {zy1000_version zy1000}]</tcl><br>
- <tcl>append buffer [capture {zy1000_version openocd}]</tcl><br>
- <tcl>append buffer [capture {zy1000_version date}]</tcl><br>
+ <tcl>append buffer [zy1000_version zy1000]</tcl><br>
+ <tcl>append buffer [zy1000_version openocd]</tcl><br>
+ <tcl>append buffer [zy1000_version date]</tcl><br>
<tcl>append buffer [ip]</tcl><br>
<tcl>append buffer [ocd_gdb_port]</tcl>
</td>
@@ -1556,9 +1556,9 @@
set form_config [load_config "[load_target]"]
set support_id [string range [rand] 0 7]
set form_log ""
- append form_log "Version: [capture "zy1000_version zy1000"]"
- append form_log "OpenOCD version: [capture "zy1000_version openocd"]"
- append form_log "Version date: [capture "zy1000_version date"]"
+ append form_log "Version: [zy1000_version zy1000]"
+ append form_log "OpenOCD version: [zy1000_version openocd]"
+ append form_log "Version date: [zy1000_version date]"
append form_log [log]
</tcl>
Modified: zy1000/trunk/build/menu/zy1000menu.xsl
===================================================================
--- zy1000/trunk/build/menu/zy1000menu.xsl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/menu/zy1000menu.xsl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -36,7 +36,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div class="textlight" style="position:relative;left:15px;top:4px;">
- <tcl>append buffer [capture zy1000_version]</tcl>
+ <tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/browsemem.tcl
===================================================================
--- zy1000/trunk/build/tcl/browsemem.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/browsemem.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -54,7 +54,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/downloadmem.tcl
===================================================================
--- zy1000/trunk/build/tcl/downloadmem.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/downloadmem.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -59,7 +59,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/editconfigs.tcl
===================================================================
--- zy1000/trunk/build/tcl/editconfigs.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/editconfigs.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -27,7 +27,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/editfile.tcl
===================================================================
--- zy1000/trunk/build/tcl/editfile.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/editfile.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -75,7 +75,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/erase.tcl
===================================================================
--- zy1000/trunk/build/tcl/erase.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/erase.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -48,7 +48,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/flash.tcl
===================================================================
--- zy1000/trunk/build/tcl/flash.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/flash.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -39,7 +39,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/flashinfo.tcl
===================================================================
--- zy1000/trunk/build/tcl/flashinfo.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/flashinfo.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -37,7 +37,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/guiupload.tcl
===================================================================
--- zy1000/trunk/build/tcl/guiupload.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/guiupload.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -69,7 +69,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/index.tcl
===================================================================
--- zy1000/trunk/build/tcl/index.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/index.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -21,7 +21,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
@@ -164,9 +164,9 @@
append buffer [ocd_jtag_khz]
</tcl>
<br>
- <tcl>append buffer [capture {zy1000_version zy1000}]</tcl><br>
- <tcl>append buffer [capture {zy1000_version openocd}]</tcl><br>
- <tcl>append buffer [capture {zy1000_version date}]</tcl><br>
+ <tcl>append buffer [zy1000_version zy1000]</tcl><br>
+ <tcl>append buffer [zy1000_version openocd]</tcl><br>
+ <tcl>append buffer [zy1000_version date]</tcl><br>
<tcl>append buffer [ip]</tcl><br>
<tcl>append buffer [ocd_gdb_port]</tcl>
</td>
Modified: zy1000/trunk/build/tcl/log.tcl
===================================================================
--- zy1000/trunk/build/tcl/log.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/log.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -66,7 +66,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/openocd.tcl
===================================================================
--- zy1000/trunk/build/tcl/openocd.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/openocd.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -63,7 +63,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/preconfig.tcl
===================================================================
--- zy1000/trunk/build/tcl/preconfig.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/preconfig.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -24,7 +24,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/production.tcl
===================================================================
--- zy1000/trunk/build/tcl/production.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/production.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -44,7 +44,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/reload.tcl
===================================================================
--- zy1000/trunk/build/tcl/reload.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/reload.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -34,7 +34,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/run.tcl
===================================================================
--- zy1000/trunk/build/tcl/run.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/run.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -51,7 +51,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/support.tcl
===================================================================
--- zy1000/trunk/build/tcl/support.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/support.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -85,7 +85,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
@@ -202,9 +202,9 @@
set form_config [load_config "[load_target]"]
set support_id [string range [rand] 0 7]
set form_log ""
- append form_log "Version: [capture "zy1000_version zy1000"]"
- append form_log "OpenOCD version: [capture "zy1000_version openocd"]"
- append form_log "Version date: [capture "zy1000_version date"]"
+ append form_log "Version: [zy1000_version zy1000]"
+ append form_log "OpenOCD version: [zy1000_version openocd]"
+ append form_log "Version date: [zy1000_version date]"
append form_log [log]
</tcl>
Modified: zy1000/trunk/build/tcl/targets.tcl
===================================================================
--- zy1000/trunk/build/tcl/targets.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/targets.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -30,7 +30,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
@@ -325,7 +325,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/terminal.tcl
===================================================================
--- zy1000/trunk/build/tcl/terminal.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/terminal.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -89,7 +89,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/upgrade.tcl
===================================================================
--- zy1000/trunk/build/tcl/upgrade.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/upgrade.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -72,7 +72,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/tcl/zy1000.tcl
===================================================================
--- zy1000/trunk/build/tcl/zy1000.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/tcl/zy1000.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -82,7 +82,7 @@
</div>
<div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('/rom/menu_cuts/top_right.png');">
<div style="position:relative;left:15px;top:4px;" class="textlight">
-<tcl>append buffer [capture zy1000_version]</tcl>
+<tcl>append buffer [zy1000_version]</tcl>
</div>
</div>
</div>
Modified: zy1000/trunk/build/testhttpd.tcl
===================================================================
--- zy1000/trunk/build/testhttpd.tcl 2009-05-06 08:30:50 UTC (rev 1612)
+++ zy1000/trunk/build/testhttpd.tcl 2009-05-06 11:22:30 UTC (rev 1613)
@@ -1,8 +1,5 @@
# some dummy proc's to get things going for test purposes
-proc zy1000_version {args} {
-return abc
-}
script ../zy1000/linux_zy1000/build/tcl/openocd.cfg
|