chore(format) add formatting for examples & demos, merge test config

This commit is contained in:
embeddedt
2022-02-13 13:59:17 -05:00
parent ba38a4bb76
commit 9771050b99
85 changed files with 2438 additions and 2388 deletions

View File

@@ -3,7 +3,7 @@
*
*/
/*Copy this file as "lv_port_disp.c" and set this value to "1" to enable content*/
/*Copy this file as "lv_port_disp.c" and set this value to "1" to enable content*/
#if 0
/*********************
@@ -88,7 +88,8 @@ void lv_port_disp_init(void)
static lv_disp_draw_buf_t draw_buf_dsc_3;
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*A screen sized buffer*/
static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*Another screen sized buffer*/
lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2,
MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
/*-----------------------------------
* Register the display in LVGL

View File

@@ -3,7 +3,7 @@
*
*/
/*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/
/*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/
#if 0
#ifndef LV_PORT_DISP_TEMPL_H

View File

@@ -3,7 +3,7 @@
*
*/
/*Copy this file as "lv_port_fs.c" and set this value to "1" to enable content*/
/*Copy this file as "lv_port_fs.c" and set this value to "1" to enable content*/
#if 0
/*********************
@@ -33,7 +33,7 @@ static lv_fs_res_t fs_seek(lv_fs_drv_t * drv, void * file_p, uint32_t pos, lv_fs
static lv_fs_res_t fs_size(lv_fs_drv_t * drv, void * file_p, uint32_t * size_p);
static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p);
static void * fs_dir_open(lv_fs_drv_t * drv, const char *path);
static void * fs_dir_open(lv_fs_drv_t * drv, const char * path);
static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * rddir_p, char * fn);
static lv_fs_res_t fs_dir_close(lv_fs_drv_t * drv, void * rddir_p);
@@ -109,18 +109,15 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode)
void * f = NULL;
if(mode == LV_FS_MODE_WR)
{
if(mode == LV_FS_MODE_WR) {
/*Open a file for write*/
f = ... /*Add your code here*/
}
else if(mode == LV_FS_MODE_RD)
{
else if(mode == LV_FS_MODE_RD) {
/*Open a file for read*/
f = ... /*Add your code here*/
}
else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD))
{
else if(mode == (LV_FS_MODE_WR | LV_FS_MODE_RD)) {
/*Open a file for read and write*/
f = ... /*Add your code here*/
}
@@ -217,12 +214,12 @@ static lv_fs_res_t fs_tell(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p)
* @param path path to a directory
* @return pointer to the directory read descriptor or NULL on error
*/
static void * fs_dir_open(lv_fs_drv_t * drv, const char *path)
static void * fs_dir_open(lv_fs_drv_t * drv, const char * path)
{
void * dir = NULL;
/*Add your code here*/
dir = ... /*Add your code here*/
return dir;
return dir;
}
/**
@@ -233,7 +230,7 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char *path)
* @param fn pointer to a buffer to store the filename
* @return LV_FS_RES_OK: no error or any error from @lv_fs_res_t enum
*/
static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * rddir_p, char *fn)
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;

View File

@@ -3,7 +3,7 @@
*
*/
/*Copy this file as "lv_port_fs.h" and set this value to "1" to enable content*/
/*Copy this file as "lv_port_fs.h" and set this value to "1" to enable content*/
#if 0
#ifndef LV_PORT_FS_TEMPL_H
@@ -29,7 +29,7 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_port_fs_init(void);
void lv_port_fs_init(void);
/**********************
* MACROS

View File

@@ -3,7 +3,7 @@
*
*/
/*Copy this file as "lv_port_indev.c" and set this value to "1" to enable content*/
/*Copy this file as "lv_port_indev.c" and set this value to "1" to enable content*/
#if 0
/*********************
@@ -165,8 +165,8 @@ void lv_port_indev_init(void)
/*Assign buttons to points on the screen*/
static const lv_point_t btn_points[2] = {
{10, 10}, /*Button 0 -> x:10; y:10*/
{40, 100}, /*Button 1 -> x:40; y:100*/
{10, 10}, /*Button 0 -> x:10; y:10*/
{40, 100}, /*Button 1 -> x:40; y:100*/
};
lv_indev_set_button_points(indev_button, btn_points);
}
@@ -195,7 +195,8 @@ static void touchpad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
if(touchpad_is_pressed()) {
touchpad_get_xy(&last_x, &last_y);
data->state = LV_INDEV_STATE_PR;
} else {
}
else {
data->state = LV_INDEV_STATE_REL;
}
@@ -240,7 +241,8 @@ static void mouse_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
/*Get whether the mouse button is pressed or released*/
if(mouse_is_pressed()) {
data->state = LV_INDEV_STATE_PR;
} else {
}
else {
data->state = LV_INDEV_STATE_REL;
}
}
@@ -287,25 +289,26 @@ static void keypad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
/*Translate the keys to LVGL control characters according to your key definitions*/
switch(act_key) {
case 1:
act_key = LV_KEY_NEXT;
break;
case 2:
act_key = LV_KEY_PREV;
break;
case 3:
act_key = LV_KEY_LEFT;
break;
case 4:
act_key = LV_KEY_RIGHT;
break;
case 5:
act_key = LV_KEY_ENTER;
break;
case 1:
act_key = LV_KEY_NEXT;
break;
case 2:
act_key = LV_KEY_PREV;
break;
case 3:
act_key = LV_KEY_LEFT;
break;
case 4:
act_key = LV_KEY_RIGHT;
break;
case 5:
act_key = LV_KEY_ENTER;
break;
}
last_key = act_key;
} else {
}
else {
data->state = LV_INDEV_STATE_REL;
}
@@ -369,7 +372,8 @@ static void button_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
if(btn_act >= 0) {
data->state = LV_INDEV_STATE_PR;
last_btn = btn_act;
} else {
}
else {
data->state = LV_INDEV_STATE_REL;
}

View File

@@ -4,7 +4,7 @@
*
*/
/*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/
/*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/
#if 0
#ifndef LV_PORT_INDEV_TEMPL_H