stlink: support expected-id 0

This brings the stlink driver inline with the rest of OpenOCD.

If the user configures the tap as -expected-id 0 then the IDCODE will be
treated as a wildcard and ignored.

Change-Id: I99160c69b2b40f5b1f608bb59ab6630894502fd8
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/476
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
__archive__
Spencer Oliver 2012-02-21 10:41:39 +00:00
parent 897981c318
commit f6b50b8ea2
1 changed files with 2 additions and 1 deletions

View File

@ -67,7 +67,8 @@ int stlink_interface_init_target(struct target *t)
for (ii = 0; ii < limit; ii++) {
uint32_t expected = t->tap->expected_ids[ii];
if (t->tap->idcode == expected) {
/* treat "-expected-id 0" as a "don't-warn" wildcard */
if (!expected || (t->tap->idcode == expected)) {
found = 1;
break;
}