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 <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2191
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Paul Fertser 2014-06-24 18:10:35 +04:00 committed by Andreas Fritiofson
parent a74b5687a7
commit aa79f7b7e0
1 changed files with 2 additions and 0 deletions

View File

@ -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)) if ((cmsis_dap_vid[i] == cur_dev->vendor_id) && (cmsis_dap_pid[i] == cur_dev->product_id))
break; break;
} }
if (cmsis_dap_vid[i] || cmsis_dap_pid[i])
break;
} }
cur_dev = cur_dev->next; cur_dev = cur_dev->next;