fix conflicts

This commit is contained in:
Gabor Kiss-Vamosi
2021-03-18 17:31:09 +01:00
226 changed files with 1360 additions and 1348 deletions
+5 -5
View File
@@ -44,14 +44,14 @@ Before every function have a comment like this:
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
```
Always use `/* Something */` format and NOT `//Something`
Always use `/*Something*/` format and NOT `//Something`
Write readable code to avoid descriptive comments like:
`x++; /* Add 1 to x */`.
`x++; /*Add 1 to x*/`.
The code should show clearly what you are doing.
You should write **why** have you done this:
`x++; /*Because of closing '\0' of the string */`
`x++; /*Because of closing '\0' of the string*/`
Short "code summaries" of a few lines are accepted. E.g. `/*Calculate the new coordinates*/`
@@ -66,7 +66,7 @@ Here is example to show bracket placing and using of white spaces:
* @param text '\0' terminated character string. NULL to refresh with the current text.
*/
void lv_label_set_text(lv_obj_t * label, const char * text)
{ /* Main brackets of functions in new line*/
{ /*Main brackets of functions in new line*/
if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
@@ -74,7 +74,7 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
lv_label_ext_t * ext = lv_obj_get_ext(label);
/*Comment before a section */
/*Comment before a section*/
if(text == ext->txt || text == NULL) { /*Bracket of statements start inline*/
lv_label_refr_text(label);
return;
+22 -26
View File
@@ -1,25 +1,21 @@
#include <lvgl.h>
#include <TFT_eSPI.h>
/* If you want to use the LVGL examples,
make sure to install the lv_examples Arduino library
and uncomment the following line.
#include <lv_examples.h> */
/*If you want to use the LVGL examples,
make sure to install the lv_examples Arduino library
and uncomment the following line.
#include <lv_examples.h>*/
TFT_eSPI tft = TFT_eSPI(); /* TFT instance */
TFT_eSPI tft = TFT_eSPI(); /*TFT instance*/
/* Change to your screen resolution */
/*Change to your screen resolution*/
static uint32_t screenWidth = 320;
static uint32_t screenHeight = 240;
<<<<<<< HEAD
static lv_disp_buf_t disp_buf;
=======
static lv_draw_buf_t draw_buf;
>>>>>>> xiaoxiang781216-disp
static lv_color_t buf[screenWidth * 10];
#if LV_USE_LOG != 0
/* Serial debugging */
/*Serial debugging*/
void my_print(lv_log_level_t level, const char *file, uint32_t line, const char *fn_name, const char *dsc)
{
Serial.printf("%s(%s)@%d->%s\r\n", file, fn_name, line, dsc);
@@ -27,7 +23,7 @@ void my_print(lv_log_level_t level, const char *file, uint32_t line, const char
}
#endif
/* Display flushing */
/*Display flushing*/
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
uint32_t w = (area->x2 - area->x1 + 1);
@@ -69,49 +65,49 @@ bool my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
void setup()
{
Serial.begin(115200); /* prepare for possible serial debug */
Serial.begin(115200); /*prepare for possible serial debug*/
lv_init();
#if LV_USE_LOG != 0
lv_log_register_print_cb(my_print); /* register print function for debugging */
lv_log_register_print_cb(my_print); /*register print function for debugging*/
#endif
tft.begin(); /* TFT init */
tft.setRotation(1); /* Landscape orientation */
tft.begin(); /*TFT init*/
tft.setRotation(1); /*Landscape orientation*/
/* Set the touchscreen calibration data,
the actual data for your display can be aquired using
the Generic -> Touch_calibrate example from the TFT_eSPI library */
/*Set the touchscreen calibration data,
the actual data for your display can be aquired using
the Generic -> Touch_calibrate example from the TFT_eSPI library*/
uint16_t calData[5] = {275, 3620, 264, 3532, 1};
tft.setTouch(calData);
lv_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10);
/* Initialize the display */
/*Initialize the display*/
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
/* Change the following line to your display resolution */
/*Change the following line to your display resolution*/
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv);
/* Initialize the (dummy) input device driver */
/*Initialize the (dummy) input device driver*/
lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register(&indev_drv);
/* Try an example from the lv_examples Arduino library
make sure to include it as written above.
lv_example_btn_1(); */
/*Try an example from the lv_examples Arduino library
make sure to include it as written above.
lv_example_btn_1();*/
}
void loop()
{
lv_timer_handler(); /* let the GUI do its work */
lv_timer_handler(); /*let the GUI do its work*/
delay(5);
}
@@ -34,7 +34,7 @@ void lv_example_get_started_3(void);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EX_GET_STARTED_H*/
@@ -17,13 +17,13 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event)
*/
void lv_example_get_started_3(void)
{
/* Create a slider in the center of the display */
/*Create a slider in the center of the display*/
lv_obj_t * slider = lv_slider_create(lv_scr_act(), NULL);
lv_obj_set_width(slider, 200); /*Set the width*/
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the center of the parent (screen)*/
lv_obj_add_event_cb(slider, slider_event_cb, NULL); /*Assign an event function*/
/* Create a label below the slider */
/*Create a label below the slider*/
label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(label, "0");
lv_obj_align(label, slider, LV_ALIGN_OUT_TOP_MID, 0, -15); /*Align below the slider*/
+1 -1
View File
@@ -37,7 +37,7 @@ void lv_example_flex_6(void);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLE_FLEX_H*/
+1 -1
View File
@@ -37,7 +37,7 @@ void lv_example_grid_6(void);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLE_GRID_H*/
+2 -2
View File
@@ -28,8 +28,8 @@ void lv_example_grid_1(void)
uint8_t row = i / 3;
obj = lv_obj_create(cont, NULL);
/* Stretch the cell horizontally and vertically too
* Set span to 1 to make the cell 1 column/row sized */
/*Stretch the cell horizontally and vertically too
*Set span to 1 to make the cell 1 column/row sized*/
lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1,
LV_GRID_STRETCH, row, 1);
+5 -5
View File
@@ -23,7 +23,7 @@ void lv_example_grid_2(void)
lv_obj_t * label;
lv_obj_t * obj;
/*Cell to 0;0 and align to to the start (left/top) horizontally and vertically too */
/*Cell to 0;0 and align to to the start (left/top) horizontally and vertically too*/
obj = lv_obj_create(cont, NULL);
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_grid_cell(obj, LV_GRID_START, 0, 1,
@@ -31,7 +31,7 @@ void lv_example_grid_2(void)
label = lv_label_create(obj, NULL);
lv_label_set_text(label, "c0, r0");
/*Cell to 1;0 and align to to the start (left) horizontally and center vertically too */
/*Cell to 1;0 and align to to the start (left) horizontally and center vertically too*/
obj = lv_obj_create(cont, NULL);
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_grid_cell(obj, LV_GRID_START, 1, 1,
@@ -39,7 +39,7 @@ void lv_example_grid_2(void)
label = lv_label_create(obj, NULL);
lv_label_set_text(label, "c1, r0");
/*Cell to 2;0 and align to to the start (left) horizontally and end (bottom) vertically too */
/*Cell to 2;0 and align to to the start (left) horizontally and end (bottom) vertically too*/
obj = lv_obj_create(cont, NULL);
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_grid_cell(obj, LV_GRID_START, 2, 1,
@@ -47,7 +47,7 @@ void lv_example_grid_2(void)
label = lv_label_create(obj, NULL);
lv_label_set_text(label, "c2, r0");
/*Cell to 1;1 but 2 column wide (span = 2).Set width and height to stretched. */
/*Cell to 1;1 but 2 column wide (span = 2).Set width and height to stretched.*/
obj = lv_obj_create(cont, NULL);
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, 1, 2,
@@ -55,7 +55,7 @@ void lv_example_grid_2(void)
label = lv_label_create(obj, NULL);
lv_label_set_text(label, "c1-2, r1");
/*Cell to 0;1 but 2 rows tall (span = 2).Set width and height to stretched. */
/*Cell to 0;1 but 2 rows tall (span = 2).Set width and height to stretched.*/
obj = lv_obj_create(cont, NULL);
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, 0, 1,
+8 -8
View File
@@ -6,14 +6,14 @@
*/
void lv_example_grid_3(void)
{
/* Column 1: fix width 60 px
* Column 2: 1 unit from the remaining free space
* Column 3: 2 unit from the remaining free space */
/*Column 1: fix width 60 px
*Column 2: 1 unit from the remaining free space
*Column 3: 2 unit from the remaining free space*/
static lv_coord_t col_dsc[3] = {60, LV_GRID_FR(1), LV_GRID_FR(2)};
/* Row 1: fix width 60 px
* Row 2: 1 unit from the remaining free space
* Row 3: fix width 60 px */
/*Row 1: fix width 60 px
*Row 2: 1 unit from the remaining free space
*Row 3: fix width 60 px*/
static lv_coord_t row_dsc[3] = {40, LV_GRID_FR(1), 40};
static lv_grid_t grid;
@@ -34,8 +34,8 @@ void lv_example_grid_3(void)
uint8_t row = i / 3;
obj = lv_obj_create(cont, NULL);
/* Stretch the cell horizontally and vertically too
* Set span to 1 to make the cell 1 column/row sized */
/*Stretch the cell horizontally and vertically too
*Set span to 1 to make the cell 1 column/row sized*/
lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1,
LV_GRID_STRETCH, row, 1);
+2 -2
View File
@@ -30,8 +30,8 @@ void lv_example_grid_4(void)
uint8_t row = i / 3;
obj = lv_obj_create(cont, NULL);
/* Stretch the cell horizontally and vertically too
* Set span to 1 to make the cell 1 column/row sized */
/*Stretch the cell horizontally and vertically too
*Set span to 1 to make the cell 1 column/row sized*/
lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1,
LV_GRID_STRETCH, row, 1);
+2 -2
View File
@@ -29,8 +29,8 @@ void lv_example_grid_6(void)
uint8_t row = i / 3;
obj = lv_obj_create(cont, NULL);
/* Stretch the cell horizontally and vertically too
* Set span to 1 to make the cell 1 column/row sized */
/*Stretch the cell horizontally and vertically too
*Set span to 1 to make the cell 1 column/row sized*/
lv_obj_set_grid_cell(obj, LV_GRID_STRETCH, col, 1,
LV_GRID_STRETCH, row, 1);
+1 -1
View File
@@ -33,7 +33,7 @@ extern "C" {
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLE_LAYOUT_H*/
+1 -1
View File
@@ -36,7 +36,7 @@ extern "C" {
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLES_H*/
+14 -13
View File
@@ -54,7 +54,8 @@ void lv_port_disp_init(void)
* Create a buffer for drawing
*----------------------------*/
/* LVGL requires a buffer where it internally draws the widgets.
/**
* LVGL requires a buffer where it internally draws the widgets.
* Later this buffer will passed your display drivers `flush_cb` to copy its content to your display.
* The buffer has to be greater than 1 display row
*
@@ -72,7 +73,7 @@ void lv_port_disp_init(void)
* Similar to 2) but the buffer have to be screen sized. When LVGL is ready it will give the
* whole frame to display. This way you only need to change the frame buffer's address instead of
* copying the pixels.
* */
*/
/* Example for 1) */
static lv_draw_buf_t draw_buf_dsc_1;
@@ -123,15 +124,15 @@ void lv_port_disp_init(void)
* STATIC FUNCTIONS
**********************/
/* Initialize your display and the required peripherals. */
/*Initialize your display and the required peripherals.*/
static void disp_init(void)
{
/*You code here*/
}
/* Flush the content of the internal buffer the specific 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. */
/*Flush the content of the internal buffer the specific 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_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
/*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
@@ -140,21 +141,21 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
int32_t y;
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)*/
/*Put a pixel to the display. For example:*/
/*put_px(x, y, *color_p)*/
color_p++;
}
}
/* IMPORTANT!!!
* Inform the graphics library that you are ready with the flushing*/
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_disp_flush_ready(disp_drv);
}
/*OPTIONAL: GPU INTERFACE*/
#if LV_USE_GPU
/* If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color*/
/*If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color*/
static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
const lv_area_t * fill_area, lv_color_t color)
{
@@ -172,8 +173,8 @@ static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t
#endif /*LV_USE_GPU*/
#else /* Enable this file at the top */
#else /*Enable this file at the top*/
/* This dummy typedef exists purely to silence -Wpedantic. */
/*This dummy typedef exists purely to silence -Wpedantic.*/
typedef int keep_pedantic_happy;
#endif
+1 -1
View File
@@ -35,7 +35,7 @@ extern "C" {
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_PORT_DISP_TEMPL_H*/
+25 -25
View File
@@ -19,17 +19,17 @@
* TYPEDEFS
**********************/
/* Create a type to store the required data about your file.
* If you are using a File System library
* it already should have a File type.
* For example FatFS has `FIL`. In this case use `typedef FIL file_t`*/
/*Create a type to store the required data about your file.
*If you are using a File System library
*it already should have a File type.
*For example FatFS has `FIL`. In this case use `typedef FIL file_t`*/
typedef struct {
/*Add the data you need to store about a file*/
uint32_t dummy1;
uint32_t dummy2;
}file_t;
/*Similarly to `file_t` create a type for directory reading too */
/*Similarly to `file_t` create a type for directory reading too*/
typedef struct {
/*Add the data you need to store about directory reading*/
uint32_t dummy1;
@@ -83,7 +83,7 @@ void lv_port_fs_init(void)
* Register the file system interface in LVGL
*--------------------------------------------------*/
/* Add a simple drive to open images */
/*Add a simple drive to open images*/
lv_fs_drv_t fs_drv;
lv_fs_drv_init(&fs_drv);
@@ -114,7 +114,7 @@ void lv_port_fs_init(void)
* STATIC FUNCTIONS
**********************/
/* Initialize your Storage device and File system. */
/*Initialize your Storage device and File system.*/
static void fs_init(void)
{
/*E.g. for FatFS initialize the SD card and FatFS itself*/
@@ -138,19 +138,19 @@ static lv_fs_res_t fs_open (lv_fs_drv_t * drv, void * file_p, const char * path,
{
/*Open a file for write*/
/* Add your code here*/
/*Add your code here*/
}
else if(mode == LV_FS_MODE_RD)
{
/*Open a file for read*/
/* Add your code here*/
/*Add your code here*/
}
else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD))
{
/*Open a file for read and write*/
/* Add your code here*/
/*Add your code here*/
}
return res;
@@ -167,7 +167,7 @@ static lv_fs_res_t fs_close (lv_fs_drv_t * drv, void * file_p)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -186,7 +186,7 @@ static lv_fs_res_t fs_read (lv_fs_drv_t * drv, void * file_p, void * buf, uint32
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -204,7 +204,7 @@ static lv_fs_res_t fs_write(lv_fs_drv_t * drv, void * file_p, const void * buf,
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -221,7 +221,7 @@ static lv_fs_res_t fs_seek (lv_fs_drv_t * drv, void * file_p, uint32_t pos)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -237,7 +237,7 @@ static lv_fs_res_t fs_size (lv_fs_drv_t * drv, void * file_p, uint32_t * size_p)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -253,7 +253,7 @@ static lv_fs_res_t fs_tell (lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -268,7 +268,7 @@ static lv_fs_res_t fs_remove (lv_fs_drv_t * drv, const char *path)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -284,7 +284,7 @@ static lv_fs_res_t fs_trunc (lv_fs_drv_t * drv, void * file_p)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -300,7 +300,7 @@ static lv_fs_res_t fs_rename (lv_fs_drv_t * drv, const char * oldname, const cha
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -317,7 +317,7 @@ static lv_fs_res_t fs_free (lv_fs_drv_t * drv, uint32_t * total_p, uint32_t * fr
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -333,7 +333,7 @@ static lv_fs_res_t fs_dir_open (lv_fs_drv_t * drv, void * rddir_p, const char *p
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -350,7 +350,7 @@ static lv_fs_res_t fs_dir_read (lv_fs_drv_t * drv, void * rddir_p, char *fn)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
@@ -365,13 +365,13 @@ static lv_fs_res_t fs_dir_close (lv_fs_drv_t * drv, void * rddir_p)
{
lv_fs_res_t res = LV_FS_RES_NOT_IMP;
/* Add your code here*/
/*Add your code here*/
return res;
}
#else /* Enable this file at the top */
#else /*Enable this file at the top*/
/* This dummy typedef exists purely to silence -Wpedantic. */
/*This dummy typedef exists purely to silence -Wpedantic.*/
typedef int keep_pedantic_happy;
#endif
+1 -1
View File
@@ -35,7 +35,7 @@ extern "C" {
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_PORT_FS_TEMPL_H*/
+21 -20
View File
@@ -68,7 +68,8 @@ static lv_indev_state_t encoder_state;
void lv_port_indev_init(void)
{
/* Here you will find example implementation of input devices supported by LittelvGL:
/**
* Here you will find example implementation of input devices supported by LittelvGL:
* - Touchpad
* - Mouse (with cursor support)
* - Keypad (supports GUI usage only with key)
@@ -125,10 +126,10 @@ void lv_port_indev_init(void)
indev_drv.read_cb = keypad_read;
indev_keypad = lv_indev_drv_register(&indev_drv);
/* Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
* add objects to the group with `lv_group_add_obj(group, obj)`
* and assign this input device to group to navigate in it:
* `lv_indev_set_group(indev_keypad, group);` */
/*Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
*add objects to the group with `lv_group_add_obj(group, obj)`
*and assign this input device to group to navigate in it:
*`lv_indev_set_group(indev_keypad, group);`*/
/*------------------
* Encoder
@@ -143,10 +144,10 @@ void lv_port_indev_init(void)
indev_drv.read_cb = encoder_read;
indev_encoder = lv_indev_drv_register(&indev_drv);
/* Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
* add objects to the group with `lv_group_add_obj(group, obj)`
* and assign this input device to group to navigate in it:
* `lv_indev_set_group(indev_encoder, group);` */
/*Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
*add objects to the group with `lv_group_add_obj(group, obj)`
*and assign this input device to group to navigate in it:
*`lv_indev_set_group(indev_encoder, group);`*/
/*------------------
* Button
@@ -183,7 +184,7 @@ static void touchpad_init(void)
/*Your code comes here*/
}
/* Will be called by the library to read the touchpad */
/*Will be called by the library to read the touchpad*/
static bool touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
{
static lv_coord_t last_x = 0;
@@ -226,13 +227,13 @@ static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y)
* Mouse
* -----------------*/
/* Initialize your mouse */
/*Initialize your mouse*/
static void mouse_init(void)
{
/*Your code comes here*/
}
/* Will be called by the library to read the mouse */
/*Will be called by the library to read the mouse*/
static bool mouse_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
{
/*Get the current x and y coordinates*/
@@ -270,13 +271,13 @@ static void mouse_get_xy(lv_coord_t * x, lv_coord_t * y)
* Keypad
* -----------------*/
/* Initialize your keypad */
/*Initialize your keypad*/
static void keypad_init(void)
{
/*Your code comes here*/
}
/* Will be called by the library to read the mouse */
/*Will be called by the library to read the mouse*/
static bool keypad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
{
static uint32_t last_key = 0;
@@ -331,13 +332,13 @@ static uint32_t keypad_get_key(void)
* Encoder
* -----------------*/
/* Initialize your keypad */
/*Initialize your keypad*/
static void encoder_init(void)
{
/*Your code comes here*/
}
/* Will be called by the library to read the encoder */
/*Will be called by the library to read the encoder*/
static bool encoder_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
{
@@ -361,13 +362,13 @@ static void encoder_handler(void)
* Button
* -----------------*/
/* Initialize your buttons */
/*Initialize your buttons*/
static void button_init(void)
{
/*Your code comes here*/
}
/* Will be called by the library to read the button */
/*Will be called by the library to read the button*/
static bool button_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
{
@@ -416,8 +417,8 @@ static bool button_is_pressed(uint8_t id)
return false;
}
#else /* Enable this file at the top */
#else /*Enable this file at the top*/
/* This dummy typedef exists purely to silence -Wpedantic. */
/*This dummy typedef exists purely to silence -Wpedantic.*/
typedef int keep_pedantic_happy;
#endif
+1 -1
View File
@@ -36,7 +36,7 @@ extern "C" {
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_PORT_INDEV_TEMPL_H*/
+1 -1
View File
@@ -34,7 +34,7 @@ void lv_example_scroll_3(void);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLE_SCROLL_H*/
+1 -1
View File
@@ -42,7 +42,7 @@ void lv_example_style_11(void);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EXAMPLE_STYLE_H*/
+2 -2
View File
@@ -31,8 +31,8 @@ void lv_example_arc_2(void)
lv_arc_set_angles(arc, 270, 270);
lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0);
/* Create an `lv_timer` to update the arc.
* Store the `arc` in the user data*/
/*Create an `lv_timer` to update the arc.
*Store the `arc` in the user data*/
lv_timer_create(arc_loader, 20, arc);
}
+1 -1
View File
@@ -28,7 +28,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
txt_area.x1 = txt_area.x2 - txt_size.x + 1;
dsc.color = lv_color_white();
}
/*If the indicator is still short put the text out of it on the right */
/*If the indicator is still short put the text out of it on the right*/
else {
txt_area.x1 = bar->indic_area.x2 + 5;
txt_area.x2 = txt_area.x1 + txt_size.x - 1;
+4 -4
View File
@@ -22,13 +22,13 @@ void lv_example_btn_3(void)
lv_anim_path_set_cb(&path_overshoot, lv_anim_path_overshoot);
/* Transition descriptor when going back to the default state.
* Add some delay to be sure the press transition is visible even if the press was very short*/
/*Transition descriptor when going back to the default state.
*Add some delay to be sure the press transition is visible even if the press was very short*/
static lv_style_transition_dsc_t transition_dsc_def;
lv_style_transition_dsc_init(&transition_dsc_def, props, &path_overshoot, 250, 100);
/* Transition descriptor when going to pressed state.
* No delay, go to presses state immediately*/
/*Transition descriptor when going to pressed state.
*No delay, go to presses state immediately*/
static lv_style_transition_dsc_t transition_dsc_pr;
lv_style_transition_dsc_init(&transition_dsc_pr, props, &path_ease_in_out, 250, 0);
@@ -7,7 +7,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
if(e == LV_EVENT_DRAW_PART_BEGIN) {
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
/*Change the draw descriptor the 2nd button */
/*Change the draw descriptor the 2nd button*/
if(dsc->id == 1) {
dsc->rect_dsc->radius = 0;
if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) dsc->rect_dsc->bg_color = lv_color_blue_darken_3();
@@ -18,7 +18,7 @@ static void event_cb(lv_obj_t * obj, lv_event_t e)
dsc->rect_dsc->shadow_ofs_y = 3;
dsc->label_dsc->color = lv_color_white();
}
/*Change the draw descriptor the 3rd button */
/*Change the draw descriptor the 3rd button*/
else if(dsc->id == 2) {
dsc->rect_dsc->radius = LV_RADIUS_CIRCLE;
if(lv_btnmatrix_get_selected_btn(obj) == dsc->id) dsc->rect_dsc->bg_color = lv_color_red_darken_3();
@@ -36,8 +36,8 @@ void lv_example_canvas_1(void)
lv_canvas_draw_text(canvas, 40, 20, 100, &label_dsc, "Some text on text canvas");
/* Test the rotation. It requires an other buffer where the orignal image is stored.
* So copy the current image to buffer and rotate it to the canvas */
/*Test the rotation. It requires an other buffer where the orignal image is stored.
*So copy the current image to buffer and rotate it to the canvas*/
static lv_color_t cbuf_tmp[CANVAS_WIDTH * CANVAS_HEIGHT];
memcpy(cbuf_tmp, cbuf, sizeof(cbuf_tmp));
lv_img_dsc_t img;
+1 -1
View File
@@ -7,7 +7,7 @@ static lv_chart_series_t * ser2;
static void event_cb(lv_obj_t * obj, lv_event_t e)
{
/*Add the faded area before the lines are drawn */
/*Add the faded area before the lines are drawn*/
if(e == LV_EVENT_DRAW_PART_BEGIN) {
lv_obj_draw_dsc_t * dsc = lv_event_get_param();
if(dsc->part != LV_PART_ITEMS) return;
@@ -33,7 +33,7 @@ void lv_example_dropdown_3(void)
lv_dropdown_set_symbol(dropdown, &img_caret_down);
lv_obj_set_style_transform_angle(dropdown, LV_PART_MAIN, LV_STATE_CHECKED, 1800);
/* In a menu we don't need to show the last clicked item*/
/*In a menu we don't need to show the last clicked item*/
lv_dropdown_set_selected_highlight(dropdown, false);
lv_obj_add_event_cb(dropdown, event_cb, NULL);
+2 -2
View File
@@ -29,7 +29,7 @@ void lv_example_img_2(void)
lv_obj_align(blue_slider, green_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0);
lv_obj_align(intense_slider, blue_slider, LV_ALIGN_OUT_RIGHT_MID, 25, 0);
/* Now create the actual image */
/*Now create the actual image*/
LV_IMG_DECLARE(img_cogwheel_argb)
img1 = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img1, &img_cogwheel_argb);
@@ -43,7 +43,7 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event)
LV_UNUSED(slider);
if(event == LV_EVENT_VALUE_CHANGED) {
/* Recolor the image based on the sliders' values */
/*Recolor the image based on the sliders' values*/
lv_color_t color = lv_color_make(lv_slider_get_value(red_slider), lv_slider_get_value(green_slider), lv_slider_get_value(blue_slider));
lv_opa_t intense = lv_slider_get_value(intense_slider);
lv_obj_set_style_img_recolor_opa(img1, LV_PART_MAIN, LV_STATE_DEFAULT, intense);
+1 -1
View File
@@ -19,7 +19,7 @@ void lv_example_img_3(void)
{
LV_IMG_DECLARE(img_cogwheel_argb);
/* Now create the actual image */
/*Now create the actual image*/
lv_obj_t * img = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img, &img_cogwheel_argb);
lv_obj_align(img, NULL, LV_ALIGN_CENTER, 50, 50);
@@ -7,7 +7,7 @@ void lv_example_imgbtn_1(void)
LV_IMG_DECLARE(imgbtn_right);
LV_IMG_DECLARE(imgbtn_mid);
/* Create a transition animation on width transformation and recolor.*/
/*Create a transition animation on width transformation and recolor.*/
static lv_style_prop_t tr_prop[] = {LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_IMG_RECOLOR_OPA, 0};
static lv_style_transition_dsc_t tr;
lv_style_transition_dsc_init(&tr, tr_prop, &lv_anim_path_def, 200, 0);
+5 -5
View File
@@ -6,17 +6,17 @@
*/
void lv_example_label_2(void)
{
/* Create a style for the shadow*/
/*Create a style for the shadow*/
static lv_style_t style_shadow;
lv_style_init(&style_shadow);
lv_style_set_text_opa(&style_shadow, LV_OPA_30);
lv_style_set_text_color(&style_shadow, lv_color_black());
/*Create a label for the shadow first (it's in the background) */
/*Create a label for the shadow first (it's in the background)*/
lv_obj_t * shadow_label = lv_label_create(lv_scr_act(), NULL);
lv_obj_add_style(shadow_label, LV_PART_MAIN, LV_STATE_DEFAULT, &style_shadow);
/* Create the main label */
/*Create the main label*/
lv_obj_t * main_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(main_label, "A simple method to create\n"
"shadows on a text.\n"
@@ -26,10 +26,10 @@ void lv_example_label_2(void)
/*Set the same text for the shadow label*/
lv_label_set_text(shadow_label, lv_label_get_text(main_label));
/* Position the main label */
/*Position the main label*/
lv_obj_align(main_label, NULL, LV_ALIGN_CENTER, 0, 0);
/* Shift the second label down and to the right by 2 pixel */
/*Shift the second label down and to the right by 2 pixel*/
lv_obj_align(shadow_label, main_label, LV_ALIGN_IN_TOP_LEFT, 2, 2);
}
+1 -1
View File
@@ -121,7 +121,7 @@ void lv_example_win_1(void);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_EX_WIDGETS_H*/
+2 -2
View File
@@ -23,7 +23,7 @@ void lv_example_meter_1(void)
lv_meter_indicator_t * indic;
/*Add a blue arc to the start */
/*Add a blue arc to the start*/
indic = lv_meter_add_arc(meter, scale, 3, lv_color_blue(), 0);
lv_meter_set_indicator_start_value(meter, indic, 0);
lv_meter_set_indicator_end_value(meter, indic, 20);
@@ -33,7 +33,7 @@ void lv_example_meter_1(void)
lv_meter_set_indicator_start_value(meter, indic, 0);
lv_meter_set_indicator_end_value(meter, indic, 20);
/*Add a red arc to the end */
/*Add a red arc to the end*/
indic = lv_meter_add_arc(meter, scale, 3, lv_color_red(), 0);
lv_meter_set_indicator_start_value(meter, indic, 80);
lv_meter_set_indicator_end_value(meter, indic, 100);
+1 -1
View File
@@ -26,7 +26,7 @@ void lv_example_meter_2(void)
lv_meter_set_scale_major_ticks(meter, scale, 1, 2, 30, lv_color_hex3(0xeee), 10);
lv_meter_set_scale_range(meter, scale, 0, 100, 270, 90);
/*Add a three arc indicator */
/*Add a three arc indicator*/
lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, scale, 10, lv_color_red(), 0);
lv_meter_indicator_t * indic2 = lv_meter_add_arc(meter, scale, 10, lv_color_green(), -10);
lv_meter_indicator_t * indic3 = lv_meter_add_arc(meter, scale, 10, lv_color_blue(), -20);
+1 -1
View File
@@ -31,7 +31,7 @@ void lv_example_meter_3(void)
LV_IMG_DECLARE(img_hand)
/*Add a the hands from images */
/*Add a the hands from images*/
lv_meter_indicator_t * indic_min = lv_meter_add_needle_img(meter, scale_min, &img_hand, 5, 5);
lv_meter_indicator_t * indic_hour = lv_meter_add_needle_img(meter, scale_min, &img_hand, 5, 5);
+1 -1
View File
@@ -18,7 +18,7 @@ void lv_example_meter_4(void)
lv_meter_set_scale_ticks(meter, scale, 0, 0, 0, lv_color_black());
lv_meter_set_scale_range(meter, scale, 0, 100, 360, 0);
/*Add a three arc indicator */
/*Add a three arc indicator*/
lv_coord_t indic_w = lv_obj_get_width(meter) / 2;
lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, scale, indic_w, lv_color_orange(), 0);
lv_meter_set_indicator_start_value(meter, indic1, 0);
@@ -9,12 +9,12 @@ static lv_obj_t * slider_label;
*/
void lv_example_slider_1(void)
{
/* Create a slider in the center of the display */
/*Create a slider in the center of the display*/
lv_obj_t * slider = lv_slider_create(lv_scr_act(), NULL);
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_event_cb(slider, slider_event_cb, NULL);
/* Create a label below the slider */
/*Create a label below the slider*/
slider_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(slider_label, "0%");
@@ -19,7 +19,7 @@ void lv_example_slider_2(void)
lv_style_set_content_opa(&style_pr, LV_OPA_COVER);
lv_style_set_content_ofs_y(&style_pr, -15);
/* Create a slider in the center of the display */
/*Create a slider in the center of the display*/
lv_obj_t * slider;
slider = lv_slider_create(lv_scr_act(), NULL);
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
@@ -9,7 +9,7 @@ static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
*/
void lv_example_slider_3(void)
{
/* Create a slider in the center of the display */
/*Create a slider in the center of the display*/
lv_obj_t * slider;
slider = lv_slider_create(lv_scr_act(), NULL);
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
+1 -1
View File
@@ -64,7 +64,7 @@ void lv_example_table_2(void)
lv_obj_set_size(table, 150, 200);
lv_table_set_col_width(table, 0, 150);
lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value */
lv_table_set_row_cnt(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/
lv_table_set_col_cnt(table, 1);
/*Don't make the cell pressed, we will draw something different in the event*/
@@ -7,7 +7,7 @@ static lv_obj_t * kb;
void lv_example_textarea_2(void)
{
/* Create the password box */
/*Create the password box*/
lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL);
lv_textarea_set_text(pwd_ta, "");
lv_textarea_set_password_mode(pwd_ta, true);
@@ -16,33 +16,33 @@ void lv_example_textarea_2(void)
lv_obj_set_pos(pwd_ta, 5, 20);
lv_obj_add_event_cb(pwd_ta, ta_event_cb, NULL);
/* Create a label and position it above the text box */
/*Create a label and position it above the text box*/
lv_obj_t * pwd_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(pwd_label, "Password:");
lv_obj_align(pwd_label, pwd_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
/* Create the one-line mode text area */
/*Create the one-line mode text area*/
lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta);
lv_textarea_set_password_mode(oneline_ta, false);
lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
/* Create a label and position it above the text box */
/*Create a label and position it above the text box*/
lv_obj_t * oneline_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(oneline_label, "Text:");
lv_obj_align(oneline_label, oneline_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
/* Create a keyboard */
/*Create a keyboard*/
kb = lv_keyboard_create(lv_scr_act());
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
lv_keyboard_set_textarea(kb, pwd_ta); /* Focus it on one of the text areas to start */
lv_keyboard_set_textarea(kb, pwd_ta); /*Focus it on one of the text areas to start*/
}
static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
/* Focus on the clicked text area */
/*Focus on the clicked text area*/
if(kb != NULL)
lv_keyboard_set_textarea(kb, ta);
}
@@ -11,7 +11,7 @@ static lv_obj_t * kb;
*/
void lv_example_textarea_3(void)
{
/* Create the text area */
/*Create the text area*/
lv_obj_t * ta = lv_textarea_create(lv_scr_act(), NULL);
lv_obj_add_event_cb(ta, ta_event_cb, NULL);
lv_textarea_set_accepted_chars(ta, "0123456789:");
@@ -19,7 +19,7 @@ void lv_example_textarea_3(void)
lv_textarea_set_one_line(ta, true);
lv_textarea_set_text(ta, "");
/* Create a keyboard*/
/*Create a keyboard*/
kb = lv_keyboard_create(lv_scr_act());
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER);
+97 -96
View File
@@ -11,7 +11,7 @@
#ifndef LV_CONF_H
#define LV_CONF_H
/* clang-format off */
/*clang-format off*/
#include <stdint.h>
@@ -20,15 +20,15 @@
COLOR SETTINGS
*====================*/
/* Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888) */
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
#define LV_COLOR_DEPTH 32
/* Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/
/*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/
#define LV_COLOR_16_SWAP 0
/* Enable more complex drawing routines to manage screens transparency.
* Can be used if the UI is above an other layer, e.g. an OSD menu or video player.
* Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value */
/*Enable more complex drawing routines to manage screens transparency.
*Can be used if the UI is above an other layer, e.g. an OSD menu or video player.
*Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/
#define LV_COLOR_SCREEN_TRANSP 0
/*Images pixels with this color will not be drawn if they are chroma keyed)*/
@@ -38,13 +38,13 @@
MEMORY SETTINGS
*=========================*/
/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()` */
/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
#define LV_MEM_CUSTOM 0
#if LV_MEM_CUSTOM == 0
/* Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
# define LV_MEM_SIZE (32U * 1024U) /* [bytes] */
/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
# define LV_MEM_SIZE (32U * 1024U) /*[bytes]*/
/* Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too. */
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
# define LV_MEM_ADR 0 /*0: unused*/
#else /*LV_MEM_CUSTOM*/
# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
@@ -53,29 +53,29 @@
# define LV_MEM_CUSTOM_REALLOC realloc
#endif /*LV_MEM_CUSTOM*/
/* Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster). */
/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/
#define LV_MEMCPY_MEMSET_STD 0
/*====================
HAL SETTINGS
*====================*/
/* Default display refresh period. LVG will redraw changed ares with this period time */
/*Default display refresh period. LVG will redraw changed ares with this period time*/
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
/* Input device read period in milliseconds */
/*Input device read period in milliseconds*/
#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/
/* Use a custom tick source that tells the elapsed time in milliseconds.
* It removes the need to manually update the tick with `lv_tick_inc()`) */
/*Use a custom tick source that tells the elapsed time in milliseconds.
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
#define LV_TICK_CUSTOM 0
#if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
#endif /*LV_TICK_CUSTOM*/
/* Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
* (Not so important, you can adjust it to modify default sizes and spaces)*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*=======================
@@ -86,25 +86,25 @@
* Drawing
*-----------*/
/* Enable complex draw engine.
* Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks */
/*Enable complex draw engine.
*Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/
#define LV_DRAW_COMPLEX 1
#if LV_DRAW_COMPLEX != 0
/* Allow buffering some shadow calculation.
* LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
* Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
/*Allow buffering some shadow calculation.
*LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
#define LV_SHADOW_CACHE_SIZE 0
#endif /*LV_DRAW_COMPLEX*/
/* Default image cache size. Image caching keeps the images opened.
* If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
* With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
* However the opened images might consume additional RAM.
* 0: to disable caching */
/*Default image cache size. Image caching keeps the images opened.
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
*However the opened images might consume additional RAM.
*0: to disable caching*/
#define LV_IMG_CACHE_DEF_SIZE 0
/* Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver. */
/*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver.*/
#define LV_DISP_ROT_MAX_BUF (10*1024)
/*-------------
* GPU
@@ -114,22 +114,22 @@
#define LV_USE_GPU_STM32_DMA2D 0
#if LV_USE_GPU_STM32_DMA2D
/*Must be defined to include path of CMSIS header of target processor
e.g. "stm32f769xx.h" or "stm32f429xx.h" */
e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
#define LV_GPU_DMA2D_CMSIS_INCLUDE
#endif
/* Use NXP's PXP GPU iMX RTxxx platforms */
/*Use NXP's PXP GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_PXP 0
#if LV_USE_GPU_NXP_PXP
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
* */
*/
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
#endif
/* Use NXP's VG-Lite GPU iMX RTxxx platforms */
/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_VG_LITE 0
/*-------------
@@ -140,20 +140,20 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
#define LV_USE_LOG 1
#if LV_USE_LOG
/* How important log should be added:
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
* LV_LOG_LEVEL_INFO Log important events
* LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
* LV_LOG_LEVEL_USER Only logs added by the user
* LV_LOG_LEVEL_NONE Do not log anything */
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/* 1: Print the log with 'printf';
* 0: User need to register a callback with `lv_log_register_print_cb()`*/
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
# define LV_LOG_PRINTF 1
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs */
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
# define LV_LOG_TRACE_MEM 1
# define LV_LOG_TRACE_TIMER 1
# define LV_LOG_TRACE_INDEV 1
@@ -170,13 +170,13 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
* Asserts
*-----------*/
/* Enable asserts if an operation is failed or an invalid data is found.
* If LV_USE_LOG is enabled an error message will be printed on failure*/
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended) */
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#define LV_USE_ASSERT_MEM_INTEGRITY 1 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow) */
#define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
@@ -208,50 +208,50 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */
typedef void * lv_user_data_t;
#endif
/* Garbage Collector settings
* Used if lvgl is binded to higher level language and the memory is managed by that language */
/*Garbage Collector settings
*Used if lvgl is binded to higher level language and the memory is managed by that language*/
#define LV_ENABLE_GC 0
#if LV_ENABLE_GC != 0
# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
#endif /* LV_ENABLE_GC */
#endif /*LV_ENABLE_GC*/
/*=====================
* COMPILER SETTINGS
*====================*/
/* For big endian systems set to 1 */
/*For big endian systems set to 1*/
#define LV_BIG_ENDIAN_SYSTEM 0
/* Define a custom attribute to `lv_tick_inc` function */
/*Define a custom attribute to `lv_tick_inc` function*/
#define LV_ATTRIBUTE_TICK_INC
/* Define a custom attribute to `lv_timer_handler` function */
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
/* Define a custom attribute to `lv_disp_flush_ready` function */
/*Define a custom attribute to `lv_disp_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/* Required alignment size for buffers */
/*Required alignment size for buffers*/
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#define LV_ATTRIBUTE_MEM_ALIGN
/* Attribute to mark large constant arrays for example font's bitmaps */
/*Attribute to mark large constant arrays for example font's bitmaps*/
#define LV_ATTRIBUTE_LARGE_CONST
/* Complier prefix for a big array declaration in RAM*/
/*Complier prefix for a big array declaration in RAM*/
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
/* Place performance critical functions into a faster memory (e.g RAM) */
/*Place performance critical functions into a faster memory (e.g RAM)*/
#define LV_ATTRIBUTE_FAST_MEM
/* Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible */
/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/
#define LV_ATTRIBUTE_DMA
/* Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
* should also appear on LVGL binding API such as Micropython.*/
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/
@@ -261,8 +261,8 @@ typedef void * lv_user_data_t;
* FONT USAGE
*===================*/
/* Montserrat fonts with ASCII range and some symbols using bpp = 4
* https://fonts.google.com/specimen/Montserrat */
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
@@ -285,37 +285,37 @@ typedef void * lv_user_data_t;
#define LV_FONT_MONTSERRAT_46 0
#define LV_FONT_MONTSERRAT_48 0
/* Demonstrate special features */
/*Demonstrate special features*/
#define LV_FONT_MONTSERRAT_12_SUBPX 0
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Perisan letters and all their forms*/
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
/*Pixel perfect monospace fonts
* http://pelulamu.net/unscii/ */
*http://pelulamu.net/unscii/*/
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/* Optionally declare custom fonts here.
* You can use these fonts as default font too and they will be available globally.
* E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2) */
/*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font*/
#define LV_FONT_DEFAULT &lv_font_montserrat_14
/* Enable handling large font and/or fonts with a lot of characters.
* The limit depends on the font size, font face and bpp.
* Compiler error will be triggered if a font needs it.*/
/*Enable handling large font and/or fonts with a lot of characters.
*The limit depends on the font size, font face and bpp.
*Compiler error will be triggered if a font needs it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/* Enables/disables support for compressed fonts. */
/*Enables/disables support for compressed fonts.*/
#define LV_USE_FONT_COMPRESSED 0
/* Enable subpixel rendering */
/*Enable subpixel rendering*/
#define LV_USE_FONT_SUBPX 0
#if LV_USE_FONT_SUBPX
/* Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/
#endif
@@ -323,52 +323,53 @@ typedef void * lv_user_data_t;
* TEXT SETTINGS
*=================*/
/* Select a character encoding for strings.
/**
* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
* */
*/
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS " ,.;:-_"
/* If a word is at least this long, will break wherever "prettiest"
* To disable, set to a value <= 0 */
/*If a word is at least this long, will break wherever "prettiest"
*To disable, set to a value <= 0*/
#define LV_TXT_LINE_BREAK_LONG_LEN 0
/* Minimum number of characters in a long word to put on a line before a break.
* Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
/*Minimum number of characters in a long word to put on a line before a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
/* Minimum number of characters in a long word to put on a line after a break.
* Depends on LV_TXT_LINE_BREAK_LONG_LEN. */
/*Minimum number of characters in a long word to put on a line after a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
/* The control character to use for signalling text recoloring. */
/*The control character to use for signalling text recoloring.*/
#define LV_TXT_COLOR_CMD "#"
/* Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
*The direction will be processed according to the Unicode Bidirectioanl Algorithm:
*https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#define LV_USE_BIDI 0
#if LV_USE_BIDI
/* Set the default direction. Supported values:
* `LV_BIDI_DIR_LTR` Left-to-Right
* `LV_BIDI_DIR_RTL` Right-to-Left
* `LV_BIDI_DIR_AUTO` detect texts base direction */
/*Set the default direction. Supported values:
*`LV_BIDI_DIR_LTR` Left-to-Right
*`LV_BIDI_DIR_RTL` Right-to-Left
*`LV_BIDI_DIR_AUTO` detect texts base direction*/
#define LV_BIDI_BASE_DIR_DEF LV_BIDI_DIR_AUTO
#endif
/* Enable Arabic/Persian processing
* In these languages characters should be replaced with an other form based on their position in the text */
/*Enable Arabic/Persian processing
*In these languages characters should be replaced with an other form based on their position in the text*/
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*==================
* WIDGET USAGE
*================*/
/* Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html */
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
#define LV_USE_ARC 1
@@ -390,7 +391,7 @@ typedef void * lv_user_data_t;
#define LV_USE_LABEL 1
#if LV_USE_LABEL
# define LV_LABEL_TEXT_SEL 1 /*Enable selecting text of the label */
# define LV_LABEL_TEXT_SEL 1 /*Enable selecting text of the label*/
# define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#endif
@@ -460,14 +461,14 @@ typedef void * lv_user_data_t;
/*-----------
* Themes
*----------*/
/* A simple, impressive and very complete theme */
/*A simple, impressive and very complete theme*/
#define LV_USE_THEME_DEFAULT 1
#if LV_USE_THEME_DEFAULT
/* 1: Light mode; 0: Dark mode*/
/*1: Light mode; 0: Dark mode*/
# define LV_THEME_DEFAULT_PALETTE_LIGHT 1
/* 1: Enable grow on press*/
/*1: Enable grow on press*/
# define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/
+2 -2
View File
@@ -109,7 +109,7 @@ extern "C" {
* bugfix_in_v5_3_2();
* #endif
*
* */
*/
#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))
/**
@@ -137,7 +137,7 @@ static inline const char *lv_version_info(void)
}
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LVGL_H*/
+5 -5
View File
@@ -23,18 +23,18 @@ fout.write(
#ifndef LV_CONF_INTERNAL_H
#define LV_CONF_INTERNAL_H
/* clang-format off */
/*clang-format off*/
#include <stdint.h>
/* Handle special Kconfig options */
/*Handle special Kconfig options*/
#include "lv_conf_kconfig.h"
#ifdef CONFIG_LV_CONF_SKIP
#define LV_CONF_SKIP
#endif
/* If "lv_conf.h" is available from here try to use it later.*/
/*If "lv_conf.h" is available from here try to use it later.*/
#if defined __has_include
# if __has_include("lv_conf.h")
# ifndef LV_CONF_INCLUDE_SIMPLE
@@ -54,7 +54,7 @@ fout.write(
# elif defined(LV_CONF_INCLUDE_SIMPLE) /*Or simply include lv_conf.h is enabled*/
# include "lv_conf.h"
# else
# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder */
# include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/
# endif
#endif
@@ -113,7 +113,7 @@ fout.write(
typedef void * lv_obj_user_data_t;
# endif
# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /*Disable warnings for Visual Studio*/
# define _CRT_SECURE_NO_WARNINGS
# endif
+1 -1
View File
@@ -258,7 +258,7 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
switch(anim_type) {
case LV_SCR_LOAD_ANIM_NONE:
/* Create a dummy animation to apply the delay*/
/*Create a dummy animation to apply the delay*/
lv_anim_set_exec_cb(&a_new, set_x_anim);
lv_anim_set_values(&a_new, 0, 0);
break;
+1 -1
View File
@@ -225,7 +225,7 @@ static inline lv_coord_t lv_dpx(lv_coord_t n)
}
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_DISP_H*/
+6 -6
View File
@@ -134,8 +134,8 @@ void lv_group_add_obj(lv_group_t * group, lv_obj_t * obj)
if(next == NULL) return;
*next = obj;
/* If the head and the tail is equal then there is only one object in the linked list.
* In this case automatically activate it*/
/*If the head and the tail is equal then there is only one object in the linked list.
*In this case automatically activate it*/
if(_lv_ll_get_head(&group->obj_ll) == next) {
lv_group_refocus(group);
}
@@ -168,14 +168,14 @@ void lv_group_remove_obj(lv_obj_t * obj)
}
}
/* If the focuses object is still the same then it was the only object in the group but it will
* be deleted. Set the `obj_focus` to NULL to get back to the initial state of the group with
* zero objects*/
/*If the focuses object is still the same then it was the only object in the group but it will
*be deleted. Set the `obj_focus` to NULL to get back to the initial state of the group with
*zero objects*/
if(*g->obj_focus == obj) {
g->obj_focus = NULL;
}
/*Search the object and remove it from its group */
/*Search the object and remove it from its group*/
lv_obj_t ** i;
_LV_LL_READ(&g->obj_ll, i) {
if(*i == obj) {
+3 -3
View File
@@ -55,7 +55,7 @@ typedef void (*lv_group_focus_cb_t)(struct _lv_group_t *);
* They are NOT for laying out objects on a screen (try `lv_cont` for that).
*/
typedef struct _lv_group_t {
lv_ll_t obj_ll; /**< Linked list to store the objects in the group */
lv_ll_t obj_ll; /**< Linked list to store the objects in the group*/
struct _lv_obj_t ** obj_focus; /**< The object in focus*/
lv_group_focus_cb_t focus_cb; /**< A function to call when a new object is focused (optional)*/
@@ -66,7 +66,7 @@ typedef struct _lv_group_t {
uint8_t frozen : 1; /**< 1: can't focus to new object*/
uint8_t editing : 1; /**< 1: Edit mode, 0: Navigate mode*/
uint8_t click_focus : 1; /**< 1: If an object in a group is clicked by an indev then it will be
focused */
focused*/
uint8_t refocus_policy : 1; /**< 1: Focus prev if focused on deletion. 0: Focus next if focused on
deletion.*/
uint8_t wrap : 1; /**< 1: Focus next/prev can wrap at end of list. 0: Focus next/prev stops at end
@@ -226,7 +226,7 @@ bool lv_group_get_wrap(lv_group_t * group);
**********************/
#ifdef __cplusplus
} /* extern "C" */
} /*extern "C"*/
#endif
#endif /*LV_GROUP_H*/

Some files were not shown because too many files have changed in this diff Show More