Skip to content

Commit

Permalink
Damnit, always forgetting something. Added the attach driver function…
Browse files Browse the repository at this point in the history
… when we close the USB device to get things back to

how they were before we started.
  • Loading branch information
profanum429 committed Aug 2, 2014
1 parent f0574f2 commit acdc1af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion native_usb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ int native_usb::open_usb(int vid, int pid)
if(r != 0)
{
qDebug("Detach Kernel Driver: %s", libusb_error_name(r));
return -1;
}
#endif

Expand Down Expand Up @@ -191,6 +190,10 @@ int native_usb::close_usb()
return -1;
}

#if defined(Q_OS_LINUX)
libusb_attach_kernel_driver(usb, 0);
#endif

libusb_close(usb);
libusb_exit(NULL);

Expand Down

0 comments on commit acdc1af

Please sign in to comment.