X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/0201007d5494d0d0bbecb25e0176901d9be151ce..daa6273b65452c3d39f3e625876ef14a544d1add:/src/board.py diff --git a/src/board.py b/src/board.py index cb8c6c8..1b42b53 100755 --- a/src/board.py +++ b/src/board.py @@ -224,15 +224,19 @@ elif "sphinx" in sys.modules: else: raise NotImplementedError("Board not supported {}".format(board_id)) -if SDA and SCL: +try: + if SDA and SCL: - def I2C(): - """The singleton I2C interface""" - return busio.I2C(SCL, SDA) + def I2C(): + """The singleton I2C interface""" + return busio.I2C(SCL, SDA) + if SCLK: -if SCLK: + def SPI(): + """The singleton SPI interface""" + return busio.SPI(SCLK, MOSI, MISO) - def SPI(): - """The singleton SPI interface""" - return busio.SPI(SCLK, MOSI, MISO) + +except NameError: + pass