Skip to content

Commit a3ad6ac

Browse files
Try render_mode = lv.DISPLAY_RENDER_MODE.FULL
It's sort of okay but there's a skew/italic effect.
1 parent d921cb3 commit a3ad6ac

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

internal_filesystem/lib/mpos/board/lilygo_t_display_s3.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@
2929
time.sleep(3)
3030
machine.reset()
3131

32-
_BUFFER_SIZE = const(28800)
32+
#_BUFFER_SIZE = const(28800)
33+
_BUFFER_SIZE = const(170 * 320 * 2) # without the + 1 this triggers render_mode = lv.DISPLAY_RENDER_MODE.FULL which is broken on emulated hardware (actual hardware still to test)
3334
fb1 = display_bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_INTERNAL | lcd_bus.MEMORY_DMA)
34-
fb2 = display_bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_INTERNAL | lcd_bus.MEMORY_DMA)
35+
#fb1_aligned = lv.draw_buf_align(fb1, lv.COLOR_FORMAT.RGB565)
36+
#fb2 = display_bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_INTERNAL | lcd_bus.MEMORY_DMA)
3537

3638
import drivers.display.st7789 as st7789
3739
import mpos.ui
3840
mpos.ui.main_display = st7789.ST7789(
3941
data_bus=display_bus,
4042
frame_buffer1=fb1,
41-
frame_buffer2=fb2,
42-
display_width=170,
43-
display_height=320,
43+
#frame_buffer2=fb2,
44+
display_width=320,
45+
display_height=170,
4446
color_space=lv.COLOR_FORMAT.RGB565,
4547
# color_space=lv.COLOR_FORMAT.RGB888, # not supported on qemu
4648
color_byte_order=st7789.BYTE_ORDER_BGR,
@@ -51,15 +53,17 @@
5153
backlight_pin=38, # needed
5254
backlight_on_state=st7789.STATE_PWM,
5355
offset_x=0,
54-
offset_y=35
56+
offset_y=0
5557
) # this will trigger lv.init()
5658
mpos.ui.main_display.set_power(True) # set RD pin to high before the rest, otherwise garbled output
5759
mpos.ui.main_display.init()
5860
mpos.ui.main_display.set_backlight(100) # works
5961

60-
mpos.ui.main_display.set_rotation(lv.DISPLAY_ROTATION._270) # must be done after initializing display and creating the touch drivers, to ensure proper handling
62+
#mpos.ui.main_display.set_rotation(lv.DISPLAY_ROTATION._270) # must be done after initializing display and creating the touch drivers, to ensure proper handling
63+
mpos.ui.main_display.set_rotation(lv.DISPLAY_ROTATION._180)
6164
mpos.ui.main_display.set_color_inversion(True)
6265

66+
mpos.ui.frame_buffer1 = fb1
6367

6468
# Button handling code:
6569
from machine import Pin

0 commit comments

Comments
 (0)