nequam
February 18, 2020, 4:37pm
1
Description
It looks like evdev driver is not lined up with indev interface in version 6.1.1.
There are some compilation problems:
function bool evdev_read(lv_indev_data_t * data)
, does not have
struct _lv_indev_drv_t * indev_drv
argument (ref. lv_indev_drv_t::read_cb
).
evdev.h:26 #include "lvgl/lv_hal/lv_hal_indev.h"
is missig \src\ subdir
there is no evdev_exit()
function (to close the event file handle)
What MCU/Processor/Board and compiler are you using?
It is a compilation problem.
What do you experience?
It does not compile.
indev_drv.read_cb = evdev_read;
What do you expect?
Successful compilation
Code to reproduce
lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = evdev_read;
Screenshot and/or video
If possible, add screenshots and/or videos about the current issue.
Make sure you’re using the latest lv_drivers
from GitHub. That version works with the 6.x series.
evdev_key_val = 0;
evdev_button = LV_INDEV_STATE_REL;
return true;
}
/**
* Get the current position and state of the evdev
* @param data store the evdev data here
* @return false: because the points are not buffered, so no more data to be read
*/
bool evdev_read(lv_indev_drv_t * drv, lv_indev_data_t * data)
{
struct input_event in;
while(read(evdev_fd, &in, sizeof(struct input_event)) > 0) {
if(in.type == EV_REL) {
if(in.code == REL_X)
#if EVDEV_SWAP_AXES
evdev_root_y += in.value;
#else
evdev_root_x += in.value;
nequam
February 19, 2020, 10:19am
3
Great, thank you.
If so, the drivers zip in the downloadable package 6.1.1 is not up to date.
There is ,even in github source, no evdev_exit (like in mouse drvier) for the event file handle release.
Linux will close file handles automatically when the process exits, so the evdev_exit
function isn’t strictly necessary.