2021-10-18 07:55:20 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2021-10-18 Meco Man The first version
|
|
|
|
*/
|
|
|
|
|
2021-10-18 09:58:02 -05:00
|
|
|
#ifdef __RTTHREAD__
|
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
#include <rtthread.h>
|
|
|
|
#include <lvgl.h>
|
|
|
|
#define DBG_TAG "LVGL"
|
|
|
|
#define DBG_LVL DBG_INFO
|
|
|
|
#include <rtdbg.h>
|
|
|
|
|
2021-10-22 05:13:39 -04:00
|
|
|
#ifndef PKG_USING_LVGL_DISP_DEVICE
|
|
|
|
# include <lv_port_disp.h>
|
|
|
|
#endif
|
|
|
|
#ifndef PKG_USING_LVGL_INDEV_DEVICE
|
|
|
|
# include <lv_port_indev.h>
|
|
|
|
#endif
|
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
#if LV_USE_LOG && LV_LOG_PRINTF
|
|
|
|
static void lv_rt_log(const char *buf)
|
|
|
|
{
|
|
|
|
LOG_I(buf);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int lv_port_init(void)
|
|
|
|
{
|
|
|
|
#if LV_USE_LOG && LV_LOG_PRINTF
|
|
|
|
lv_log_register_print_cb(lv_rt_log);
|
|
|
|
#endif
|
|
|
|
|
2021-10-22 05:13:39 -04:00
|
|
|
lv_init();
|
|
|
|
|
|
|
|
#ifndef PKG_USING_LVGL_DISP_DEVICE
|
|
|
|
lv_port_disp_init();
|
|
|
|
#endif
|
|
|
|
#ifndef PKG_USING_LVGL_INDEV_DEVICE
|
|
|
|
lv_port_indev_init();
|
|
|
|
#endif
|
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
INIT_COMPONENT_EXPORT(lv_port_init);
|
2021-10-18 09:58:02 -05:00
|
|
|
|
|
|
|
#endif /*__RTTHREAD__*/
|