Update usblib.py

This commit is contained in:
Bjoern Kerler 2021-08-14 15:30:41 +02:00 committed by GitHub
parent 6088abfe59
commit 80af3a5b57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,8 +104,11 @@ class usb_class(metaclass=LogBase):
elif sys.platform.startswith('win32'):
self.backend = usb.backend.libusb1.get_backend(find_library=lambda x: "libusb-1.0.dll")
if self.backend is not None:
self.backend.lib.libusb_set_option.argtypes = [c_void_p, c_int]
self.backend.lib.libusb_set_option(self.backend.ctx, 1)
try:
self.backend.lib.libusb_set_option.argtypes = [c_void_p, c_int]
self.backend.lib.libusb_set_option(self.backend.ctx, 1)
except:
self.backend = None
def verify_data(self, data, pre="RX:"):
if self.__logger.level == logging.DEBUG: