lvgl ui support AiUIBuilder

This commit is contained in:
刘可亮
2024-11-26 13:23:39 +08:00
parent e4a45f6b7d
commit a89bc72654
57 changed files with 530 additions and 110 deletions

View File

@@ -199,6 +199,10 @@ choice
default AIC_LVGL_BASE_DEMO
depends on AIC_LVGL_DEMO
config AIC_LVGL_UI_BUILDER
select LPKG_USING_FREETYPE
bool "Support AiUIBuider"
config AIC_LVGL_BASE_DEMO
bool "LVGL demo with basic function"
@@ -309,6 +313,13 @@ config MPP_JPEG_DEC_OUT_SIZE_LIMIT_ENABLE
default n
depends on LPKG_USING_LVGL
if !AIC_LVGL_MUSIC_DEMO && !AIC_LVGL_DEMO_WIDGETS && !AIC_LVGL_DEMO_BENCHMARK
config LV_USE_CONF_CUSTOM
bool "LVGL use custom config"
default y
depends on LPKG_USING_LVGL
endif
if MPP_JPEG_DEC_OUT_SIZE_LIMIT_ENABLE
config MPP_JPEG_DEC_MAX_OUT_WIDTH
int "Max output width of MPP JPEG decoder"

View File

@@ -1,17 +1,40 @@
from building import *
import os
cwd = GetCurrentDir()
# check if .h or .hpp files exist
def check_h_hpp_exist(path):
file_dirs = os.listdir(path)
for file_dir in file_dirs:
if os.path.splitext(file_dir)[1] in ['.h', '.hpp']:
return True
return False
src = []
inc = []
group = []
src = Glob('*.c')
CPPPATH = [cwd]
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
group = group + SConscript(os.path.join(d, 'SConscript'))
cwd = GetCurrentDir()
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_DEMO'], CPPPATH = CPPPATH)
if GetDepend(['AIC_LVGL_UI_BUILDER']):
ui_path = 'ui_builder/'
src = Glob(ui_path + '*.c')
lvgl_cwd = cwd + '/'
lvgl_src_cwd = lvgl_cwd + ui_path
inc = inc + [lvgl_src_cwd]
for root, dirs, files in os.walk(lvgl_src_cwd):
for dir in dirs:
current_path = os.path.join(root, dir)
rela_path = current_path.replace(lvgl_cwd, '')
src = src + Glob(rela_path + '/*.c') # add all .c files
if check_h_hpp_exist(current_path): # add .h and .hpp path
inc = inc + [current_path]
else:
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
group = group + SConscript(os.path.join(d, 'SConscript'))
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_DEMO'], CPPPATH = inc)
Return('group')

View File

@@ -411,3 +411,8 @@ void base_ui_init()
lv_obj_add_event_cb(main_tabview, main_tapview_event, LV_EVENT_ALL, NULL);
}
void ui_init(void)
{
base_ui_init();
}

View File

@@ -1065,3 +1065,8 @@ void base_ui_init()
lv_obj_add_event_cb(main_tabview, main_tapview_event, LV_EVENT_ALL, NULL);
}
void ui_init(void)
{
base_ui_init();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2023-2024 ArtinChip Technology Co., Ltd.
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/
@@ -383,3 +386,8 @@ void dashboard_ui_init()
lv_timer_create(trip_callback, 1000 * 5, 0);
lv_timer_create(signal_callback, 500, 0);
}
void ui_init(void)
{
dashboard_ui_init();
}

View File

@@ -1,8 +1,12 @@
/*
* Copyright (C) 2023-2024 ArtinChip Technology Co., Ltd.
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/
#ifndef DASHBOARD_H
#define DASHBOARD_H

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -121,3 +121,8 @@ void layer_sys_ui_invisible(int flag)
{
lv_obj_add_flag(sys_ui.home_btn, LV_OBJ_FLAG_HIDDEN);
}
void ui_init(void)
{
demo_hub_init();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2023-2024 ArtinChip Technology Co., Ltd.
* Copyright (C) 2023-2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Huahui Mai <huahui.mai@artinchip.com>
*
*/

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2023-2024 ArtinChip Technology Co., Ltd.
* Copyright (C) 2023-2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Huahui Mai <huahui.mai@artinchip.com>
*
*/

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2023-2024 ArtinChip Technology Co., Ltd.
* Copyright (C) 2023-2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Keliang Liu <keliang.liu@artinchip.com>
* Huahui Mai <huahui.mai@artinchip.com>
*/
@@ -18,7 +21,7 @@
#include "elevator_uart.h"
FAKE_IMAGE_DECLARE(ELEVATOR_BG_WHITE)
FAKE_IMAGE_DECLARE(ELEVATOR_BG_WHITE);
LV_FONT_DECLARE(ui_font_h1);
LV_FONT_DECLARE(ui_font_regular);
@@ -577,3 +580,7 @@ void elevator_ui_init()
#endif
}
void ui_init(void)
{
elevator_ui_init();
}

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2023-2024 ArtinChip Technology Co., Ltd.
* Copyright (C) 2023-2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Keliang Liu <keliang.liu@artinchip.com>
* Huahui Mai <huahui.mai@artinchip.com>
*/

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -44,3 +44,8 @@ void gif_ui_init()
lv_obj_add_event_cb(img, gif_event, LV_EVENT_ALL, NULL);
printf("gif_ini_ok\n");
}
void ui_init(void)
{
gif_ui_init();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -124,3 +124,8 @@ void image_ui_init(void)
lv_timer_create(change_file_image_callback, 1000, 0);
#endif
}
void ui_init(void)
{
image_ui_init();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -27,3 +27,8 @@ void launcher_ui_init()
lv_scr_load(scr_launcher);
}
void ui_init(void)
{
launcher_ui_init();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -625,3 +625,8 @@ void meter_ui_init()
return;
}
void ui_init(void)
{
meter_ui_init();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -47,3 +47,8 @@ void lv_multi_lang_example(void)
lv_scr_load(screen_white);
}
void ui_init(void)
{
lv_multi_lang_example();
}

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/

View File

@@ -1,5 +1,8 @@
/*__cplusplus
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
/*
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/

View File

@@ -1,5 +1,8 @@
/*__cplusplus
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
/*
* Copyright (C) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -386,3 +386,7 @@ void simple_player_ui_init()
lv_timer_create(player_callback, 20, 0);
}
void ui_init(void)
{
simple_player_ui_init();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -23,3 +23,8 @@ void slide_ui_init()
scr_slide = hor_screen_init();
lv_scr_load(scr_slide);
}
void ui_init(void)
{
slide_ui_init();
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
#undef LV_USE_FREETYPE
#define LV_USE_FREETYPE 1
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: ArtInChip
*/
#include "ui_init.h"
void ui_init(void)
{
lv_obj_t * label = lv_label_create(lv_scr_act());
lv_label_set_text(label, "You can replace this code with the code generated by AiUIBuilder!");
lv_obj_center(label);
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: ArtInChip
*/
#ifndef _UI_INIT_H
#define _UI_INIT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "lvgl.h"
void ui_init(void);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif // _UI_INIT_H

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -454,3 +454,8 @@ void usb_osd_ui_init(void)
lv_timer_create(usb_osd_ui_callback, 200, 0);
}
void ui_init(void)
{
usb_osd_ui_init();
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* lv_conf_custom.h for custom lv_conf.h file
* example :
* #undef LV_USE_LOG
* #define LV_USE_LOG 1
*/
#ifndef LV_CONF_CUSTOM_H
#define LV_CONF_CUSTOM_H
/* code begin */
/* code end */
#endif /* LV_CONF_CUSTOM_H */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
* Copyright (C) 2023-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -22,3 +22,8 @@ void vscode_ui_init(void)
template_ui_init();
#endif
}
void ui_init(void)
{
vscode_ui_init();
}

View File

@@ -38,79 +38,18 @@ static void use_touch_monkey_test(void)
void aic_ui_init()
{
/* qc test demo is only for aic internal qc testing, please ignore it. */
#ifdef AIC_LVGL_VSCODE_DEMO
extern void vscode_ui_init();
vscode_ui_init();
return;
#endif
#ifdef AIC_LVGL_BASE_DEMO
#include "base_ui.h"
base_ui_init();
#endif
#ifdef AIC_LVGL_METER_DEMO
#include "meter_ui.h"
meter_ui_init();
#endif
#ifdef AIC_LVGL_LAUNCHER_DEMO
extern void launcher_ui_init();
launcher_ui_init();
#endif
#ifdef AIC_LVGL_DASHBOARD_DEMO
extern void dashboard_ui_init(void);
dashboard_ui_init();
#endif
#ifdef AIC_LVGL_DEMO_HUB_DEMO
extern void demo_hub_init(void);
demo_hub_init();
#endif
#ifdef AIC_LVGL_ELEVATOR_DEMO
#include "elevator_ui.h"
elevator_ui_init();
#endif
#ifdef AIC_LVGL_USB_OSD_DEMO
#include "usb_osd_ui.h"
usb_osd_ui_init();
#endif
#ifdef AIC_LVGL_SLIDE_DEMO
extern void slide_ui_init(void);
slide_ui_init();
#endif
#ifdef AIC_LVGL_GIF_DEMO
extern void gif_ui_init(void);
gif_ui_init();
#endif
#ifdef AIC_LVGL_SIMPLE_PLAYER_DEMO
extern void simple_player_ui_init(void);
simple_player_ui_init();
#endif
#ifdef AIC_LVGL_MUSIC_DEMO
#if defined(AIC_LVGL_QC_TEST_DEMO)
extern int qc_test_init();
qc_test_init();
#elif defined(AIC_LVGL_MUSIC_DEMO)
lv_demo_music();
#endif
#ifdef AIC_LVGL_DEMO_BENCHMARK
#elif defined(AIC_LVGL_DEMO_BENCHMARK)
lv_demo_benchmark();
#endif
#ifdef AIC_LVGL_DEMO_WIDGETS
#elif defined(AIC_LVGL_DEMO_WIDGETS)
lv_demo_widgets();
#endif
#ifdef AIC_LVGL_IMAGE_DEMO
extern void image_ui_init(void);
image_ui_init();
#else
extern void ui_init(void);
ui_init();
#endif
#ifdef AIC_USE_TOUCH_MONKEY_TEST

View File

@@ -1,5 +1,8 @@
/*
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
* Copyright (C) 2022-2024 ArtInChip Technology Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: Ning Fang <ning.fang@artinchip.com>
*/
@@ -16,6 +19,12 @@ extern "C" {
#ifndef LVGL_STORAGE_PATH
#define LVGL_STORAGE_PATH "/rodata/lvgl_data"
#endif
#ifdef AIC_LVGL_UI_BUILDER
#undef LVGL_STORAGE_PATH
#define LVGL_STORAGE_PATH "/rodata"
#endif
#define LVGL_DIR "L:"LVGL_STORAGE_PATH"/"
#define FILE_LIST_PATH LVGL_STORAGE_PATH"/video/"
@@ -23,6 +32,8 @@ extern "C" {
#define LVGL_PATH(y) CONN(LVGL_DIR, y)
#define LVGL_FILE_LIST_PATH(y) CONN(FILE_LIST_PATH, y)
#define LVGL_PATH_ORI(y) CONN(LVGL_STORAGE_PATH"/", y)
#define LVGL_FONT_PATH(y) CONN(LVGL_STORAGE_PATH"/""font/", y)
#define LVGL_IMAGE_PATH(y) CONN(LVGL_DIR"image/", y)
/* use fake image to fill color */
#define FAKE_IMAGE_DECLARE(name) char fake_##name[256];

View File

@@ -119,4 +119,9 @@
/*1: Enable Monkey test*/
#define LV_USE_MONKEY 1
// should at the end of lv_conf.h
#if defined(LV_USE_CONF_CUSTOM)
#include "lv_conf_custom.h"
#endif
#endif // LV_CONF_H

View File

@@ -224,10 +224,13 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
lv_disp_t * d = lv_obj_get_disp(new_scr);
lv_obj_t * act_scr = lv_scr_act();
if(act_scr == new_scr || d->scr_to_load == new_scr) {
return;
}
/*If an other screen load animation is in progress
*make target screen loaded immediately. */
if(d->scr_to_load && act_scr != d->scr_to_load) {
scr_load_internal(d->scr_to_load);
if(d->scr_to_load) {
lv_anim_del(d->scr_to_load, NULL);
lv_obj_set_pos(d->scr_to_load, 0, 0);
lv_obj_remove_local_style_prop(d->scr_to_load, LV_STYLE_OPA, 0);
@@ -236,6 +239,8 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
lv_obj_del(act_scr);
}
act_scr = d->scr_to_load;
scr_load_internal(d->scr_to_load);
}
d->scr_to_load = new_scr;
@@ -258,10 +263,10 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0);
lv_obj_remove_local_style_prop(lv_scr_act(), LV_STYLE_OPA, 0);
/*Shortcut for immediate load*/
if(time == 0 && delay == 0) {
scr_load_internal(new_scr);
if(auto_del) lv_obj_del(act_scr);
return;
}
@@ -477,6 +482,7 @@ static void scr_load_internal(lv_obj_t * scr)
if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOAD_START, NULL);
d->act_scr = scr;
d->scr_to_load = NULL;
if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOADED, NULL);
if(d->act_scr) lv_event_send(old_scr, LV_EVENT_SCREEN_UNLOADED, NULL);

View File

@@ -120,4 +120,10 @@
#define LV_DRAW_BUF_ALIGN CACHE_LINE_SIZE
#define LV_USE_MONKEY 1
// should at the end of lv_conf.h
#if defined(LV_USE_CONF_CUSTOM)
#include "lv_conf_custom.h"
#endif
#endif // LV_CONF_H

View File

@@ -197,6 +197,10 @@ static int32_t ge2d_evaluate(lv_draw_unit_t *u, lv_draw_task_t *t)
case LV_DRAW_TASK_TYPE_LAYER: {
const lv_draw_image_dsc_t *draw_dsc = (lv_draw_image_dsc_t *)t->draw_dsc;
lv_layer_t *layer= (lv_layer_t *)draw_dsc->src;
lv_draw_buf_t *dest_buf = draw_dsc->base.layer->draw_buf;
if (!dest_buf)
return 0;
if (!ge2d_src_fmt_supported(layer->color_format))
return 0;
@@ -213,6 +217,10 @@ static int32_t ge2d_evaluate(lv_draw_unit_t *u, lv_draw_task_t *t)
case LV_DRAW_TASK_TYPE_IMAGE: {
lv_draw_image_dsc_t *draw_dsc = (lv_draw_image_dsc_t *)t->draw_dsc;
lv_draw_buf_t *dest_buf = draw_dsc->base.layer->draw_buf;
if (!dest_buf)
return 0;
if (!ge2d_src_fmt_supported(draw_dsc->header.cf))
return 0;