]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/_fourwire.py
Remove debug code + add bus free
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / _fourwire.py
index c343e6511a407cdb39c1abfc5df58097b95da4ea..61be810d45303555fa45291437e38c1e64967b8d 100644 (file)
@@ -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():