-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
USB: fix device open & endpoint config code
* Detach kernel driver from all interfaces it is attached to. In case of PocketPOD, the kernel driver is attached to both iface 0 and 1 and it all needs to be detached, otherwise setting config will fail! Learned the hard way; * If endpoint alt setting is 0, don't set alt setting 0, otherwise this messed the endpoints up and you won't be able to read/write! Learned the hard way; * Upon error and when closing the device, reattach the kernel back. For some reason, this fails with "resource busy", but the device seems to work fine afterwards. Will investigate; * Fix `check!` macro to correctly match the LIBUSB_SUCCESS constant! LEARNED THE HARD WAY!!! ;( * Fix the callback to correctly write to log and stop on errors;
- Loading branch information
Showing
3 changed files
with
117 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters