diff --git a/bsp/raspberry-pico/applications/SConscript b/bsp/raspberry-pico/applications/SConscript index a0508c4020..496584a1ae 100644 --- a/bsp/raspberry-pico/applications/SConscript +++ b/bsp/raspberry-pico/applications/SConscript @@ -2,9 +2,7 @@ from building import * import os cwd = GetCurrentDir() - src = ['main.c'] - CPPPATH = [cwd] group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/raspberry-pico/applications/lvgl/SConscript b/bsp/raspberry-pico/applications/lvgl/SConscript index bbeed6d911..3cb9a1dde7 100644 --- a/bsp/raspberry-pico/applications/lvgl/SConscript +++ b/bsp/raspberry-pico/applications/lvgl/SConscript @@ -1,17 +1,17 @@ -from building import * import os +from building import * cwd = GetCurrentDir() group = [] src = Glob('*.c') CPPPATH = [cwd] -group = DefineGroup('LVGL-port', src, depend = ['BSP_USING_LVGL'], CPPPATH = CPPPATH) - 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 = ['BSP_USING_LVGL'], CPPPATH = CPPPATH) + Return('group') diff --git a/bsp/raspberry-pico/applications/lvgl/demo/SConscript b/bsp/raspberry-pico/applications/lvgl/demo/SConscript new file mode 100644 index 0000000000..9c1b6d1ebd --- /dev/null +++ b/bsp/raspberry-pico/applications/lvgl/demo/SConscript @@ -0,0 +1,17 @@ +from building import * +import os + +cwd = GetCurrentDir() +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')) + +group = group + DefineGroup('LVGL-demo', src, depend = ['BSP_USING_LVGL', 'BSP_USING_LVGL_DEMO'], CPPPATH = CPPPATH) + +Return('group') diff --git a/bsp/raspberry-pico/applications/lvgl/demo/lv_demo.c b/bsp/raspberry-pico/applications/lvgl/demo/lv_demo.c new file mode 100644 index 0000000000..77bdc0ac47 --- /dev/null +++ b/bsp/raspberry-pico/applications/lvgl/demo/lv_demo.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-10-17 Meco Man First version + * 2022-05-10 Meco Man improve rt-thread initialization process + */ + +void lv_user_gui_init(void) +{ + /* display demo; you may replace with your LVGL application at here */ + extern void lv_demo_music(void); + lv_demo_music(); +} diff --git a/bsp/raspberry-pico/applications/lvgl/lv_demo.c b/bsp/raspberry-pico/applications/lvgl/lv_demo.c deleted file mode 100644 index 95e047d541..0000000000 --- a/bsp/raspberry-pico/applications/lvgl/lv_demo.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2021-10-17 Meco Man First version - */ -#include -#include -#include -#define DBG_TAG "LVGL.demo" -#define DBG_LVL DBG_INFO -#include - -#ifndef LV_THREAD_STACK_SIZE -#define LV_THREAD_STACK_SIZE 4096 -#endif - -#ifndef LV_THREAD_PRIO -#define LV_THREAD_PRIO (RT_THREAD_PRIORITY_MAX * 2 / 3) -#endif - -static void lvgl_thread(void *parameter) -{ - extern void lv_demo_music(void); - lv_demo_music(); - while (1) - { - lv_task_handler(); - rt_thread_mdelay(5); - } -} - -static int lvgl_demo_init(void) -{ - rt_thread_t tid; - - tid = rt_thread_create("LVGL", lvgl_thread, RT_NULL, LV_THREAD_STACK_SIZE, LV_THREAD_PRIO, 0); - if (tid == RT_NULL) - { - LOG_E("Fail to create 'LVGL' thread"); - } - rt_thread_startup(tid); - - return 0; -} -INIT_APP_EXPORT(lvgl_demo_init); diff --git a/bsp/raspberry-pico/libraries/Kconfig b/bsp/raspberry-pico/libraries/Kconfig index 9de45a9aa6..5aa5310147 100644 --- a/bsp/raspberry-pico/libraries/Kconfig +++ b/bsp/raspberry-pico/libraries/Kconfig @@ -12,12 +12,14 @@ menu "Onboard Peripheral Drivers" bool "Enable LVGL for LCD" select PKG_USING_LVGL select BSP_USING_SPI_LCD - select PKG_USING_LV_MUSIC_DEMO default n - + + if BSP_USING_LVGL + config BSP_USING_LVGL_DEMO + bool "Enable LVGL demo" + select PKG_USING_LV_MUSIC_DEMO + default n + endif endmenu endmenu - - -