Skip to content

Commit 0415b1c

Browse files
authored
Merge pull request #79 from makermelissa/master
Huge GreatFET detection speedup
2 parents 66925a5 + 1333644 commit 0415b1c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

adafruit_platformdetect/chip.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,14 @@ def id(
8888
+ "set, but no MCP2221 device found"
8989
)
9090
if os.environ.get("BLINKA_GREATFET"):
91-
from greatfet import GreatFET
92-
from greatfet.errors import DeviceNotFoundError
91+
import usb
9392

94-
try:
95-
_ = GreatFET()
93+
if usb.core.find(idVendor=0x1D50, idProduct=0x60E6) is not None:
9694
return chips.LPC4330
97-
except DeviceNotFoundError():
98-
raise RuntimeError(
99-
"BLINKA_GREATFET environment variable "
100-
+ "set, but no GreatFET device found"
101-
)
95+
raise RuntimeError(
96+
"BLINKA_GREATFET environment variable "
97+
+ "set, but no GreatFET device found"
98+
)
10299
if os.environ.get("BLINKA_NOVA"):
103100
return chips.BINHO
104101

0 commit comments

Comments
 (0)