From 4b283e31220c08f6e834e85e39a8f9aca1874dd6 Mon Sep 17 00:00:00 2001 From: Ihor Nehrutsa Date: Thu, 13 May 2021 10:50:02 +0300 Subject: [PATCH] st7789_4bit.py: Prevents a white screen when the first time self.show() is called in __init__(). --- drivers/st7789/st7789_4bit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/st7789/st7789_4bit.py b/drivers/st7789/st7789_4bit.py index ff3ac4a..74068ae 100644 --- a/drivers/st7789/st7789_4bit.py +++ b/drivers/st7789/st7789_4bit.py @@ -46,6 +46,8 @@ def _lcopy(dest:ptr16, source:ptr8, lut:ptr16, length:int): class ST7789(framebuf.FrameBuffer): lut = bytearray(32) + for i in range(len(lut)): + lut[i] = 0xFF # set all colors to BLACK # Convert r, g, b in range 0-255 to a 16 bit colour value rgb565. # LS byte goes into LUT offset 0, MS byte into offset 1 @@ -79,7 +81,6 @@ class ST7789(framebuf.FrameBuffer): super().__init__(buf, width, height, mode) self._linebuf = bytearray(self.width * 2) # 16 bit color out self._init(disp_mode, orientation) - self.fill(0) self.show() # Hardware reset