Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call hid_init() at import time, to avoid macOS crash #150

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chid.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cdef extern from "hidapi.h":
hid_device* hid_open(unsigned short, unsigned short, const wchar_t*)
hid_device* hid_open_path(char *path)
void hid_close(hid_device *)
int hid_init()
int hid_exit()
int hid_write(hid_device* device, unsigned char *data, int length) nogil
int hid_read(hid_device* device, unsigned char* data, int max_length) nogil
Expand Down
3 changes: 3 additions & 0 deletions hid.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ from libc.stddef cimport wchar_t, size_t
__version__ = "0.13.1"


hid_init()


cdef extern from "ctype.h":
int wcslen(wchar_t*)

Expand Down