The C implementation of adafruit_bus_device.spi_device.SPIDevice will hang on __enter__() if the busio.SPI() object is locked and not released while it's waiting for the lock. It cannot be ctrl-C'd.
Test program:
import board
import adafruit_bus_device.spi_device
spi = board.SPI()
spid = adafruit_bus_device.spi_device.SPIDevice(spi)
spi.try_lock()
with spid as spi:
print("waiting to write")
spi.write(b'abc')
# cannot ctrl-C here
print("wrote")
The C implementation of
adafruit_bus_device.spi_device.SPIDevicewill hang on__enter__()if thebusio.SPI()object is locked and not released while it's waiting for the lock. It cannot be ctrl-C'd.Test program: