Optimize draw_rgb565 display write speed by skipping slow synchronous canvas updates during raw video frames
This commit is contained in:
+3
-2
@@ -233,7 +233,7 @@ class ILI9341:
|
||||
mono = 1 if lum >= 128 else 0
|
||||
self.canvas.pixel(screen_x, screen_y, mono)
|
||||
|
||||
def draw_rgb565(self, x, y, w, h, data):
|
||||
def draw_rgb565(self, x, y, w, h, data, sync_canvas=True):
|
||||
"""Draw raw RGB565 pixel data on the screen at specified (x,y) with width and height."""
|
||||
# Clip coordinates
|
||||
x_start = max(0, x)
|
||||
@@ -265,7 +265,8 @@ class ILI9341:
|
||||
self.cs(1)
|
||||
|
||||
# Sync the internal 1-bit canvas buffer
|
||||
self._update_mono_canvas_rgb565(x, y, w, h, data)
|
||||
if sync_canvas:
|
||||
self._update_mono_canvas_rgb565(x, y, w, h, data)
|
||||
return True
|
||||
|
||||
# --- SCREENSHOT ---
|
||||
|
||||
Reference in New Issue
Block a user