mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 13:02:09 +08:00
fix for PC: detach panda kernel driver if active (#1950)
old-commit-hash: 4f0c75291b9c56b9eb219cbe74025c6897635d85
This commit is contained in:
@@ -25,6 +25,10 @@ Panda::Panda(){
|
||||
dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc);
|
||||
if (dev_handle == NULL) { goto fail; }
|
||||
|
||||
if (libusb_kernel_driver_active(dev_handle, 0) == 1) {
|
||||
libusb_detach_kernel_driver(dev_handle, 0);
|
||||
}
|
||||
|
||||
err = libusb_set_configuration(dev_handle, 1);
|
||||
if (err != 0) { goto fail; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user