Optimize draw_rgb565 display write speed by skipping slow synchronous canvas updates during raw video frames

This commit is contained in:
Adolfo Reyna
2026-06-19 13:38:25 -04:00
parent c8853cc5df
commit 30aff5eb8b
3 changed files with 23 additions and 5 deletions
+3 -2
View File
@@ -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 ---