From: <oh...@ma...> - 2008-12-17 15:55:16
|
Author: oharboe Date: 2008-12-17 15:55:12 +0100 (Wed, 17 Dec 2008) New Revision: 1257 Modified: trunk/src/jtag/zy1000.c trunk/src/openocd.c zy1000/trunk/build/tcl/openocd.cfg Log: check syntax for init/version Modified: trunk/src/jtag/zy1000.c =================================================================== --- trunk/src/jtag/zy1000.c 2008-12-17 14:07:03 UTC (rev 1256) +++ trunk/src/jtag/zy1000.c 2008-12-17 14:55:12 UTC (rev 1257) @@ -355,7 +355,7 @@ int zy1000_init(void) { - LOG_ERROR("%s\n", ZYLIN_OPENOCD_VERSION); + LOG_USER("%s", ZYLIN_OPENOCD_VERSION); ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x30); // Turn on LED1 & LED2 Modified: trunk/src/openocd.c =================================================================== --- trunk/src/openocd.c 2008-12-17 14:07:03 UTC (rev 1256) +++ trunk/src/openocd.c 2008-12-17 14:55:12 UTC (rev 1257) @@ -82,6 +82,9 @@ /* 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) { + if (argc!=0) + return ERROR_COMMAND_SYNTAX_ERROR; + command_print(cmd_ctx, OPENOCD_VERSION); return ERROR_OK; @@ -123,6 +126,10 @@ /* OpenOCD can't really handle failure of this command. Patches welcome! :-) */ int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { + + if (argc!=0) + return ERROR_COMMAND_SYNTAX_ERROR; + int retval; static int initialized=0; if (initialized) Modified: zy1000/trunk/build/tcl/openocd.cfg =================================================================== --- zy1000/trunk/build/tcl/openocd.cfg 2008-12-17 14:07:03 UTC (rev 1256) +++ zy1000/trunk/build/tcl/openocd.cfg 2008-12-17 14:55:12 UTC (rev 1257) @@ -90,6 +90,16 @@ } +add_help_text ls "<directory> - lists files in directory" +add_help_text reboot "reboots ZY1000 unit" +add_help_text mac "prints MAC number of ZY1000 unit" +add_help_text ip "print current IP number of ZY1000 unit" + + +proc zy1000_flash {} { + set t [lindex 0 [ocd_flash_banks]] + return $t(base) +} interface ZY1000 telnet_port 23 @@ -105,18 +115,7 @@ # Here we do *not* catch the error since we want the file & line number to appear # in the log script /config/settings/openocd.cfg -init result +init # Startup was OK set startup_status 1 - -add_help_text ls "<directory> - lists files in directory" -add_help_text reboot "reboots ZY1000 unit" -add_help_text mac "prints MAC number of ZY1000 unit" -add_help_text ip "print current IP number of ZY1000 unit" - - -proc zy1000_flash {} { - set t [lindex 0 [ocd_flash_banks]] - return $t(base) -} \ No newline at end of file |