diff --git a/docs/manual_installation.md b/docs/manual_installation.md index 5b8ebadf..a8c63da5 100644 --- a/docs/manual_installation.md +++ b/docs/manual_installation.md @@ -215,6 +215,13 @@ workon seedsigner-env pwd ``` +### Optional: increase spidev buffer size +This allows `ST7789.py` to update the LCD without performing multiple write operations because the default buffer size is 4096 bytes. The default can be changed via the `/boot/cmdline.txt` file. You will need to add `spidev.bufsiz=131072` to the end of this single lined file command. + +Example `cmdline.txt` contents: +``` +console=serial0,115200 console=tty1 root=PARTUUID=2fa4ba7e-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether spidev.bufsiz=131072 +``` ### Configure `systemd` to run SeedSigner at boot: diff --git a/src/seedsigner/gui/screens/scan_screens.py b/src/seedsigner/gui/screens/scan_screens.py index 88253322..87062786 100644 --- a/src/seedsigner/gui/screens/scan_screens.py +++ b/src/seedsigner/gui/screens/scan_screens.py @@ -44,7 +44,7 @@ class ScanScreen(BaseScreen): decoder: DecodeQR = None instructions_text: str = "< back | Scan a QR code" resolution: tuple[int,int] = (480, 480) - framerate: int = 5 # TODO: alternate optimization for Pi Zero 2W? + framerate: int = 6 # TODO: alternate optimization for Pi Zero 2W? render_rect: tuple[int,int,int,int] = None diff --git a/src/seedsigner/hardware/ST7789.py b/src/seedsigner/hardware/ST7789.py index c9cb1cdb..ebd4952b 100644 --- a/src/seedsigner/hardware/ST7789.py +++ b/src/seedsigner/hardware/ST7789.py @@ -159,13 +159,11 @@ class ST7789(object): pix = arr.tobytes() self.SetWindows ( 0, 0, self.width, self.height) GPIO.output(self._dc,GPIO.HIGH) - for i in range(0,len(pix),4096): - self._spi.writebytes(pix[i:i+4096]) + self._spi.writebytes2(pix) def clear(self): """Clear contents of image buffer""" _buffer = [0xff]*(self.width * self.height * 2) self.SetWindows ( 0, 0, self.width, self.height) GPIO.output(self._dc,GPIO.HIGH) - for i in range(0,len(_buffer),4096): - self._spi.writebytes(_buffer[i:i+4096]) + self._spi.writebytes2(_buffer)