improving devices support
This commit is contained in:
parent
660f73c26d
commit
466f1a4db6
2 changed files with 15 additions and 0 deletions
10
dev_in.c
10
dev_in.c
|
|
@ -44,6 +44,8 @@ typedef struct dev_in_ev {
|
||||||
|
|
||||||
struct ff_effect ff_effect;
|
struct ff_effect ff_effect;
|
||||||
|
|
||||||
|
void* user_data;
|
||||||
|
|
||||||
} dev_in_ev_t;
|
} dev_in_ev_t;
|
||||||
|
|
||||||
typedef union dev_in_aggr {
|
typedef union dev_in_aggr {
|
||||||
|
|
@ -440,8 +442,10 @@ void* dev_in_thread_func(void *ptr) {
|
||||||
&dev_in_data->input_dev_decl->dev[i]->filters.ev,
|
&dev_in_data->input_dev_decl->dev[i]->filters.ev,
|
||||||
&devices[i].dev.evdev
|
&devices[i].dev.evdev
|
||||||
);
|
);
|
||||||
|
|
||||||
if (open_res == 0) {
|
if (open_res == 0) {
|
||||||
devices[i].type = DEV_IN_TYPE_EV;
|
devices[i].type = DEV_IN_TYPE_EV;
|
||||||
|
devices[i].dev.evdev.user_data = dev_in_data->input_dev_decl->dev[i]->user_data;
|
||||||
|
|
||||||
// device is now connected, query it in select
|
// device is now connected, query it in select
|
||||||
FD_SET(libevdev_get_fd(devices[i].dev.evdev.evdev), &read_fds);
|
FD_SET(libevdev_get_fd(devices[i].dev.evdev.evdev), &read_fds);
|
||||||
|
|
@ -457,6 +461,9 @@ void* dev_in_thread_func(void *ptr) {
|
||||||
|
|
||||||
if (open_res == 0) {
|
if (open_res == 0) {
|
||||||
devices[i].type = DEV_IN_TYPE_IIO;
|
devices[i].type = DEV_IN_TYPE_IIO;
|
||||||
|
|
||||||
|
// device is now connected, query it in select
|
||||||
|
FD_SET(dev_iio_get_buffer_fd(devices[i].dev.iio.iiodev), &read_fds);
|
||||||
}
|
}
|
||||||
} else if (d_type == input_dev_type_hidraw) {
|
} else if (d_type == input_dev_type_hidraw) {
|
||||||
fprintf(stderr, "Device (hidraw) %zu not found -- Attempt reconnection for device %x:%x\n", i, dev_in_data->input_dev_decl->dev[i]->filters.hidraw.pid, dev_in_data->input_dev_decl->dev[i]->filters.hidraw.vid);
|
fprintf(stderr, "Device (hidraw) %zu not found -- Attempt reconnection for device %x:%x\n", i, dev_in_data->input_dev_decl->dev[i]->filters.hidraw.pid, dev_in_data->input_dev_decl->dev[i]->filters.hidraw.vid);
|
||||||
|
|
@ -471,6 +478,9 @@ void* dev_in_thread_func(void *ptr) {
|
||||||
devices[i].dev.hidraw.callbacks = dev_in_data->input_dev_decl->dev[i]->map.hidraw_callbacks;
|
devices[i].dev.hidraw.callbacks = dev_in_data->input_dev_decl->dev[i]->map.hidraw_callbacks;
|
||||||
devices[i].dev.hidraw.user_data = dev_in_data->input_dev_decl->dev[i]->user_data;
|
devices[i].dev.hidraw.user_data = dev_in_data->input_dev_decl->dev[i]->user_data;
|
||||||
devices[i].type = DEV_IN_TYPE_HIDRAW;
|
devices[i].type = DEV_IN_TYPE_HIDRAW;
|
||||||
|
|
||||||
|
// device is now connected, query it in select
|
||||||
|
FD_SET(dev_hidraw_get_fd(devices[i].dev.hidraw.hidrawdev), &read_fds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,11 @@ typedef struct iio_settings {
|
||||||
int8_t post_matrix[3][3];
|
int8_t post_matrix[3][3];
|
||||||
} iio_settings_t;
|
} iio_settings_t;
|
||||||
|
|
||||||
|
typedef struct timer_filters {
|
||||||
|
char name[128];
|
||||||
|
uint64_t ticktime_ms;
|
||||||
|
} timer_filters_t;
|
||||||
|
|
||||||
typedef struct input_dev {
|
typedef struct input_dev {
|
||||||
input_dev_type_t dev_type;
|
input_dev_type_t dev_type;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue