mirror of
https://github.com/RPCS3/hidapi.git
synced 2026-07-21 00:45:21 -04:00
Merge branch 'master' of github.com:signal11/hidapi
This commit is contained in:
+11
-3
@@ -755,9 +755,17 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
|
||||
break;
|
||||
}
|
||||
good_open = 1;
|
||||
res = libusb_detach_kernel_driver(dev->device_handle, intf_desc->bInterfaceNumber);
|
||||
if (res < 0) {
|
||||
//LOG("Unable to detach. Maybe this is OK\n");
|
||||
|
||||
/* Detach the kernel driver, but only if the
|
||||
device is managed by the kernel */
|
||||
if (libusb_kernel_driver_active(dev->device_handle, intf_desc->bInterfaceNumber) == 1) {
|
||||
res = libusb_detach_kernel_driver(dev->device_handle, intf_desc->bInterfaceNumber);
|
||||
if (res < 0) {
|
||||
libusb_close(dev->device_handle);
|
||||
LOG("Unable to detach Kernel Driver\n");
|
||||
good_open = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
res = libusb_claim_interface(dev->device_handle, intf_desc->bInterfaceNumber);
|
||||
|
||||
@@ -420,6 +420,10 @@ MainWindow::onTimeout(FXObject *sender, FXSelector sel, void *ptr)
|
||||
input_text->appendText(s);
|
||||
input_text->setBottomLine(INT_MAX);
|
||||
}
|
||||
if (res < 0) {
|
||||
input_text->appendText("hid_read() returned error\n");
|
||||
input_text->setBottomLine(INT_MAX);
|
||||
}
|
||||
|
||||
getApp()->addTimeout(this, ID_TIMER,
|
||||
5 * timeout_scalar /*5ms*/);
|
||||
|
||||
Reference in New Issue
Block a user