Skip to content

Commit

Permalink
[lvgl/demo]: Optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
jiale-gdyd committed Feb 17, 2023
1 parent b2d7e30 commit 0bc3243
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions project/entry/gui_demo/lvgl/lvgl_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
#include "printer/printer.h"
#endif

#define DISP_BUF_SIZE (810 * 1440)
#if defined(CONFIG_IMX6ULL)
#define DISP_BUF_SIZE (800 * 480)
#else
#define DISP_BUF_SIZE (1440 * 810)
#endif

static lv_color_t buf0[DISP_BUF_SIZE];
static lv_color_t buf1[DISP_BUF_SIZE];
Expand Down Expand Up @@ -86,7 +90,7 @@ int lvgl_demo_init(int argc, char *argv[])
static lv_disp_drv_t disp_drv;
static lv_disp_buf_t disp_buf;
static lv_indev_drv_t indev_drv;
lv_coord_t width = 640, height = 480;
lv_coord_t width = 800, height = 480;

lv_disp_drv_init(&disp_drv);

Expand All @@ -111,7 +115,7 @@ int lvgl_demo_init(int argc, char *argv[])
lv_indev_drv_init(&indev_drv);

indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.disp = disp;
// indev_drv.disp = disp;
indev_drv.read_cb = evdev_read;
lv_indev_drv_register(&indev_drv);
#endif
Expand All @@ -125,7 +129,7 @@ int lvgl_demo_init(int argc, char *argv[])
static lv_disp_drv_t disp_drv;
static lv_indev_drv_t indev_drv;
static lv_disp_draw_buf_t disp_buf;
lv_coord_t width = 640, height = 480;
lv_coord_t width = 800, height = 480;

lv_disp_drv_init(&disp_drv);

Expand All @@ -148,7 +152,7 @@ int lvgl_demo_init(int argc, char *argv[])
static lv_disp_t *disp = lv_disp_drv_register(&disp_drv);

lv_indev_drv_init(&indev_drv);
indev_drv.disp = disp;
// indev_drv.disp = disp;
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = evdev_read;
static lv_indev_t *indev = lv_indev_drv_register(&indev_drv);
Expand Down Expand Up @@ -185,8 +189,8 @@ int lvgl_demo_init(int argc, char *argv[])
while ((poll(&wayland_pfd, 1, wayland_sleep) < 0) && (errno == EINTR));
#else
lv_task_handler();
usleep(1);
lv_tick_inc(1);
usleep(5000);
// lv_tick_inc(1);
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions project/gui/lvgl/lvgl7/lv_drv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
#endif

#if USE_LIBINPUT
#define LIBINPUT_NAME "/dev/input/event0"
#define LIBINPUT_NAME "/dev/input/event1"
#endif

#ifndef USE_EVDEV
Expand All @@ -265,7 +265,7 @@
#endif

#if USE_EVDEV || USE_BSD_EVDEV
#define EVDEV_NAME "/dev/input/event0" // 您可以使用"evtest" Linux 工具获取设备列表并对其进行测试
#define EVDEV_NAME "/dev/input/event1" // 您可以使用"evtest" Linux 工具获取设备列表并对其进行测试
#define EVDEV_SWAP_AXES 0 // 交换触摸屏的x和y轴

#define EVDEV_CALIBRATE 0 // 通过使用每个轴的最大值和最小值来缩放和偏移触摸屏坐标
Expand Down

0 comments on commit 0bc3243

Please sign in to comment.