Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RAW_IO with WinUSB #1483

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JVital2013
Copy link

At the request of @martinling, here's a draft PR that implements RAW_IO on Windows, using libusb/libusb#1512. The change checks if RAW_IO is available, and if it is, it turns it on for the RX_ENDPOINT_ADDRESS. I've made it silently ignore the result of libusb_endpoint_set_raw_io, since in the unlikely event of the call not working, I'd think we should continue on anyway.

This change fixes sample drops on problematic Windows machines. I've marked the PR a draft because this change will require #if LIBUSB_API_VERSION >= 0x0100010B ... #endif to prevent issues when building with older versions of LibUSB. The problem is:

  • The change isn't actually merged into LibUSB yet (hopefully it is soon!)
  • LIBUSB_API_VERSION has not been bumped yet. It's still sitting at 0x0100010A, so there's no good way to detect the presence of this function

While we wait for upstream devs, let me know if you'd like to see any changes to this!

@martinling
Copy link
Member

Yes, that looks fine - after all, I designed that libusb API specifically so that it could be this simple! 😁

You'll need a space after the if to satisfy the clang-format check. You can run tools/reformat-source.sh to reformat automatically.

Other than that we just need to wait for the official LIBUSB_API_VERSION bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants