From: Melissa LeBlanc-Williams Date: Thu, 21 May 2020 15:02:42 +0000 (-0700) Subject: Display message to linux user to use new Bitbang Library for now X-Git-Tag: 4.10.0~1^2 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/bb8f8b71f45446780449a730a741cc952a9f8578 Display message to linux user to use new Bitbang Library for now --- diff --git a/src/bitbangio.py b/src/bitbangio.py index 241db56..8570620 100755 --- a/src/bitbangio.py +++ b/src/bitbangio.py @@ -16,6 +16,11 @@ class I2C(Lockable): # TODO: This one is a bit questionable: if agnostic.board_id == ap_board.PYBOARD: raise NotImplementedError("No software I2C on {}".format(agnostic.board_id)) + elif agnostic.detector.board.any_embedded_linux: + # TODO: Attempt to load this library automatically + raise NotImplementedError( + "For bitbangio on Linux, please use Adafruit_CircuitPython_BitbangIO" + ) self.init(scl, sda, frequency) def init(self, scl, sda, frequency): @@ -63,6 +68,11 @@ class I2C(Lockable): # TODO untested, as actually busio.SPI was on tasklist https://github.com/adafruit/Adafruit_Micropython_Blinka/issues/2 :( class SPI(Lockable): def __init__(self, clock, MOSI=None, MISO=None): + if agnostic.detector.board.any_embedded_linux: + # TODO: Attempt to load this library automatically + raise NotImplementedError( + "For bitbangio on Linux, please use Adafruit_CircuitPython_BitbangIO" + ) from machine import SPI self._spi = SPI(-1)