1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

docs(disp): use px_map parameter name instead of color_p

related to https://github.com/lvgl/lv_binding_micropython/issues/263#issuecomment-1477790684
This commit is contained in:
Gabor Kiss-Vamosi 2023-03-22 10:06:51 +01:00
parent 68b6fc7bcf
commit a6880eb825
2 changed files with 9 additions and 8 deletions

View File

@ -34,7 +34,7 @@
**********************/ **********************/
static void disp_init(void); 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 * STATIC VARIABLES
@ -108,10 +108,11 @@ void disp_disable_update(void)
disp_flush_enabled = false; 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 *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.*/ *'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 * color_buf) static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t * px_map)
{ {
if(disp_flush_enabled) { if(disp_flush_enabled) {
/*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/ /*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(y = area->y1; y <= area->y2; y++) {
for(x = area->x1; x <= area->x2; x++) { for(x = area->x1; x <= area->x2; x++) {
/*Put a pixel to the display. For example:*/ /*Put a pixel to the display. For example:*/
/*put_px(x, y, *color_p)*/ /*put_px(x, y, *px_map)*/
color_buf++; px_map++;
} }
} }
} }

View File

@ -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. * Set the flush callback whcih will be called to copy the rendered image to the display.
* @param disp pointer to a 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, 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. * 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 * If set to other than `LV_COLOR_FORMAT_NATIVE` the draw_ctx's `buffer_convert` function will be used