Skip to content

Commit

Permalink
fix(display): fix st77xx.py generic driver flush_cb issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PGNetHun committed Feb 4, 2024
1 parent dc5bb8f commit 03ed689
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion driver/generic/ili9xxx.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def apply_rotation(self, rot):
class Ili9341(Ili9341_hw, st77xx.St77xx_lvgl):
def __init__(self, doublebuffer=True, factor=4, **kw):
"""See :obj:`Ili9341_hw` for the meaning of the parameters."""
import lvgl as lv

Ili9341_hw.__init__(self, **kw)
st77xx.St77xx_lvgl.__init__(self, doublebuffer, factor)
9 changes: 6 additions & 3 deletions driver/generic/st77xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,17 @@ class St77xx_lvgl(object):
'''
def disp_drv_flush_cb(self,disp_drv,area,color_p):
# print(f"({area.x1},{area.y1}..{area.x2},{area.y2})")
self.rp2_wait_dma() # wait if not yet done and DMA is being used
# blit in background

w = area.x2 - area.x1 + 1
h = area.y2 - area.y1 + 1
size = w * h
data_view = color_p.__dereference__(size * self.pixel_size)
if self.rgb565_swap_func:
self.rgb565_swap_func(data_view, size)
self.blit(area.x1,area.y1,w:=(area.x2-area.x1+1),h:=(area.y2-area.y1+1),data_view,is_blocking=False)

# blit in background
self.blit(area.x1, area.y1, w, h, data_view, is_blocking=False)
self.disp_drv.flush_ready()

def __init__(self,doublebuffer=True,factor=4):
Expand Down

0 comments on commit 03ed689

Please sign in to comment.