Display flush callback and convertsion v8.4.0 to v9.5.0

Hi

Regarding the flush callback, the equivalent should be something like this:

//In V9
static void my_disp_flush(lv_disp_t *disp, const lv_area_t *area, uint8_t *pxmap)
{
    uint32_t w = (area->x2 - area->x1 + 1);
    uint32_t h = (area->y2 - area->x1 + 1);

#if (LV_COLOR_16_SWAP != 0)
    gfx->draw16bitBeRGBBitmap(area->x1, area->y1, (uint16_t *)pxmap, w, h);
#else
    gfx->draw16bitRGBBitmap(area->x1, area->y1, (uint16_t *)pxmap, w, h);
#endif

    lv_disp_flush_ready(disp);
}

The main difference, is that instead of the function receives a pointer to array of lv_color_t it receives a pointer to array of uint8_t.

Regarding the slowmentioned in the documentation, is related to the fact that this function gfx->draw16bitRGBBitmap is blocking, and not using “DMA” that could release the CPU to process “stuff” instead of waiting to send the data.

1 Like