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

Add API to access current USB status #231

Merged
merged 1 commit into from
Oct 1, 2020
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
2 changes: 2 additions & 0 deletions app/include/zmk/usb_hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@

int zmk_usb_hid_init();

enum usb_dc_status_code zmk_usb_hid_get_status();

int zmk_usb_hid_send_report(u8_t *report, size_t len);
2 changes: 2 additions & 0 deletions app/src/usb_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static const struct hid_ops ops = {
.int_in_ready = in_ready_cb,
};

enum usb_dc_status_code zmk_usb_hid_get_status() { return usb_status; }

int zmk_usb_hid_send_report(const u8_t *report, size_t len) {
switch (usb_status) {
case USB_DC_SUSPEND:
Expand Down