X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/5addeea21db64285a19902913dde42a98546625c..3640a5c3207d39d72eae23e9e0a5401eefc5b85c:/displayio/_fourwire.py?ds=sidebyside diff --git a/displayio/_fourwire.py b/displayio/_fourwire.py index c343e65..61be810 100644 --- a/displayio/_fourwire.py +++ b/displayio/_fourwire.py @@ -132,6 +132,13 @@ class FourWire: else: self._spi.write(data) + def _free(self) -> bool: + """Attempt to free the bus and return False if busy""" + if not self._spi.try_lock(): + return False + self._spi.unlock() + return True + def _begin_transaction(self) -> bool: """Begin the SPI transaction by locking, configuring, and setting Chip Select""" if not self._spi.try_lock():