From 0ccaac4e002897a9e135d78a0269c93de37dbecf Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 21 Feb 2019 00:21:59 +0100 Subject: [PATCH] updade lv_conf_templ.h --- lv_conf_templ.h | 47 ++------------------------------------------ lv_core/lv_refr.c | 2 +- lv_hal/lv_hal_disp.h | 13 ++++++++---- 3 files changed, 12 insertions(+), 50 deletions(-) diff --git a/lv_conf_templ.h b/lv_conf_templ.h index a4712fea6..790648067 100644 --- a/lv_conf_templ.h +++ b/lv_conf_templ.h @@ -43,8 +43,8 @@ *===================*/ /* Horizontal and vertical resolution of the library.*/ -#define LV_HOR_RES (480) -#define LV_VER_RES (320) +#define LV_HOR_RES_MAX (480) +#define LV_VER_RES_MAX (320) /* Dot Per Inch: used to initialize default sizes. E.g. a button with width = LV_DPI / 2 -> half inch wide * (Not so important, you can adjust it to modify default sizes and spaces)*/ @@ -56,49 +56,6 @@ /*Screen refresh period in milliseconds*/ #define LV_REFR_PERIOD 30 -/*----------------- - * VDB settings - *----------------*/ - -/* VDB (Virtual Display Buffer) is an internal graphics buffer. - * The GUI will be drawn into this buffer first and then - * the buffer will be passed to your `disp_drv.disp_flush` function to - * copy it to your frame buffer. - * VDB is required for: buffered drawing, opacity, anti-aliasing and shadows - * Learn more: https://docs.littlevgl.com/#Drawing*/ - -/* Size of the VDB in pixels. Typical size: ~1/10 screen. Must be >= LV_HOR_RES - * Setting it to 0 will disable VDB and `disp_drv.disp_fill` and `disp_drv.disp_map` functions - * will be called to draw to the frame buffer directly*/ -#define LV_VDB_SIZE ((LV_VER_RES * LV_HOR_RES) / 10) - - /* Bit-per-pixel of VDB. Useful for monochrome or non-standard color format displays. - * Special formats are handled with `disp_drv.vdb_wr`)*/ -#define LV_VDB_PX_BPP LV_COLOR_SIZE /*LV_COLOR_SIZE comes from LV_COLOR_DEPTH below to set 8, 16 or 32 bit pixel size automatically */ - - /* Place VDB to a specific address (e.g. in external RAM) - * 0: allocate automatically into RAM - * LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/ -#define LV_VDB_ADR 0 - -/* Use two Virtual Display buffers (VDB) to parallelize rendering and flushing - * The flushing should use DMA to write the frame buffer in the background */ -#define LV_VDB_DOUBLE 0 - -/* Place VDB2 to a specific address (e.g. in external RAM) - * 0: allocate automatically into RAM - * LV_VDB_ADR_INV: to replace it later with `lv_vdb_set_adr()`*/ -#define LV_VDB2_ADR 0 - -/* Using true double buffering in `disp_drv.disp_flush` you will always get the image of the whole screen. - * Your only task is to set the rendered image (`color_p` parameter) as frame buffer address or send it to your display. - * The best if you do in the blank period of you display to avoid tearing effect. - * Requires: - * - LV_VDB_SIZE = LV_HOR_RES * LV_VER_RES - * - LV_VDB_DOUBLE = 1 - */ -#define LV_VDB_TRUE_DOUBLE_BUFFERED 0 - /*================= Misc. setting *=================*/ diff --git a/lv_core/lv_refr.c b/lv_core/lv_refr.c index e665e1a11..d17d83917 100644 --- a/lv_core/lv_refr.c +++ b/lv_core/lv_refr.c @@ -101,7 +101,7 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) /*The area is truncated to the screen*/ if(suc != false) { - if(disp_refr->driver.rounder_cb) disp_refr->driver.rounder_cb(disp_refr, &com_area); + if(disp->driver.rounder_cb) disp->driver.rounder_cb(disp_refr, &com_area); /*Save only if this area is not in one of the saved areas*/ uint16_t i; diff --git a/lv_hal/lv_hal_disp.h b/lv_hal/lv_hal_disp.h index 256e377f1..0f83d82a2 100644 --- a/lv_hal/lv_hal_disp.h +++ b/lv_hal/lv_hal_disp.h @@ -70,10 +70,6 @@ typedef struct _disp_drv_t { void (*flush_cb)(struct _disp_t * disp, const lv_area_t * area, lv_color_t * color_p); lv_disp_user_data_t flush_user_data; - /* OPTIONAL: Called after every refresh cycle to tell the rendering and flushing time + the number of flushed pixels */ - void (*monitor_cb)(struct _disp_t * disp, uint32_t time, uint32_t px); - lv_disp_user_data_t monitor_user_data; - /* OPTIONAL: Extend the invalidated areas to match with the display drivers requirements * E.g. round `y` to, 8, 16 ..) on a monochrome display*/ void (*rounder_cb)(struct _disp_t * disp, lv_area_t * area); @@ -85,6 +81,10 @@ typedef struct _disp_drv_t { void (*set_px_cb)(struct _disp_t * disp, uint8_t * buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa); lv_disp_user_data_t set_px_user_data; + /* Called after every refresh cycle to tell the rendering and flushing time + the number of flushed pixels */ + void (*monitor_cb)(struct _disp_t * disp, uint32_t time, uint32_t px); + lv_disp_user_data_t monitor_user_data; + #if USE_LV_GPU /*OPTIONAL: Blend two memories using opacity (GPU only)*/ void (*mem_blend)(lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa); @@ -98,11 +98,16 @@ typedef struct _disp_drv_t { struct _lv_obj_t; typedef struct _disp_t { + /*Driver to the display*/ lv_disp_drv_t driver; + + /*Screens of the display*/ lv_ll_t scr_ll; struct _lv_obj_t * act_scr; struct _lv_obj_t * top_layer; struct _lv_obj_t * sys_layer; + + /*Invalidated (marked to redraw) areas*/ lv_area_t inv_areas[LV_INV_BUF_SIZE]; uint8_t inv_area_joined[LV_INV_BUF_SIZE]; uint32_t inv_p :10;