We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca086fd commit 626bf15Copy full SHA for 626bf15
pylabrobot/io/ftdi.py
@@ -6,7 +6,7 @@
6
from typing import Optional, cast
7
8
try:
9
- from pylibftdi import Device, LibraryMissingError
+ from pylibftdi import Device, FtdiError, LibraryMissingError
10
11
HAS_PYLIBFTDI = True
12
except ImportError as e:
@@ -52,7 +52,12 @@ def dev(self) -> "Device":
52
return self._dev
53
54
async def setup(self):
55
- self.dev.open()
+ try:
56
+ self.dev.open()
57
+ except FtdiError as e:
58
+ raise RuntimeError(
59
+ f"Failed to open FTDI device: {e}. Is the device connected? Is it in use by another process? Try restarting the kernel."
60
+ ) from e
61
self._executor = ThreadPoolExecutor(max_workers=1)
62
63
async def set_baudrate(self, baudrate: int):
0 commit comments