diff --git a/Makefile b/Makefile index 7e3b7a2..320d1ae 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ Q=@ CC=gcc CFLAGS=-g -Wall -Wno-format-truncation -pthread -lm -LDFLAGS= +LDFLAGS=-lm BUILD_DIR=./objects BIN=jsfw @@ -19,7 +19,7 @@ run: $(BIN) $(BIN): $(OBJECTS) @echo "LD $@" - $(Q) $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ + $(Q) $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ $(BUILD_DIR)/%.o: %.c | $(BUILD_DIR) @echo "CC $<" diff --git a/hid.c b/hid.c index 1edd9d7..0384e28 100644 --- a/hid.c +++ b/hid.c @@ -144,10 +144,10 @@ bool filter_event(int fd, char *event) { } } - // Check product and vendor id 054c:05c4 => Dualshock 4 + // Check product and vendor id 054c:05c4 => Dualshock 4 (09cc is for the second generation) uint16_t info[4]; ioctl(fd, EVIOCGID, info); - return info[1] == 0x054c && info[2] == 0x05c4; + return info[1] == 0x054c && (info[2] == 0x05c4 || info[2] == 0x09cc); } // Initialize vectors for polling