From 0172d3f32bb6e69877f66428bdcc02bd9bf62280 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 8 Nov 2014 02:36:01 +0200 Subject: [PATCH] fix an issue of lost inputs in direct control mode --- host/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/main.c b/host/main.c index c3a850b..73b8a9f 100644 --- a/host/main.c +++ b/host/main.c @@ -661,7 +661,7 @@ int main(int argc, char *argv[]) struct teensy_dev dev; struct usbdevfs_urb urb[URB_CNT]; struct usbdevfs_urb *reaped_urb; - int fixed_input_changed; + int fixed_input_changed = 0; int evdev_fds[16]; int evdev_fd_cnt = 0; int evdev_support; @@ -925,7 +925,6 @@ int main(int argc, char *argv[]) } /* something from input devices? */ - fixed_input_changed = 0; for (i = 0; i < evdev_fd_cnt; i++) { if (FD_ISSET(evdev_fds[i], &rfds)) { fixed_input_changed |= @@ -1071,6 +1070,7 @@ int main(int argc, char *argv[]) perror("USBDEVFS_SUBMITURB PKT_FIXED_STATE"); break; } + fixed_input_changed = 0; pending_urbs |= 1 << URB_DATA_OUT; continue; } -- 2.39.5