diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-05-01 16:24:15 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-05-01 16:24:15 +0200 |
commit | a30ba67504ffd12c4db499adbb5ce47a7d1f6036 (patch) | |
tree | 9ae1a7e3849dda6bbb5c578232f6f2fa5b2e7e7e /spectro/usbio_nt.c | |
parent | 89e99e8a827859729729dfc92d74be4a8f96f1a4 (diff) | |
parent | 094535c010320967639e8e86f974d878e80baa72 (diff) |
New release 1.7.0
Diffstat (limited to 'spectro/usbio_nt.c')
-rw-r--r-- | spectro/usbio_nt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spectro/usbio_nt.c b/spectro/usbio_nt.c index de9b265..8eb791f 100644 --- a/spectro/usbio_nt.c +++ b/spectro/usbio_nt.c @@ -409,6 +409,7 @@ void usb_close_port(icoms *p) { &req, sizeof(libusb_request), NULL, 0, NULL)) != ICOM_OK) { a1logd(p->log, 1, "usb_close_port: reset returned %d\n",rv); } + msec_sleep(500); /* Things foul up unless we wait for the reset... */ } CloseHandle(p->usbd->handle); @@ -466,9 +467,12 @@ char **pnames /* List of process names to try and kill before opening */ FILE_FLAG_OVERLAPPED, NULL)) == INVALID_HANDLE_VALUE) { a1logd(p->log, 8, "usb_open_port: open '%s' config %d failed (%d) (Device being used ?)\n",p->usbd->dpath,config,GetLastError()); if (retries <= 0) { - if (kpc != NULL) + if (kpc != NULL) { + if (kpc->th->result < 0) + a1logw(p->log, "usb_open_port: killing competing processes failed\n"); kpc->del(kpc); - a1loge(p->log, ICOM_SYS, "usb_open_port: open '%s' config %d failed (%d) (Device being used ?)\n",p->usbd->dpath,config,GetLastError()); + } + a1logw(p->log, "usb_open_port: open '%s' config %d failed (%d) (Device being used ?)\n",p->usbd->dpath,config,GetLastError()); return ICOM_SYS; } continue; @@ -614,7 +618,7 @@ static int icoms_usb_transaction( amutex_lock(cancelt->cmtx); cancelt->hcancel = (void *)&endpoint; cancelt->state = 1; - amutex_unlock(cancelt->cond); /* Signal any thread waiting for IO start */ + amutex_unlock(cancelt->condx); /* Signal any thread waiting for IO start */ amutex_unlock(cancelt->cmtx); } @@ -643,7 +647,7 @@ done:; amutex_lock(cancelt->cmtx); cancelt->hcancel = (void *)NULL; if (cancelt->state == 0) - amutex_unlock(cancelt->cond); /* Make sure this gets unlocked */ + amutex_unlock(cancelt->condx); /* Make sure this gets unlocked */ cancelt->state = 2; amutex_unlock(cancelt->cmtx); } |