]> git.sur5r.net Git - openocd/commitdiff
fix output from jtag_khz when only jtag_speed has been invoked
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 11 Aug 2008 13:36:56 +0000 (13:36 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 11 Aug 2008 13:36:56 +0000 (13:36 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@908 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/jtag.c

index 315cc9d52c3d32c919be93711076b4ecc348bf0e..c28858ee77d91a5b364123c8ba547a7a5c74bca8 100644 (file)
@@ -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;