From e424fe8db6906ca04048970ffb80b021632a4128 Mon Sep 17 00:00:00 2001 From: Ricardo Hermida Ruiz Date: Sun, 16 Jun 2024 18:22:44 -0300 Subject: [PATCH] Update for qmk userspace, modern homebrew, homebrew hidapi --- Makefile | 6 ++++-- README.md | 16 +++------------- hid_send.c | 4 ++++ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 23109fb..ca726b0 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ OSNAME:=$(shell uname -s) -CFLAGS=-I/usr/local/lib -Wno-write-strings -I../qmk_firmware -lc +CFLAGS=-Wno-write-strings -I../qmk_userspace -lc # Order of LDFLAGS matters! Remember, linking happens after compiling. LDFLAGS= ifeq ($(OSNAME),Darwin) - CFLAGS += -lhidapi + BREW_PREFIX:=$(shell brew --prefix) + CFLAGS += -I$(BREW_PREFIX)/include -I$(BREW_PREFIX)/lib -I/usr/local/lib -DOS_DARWIN + LDFLAGS += -L$(BREW_PREFIX)/lib -lhidapi else CFLAGS += -I/usr/local/include/hidapi LDFLAGS += -lhidapi-libusb diff --git a/README.md b/README.md index 271bac8..6d68824 100644 --- a/README.md +++ b/README.md @@ -11,26 +11,16 @@ This asumes `qmk` is cloned next to this folder: ``` git clone git@github.com:rhruiz/hid_send.git -git clone git@github.com:rhruiz/qmk_firmware.git +git clone git@github.com:rhruiz/qmk-userspace.git qmk_userspace ``` ### macOS setup -Install patched version of hidapi: - ```shell -git clone https://github.com/signal11/hidapi.git -cd hidapi -git remote add dylanmckay https://github.com/dylanmckay/hidapi.git -git fetch dylanmckay -git checkout mac-hid-interface-support -./bootstrap -./configure -make -sudo make install -cd ../ +brew instal hidapi # brew qmk/qmk/qmk already installed this ``` + ## Building Just run: diff --git a/hid_send.c b/hid_send.c index b0d93ec..2f5f4e0 100644 --- a/hid_send.c +++ b/hid_send.c @@ -5,7 +5,11 @@ #include #include #include +#ifdef OS_DARWIN +#include +#else #include +#endif // qmk includes #include