fix for PC: detach panda kernel driver if active (#1950)

old-commit-hash: 4f0c75291b
vw-mqb-aeb
xx979xx 5 years ago committed by GitHub
parent 1ea8e10240
commit 705dfc1c5b
  1. 4
      selfdrive/boardd/panda.cc

@ -25,6 +25,10 @@ Panda::Panda(){
dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc); dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc);
if (dev_handle == NULL) { goto fail; } 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); err = libusb_set_configuration(dev_handle, 1);
if (err != 0) { goto fail; } if (err != 0) { goto fail; }

Loading…
Cancel
Save