mirror of
https://github.com/lvgl/lvgl.git
synced 2026-09-22 11:16:21 +08:00
fix(evdev): calibrate pointer device for touch screen device (#8282) (#8325)
Micropython CI / Build esp32 port (push) Has been cancelled
Micropython CI / Build rp2 port (push) Has been cancelled
Micropython CI / Build stm32 port (push) Has been cancelled
Micropython CI / Build unix port (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Micropython CI / Build esp32 port (push) Has been cancelled
Micropython CI / Build rp2 port (push) Has been cancelled
Micropython CI / Build stm32 port (push) Has been cancelled
Micropython CI / Build unix port (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Build docs / build-and-deploy (push) Has been cancelled
Co-authored-by: André Costa <andre_miguel_costa@hotmail.com> Co-authored-by: zhut <ztyx516@126.com>
This commit is contained in:
co-authored by
André Costa
zhut
parent
b25519abce
commit
322e18e05b
@@ -16,7 +16,7 @@ jobs:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.7
|
||||
python-version: 3.12
|
||||
- name: Generate lv_conf_internal.h
|
||||
run: python lv_conf_internal_gen.py
|
||||
working-directory: scripts
|
||||
|
||||
@@ -179,6 +179,25 @@ lv_indev_t * lv_evdev_create(lv_indev_type_t indev_type, const char * dev_path)
|
||||
goto err_after_open;
|
||||
}
|
||||
|
||||
/* Detect the minimum and maximum values of the input device for calibration. */
|
||||
if(indev_type == LV_INDEV_TYPE_POINTER) {
|
||||
struct input_absinfo absinfo;
|
||||
if(ioctl(dsc->fd, EVIOCGABS(ABS_X), &absinfo) == 0) {
|
||||
dsc->min_x = absinfo.minimum;
|
||||
dsc->max_x = absinfo.maximum;
|
||||
}
|
||||
else {
|
||||
LV_LOG_ERROR("ioctl EVIOCGABS(ABS_X) failed: %s", strerror(errno));
|
||||
}
|
||||
if(ioctl(dsc->fd, EVIOCGABS(ABS_Y), &absinfo) == 0) {
|
||||
dsc->min_y = absinfo.minimum;
|
||||
dsc->max_y = absinfo.maximum;
|
||||
}
|
||||
else {
|
||||
LV_LOG_ERROR("ioctl EVIOCGABS(ABS_Y) failed: %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
lv_indev_t * indev = lv_indev_create();
|
||||
if(indev == NULL) goto err_after_open;
|
||||
lv_indev_set_type(indev, indev_type);
|
||||
|
||||
Reference in New Issue
Block a user