]> Repositories - hackapet/Adafruit_Blinka.git/blobdiff - src/board.py
Move import busio back to where it was
[hackapet/Adafruit_Blinka.git] / src / board.py
index 9de41722cd9b9eb015c5a120383dc068fa4d89be..3852a77a5bf27c5956af816624b6bd7d6392a4d0 100755 (executable)
@@ -224,7 +224,7 @@ elif "sphinx" in sys.modules:
 else:
     raise NotImplementedError("Board not supported {}".format(board_id))
 
-if SCL and SDA:
+try:
 
     def I2C():
         """The singleton I2C interface"""
@@ -233,10 +233,17 @@ if SCL and SDA:
         return busio.I2C(SCL, SDA)
 
 
-if SCLK and MOSI and MISO:
+except NameError:
+    pass
+
+try:
 
     def SPI():
         """The singleton SPI interface"""
         import busio
 
         return busio.SPI(SCLK, MOSI, MISO)
+
+
+except NameError:
+    pass