Merge pull request #897 from UweBonnes/fixes

bmp_libusb: Check only for cmsis_dap if no cable has been found yet.
This commit is contained in:
UweBonnes 2021-06-18 12:13:19 +02:00 committed by GitHub
commit 41719c5559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -229,8 +229,9 @@ int find_debuggers(BMP_CL_OPTIONS_t *cl_opts,bmp_info_t *info)
DEBUG_WARN("BMP in botloader mode found. Restart or reflash!\n"); DEBUG_WARN("BMP in botloader mode found. Restart or reflash!\n");
continue; continue;
} }
} else if ((type = find_cmsis_dap_interface(dev, info)) != BMP_TYPE_NONE) { } else if ((type == BMP_TYPE_NONE) &&
/* type was set by the expression */ ((type = find_cmsis_dap_interface(dev, info)) != BMP_TYPE_NONE)) {
/* find_cmsis_dap_interface has set valid type*/
} else if ((strstr(manufacturer, "CMSIS")) || (strstr(product, "CMSIS"))) { } else if ((strstr(manufacturer, "CMSIS")) || (strstr(product, "CMSIS"))) {
type = BMP_TYPE_CMSIS_DAP_V1; type = BMP_TYPE_CMSIS_DAP_V1;
} else if (desc.idVendor == VENDOR_ID_STLINK) { } else if (desc.idVendor == VENDOR_ID_STLINK) {