Skip to content

Commit 26a7920

Browse files
committed
Update rpi_ws281x.py
call ws2811_fini() before calling delete_ws2811_t() to ensure DMA is finished when terminating
1 parent 70a8528 commit 26a7920

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/rpi_ws281x/rpi_ws281x.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def __init__(self, num, pin, freq_hz=800000, dma=10, invert=False,
111111
def _cleanup(self):
112112
# Clean up memory used by the library when not needed anymore.
113113
if self._leds is not None:
114+
ws.ws2811_fini(self.leds)
114115
ws.delete_ws2811_t(self._leds)
115116
self._leds = None
116117
self._channel = None

0 commit comments

Comments
 (0)