adafruit / Adafruit_CircuitPython_DotStar

Dotstarrin' away in CircuitPython land
MIT License
46 stars 38 forks source link

Unlock SPI before deinit #65

Closed dhalbert closed 1 week ago

dhalbert commented 1 week ago

See https://github.com/adafruit/circuitpython/issues/9586. As of https://github.com/adafruit/circuitpython/pull/9164, on Espressif, SPI.deinit() waits for the SPI lock to be unlocked before doing the deinit. This causes DotStar.deinit() to hang. The DotStar object has exclusive access to the SPI it creates and does not bother to lock and unlock it each time.

So just unlock the SPI lock before doing the deinit(). This may become unnecessary when https://github.com/adafruit/circuitpython/issues/9586 is addressed, but it's safer anyway.