feat(rtthread): prepare for porting the device-driver of rt-thread (#2719)
This commit is contained in:
committed by
GitHub
parent
00e5597d69
commit
9d7f53012c
@@ -8,13 +8,10 @@ cwd = GetCurrentDir()
|
|||||||
|
|
||||||
src = []
|
src = []
|
||||||
inc = []
|
inc = []
|
||||||
LOCAL_CCFLAGS = ''
|
|
||||||
|
|
||||||
lvgl_cwd = cwd + '/../'
|
lvgl_cwd = cwd + '/../'
|
||||||
lvgl_src_cwd = lvgl_cwd + 'src/'
|
lvgl_src_cwd = lvgl_cwd + 'src/'
|
||||||
|
|
||||||
src = src + Glob('*.c')
|
|
||||||
inc = inc + [cwd]
|
|
||||||
inc = inc + [lvgl_src_cwd]
|
inc = inc + [lvgl_src_cwd]
|
||||||
|
|
||||||
for root, dirs, files in os.walk(lvgl_src_cwd):
|
for root, dirs, files in os.walk(lvgl_src_cwd):
|
||||||
@@ -22,6 +19,7 @@ for root, dirs, files in os.walk(lvgl_src_cwd):
|
|||||||
src = src + Glob(os.path.join(root,dir,'*.c'))
|
src = src + Glob(os.path.join(root,dir,'*.c'))
|
||||||
inc = inc + [os.path.join(root,dir)]
|
inc = inc + [os.path.join(root,dir)]
|
||||||
|
|
||||||
|
LOCAL_CCFLAGS = ''
|
||||||
if rtconfig.CROSS_TOOL == 'gcc':
|
if rtconfig.CROSS_TOOL == 'gcc':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CCFLAGS += ' -std=c99'
|
||||||
elif rtconfig.CROSS_TOOL == 'keil':
|
elif rtconfig.CROSS_TOOL == 'keil':
|
||||||
@@ -29,6 +27,10 @@ elif rtconfig.CROSS_TOOL == 'keil':
|
|||||||
|
|
||||||
group = DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
group = DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
||||||
|
|
||||||
|
port_src = Glob('*.c')
|
||||||
|
port_inc = [cwd]
|
||||||
|
group = group + DefineGroup('LVGL-port', port_src, depend = ['PKG_USING_LVGL'], CPPPATH = port_inc)
|
||||||
|
|
||||||
list = os.listdir(cwd)
|
list = os.listdir(cwd)
|
||||||
for d in list:
|
for d in list:
|
||||||
path = os.path.join(cwd, d)
|
path = os.path.join(cwd, d)
|
||||||
|
|||||||
@@ -16,6 +16,13 @@
|
|||||||
#define DBG_LVL DBG_INFO
|
#define DBG_LVL DBG_INFO
|
||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
|
#ifndef PKG_USING_LVGL_DISP_DEVICE
|
||||||
|
# include <lv_port_disp.h>
|
||||||
|
#endif
|
||||||
|
#ifndef PKG_USING_LVGL_INDEV_DEVICE
|
||||||
|
# include <lv_port_indev.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if LV_USE_LOG && LV_LOG_PRINTF
|
#if LV_USE_LOG && LV_LOG_PRINTF
|
||||||
static void lv_rt_log(const char *buf)
|
static void lv_rt_log(const char *buf)
|
||||||
{
|
{
|
||||||
@@ -29,6 +36,15 @@ static int lv_port_init(void)
|
|||||||
lv_log_register_print_cb(lv_rt_log);
|
lv_log_register_print_cb(lv_rt_log);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
lv_init();
|
||||||
|
|
||||||
|
#ifndef PKG_USING_LVGL_DISP_DEVICE
|
||||||
|
lv_port_disp_init();
|
||||||
|
#endif
|
||||||
|
#ifndef PKG_USING_LVGL_INDEV_DEVICE
|
||||||
|
lv_port_indev_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
INIT_COMPONENT_EXPORT(lv_port_init);
|
INIT_COMPONENT_EXPORT(lv_port_init);
|
||||||
|
|||||||
Reference in New Issue
Block a user