mirror of
https://github.com/pimoroni/st7735-python.git
synced 2025-01-05 22:40:25 +03:00
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:
@@ -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."""
|
||||
|
||||
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user