]> git.sur5r.net Git - openocd/commitdiff
arm-jtag-ew: Fix setting interface speed (2/2)
authorSimon Barner <barner@gmx.de>
Fri, 16 Sep 2011 19:08:10 +0000 (21:08 +0200)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sat, 8 Oct 2011 21:08:46 +0000 (23:08 +0200)
Interface expects speed in Hz, not kHz

- Ticket #34

src/jtag/drivers/arm-jtag-ew.c

index f39730f9d73ccced1d66cb5e2067081587d849e0..bf60c7725c21fb52a6ffb8f4b5c1ea26507c8344 100644 (file)
@@ -184,7 +184,7 @@ static int armjtagew_speed(int speed)
 
 
     usb_out_buffer[0] = CMD_SET_TCK_FREQUENCY;
-       buf_set_u32(usb_out_buffer + 1, 0, 32, speed);
+       buf_set_u32(usb_out_buffer + 1, 0, 32, speed*1000);
 
     result = armjtagew_usb_message(armjtagew_handle, 5, 4);
 
@@ -196,7 +196,7 @@ static int armjtagew_speed(int speed)
 
        usb_out_buffer[0] = CMD_GET_TCK_FREQUENCY;
     result = armjtagew_usb_message(armjtagew_handle, 1, 4);
-       speed_real = (int)buf_get_u32(usb_in_buffer,0,32);
+       speed_real = (int)buf_get_u32(usb_in_buffer,0,32) / 1000;
        if (result < 0)
        {
         LOG_ERROR("ARM-JTAG-EW getting speed failed (%d)", result);