From a6880eb825489700467ada662b177de58cf7fa28 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 22 Mar 2023 10:06:51 +0100 Subject: [PATCH] docs(disp): use px_map parameter name instead of color_p related to https://github.com/lvgl/lv_binding_micropython/issues/263#issuecomment-1477790684 --- examples/porting/lv_port_disp_template.c | 13 +++++++------ src/core/lv_disp.h | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/porting/lv_port_disp_template.c b/examples/porting/lv_port_disp_template.c index 1cd74f798..b17313a70 100644 --- a/examples/porting/lv_port_disp_template.c +++ b/examples/porting/lv_port_disp_template.c @@ -34,7 +34,7 @@ **********************/ static void disp_init(void); -static void disp_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * color_buf); +static void disp_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * px_map); /********************** * STATIC VARIABLES @@ -108,10 +108,11 @@ void disp_disable_update(void) disp_flush_enabled = false; } -/*Flush the content of the internal buffer the specific area on the display +/*Flush the content of the internal buffer the specific area on the display. + *`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display. *You can use DMA or any hardware acceleration to do this operation in the background but - *'lv_disp_flush_ready()' has to be called when finished.*/ -static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t * color_buf) + *'lv_disp_flush_ready()' has to be called when it's finished.*/ +static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t * px_map) { if(disp_flush_enabled) { /*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/ @@ -121,8 +122,8 @@ static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t for(y = area->y1; y <= area->y2; y++) { for(x = area->x1; x <= area->x2; x++) { /*Put a pixel to the display. For example:*/ - /*put_px(x, y, *color_p)*/ - color_buf++; + /*put_px(x, y, *px_map)*/ + px_map++; } } } diff --git a/src/core/lv_disp.h b/src/core/lv_disp.h index d5c2718d5..68c5233a4 100644 --- a/src/core/lv_disp.h +++ b/src/core/lv_disp.h @@ -245,10 +245,10 @@ void lv_disp_set_draw_buffers(lv_disp_t * disp, void * buf1, void * buf2, uint32 /** * Set the flush callback whcih will be called to copy the rendered image to the display. * @param disp pointer to a display - * @param flush_cb the flush callback + * @param flush_cb the flush callback (`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display) */ void lv_disp_set_flush_cb(lv_disp_t * disp, void (*flush_cb)(struct _lv_disp_t * disp, const lv_area_t * area, - lv_color_t * color_p)); + lv_color_t * px_map)); /** * Set the color format of the display. * If set to other than `LV_COLOR_FORMAT_NATIVE` the draw_ctx's `buffer_convert` function will be used