From aa79f7b7e0124f993da379690f3b629ef6d76c6c Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Tue, 24 Jun 2014 18:10:35 +0400 Subject: [PATCH] jtag/drivers/cmsis_dap: fix check for hardcoded vids/pids This is intended to fix cmsis_dap_vid_pid command but it doesn't because cmsis-dap has only one transport and it's auto-selected from "interface" command handler (before any other commands are run) and as the result cmsis_dap_usb_open() is called too early. Change-Id: Idaade73797d8df67a6439d096f6abc9736495599 Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/2191 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/jtag/drivers/cmsis_dap_usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c index 5072de0c7..7d4c579ae 100644 --- a/src/jtag/drivers/cmsis_dap_usb.c +++ b/src/jtag/drivers/cmsis_dap_usb.c @@ -193,6 +193,8 @@ static int cmsis_dap_usb_open(void) if ((cmsis_dap_vid[i] == cur_dev->vendor_id) && (cmsis_dap_pid[i] == cur_dev->product_id)) break; } + if (cmsis_dap_vid[i] || cmsis_dap_pid[i]) + break; } cur_dev = cur_dev->next;