We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba960a0 commit 647145bCopy full SHA for 647145b
2 files changed
src/gamepad.c
@@ -9,7 +9,7 @@
9
#include <sys/epoll.h>
10
11
#define GAMEPAD_CONFIG_INTERVAL 5000 // milliseconds
12
-#define GAMEPAD_HAPTICS_INTERVAL 8 // milliseconds
+#define GAMEPAD_HAPTICS_INTERVAL 40 // milliseconds
13
14
int Gamepad_init(struct Gamepad* const gamepad, int epoll, int hidraw) {
15
gamepad->hidraw = hidraw;
src/main.c
@@ -118,7 +118,7 @@ int try_add_gamepad(
118
// cause a noticeable delay when processing game controller input,
119
// but it should occur somewhat rarely.
120
for (size_t i = 0; i < 10; i++) {
121
- if (((hidraw_fd = open(path, O_RDWR)) != -1) || !retry) {
+ if (((hidraw_fd = open(path, O_RDWR | O_NONBLOCK)) != -1) || !retry) {
122
break;
123
}
124
sleep(1);
0 commit comments