diff options
Diffstat (limited to 'extra')
-rw-r--r-- | extra/tigertool/ecusb/stm32uart.py | 1 | ||||
-rw-r--r-- | extra/tigertool/ecusb/stm32usb.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/extra/tigertool/ecusb/stm32uart.py b/extra/tigertool/ecusb/stm32uart.py index 459ca8e90f..21fcbd2cc2 100644 --- a/extra/tigertool/ecusb/stm32uart.py +++ b/extra/tigertool/ecusb/stm32uart.py @@ -73,6 +73,7 @@ class Suart(object): if self._tx_thread: self._tx_thread.join(2) self._tx_thread = None + self._susb.close() def run_rx_thread(self): """Background loop to pass data from USB to pty.""" diff --git a/extra/tigertool/ecusb/stm32usb.py b/extra/tigertool/ecusb/stm32usb.py index 5a91c57d13..875251329f 100644 --- a/extra/tigertool/ecusb/stm32usb.py +++ b/extra/tigertool/ecusb/stm32usb.py @@ -87,6 +87,8 @@ class Susb(object): except usb.core.USBError: pass + self._dev = dev + # Get an endpoint instance. cfg = dev.get_active_configuration() intf = usb.util.find_descriptor(cfg, bInterfaceNumber=self._interface) @@ -108,3 +110,6 @@ class Susb(object): write_ep_number = intf.bInterfaceNumber + self.WRITE_ENDPOINT write_ep = usb.util.find_descriptor(intf, bEndpointAddress=write_ep_number) self._write_ep = write_ep + + def close(self): + usb.util.dispose_resources(self._dev) |