add lvgl for xiuos
This commit is contained in:
@@ -12,11 +12,21 @@
|
||||
#include "lv_demo_calendar.h"
|
||||
#include <transform.h>
|
||||
|
||||
extern void lv_example_chart_2(void);
|
||||
extern void lv_example_img_1(void);
|
||||
extern void lv_example_img_2(void);
|
||||
extern void lv_example_img_3(void);
|
||||
extern void lv_example_img_4(void);
|
||||
extern void lv_example_line_1(void);
|
||||
extern void lv_example_aoteman(void);
|
||||
void* lvgl_thread(void *parameter)
|
||||
{
|
||||
/* display demo; you may replace with your LVGL application at here */
|
||||
lv_demo_calendar();
|
||||
|
||||
// lv_demo_calendar();
|
||||
// lv_example_img_1();
|
||||
// lv_example_chart_2();
|
||||
// lv_example_line_1();
|
||||
lv_example_aoteman();
|
||||
/* handle the tasks of LVGL */
|
||||
while(1)
|
||||
{
|
||||
@@ -29,7 +39,7 @@ pthread_t lvgl_task;
|
||||
static int lvgl_demo_init(void)
|
||||
{
|
||||
pthread_attr_t attr;
|
||||
attr.schedparam.sched_priority = 20;
|
||||
attr.schedparam.sched_priority = 25;
|
||||
attr.stacksize = 4096;
|
||||
|
||||
PrivTaskCreate(&lvgl_task, &attr, lvgl_thread, NULL);
|
||||
|
||||
@@ -18,7 +18,7 @@ static void event_handler(lv_event_t * e)
|
||||
void lv_demo_calendar(void)
|
||||
{
|
||||
lv_obj_t * calendar = lv_calendar_create(lv_scr_act());
|
||||
lv_obj_set_size(calendar, 240, 240);
|
||||
lv_obj_set_size(calendar, 320, 240);
|
||||
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
@@ -35,7 +35,7 @@ void lv_demo_calendar(void)
|
||||
highlighted_days[1].month = 02;
|
||||
highlighted_days[1].day = 11;
|
||||
|
||||
highlighted_days[2].year = 2022;
|
||||
highlighted_days[2].year = 2021;
|
||||
highlighted_days[2].month = 02;
|
||||
highlighted_days[2].day = 22;
|
||||
|
||||
@@ -46,5 +46,5 @@ void lv_demo_calendar(void)
|
||||
#elif LV_USE_CALENDAR_HEADER_ARROW
|
||||
lv_calendar_header_arrow_create(calendar);
|
||||
#endif
|
||||
lv_calendar_set_showed_date(calendar, 2021, 10);
|
||||
// lv_calendar_set_showed_date(calendar, 2021, 10);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ extern void lv_port_indev_init(void);
|
||||
#if LV_USE_LOG && LV_LOG_PRINTF
|
||||
static void lv_rt_log(const char *buf)
|
||||
{
|
||||
LOG_I(buf);
|
||||
printf(buf);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,12 +24,12 @@ int lv_port_init(void)
|
||||
#if LV_USE_LOG && LV_LOG_PRINTF
|
||||
lv_log_register_print_cb(lv_rt_log);
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user