Hi, I am using the following esp32 board and ili9341 display:
- LilyGO T7 v1.4 with 4 MB PSRAM
- 2.8" ili9341 display 320x240
- lv_micropython GENERIC_SPIRAM firmware compiled with linux
I fill a canvas using canvas.set_px():
- when canvas size is 320x180, or smaller, the program is ok and draws 2700 pixels per second (21 seconds for 320x180 pixels)
- when canvas size is 320x181 (just one line bigger) it slows down a lot, it takes 32 minutes to complete (30 pixels per second)!!!
Why is it getting so slow, what’s going wrong?
The program I used:
import lvgl as lv
from ili9XXX import ili9341, LANDSCAPE
import time
CANVAS_WIDTH = 320
CANVAS_HEIGHT = 180 # 180 OK, 181 ULTRA-SLOW
lv.init()
disp = ili9341(miso=19, mosi=23, clk=18, cs=5, dc=21, rst=26, width=320, height=240, rot=LANDSCAPE)
scr = lv.scr_act()
canvas = lv.canvas(scr)
buf = bytearray(CANVAS_WIDTH * CANVAS_HEIGHT * lv.color_t.SIZE)
canvas.set_buffer(buf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.img.CF.TRUE_COLOR)
color = lv.color_make(0, 0, 255)
lv.scr_load(scr)
start_ms = time.ticks_ms()
for x in range(0, CANVAS_WIDTH):
for y in range(0, CANVAS_HEIGHT):
canvas.set_px(x, y, color)
elapsed_ms = time.ticks_diff(time.ticks_ms(), start_ms)
print("elapsed seconds: {}".format(elapsed_ms / 1000))
print("pixels/second: {}".format((CANVAS_WIDTH * CANVAS_HEIGHT) / (elapsed_ms / 1000)))