From caec9f9533ab8f951cd28f5de18e84e5ae52bcee Mon Sep 17 00:00:00 2001 From: ma1co Date: Wed, 14 Jun 2017 14:30:45 +0000 Subject: [PATCH] libusb: Reset device on osx --- pmca/usb/driver/libusb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmca/usb/driver/libusb.py b/pmca/usb/driver/libusb.py index 5ffda6c..76e412a 100644 --- a/pmca/usb/driver/libusb.py +++ b/pmca/usb/driver/libusb.py @@ -1,5 +1,6 @@ """A wrapper to use libusb. Default on linux, on Windows you have to install a generic driver for your camera""" +import sys import usb.core, usb.util from . import * @@ -94,6 +95,8 @@ def reset(self): self.dev.detach_kernel_driver(0) except NotImplementedError: pass + if sys.platform == 'darwin': + self.dev.reset() def read(self, length): return self.dev.read(self.epIn, length).tostring()