Merge branch 'beta'
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
/*----------------
|
||||
* Dynamic memory
|
||||
*----------------*/
|
||||
/*
|
||||
* Memory size which will be used by the library
|
||||
* to store the graphical objects and other data
|
||||
*/
|
||||
#define LV_MEM_CUSTOM 0 /*1: use custom malloc/free, 0: use the built-in lv_mem_alloc/lv_mem_free*/
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
#define LV_MEM_SIZE (32U * 1024U) /*Size memory used by mem_alloc (in bytes)*/
|
||||
@@ -27,27 +31,33 @@
|
||||
*=====================*/
|
||||
|
||||
/* Horizontal and vertical resolution of the library.*/
|
||||
#define LV_HOR_RES (480)
|
||||
#define LV_VER_RES (320)
|
||||
#define LV_HOR_RES (320)
|
||||
#define LV_VER_RES (240)
|
||||
#define LV_DPI 100
|
||||
|
||||
/* Buffered rendering: >= LV_DOWNSCALE * lv_disp_hor_res() or 0 to disable buffering*/
|
||||
#define LV_VDB_SIZE (20 * 1024)
|
||||
#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate into RAM)*/
|
||||
/* Size of internal graphics buffer (required for buffered drawing)
|
||||
* VDB means Virtual Display Buffer (the internal graphics buffer)
|
||||
* Set to 0 for unbuffered drawing
|
||||
* Set to >= LV_HOR_RES for buffered drawing if LV_ANTIALIAS = 0
|
||||
* Set to >= 2 * LV_HOR_RES for buffered drawing if LV_ANTIALIAS = 1
|
||||
* More info: https://littlevgl.com/basics#drawing-and-rendering*/
|
||||
#define LV_VDB_SIZE (20 * 1024) /*Size of VDB in pixel count*/
|
||||
#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
|
||||
|
||||
/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing
|
||||
/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing (optional)
|
||||
* The flushing should use DMA to write the frame buffer in the background*/
|
||||
#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)*/
|
||||
#define LV_VDB_DOUBLE 0 /*1: Enable the use of 2 VDBs*/
|
||||
#define LV_VDB2_ADR 0 /*Place VDB2 to a specific address (e.g. in external RAM) (0: allocate automatically into RAM)*/
|
||||
|
||||
/* Enable anti aliasing
|
||||
* If enabled everything will be rendered in double size and filtered to normal size */
|
||||
#define LV_ANTIALIAS 1
|
||||
/* Enable anti-aliasing
|
||||
* If enabled everything will be rendered in double size and filtered to normal size.
|
||||
* Fonts and Images will be downscaled */
|
||||
#define LV_ANTIALIAS 1 /*1: Enable anti-aliasing*/
|
||||
|
||||
/* 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 */
|
||||
#define LV_FONT_ANTIALIAS 0
|
||||
/* Enable anti-aliasing only for fonts (texts)
|
||||
* It downscales the fonts to half size so you should use double sized fonts
|
||||
* Much faster then normal anti-aliasing */
|
||||
#define LV_FONT_ANTIALIAS 0 /*1: Enable font anti-aliasing*/
|
||||
|
||||
/*Screen refresh settings*/
|
||||
#define LV_REFR_PERIOD 50 /*Screen refresh period in milliseconds*/
|
||||
@@ -66,34 +76,35 @@
|
||||
#define LV_INDEV_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
|
||||
|
||||
/*Color settings*/
|
||||
#define LV_COLOR_DEPTH 16
|
||||
#define LV_COLOR_DEPTH 16 /*Color depth: 1/8/16/24*/
|
||||
#define LV_COLOR_TRANSP LV_COLOR_LIME /*Images pixels with this color will not be drawn (chroma keying)*/
|
||||
|
||||
/*Text settings*/
|
||||
#define LV_TXT_UTF8 1
|
||||
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
|
||||
#define LV_TXT_UTF8 1 /*Enable UTF-8 coded Unicode character usage */
|
||||
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
|
||||
|
||||
/*Graphics feature usage*/
|
||||
#define USE_LV_ANIMATION 1 /*1: disable all animations*/
|
||||
#define USE_LV_SHADOW 1 /*1: disable shadows*/
|
||||
#define USE_LV_ANIMATION 1 /*1: Enable all animations*/
|
||||
#define USE_LV_SHADOW 1 /*1: Enable shadows*/
|
||||
#define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/
|
||||
#define USE_LV_GPU 0 /*1: Enable GPU interface*/
|
||||
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images aka. lv_img)*/
|
||||
#define USE_LV_GPU 1 /*1: Enable GPU interface*/
|
||||
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images*/
|
||||
|
||||
/*================
|
||||
* THEME USAGE
|
||||
*================*/
|
||||
#define USE_LV_THEME_TEMPL 0 /*Just for test*/
|
||||
#define USE_LV_THEME_DEFAULT 1 /*Built mainly from the built-in styles. Consumes very few RAM*/
|
||||
#define USE_LV_THEME_ALIEN 1 /*Dark futuristic theme*/
|
||||
#define USE_LV_THEME_NIGHT 1 /*Dark elegant theme*/
|
||||
#define USE_LV_THEME_MONO 1 /*Mono color theme for monochrome displays*/
|
||||
#define USE_LV_THEME_MATERIAL 1 /*Flat theme with bold colors and light shadows*/
|
||||
#define USE_LV_THEME_ZEN 1 /*Peaceful, mainly light theme */
|
||||
#define USE_LV_THEME_DEFAULT 0 /*Built mainly from the built-in styles. Consumes very few RAM*/
|
||||
#define USE_LV_THEME_ALIEN 0 /*Dark futuristic theme*/
|
||||
#define USE_LV_THEME_NIGHT 0 /*Dark elegant theme*/
|
||||
#define USE_LV_THEME_MONO 0 /*Mono color theme for monochrome displays*/
|
||||
#define USE_LV_THEME_MATERIAL 0 /*Flat theme with bold colors and light shadows*/
|
||||
#define USE_LV_THEME_ZEN 0 /*Peaceful, mainly light theme */
|
||||
|
||||
/*==================
|
||||
* FONT USAGE
|
||||
*===================*/
|
||||
/*More info about fonts: https://littlevgl.com/basics#fonts*/
|
||||
#define LV_FONT_DEFAULT &lv_font_dejavu_40 /*Always set a default font from the built-in fonts*/
|
||||
|
||||
#define USE_LV_FONT_DEJAVU_10 0
|
||||
@@ -159,6 +170,9 @@
|
||||
/*==================
|
||||
* LV OBJ X USAGE
|
||||
*================*/
|
||||
/*
|
||||
* Documentation of the object types: https://littlevgl.com/object-types
|
||||
*/
|
||||
|
||||
/*****************
|
||||
* Simple object
|
||||
@@ -167,10 +181,10 @@
|
||||
/*Label (dependencies: -*/
|
||||
#define USE_LV_LABEL 1
|
||||
#if USE_LV_LABEL != 0
|
||||
#define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
|
||||
#define LV_LABEL_SCROLL_SPEED 25 /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL/ROLL' mode*/
|
||||
#endif
|
||||
|
||||
/*Image (dependencies: lv_label (if symbols are enabled) from misc: FSINT, UFS)*/
|
||||
/*Image (dependencies: lv_label*/
|
||||
#define USE_LV_IMG 1
|
||||
|
||||
/*Line (dependencies: -*/
|
||||
@@ -192,7 +206,7 @@
|
||||
/*Tab (dependencies: lv_page, lv_btnm)*/
|
||||
#define USE_LV_TABVIEW 1
|
||||
#if USE_LV_TABVIEW != 0
|
||||
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
|
||||
#define LV_TABVIEW_ANIM_TIME 300 /*Time of slide animation [ms] (0: no animation)*/
|
||||
#endif
|
||||
|
||||
/*************************
|
||||
|
||||
@@ -190,6 +190,7 @@ void * lv_mem_realloc(void * data_p, uint32_t new_size)
|
||||
uint32_t old_size = lv_mem_get_size(data_p);
|
||||
if(old_size == new_size) return data_p; /*Also avoid reallocating the same memory*/
|
||||
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
/* Only truncate the memory is possible
|
||||
* If the 'old_size' was extended by a header size in 'ent_trunc' it avoids reallocating this same memory */
|
||||
if(new_size < old_size) {
|
||||
@@ -197,6 +198,7 @@ void * lv_mem_realloc(void * data_p, uint32_t new_size)
|
||||
ent_trunc(e, new_size);
|
||||
return &e->first_data;
|
||||
}
|
||||
#endif
|
||||
|
||||
void * new_p;
|
||||
new_p = lv_mem_alloc(new_size);
|
||||
|
||||
@@ -76,7 +76,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy)
|
||||
ext->styles_btn[LV_BTN_STATE_REL] = &lv_style_btn_rel;
|
||||
ext->styles_btn[LV_BTN_STATE_PR] = &lv_style_btn_pr;
|
||||
ext->styles_btn[LV_BTN_STATE_TGL_REL] = &lv_style_btn_tgl_rel;
|
||||
ext->styles_btn[LV_BTN_STATE_PR] = &lv_style_btn_tgl_pr;
|
||||
ext->styles_btn[LV_BTN_STATE_TGL_PR] = &lv_style_btn_tgl_pr;
|
||||
ext->styles_btn[LV_BTN_STATE_INA] = &lv_style_btn_ina;
|
||||
ext->anim_time = LV_LIST_FOCUS_TIME;
|
||||
|
||||
@@ -149,7 +149,9 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, l
|
||||
/*Create a list element with the image an the text*/
|
||||
lv_obj_t * liste;
|
||||
liste = lv_btn_create(list, NULL);
|
||||
lv_btn_set_style(liste, LV_BTN_STYLE_REL, ext->styles_btn[LV_BTN_STATE_REL]);
|
||||
|
||||
/*Set the default styles*/
|
||||
lv_btn_set_style(liste, LV_BTN_STYLE_REL, ext->styles_btn[LV_BTN_STATE_REL]);
|
||||
lv_btn_set_style(liste, LV_BTN_STYLE_PR, ext->styles_btn[LV_BTN_STATE_PR]);
|
||||
lv_btn_set_style(liste, LV_BTN_STYLE_TGL_REL, ext->styles_btn[LV_BTN_STATE_TGL_REL]);
|
||||
lv_btn_set_style(liste, LV_BTN_STYLE_TGL_PR, ext->styles_btn[LV_BTN_STATE_TGL_PR]);
|
||||
@@ -500,7 +502,7 @@ static lv_res_t lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param)
|
||||
btn = get_next_btn(list, btn);
|
||||
}
|
||||
if(btn_prev != NULL) {
|
||||
lv_btn_set_state(btn_prev, LV_BTN_STATE_PR);
|
||||
lv_btn_set_state(btn_prev, LV_BTN_STATE_TGL_REL);
|
||||
}
|
||||
}
|
||||
else if(sign == LV_SIGNAL_DEFOCUS) {
|
||||
@@ -508,7 +510,7 @@ static lv_res_t lv_list_signal(lv_obj_t * list, lv_signal_t sign, void * param)
|
||||
lv_obj_t * btn = NULL;
|
||||
btn = get_next_btn(list, btn);
|
||||
while(btn != NULL) {
|
||||
if(lv_btn_get_state(btn) == LV_BTN_STATE_PR) break;
|
||||
if(lv_btn_get_state(btn) == LV_BTN_STATE_TGL_REL) break;
|
||||
btn = get_next_btn(list, btn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user