[Pkg-electronics-commits] [openocd] 17/19: ftdi: fix adapter_init rclk fallback

Jonathan McDowell noodles at moszumanska.debian.org
Tue Oct 31 21:15:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

noodles pushed a commit to annotated tag v0.6.1
in repository openocd.

commit 6d1ea5a7a9e2158f5937af66cf0f642a05cd99d1
Author: Spencer Oliver <spen at spen-soft.co.uk>
Date:   Mon Sep 24 12:29:47 2012 +0100

    ftdi: fix adapter_init rclk fallback
    
    adapter_init expects jtag_get_speed (via ftdi_khz) to return a valid
    fallback speed if the adapter does not support rclk. The call was failing
    and so was the rest of the adapter init.
    
    The makes the new ftdi driver emulate the old ftdi driver.
    
    Change-Id: Ic7fac7d201241eb181e98f1ba7111f159731f6e0
    Signed-off-by: Spencer Oliver <spen at spen-soft.co.uk>
    Reviewed-on: http://openocd.zylin.com/877
    Tested-by: jenkins
---
 src/jtag/drivers/ftdi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c
index 0a2aec2..f04b390 100644
--- a/src/jtag/drivers/ftdi.c
+++ b/src/jtag/drivers/ftdi.c
@@ -247,6 +247,11 @@ static int ftdi_speed_div(int speed, int *khz)
 
 static int ftdi_khz(int khz, int *jtag_speed)
 {
+	if (khz == 0 && !mpsse_is_high_speed(mpsse_ctx)) {
+		LOG_DEBUG("RCLK not supported");
+		return ERROR_FAIL;
+	}
+
 	*jtag_speed = khz * 1000;
 	return ERROR_OK;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/openocd.git



More information about the Pkg-electronics-commits mailing list