diff --git a/lv_conf_templ.h b/lv_conf_templ.h index 9fae5edfa..eb9b30108 100644 --- a/lv_conf_templ.h +++ b/lv_conf_templ.h @@ -31,12 +31,14 @@ #define LV_VER_RES (480 << LV_ANTIALIAS) #define LV_DPI (100 << LV_ANTIALIAS) -/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/ -#define LV_VDB_SIZE (40 * LV_VER_RES) +/* Buffered rendering: >= LV_HOR_RES or 0 to disable buffering*/ +#define LV_VDB_SIZE (40 * LV_HOR_RES) +#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate into RAM)*/ /* Use two Virtual Display buffers (VDB) parallelize rendering and flushing * The flushing should use DMA to write the frame buffer in the background*/ -#define LV_VDB_DOUBLE 0 +#define LV_VDB_DOUBLE 0 +#define LV_VDB2_ADR 0 /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate into RAM)*/ /* Enable anti aliasing * If enabled everything will be rendered in double size and filtered to normal size */ @@ -44,7 +46,7 @@ /* Enable anti aliasing only for fonts (texts) * It half the size of the letters so you should use double sized fonts - * Much faster then normal anti aliasing */ + * Much faster then normal anti aliasing (don't use together with LV_ANTIALIAS) */ #define LV_FONT_ANTIALIAS 1 /*================= diff --git a/lv_hal/lv_hal_tick.c b/lv_hal/lv_hal_tick.c index 6d5e23e75..44576f31d 100644 --- a/lv_hal/lv_hal_tick.c +++ b/lv_hal/lv_hal_tick.c @@ -42,7 +42,7 @@ static volatile uint8_t tick_irq_flag; void lv_tick_inc(uint32_t tick_period) { tick_irq_flag = 0; - sys_time++; + sys_time += tick_period; } /** diff --git a/lv_obj/lv_vdb.c b/lv_obj/lv_vdb.c index d65328787..77adfdc72 100644 --- a/lv_obj/lv_vdb.c +++ b/lv_obj/lv_vdb.c @@ -33,12 +33,31 @@ typedef enum { /********************** * STATIC VARIABLES **********************/ + + #if LV_VDB_DOUBLE == 0 -static lv_vdb_t vdb; -static volatile lv_vdb_state_t vdb_state = LV_VDB_STATE_ACTIVE; + /*Simple VDB*/ + static volatile lv_vdb_state_t vdb_state = LV_VDB_STATE_ACTIVE; +# if LV_VDB_ADR == 0 + /*If the buffer address is not specified simply allocate it*/ + static lv_color_t vdb_buf[LV_VDB_SIZE]; + static lv_vdb_t vdb = {.buf = vdb_buf}; +# else + /*If the buffer address is specified use that address*/ + static lv_vdb_t vdb = {.buf = (lv_color_t *)LV_VDB_ADR}; +# endif #else -static lv_vdb_t vdb[2]; -static volatile lv_vdb_state_t vdb_state[2] = {LV_VDB_STATE_FREE, LV_VDB_STATE_FREE}; + /*Double VDB*/ + static volatile lv_vdb_state_t vdb_state[2] = {LV_VDB_STATE_FREE, LV_VDB_STATE_FREE}; +# if LV_VDB_ADR == 0 + /*If the buffer address is not specified simply allocate it*/ + static lv_color_t vdb_buf1[LV_VDB_SIZE]; + static lv_color_t vdb_buf2[LV_VDB_SIZE]; + static lv_vdb_t vdb[2] = {{.buf = vdb_buf1}, {.buf = vdb_buf2}}; +# else + /*If the buffer address is specified use that address*/ + static lv_vdb_t vdb[2] = {{.buf = (lv_color_t *)LV_VDB_ADR}, {.buf = (lv_color_t *)LV_VDB2_ADR}}; +# endif #endif /********************** diff --git a/lv_obj/lv_vdb.h b/lv_obj/lv_vdb.h index 36c45facb..9cb6f1ac2 100644 --- a/lv_obj/lv_vdb.h +++ b/lv_obj/lv_vdb.h @@ -31,7 +31,7 @@ extern "C" { typedef struct { lv_area_t area; - lv_color_t buf[LV_VDB_SIZE]; + lv_color_t *buf; }lv_vdb_t; /**********************