From ca2fffabfc1c69a7d2eb21c2f6d839260543131a Mon Sep 17 00:00:00 2001 From: gg Date: Thu, 2 Nov 2023 09:51:47 +0100 Subject: [PATCH] fix --- src/components/usb_586x.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/usb_586x.py b/src/components/usb_586x.py index a9072a2..1349062 100644 --- a/src/components/usb_586x.py +++ b/src/components/usb_586x.py @@ -39,6 +39,7 @@ class USB_586x(Component): def __init__(self, config=None, name=None, period=1, lazy=True, paused=False, threaded=True): super().__init__(config=config, name=name, period=period, lazy=lazy, paused=paused, threaded=threaded) + self.buffer = None self.io_ok = False self.mutex = QMutex() self.simulate="--sim-io" in sys.argv @@ -73,6 +74,7 @@ class USB_586x(Component): def open_device(self): # DIGITAL I/O CLASS if not self.simulate: + self.log.info("OPENING USB MODULE...") if is_win: try: self.di_ctrl = InstantDiCtrl(self.info.Description) @@ -188,6 +190,8 @@ class USB_586x(Component): else: self.buffer = None self.log.error(f"READ ERROR") + self.di_ctrl.dispose() + self.do_ctrl.dispose() self.io_ok = False