@@ -27,11 +27,6 @@ class Chip:
27
27
"""Attempt detection of current chip / CPU."""
28
28
def __init__ (self , detector ):
29
29
self .detector = detector
30
- try :
31
- os .environ .get ('BLINKA_NOVA' ):
32
- self ._binho = None
33
- except KeyError : # no relevant environment var
34
- pass
35
30
36
31
@property
37
32
def id (self ): # pylint: disable=invalid-name,too-many-branches,too-many-return-statements
@@ -61,24 +56,12 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-s
61
56
raise RuntimeError ('BLINKA_MCP2221 environment variable ' + \
62
57
'set, but no MCP2221 device found' )
63
58
if os .environ .get ('BLINKA_NOVA' ):
64
- # Check if we already have a binho instance
65
- if self ._binho is not None and self ._binho == BINHO :
66
- return self ._binho
67
-
68
- # import the Binho libraries
69
- from binhoHostAdapter import binhoHostAdapter
70
- from binhoHostAdapter import binhoUtilities
71
-
72
- utilities = binhoUtilities .binhoUtilities ()
73
- devices = utilities .listAvailableDevices ()
74
-
75
- count = len (devices )
76
-
77
- if count == 0 :
78
- self ._binho = None
79
- raise RuntimeError ('BLINKA_BINHO environment variable' + \
80
- 'set, but no Binho host adapter found.' )
81
- self ._binho = BINHO
59
+ # Check for Nova connection
60
+ from adafruit_blinka .microcontroller .nova import Connection
61
+ binho = Connection .getInstance ()
62
+ if binho == None :
63
+ raise RuntimeError ('BLINKA_NOVA environment variable ' + \
64
+ 'set, but no NOVA device found' )
82
65
return BINHO
83
66
84
67
platform = sys .platform
0 commit comments