I am using the FMC peripheral and parallel interface of my microcontroller and I was looking into the best approach for sending the frame update to the LCD. The behavior I’m after is all drawing is done into the full size frame buffer, I don’t see the point of drawing it into small buffers, then copying it to the frame buffer. Then get one call to flush once the frame is updated, with the minimum update area set.
I have hacked the library slightly which is giving me almost the result I want. I have passed the same buffer pointer into the init function.
lv_disp_buf_init(&displayBufffer, frameBuffer, frameBuffer, FRAME_BUFFER_SIZE);
Where FRAME_BUFFER_SIZE
is the size of the LCD. This causes the lv_disp_is_true_double_buf()
to return true so all drawing is done into the single frame buffer. I have then commented out the code that copies the data between the two frame buffers in _lv_disp_refr_task()
, so the true double buffering code is effectively this.
if(lv_disp_is_true_double_buf(disp_refr) && disp_refr->driver.set_px_cb == NULL) {
lv_refr_vdb_flush();
while(vdb->flushing);
} /*End of true double buffer handling*/
I then get a single call to flush at the end of the frame update. The only downside to this is that the area is always set to the entire frame. So even if only a small area was updated Is I still have to send the whole frame.
I was wondering if there should be a single full buffer option, that behaves like true double buffering for drawing, but doesn’t perform the buffer copy in _lv_disp_refr_task()
and also records the area affected during the frame update.
Does this sound like a good idea? Or have I missed a simpler way of doing this?