debugging...
This commit is contained in:
parent
59cbb3cec3
commit
c9e22a451b
2 changed files with 13 additions and 10 deletions
21
input_dev.c
21
input_dev.c
|
|
@ -565,18 +565,21 @@ static void input_udev(
|
|||
timeout.tv_sec += timeout_ms / 1000;
|
||||
timeout.tv_nsec += (timeout_ms % 1000) * 1000000;
|
||||
|
||||
sem_timedwait(&in_dev->logic->rumble.sem_full, &timeout);
|
||||
const int rumble_sem_wait_result = sem_timedwait(&in_dev->logic->rumble.sem_full, &timeout);
|
||||
|
||||
// here read properties
|
||||
struct input_event rumble_upload = {
|
||||
.type = EV_FF,
|
||||
.code = effect.id,
|
||||
.value = in_dev->logic->rumble.value,
|
||||
};
|
||||
if (rumble_sem_wait_result == 0) {
|
||||
// here read properties
|
||||
struct input_event rumble_upload = {
|
||||
.type = EV_FF,
|
||||
.code = effect.id,
|
||||
.value = in_dev->logic->rumble.value,
|
||||
};
|
||||
|
||||
printf("Rumble upload: %d\n", rumble_upload.value);
|
||||
printf("Rumble upload: %d\n", rumble_upload.value);
|
||||
|
||||
sem_post(&in_dev->logic->rumble.sem_empty);
|
||||
sem_post(&in_dev->logic->rumble.sem_empty);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -839,7 +839,7 @@ void *output_dev_rumble_thread_func(void* ptr) {
|
|||
timeout.tv_sec += timeout_ms / 1000;
|
||||
timeout.tv_nsec += (timeout_ms % 1000) * 1000000;
|
||||
|
||||
int result = sem_timedwait(&out_dev->logic->rumble.sem_empty, &timeout);
|
||||
const int result = sem_timedwait(&out_dev->logic->rumble.sem_empty, &timeout);
|
||||
|
||||
if (result == 0) {
|
||||
// translate the rumble to evdev
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue