|
37 | 37 | #include <target/cortex_m.h> |
38 | 38 |
|
39 | 39 | #include "cmsis_dap.h" |
40 | | -#include "libusb_helper.h" |
| 40 | + |
| 41 | +#define TIMEOUT_MS 6000 |
41 | 42 |
|
42 | 43 | /* Create a dummy backend for 'backend' command if real one does not build */ |
43 | 44 | #if BUILD_CMSIS_DAP_USB == 0 |
@@ -363,12 +364,12 @@ static int cmsis_dap_xfer(struct cmsis_dap *dap, int txlen) |
363 | 364 | } |
364 | 365 |
|
365 | 366 | uint8_t current_cmd = dap->command[0]; |
366 | | - int retval = dap->backend->write(dap, txlen, LIBUSB_TIMEOUT_MS); |
| 367 | + int retval = dap->backend->write(dap, txlen, TIMEOUT_MS); |
367 | 368 | if (retval < 0) |
368 | 369 | return retval; |
369 | 370 |
|
370 | 371 | /* get reply */ |
371 | | - retval = dap->backend->read(dap, LIBUSB_TIMEOUT_MS, CMSIS_DAP_BLOCKING); |
| 372 | + retval = dap->backend->read(dap, TIMEOUT_MS, CMSIS_DAP_BLOCKING); |
372 | 373 | if (retval < 0) |
373 | 374 | return retval; |
374 | 375 |
|
@@ -872,7 +873,7 @@ static void cmsis_dap_swd_write_from_queue(struct cmsis_dap *dap) |
872 | 873 | } |
873 | 874 | } |
874 | 875 |
|
875 | | - int retval = dap->backend->write(dap, idx, LIBUSB_TIMEOUT_MS); |
| 876 | + int retval = dap->backend->write(dap, idx, TIMEOUT_MS); |
876 | 877 | if (retval < 0) { |
877 | 878 | queued_retval = retval; |
878 | 879 | goto skip; |
@@ -913,7 +914,7 @@ static void cmsis_dap_swd_read_process(struct cmsis_dap *dap, enum cmsis_dap_blo |
913 | 914 | } |
914 | 915 |
|
915 | 916 | /* get reply */ |
916 | | - retval = dap->backend->read(dap, LIBUSB_TIMEOUT_MS, blocking); |
| 917 | + retval = dap->backend->read(dap, TIMEOUT_MS, blocking); |
917 | 918 | bool timeout = (retval == ERROR_TIMEOUT_REACHED || retval == 0); |
918 | 919 | if (timeout && blocking == CMSIS_DAP_NON_BLOCKING) |
919 | 920 | return; |
|
0 commit comments