Hello everyone! is there any idea to implement reconnection to usb touchscreen lcd?(its waveshare)
Sometimes touchscreen is loosing its connection and i need to reassign it. So is there some methods to diagnose if touchscreen is present and if not - reassign filename and so on? without app reboot.
lvgl 7.8.1 (framebuffer example)
#define EVDEV_ACT_NAME0 "/dev/input/event0"
#define EVDEV_ACT_NAME1 "/dev/input/event1"
#define EVDEV_ACT_NAME2 "/dev/input/event2"
void evdev_init(void)
{
/* evdev_fd = open(EVDEV_ACT_NAME2, O_RDWR | O_NOCTTY | O_NDELAY);
if(evdev_fd == -1) {
evdev_fd = open(EVDEV_ACT_NAME1, O_RDWR | O_NOCTTY | O_NDELAY);
}else{goto found;}
if(evdev_fd == -1) {*/
evdev_fd = open(EVDEV_ACT_NAME0, O_RDWR | O_NOCTTY | O_NDELAY);
if(evdev_fd == -1) {
perror("unable open evdev interface:");
return;
}
evdev_fd = open(EVDEV_ACT_NAME0, O_RDWR | O_NOCTTY | O_NDELAY);
found:
fcntl(evdev_fd, F_SETFL, O_ASYNC | O_NONBLOCK);
evdev_root_x = 0;
evdev_root_y = 0;
evdev_key_val = 0;
evdev_button = LV_INDEV_STATE_REL;
}