docs: fix 'my_disp_flush' in quick-overview
Fix 'my_disp_flush' in quick-overview. In parallel rendering architecture, lv_color_t* in lv_display_flush_cb_t has been changed to uint8_t*.
Related code:
https://github.com/lvgl/lvgl/blob/a853a1289ae40898122d83be1842d0b61c56b15d/src/display/lv_display.h#L81
https://github.com/lvgl/lvgl/blob/a853a1289ae40898122d83be1842d0b61c56b15d/examples/porting/lv_port_disp_template.c#L124-L138
Thank you for pointing this out 👍
uint16_t * px_map_16 = (uint16_t*) px_map; for(y = area->y1; y <= area->y2; y++) { for(x = area->x1; x <= area->x2; x++) { put_px(x, y, *px_map_16); px_map_16++; /*Go to the next pixel*/
Does this code mean the display has 16 bit color format? If my understanding is correct, in display_flush_cb, the pointer px_map needs to be converted to the appropriate color format?
If that's the case, I have two suggestions:
- Add more explanation and example code about this to quick-overview.
- Why not change the type of
px_mapinlv_display_flush_cb_ttovoid*?px_mapis not actually a pointer touint8_t. It points to some unknown type, which is whatvoid*is for.
I noticed that the documentation has been reorganized #7136. That's pretty cool. I think I can close this PR.
- Why not change the type of
px_mapinlv_display_flush_cb_ttovoid*?px_mapis not actually a pointer touint8_t. It points to some unknown type, which is whatvoid*is for.
Actually I still have doubts about this. Maybe I will submit an issue later?
Why not change the type of px_map in lv_display_flush_cb_t to void*? px_map is not actually a pointer to uint8_t. It points to some unknown type, which is what void* is for.
Actually I don't exactly remember why I used uint8_t *. Probably I wanted to emphasize that the buffer is in bytes and not pixels.
Anyway, changing it now would be an API break. :slightly_frowning_face: