summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-11 13:36:56 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-11 13:36:56 +0000
commitbb36f541dd9f67a69471f29650e194a8a827ff95 (patch)
treed73627f2e85362ff55c062f8f9893f06c4d6c60b
parentb565b391bc2b05753abfa0786fde1197cfb5dda3 (diff)
downloadopenocd_libswd-bb36f541dd9f67a69471f29650e194a8a827ff95.tar.gz
openocd_libswd-bb36f541dd9f67a69471f29650e194a8a827ff95.tar.bz2
openocd_libswd-bb36f541dd9f67a69471f29650e194a8a827ff95.tar.xz
openocd_libswd-bb36f541dd9f67a69471f29650e194a8a827ff95.zip
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
-rw-r--r--src/jtag/jtag.c13
1 files 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;