From bb36f541dd9f67a69471f29650e194a8a827ff95 Mon Sep 17 00:00:00 2001 From: oharboe Date: Mon, 11 Aug 2008 13:36:56 +0000 Subject: fix output from jtag_khz when only jtag_speed has been invoked git-svn-id: svn://svn.berlios.de/openocd/trunk@908 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/jtag.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 315cc9d5..c28858ee 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -1662,6 +1662,7 @@ static int default_khz(int khz, int *jtag_speed) static int default_speed_div(int speed, int *khz) { + LOG_ERROR("Translation from jtag_speed to khz not implemented"); return ERROR_FAIL; } @@ -1897,7 +1898,7 @@ int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char { } else { - retval=ERROR_COMMAND_SYNTAX_ERROR; + return ERROR_COMMAND_SYNTAX_ERROR; } command_print(cmd_ctx, "jtag_speed: %d", jtag_speed); @@ -1934,8 +1935,16 @@ int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char * { } else { - retval=ERROR_COMMAND_SYNTAX_ERROR; + return ERROR_COMMAND_SYNTAX_ERROR; + } + + if (jtag!=NULL) + { + int what_speed; + if ((retval=jtag->speed_div(jtag_speed, &speed_khz))!=ERROR_OK) + return retval; } + command_print(cmd_ctx, "jtag_khz: %d", speed_khz); return retval; -- cgit v1.2.3