Hopeful fix for spidev segfault issue #6

From continued testing up to 1.8 million simulated display updates it appears that either updating to spidev==3.4 or using xfer3 fixes the issue with a segfault after ~167000 updates.
This commit is contained in:
Phil Howard
2020-01-03 17:48:54 +00:00
parent 640596059d
commit 3009ef94c3
2 changed files with 3 additions and 5 deletions

View File

@@ -206,10 +206,7 @@ class ST7735(object):
# Convert scalar argument to list so either can be passed as parameter.
if isinstance(data, numbers.Number):
data = [data & 0xFF]
# Write data a chunk at a time.
for start in range(0, len(data), chunk_size):
end = min(start + chunk_size, len(data))
self._spi.xfer(data[start:end])
self._spi.xfer3(data)
def set_backlight(self, value):
"""Set the backlight on/off."""

View File

@@ -19,4 +19,5 @@ setup(name='ST7735',
author_email='phil@pimoroni.com',
classifiers=classifiers,
url='https://github.com/pimoroni/st7735-160x80-python/',
packages=find_packages())
packages=find_packages(),
install_requires=['spidev>=3.4'])